UpgradeableStakingLST

stake()

Staking share into staking pool.

function stake(uint256 poolId, uint256 amount) external nonpayable returns (bool)
Parameter
Type
Description

poolId

uint256

The index of staking pool.

amount

uint256

The share amount to be staked.

unstake()

Withdraw share from staking pool.

function unstake(uint256 poolId, uint256 amount) external nonpayable returns (bool)
Parameter
Type
Description

poolId

uint256

The index of staking pool.

amount

uint256

The share amount to be un-staked

<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> If the pool has been converted, the withdrawn token should be the converted token. If the converted token is WTDOT, the retrieved token should be tDOT.

</aside>

claimRewards()

Claim all rewards from staking pool.

function claimRewards(uint256 poolId) external nonpayable returns (bool)
Parameter
Type
Description

poolId

uint256

The index of staking pool.

exit()

Un-stake all staked share and claim all unclaimed rewards from staking pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> It is the order to execute unstake + claimRewards, if any event is banned, it will be reverted。

</aside>

poolIndex()

Get the index of next pool.It’s equal to the current count of pools. This is zero by default.

<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> This value will be incremented by 1 whenever addPool.

</aside>

addPool()

Initialize a staking pool for shareType.

Can be called only by owner.

Parameter
Type
Description

shareType

contract IERC20

Initialize the ERC20 contract address of the pool

updateRewardRule()

Update the reward rule of rewardType for poolId pool.

Can be called only by owner.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

shareType

contract IERC20

The reward token address.

rewardRate

uint256

The reward amount per second.

endTime

uint256

The end time of rule.

rewardRules()

Get the reward rule for rewardType reward of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

rewardType

contract IERC20

The reward token address.

setRewardsDeductionRate()

Set deduction rate of claim rewards for poolId pool.

Can be called only by owner.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

rate

uint256

The deduction rate. 1e18 is 100%

rewardsDeductionRates()

Get the rewards deduction rate of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> The deduction rate. 1e18 is 100%

</aside>

shareTypes()

Get the share token of poolId pool.

Parameter
Type
Description

poolId

uint256

The pool id to be queried.

shares()

Get the share amount of who of poolId pool.

Parameter
Type
Description

poolId

uint256

The pool id to be queried.

who

address

The address of staker.

totalShares()

Get the total share amount of poolId pool.

Parameter
Type
Description

poolId

uint256

The pool id to be queried.

earned()

Get who's unclaimed reward amount of specific rewardType at poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

who

address

The address of staker.

rewardType

contract IERC20

The reward token address.

rewardPerShare()

Get the exchange rate for share to rewardType reward token of poolId pool.

The reward part is accumulated rate adds pending to accumulate rate, it's used to calculate reward. 1e18 is 100%.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

rewardType

contract IERC20

The reward token address.

rewardTypes()

Get the reward token types of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

rewards()

Get the unclaimed paid rewardType reward amount for who of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

who

address

The address of staker.

rewardType

contract IERC20

The reward token address.

lastTimeRewardApplicable()

Get latest time that can be used to accumulate rewards for rewardType reward of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

rewardType

contract IERC20

The reward token address.

paidAccumulatedRates()

Get the paid accumulated rate of rewardType for who of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

who

address

The address of staker.

rewardType

contract IERC20

The reward token address.

convertLSTPool()

convert the share token of ‘poolId’ pool to LST token by convertType.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

convertType

enum UpgradeableStakingLST.ConvertType

The convert type.

convertInfos()

Get the LSD conversion info of poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

<aside> <img src="/icons/info-alternate_gray.svg" alt="/icons/info-alternate_gray.svg" width="40px" /> If the pool has been converted, the withdrawn token should be the converted token. If the converted token is WTDOT, the retrieved token should be tDOT.

</aside>

setPoolOperationPause()

Set the paused status of operation for poolId pool.

Can be called only by owner.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

operation

enum PoolOperationPausable.Operation operation

The user operation.

paused

bool

The pause status.

pausedPoolOperations()

Get the pause status of operation for poolId pool.

Parameter
Type
Description

poolId

uint256

The index of staking pool.

operation

enum PoolOperationPausable.Operation operation

The user operation.

Last updated