EeseeStaking

EeseeStaking

ESE

contract IERC20 ESE

ESE token to use in staking.

volumeUpdaters

mapping(address => bool) volumeUpdaters

Addresses that can update volume. It can be useful to us to have multiple volume updaters.

volume

mapping(address => uint256) volume

Volume for each user on Eesee marketplace.

userInfo

mapping(bool => mapping(address => struct IEeseeStaking.UserInfo)) userInfo

Maps isLocked bool to user to struct containing user data.

totalDeposits

uint96 totalDeposits

Total ESE staked in this contract (not including rewards).

duration

uint32 duration

Min locked staking duration.

rewardID

uint32 rewardID

The number of negative reward rate updates.

deposit

function deposit(uint96 amount, uint32 lockDuration, uint32 expectedRewardID, bytes permit) external

Stakes ESE tokens. If {lockDuration} == 0, the user can withdraw tokens anytime. Else, the user can withdraw their tokens after {duration} seconds.

Parameters

withdraw

function withdraw(bool isLocked, uint96 amount, address recipient) external returns (uint96 ESEReceived)

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

Return Values

    Note: If there are not enough tokens in the contract, only part of pending tokens will be sent. 
    The other tokens will be available after the balance of this contract has increased. |

addVolume

function addVolume(uint96 _volume, address _address) external

_Adds {_volume} to an {address}'es volume. Emits {AddVolume} event.

Parameters

updateRewardRates

function updateRewardRates(uint64[] rewardRatesFlexible, uint64[] rewardRatesLocked) external

Changes the reward rates for all staking schemes and tiers.

Parameters

changeDuration

function changeDuration(uint32 _duration) external

Changes duration for locked staking. Emits {ChangeDuration} event.

Parameters

grantVolumeUpdater

function grantVolumeUpdater(address _address) external

_Grants rights to update volume to {address}. Emits {GrantVolumeUpdater} event.

Parameters

revokeVolumeUpdater

function revokeVolumeUpdater(address _address) external

_Revokes rights to update volume from {address}. Emits {RevokeVolumeUpdater} event.

Parameters

pendingReward

function pendingReward(bool isLocked, address _user) external view returns (uint96)

_Returns ESE tokens earned by {user}. Note: Does not take unlockTime or current contract reward balance into account.

Parameters

Return Values

tierInfo

function tierInfo(uint256 _tier) external view returns (struct IEeseeStaking._TierData _tierData)

Returns the info on specified tier.

Parameters

Return Values

tier

function tier(uint256 _volume) public view returns (uint256)

Returns the tier from volume.

Parameters

Return Values

Inherited from EeseeRoleHandler

Inherited from ERC2771Context

isTrustedForwarder

function isTrustedForwarder(address forwarder) public view virtual returns (bool)

Inherited from IEeseeStaking

ESE

function ESE() external view returns (contract IERC20)

volumeUpdaters

function volumeUpdaters(address) external view returns (bool)

volume

function volume(address) external view returns (uint256)

userInfo

function userInfo(bool isLocked, address user) external view returns (uint96 amount, uint96 reward, uint32 unlockTime, uint32 rewardRateID, uint256 rewardDebt)

totalDeposits

function totalDeposits() external view returns (uint96)

duration

function duration() external view returns (uint32)

DepositFlexible

event DepositFlexible(address user, uint96 amount)

DepositLocked

event DepositLocked(address user, uint96 amount, uint32 unlockTime)

WithdrawFlexible

event WithdrawFlexible(address sender, address recipient, uint96 amount)

WithdrawLocked

event WithdrawLocked(address sender, address recipient, uint96 amount)

AddVolume

event AddVolume(address volumeUpdater, address user, uint96 amount)

UpdateRewardRates

event UpdateRewardRates(uint64[] rewardRatesFlexible, uint64[] rewardRatesLocked)

ChangeDuration

event ChangeDuration(uint32 previousDuration, uint32 newDuration)

GrantVolumeUpdater

event GrantVolumeUpdater(address account)

RevokeVolumeUpdater

event RevokeVolumeUpdater(address account)

Last updated