Saffron Staking V2
Last updated
Last updated
Contract for rewarding users with SFI for the Saffron liquidity mining program.
Code based off Sushiswap's Masterchef contract with the addition of SFIRewarder.
NOTE: Do not add pools with LP tokens that are deflationary or have reflection.
struct UserInfo
Structure of user deposited amounts and their pending reward debt.
Type | Name | Description |
---|---|---|
struct PoolInfo
Structure holding information about each pool's LP token and allocation information.
setRewarder()
Update the SFIRewarder. Only callable by the contract owner.
Parameters:
setRewardPerBlock()
Update the SFIRewarder. Only callable by the contract owner.
Parameters:
setRewardCutoff()
Update the reward end block. Only callable by the contract owner.
Parameters:
setRewardPerBlockAndRewardCutoff()
Update the reward end block and sfiPerBlock atomically. Only callable by the contract owner.
Parameters:
add()
Add a new pool specifying its lp token and allocation points.
Parameters:
set()
Set the allocPoint of the specific pool with id _pid.
Parameters:
pendingSFI()
Return the pending SFI rewards of a user for a specific pool id.
Parameters:
Return Values:
massUpdatePools()
Update reward variables for all pools. Be careful of gas spending! More than 100 pools is not recommended.
updatePool()
Update accumulated SFI shares of the specified pool.
Parameters:
Return Values:
deposit()
Deposit the user's lp token into the the specified pool.
Parameters:
withdraw()
Withdraw the user's lp token from the specified pool.
Parameters:
emergencyWithdraw()
Emergency function to withdraw a user's asset in a specified pool.
Parameters:
safeSFITransfer()
Transfer SFI from the SFIRewarder contract to the user's account.
Parameters:
poolLength()
Return the number of pools in the poolInfo
list
Return Values:
pendingSFI()
Return the pending SFI rewards of a user for a specific pool id.
Parameters:
Return Values:
TokensDeposited()
Emitted when amount
tokens are deposited by user
into pool id pid
.
TokensWithdrawn()
Emitted when amount
tokens are withdrawn by user
from pool id pid
.
TokensEmergencyWithdrawn()
Emitted when amount
tokens are emergency withdrawn by user
from pool id pid
.
Type | Name | Description |
---|---|---|
Type | Visibility | Name | Description |
---|---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|
Type | Name | Description |
---|---|---|