Saffron Staking V2
Saffron staking
This is an implementation of the Saffron V2 ERC20 staking contract, which is forked from Sushiswap's Masterchef contract.
The intention is to use it to incentivize the following pools:
SFI single-asset staking
SFI/ETH Uniswap V2 pool
SFI/ETH Sushiswap pool
Governance controls the amount of SFI to be added to and distributed by this contract. This contract has an end-of-life because SFI is hard capped at 100,000 total supply. It will be replaced with another contract (determined by governance) to reward staking in the absence of SFI emissions.
Implementation Details
SFI Rewarder
SFIRewarder holds SFI tokens to be used to distribute rewards to users. It separates users' deposits of SFI tokens and rewards into separate pools. This is an extension on the typical Masterchef contract that separates concerns because of the single-asset SFI staking option.
SaffronStakingV2
SaffronStakingV2 holds rewarded ERC20 tokens and manages the reward payout for each user in the pool. This is forked directly from Sushiswap's Masterchef with the addition of SFIRewarder to clearly distinguish between SFI held by users and SFI to be rewarded based on emissions.
Development
Install the dependencies.
Create
.env
file in your root directory.
To compile the contracts, use this command.
Deploy
To deploy the contracts to mainnet, use this command.
To deploy the contracts to ropsten, use this command.
Test
To test the contracts, use this command.
Code Coverage
For a code coverage report, use this command.
Coverage report is output on terminal and an HTML coverage report is generated in coverage/index.html
Notes
You can use the testHelper library to add more unit tests.
Last updated