A secure staking smart contract built with Solidity.
- Users stake ETH and earn 10% reward
- 30-day lock period before unstaking
- Secure reward claiming system
- Checks-Effects-Interactions pattern
- ReentrancyGuard pattern (state reset before transfer)
- Access control with modifiers
- Lock period enforcement
| Function | Description |
|---|---|
| stake(amount) | Stake ETH |
| unstake() | Unstake after 30 days + claim reward |
| claimReward() | Claim reward while still staking |
| getStakeInfo(address) | View stake details |
| getTimeLeft(address) | View seconds until unlock |
- Solidity ^0.8.18
- Remix IDE
- Sepolia Testnet