This contract provides ERC20 token stacking for the award in ERC20 tokens. ERC20 Stacking URL: https://evervo.id/resources/grvx-staking/
Copy .env.example
to a new file called .env
and fill the values in it.
npx hardhat compile
npx hardhat test
Copy file example.env
to .env
and replace empty address variables with correct values. Then run:
npx hardhat run scripts/deploy-grvx.ts --network [Your Network]
This contracts allows users to stake GRVX and get FUEL rewards.
This function is used to stake GRVX to contract. Approval for staked amount should be given in prior.
function stake(uint256 amount)
Parameters
- uint256 amount - amount of GRVX (as wei) being staked
This function is used to unstake previously staked GRVX. Amount should not exceed stake size. Rewards are collected separately.
function unstake(uint256 amount)
Parameters
- uint256 amount - amount of GRVX (as wei) being unstaked
This function is used to claim accumulated reward of the user.
function claimReward()
This view function returns current reward amount for a given user.
function rewardOf(address account) public view returns (uint256)
Parameters
- address account - address to get reward for
This view function returns current stake size for a given user (as wei)
function stakeOf(address account) public view returns (uint256)
Parameters
- address account - address to get stake for
This function sets amount of fuel distributed per block. Can only be called by owner.
function setRewardPerBlock(uint256 rewardPerBlock_) external onlyOwner
Parameters
- uint256 rewardPerBlock_ - amount of FUEL (as wei) distributed between stakers per block