This repository contains RPM staking smart contract.
RPMStaking.sol allows RPM holders to stake (stake()) RPM tokens to receive rewards (reward token could be RPM or any other ERC-20 token). Staker can claim rewards (claim()). Stakers may unstake their RPM tokens by calling unstake(), which will trigger the reward claim as well. For emergency unstake, stakers can call emergencyUnstake(), beaware that emergency unstake doesn't trigger reward claim and all your pending reward tokens are lost.
After cloning the repository, make sure to install dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
Set the environment variables. For example:
INFURA_API_KEY="Your infura API key"
PK1="Your private key"
ETHERSCAN_API_KEY="Your etherscan API key"
Execute the tasks in the following order with correct params to deploy RPM staking contract and to verify it.
1. deployStakingSetup
2. deployStaking
3. setupStaking
To run the test cases:
$ yarn test
Audit was performed by Block Apex
RPM staking contract is licensed under the MIT License