EeseeStaking
EeseeStaking
ESE
ESE token to use in staking.
volumeUpdaters
Addresses that can update volume. It can be useful to us to have multiple volume updaters.
volume
Volume for each user on Eesee marketplace.
userInfo
Maps isLocked bool to user to struct containing user data.
totalDeposits
Total ESE staked in this contract (not including rewards).
duration
Min locked staking duration.
rewardID
The number of negative reward rate updates.
deposit
Stakes ESE tokens. If {lockDuration} == 0, the user can withdraw tokens anytime. Else, the user can withdraw their tokens after {duration} seconds.
Parameters
amount
uint96
- Amount of ESE tokens to stake.
lockDuration
uint32
- If lockDuration == 0, stakes tokens using Flexible scheme. If lockDuration == duration stakes tokens using Locked scheme.
expectedRewardID
uint32
- Frontrunning protection for reward rates. If reward rates are negatively changed before the transaction execution, reverts it. Can be set to any value for Flexible scheme.
permit
bytes
- Abi-encoded ESE permit data containing approveAmount, deadline, v, r and s. Set to empty bytes to skip permit.
withdraw
Withdraws staked ESE tokens, collects rewards and sends them to {recipient}. Pass 0 to {amount} to only receive rewards. In case reward rates are negatively changed during Locked staker's staking period, they are able to withdraw their funds.
Parameters
isLocked
bool
- Set to true to withdraw from locked scheme. Can only be done if the stake has unlocked (block.timestamp < user.unlockTime).
amount
uint96
- Amount of ESE tokens to unstake.
recipient
address
- ESE receiver.
Return Values
ESEReceived
uint96
- Amount of ESE tokens sent.
addVolume
_Adds {_volume} to an {address}'es volume. Emits {AddVolume} event.
Parameters
_volume
uint96
- Volume to add.
_address
address
- Address to update.
Note: This function can only be called by volumeUpdater.
updateRewardRates
Changes the reward rates for all staking schemes and tiers.
Parameters
rewardRatesFlexible
uint64[]
- New reward per token per second for flexible scheme.
rewardRatesLocked
uint64[]
- New reward per token per second for locked scheme.
Note: This function rewardRatesLocked only be called by ADMIN_ROLE.
changeDuration
Changes duration for locked staking. Emits {ChangeDuration} event.
Parameters
_duration
uint32
- New duration.
Note: This function can only be called by ADMIN_ROLE.
grantVolumeUpdater
_Grants rights to update volume to {address}. Emits {GrantVolumeUpdater} event.
Parameters
_address
address
- New volumeUpdater.
Note: This function can only be called by ADMIN_ROLE.
revokeVolumeUpdater
_Revokes rights to update volume from {address}. Emits {RevokeVolumeUpdater} event.
Parameters
_address
address
- Address to revoke volumeUpdater from.
Note: This function can only be called by ADMIN_ROLE.
pendingReward
_Returns ESE tokens earned by {user}. Note: Does not take unlockTime or current contract reward balance into account.
Parameters
isLocked
bool
_user
address
- Address to check.
Return Values
[0]
uint96
uint96 - Amount of ESE tokens ready to be collected.
tierInfo
Returns the info on specified tier.
Parameters
_tier
uint256
- Tier to get info for.
Return Values
_tierData
struct IEeseeStaking._TierData
- uint256 volumeBreakpoint, uint64 rewardRateFlexible, uint64 rewardRateLocked.
tier
Returns the tier from volume.
Parameters
_volume
uint256
- Volume to check tier for.
Return Values
[0]
uint256
uint256 - Tier ID.
Inherited from EeseeRoleHandler
Inherited from ERC2771Context
isTrustedForwarder
Inherited from IEeseeStaking
ESE
volumeUpdaters
volume
userInfo
totalDeposits
duration
DepositFlexible
DepositLocked
WithdrawFlexible
WithdrawLocked
AddVolume
UpdateRewardRates
ChangeDuration
GrantVolumeUpdater
RevokeVolumeUpdater
Last updated