Settings
Stake once. Watch it grow.
Stake STAKE, earn REWARD at a fixed global rate pro-rated by your share β fair by construction with per-user checkpoints. Claim anytime, exit in one click, or emergency-withdraw your principal.
Manage your position
Deposit STAKE and start earning immediately. Approve once first.
Pull STAKE back. Accrued rewards stay claimable.
Harvest your accrued REWARD straight to your wallet.
Exit = withdraw everything + claim. Emergency = principal only, rewards forfeited.
Emissions
β
β‘ Fund emissions
Pull REWARD from your wallet and spread it over a duration. Mid-period top-ups roll over.
π§Ή Recover stray tokens
Escape hatch for accidentally sent ERC-20s. STAKE and REWARD are protected.
Live Activity
Loadingβ¦
How to use this dApp
π§ How to use
- Connect your wallet. Press Connect Wallet in the sidebar. This dApp is configured for Sepolia β switch your wallet to Sepolia and hold some STAKE (the chain badge shows the active network).
- Approve the vault β once. Open Manage β π± Stake and press Approve max so the StakeVault contract is allowed to move STAKE on your behalf.
- Stake your STAKE. Enter an amount in the Stake form and press Stake. Your position appears in the Overview stat strip and rewards start accruing immediately.
- Watch rewards grow. The your earned Β· live counter in Overview ticks up every second: you earn at the global rate pro-rated by your share of the pool.
- Claim anytime. Press Claim now (Overview or Manage β π Claim) to harvest REWARD straight to your wallet.
- Leave whenever you want. Withdraw pulls principal back while rewards stay claimable, Exit all does withdraw + claim in one click, and Emergency withdraw returns principal only β pending rewards are forfeited.
β The process β what happens on-chain
- STAKE approval on the STAKE token (ERC-20). Your wallet calls approve() on the STAKE token, recording how much the StakeVault contract may pull. Every stake is checked against this allowance before tokens move.
- StakeVault.stake(amount). The vault first settles the global rewardPerToken accumulator and your personal checkpoint so accounting stays fair for everyone, then pulls STAKE in via transferFrom and updates balanceOf and totalSupply.
- StakeVault.startRewards(amount, duration). The owner funds emissions: the vault pulls REWARD and sets rewardRate = amount / duration. Called mid-period, leftover rewards roll over into the new rate.
- Reward accrual inside StakeVault. rewardPerToken() grows by elapsed Γ rewardRate / totalStaked; your earned() is your balance Γ the delta since your last checkpoint, plus unclaimed rewards β O(1) math with no per-user timestamps.
- StakeVault.getReward() / exitAll(). Claiming zeroes your rewards entry and transfers REWARD out. exitAll() chains withdraw + claim in one call, while emergencyWithdraw() returns principal and leaves forfeited rewards in the vault as documented dust.
πΊ Flow graph
Static overview of one stake β claim round trip. Rewards accrue per second via the global rewardPerToken accumulator while your STAKE sits in the vault.