A DeFi staking protocol built on EVM — stake STK tokens, earn RWD rewards every second.
Live demo: staking-dapp-stk.vercel.app
| Layer | Tools |
|---|---|
| Smart Contracts | Solidity 0.8.24 + Hardhat + OpenZeppelin |
| Frontend | Next.js 14, wagmi v2, RainbowKit, Tailwind CSS |
| Testnet | Sepolia (or Base Sepolia) |
| Hosting | Vercel (frontend) |
cd contracts
npm install
cp .env.example .env # fill in your keys
npx hardhat compile
npx hardhat test # run the full test suiteDeploy to Sepolia:
npx hardhat run scripts/deploy.js --network sepoliaCopy the printed addresses into frontend/.env.local.
Verify on Etherscan (optional but recommended):
npx hardhat verify --network sepolia <STAKING_POOL_ADDRESS> <STK_ADDRESS> <RWD_ADDRESS> <REWARD_RATE>cd frontend
npm install
cp .env.local.example .env.local # paste contract addresses + WalletConnect project ID
npm run dev # http://localhost:3000- Push this repo to GitHub
- Go to vercel.com → New Project → import your repo
- Set Root Directory to
frontend - Add the environment variables from
.env.localin the Vercel dashboard - Deploy!
StakingToken (STK) — ERC-20 token users stake
RewardToken (RWD) — ERC-20 reward token; only StakingPool can mint
StakingPool — Core logic: stake / unstake / claimReward / exit
Reward math uses the Synthetix rewardPerTokenStored pattern — gas-efficient, no iteration over stakers required.
After deploying:
- The deployer wallet receives 1,000,000 STK
- Transfer some to your test wallet, or use MetaMask to add a custom token by address
- Get Sepolia ETH from sepoliafaucet.com
MIT