where user stakes his ERC20 tokens . after 4 weeks of deposit user gets 5% APR , after 6 months gets 10% APR and after 1 year gets 15% APR.
For staking before calling the function "stakeTokens" , you need to approve staking or greater amount for the contract address, so that it can transfer the token amount from your account to it's own account.Otherwise it'll revert the transaction.
for stake withdrawal use the function "withdrawStake" with a given stake index and tokenBits Amount.
-
staking contract 0x3bAE1256663b43e503aee0F01e0Be2F0d93db73F . contract is verified . etherscan link
-
ERC20Token contract 0x65FB172158b7C09946Be0CF99177108cc2983b67 . contract is verified . etherscan link
for rinkeby network
-
configure hardhat.config.js
-
run :- npx hardhat run scripts/deploy.js --network rinkeby
- run:- npx hardhat test (from root directory)