SDL Pool Primary
Last updated
Last updated
The SDLPoolPrimary
allows users to stake and/or lock SDL tokens and receive reSDL (Reward Escrowed SDL) in return. SDL stakers will receive a portion of protocol rewards proportional to the amount of reSDL they hold. They will also receieve priority staking access in the PriorityPool
over non reSDL holders. A user's reSDL balance is represented by one or multiple NFTs which are minted when SDL is staked/locked in the pool.
If a user stakes but does not lock their SDL, they will receive an NFT representing reSDL at a 1:1 ratio to the SDL they staked. If a user locks their SDL, they will receive an additional boosted amount of reSDL depending on the duration they have chosen to lock for, resulting in a ratio greater than 1:1. The calculation for the amount of boost received for a specific amount of SDL and locking duration is handled by the LinearBoostController
.
If an reSDL position is not locked, the underlying SDL can be withdrawn at any time. If a position is locked, the withdrawal period must be initiated before SDL can be withdrawn. The withdrawal period can only be initiated after at least half of the total locking duration has elapsed and the withdrawal period itself will have a duration of exactly half the total locking duration. For the duration of the withdrawal period, the boost amount for the position will be set to 0 and only after this period has elapsed, the underlying SDL can be withdrawn.
A user can hold any number of reSDL NFTs and NFTs are transferrable in all states but by transferring an NFT, the ownership of the underlying SDL is also transferred.
This contract is deployed only on the primary chain.
All standard IERC721 and IERC721Metadata functions are implemented for SDLPoolPrimary
Returns the rewards pool for a token
Name | Type | Description |
---|---|---|
Returns a list of supported tokens
Returns true/false to whether a given token is supported
Returns balances of supported tokens within the controller
Returns an account's staked amount for use by reward pools controlled by this contract
Returns the total staked amount for use by reward pools controlled by this contract
Returns a list of withdrawable rewards for an account
Returns the address of the SDL token
Returns the address of the boost controller
Returns the id of the most recently minted lock
Returns the address of the CCIP controller for this contract
Returns the effective stake balance of an account (the effective stake balance includes the actual amount of tokens an account has staked across all locks plus any applicable boost gained by locking)
Returns the sum of effective balances across all accounts
Returns the list of locks that corresponds to _lockIds
Returns a list of lockIds owned by an account
Returns the address of the delegator pool
Distributes token balances to their respective rewards pools
Distributes a token to its respective rewards pool
Withdraws an account's earned rewards for a list of tokens
Adds a new token
Removes a supported token
Sets the base URI for all tokens
Sets the boost controller
Sets the CCIP controller
ERC677 implementation to stake/lock SDL tokens or distribute rewards
Extends the locking duration of a lock
Initiates the unlock period for a lock
Withdraws unlocked SDL
Handles an outgoing transfer of an reSDL lock to another chain
Handles an incoming transfer of an reSDL lock from another chain
Handles an incoming update from a secondary chain
Used by the delegator pool to migrate user stakes to this contract
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_token
address
address of token
rewardsPool
address
address of rewards pool
tokens
address[]
list of token addresses
_token
address
address of token
isSupported
bool
is token supported
tokens
address[]
list of supported tokens
balances
uint256[]
list of token balances
_account
address
address of account
staked
uint256
account's staked amount
totalStaked
uint256
total staked amount
_account
address
address of account
withdrawableRewards
uint256[]
list of withdrawable reward amounts for each token
sdlToken
address
address of SDL token
boostController
address
address of boost controller
lastLockId
uint256
latest lock id
ccipController
address
address of CCIP controller
_account
address
address of account
effectiveBalance
uint256
effective stake balance
totalEffectiveBalance
uint256
total effective balance
_lockIds
uint256[]
list of lock ids
locks
Lock[]
list of locks
_owner
address
address of account
lockIds
uint256[]
list of lockIds
delegatorPool
address
address of delegator pool
_tokens
address[]
list of token addresses
_token
address
address of token
_tokens
address[]
list of token addresses to withdraw rewards from
_token
address
address of token to add
_rewardsPool
address
address of token rewards pool to add
_token
address
address of token
_baseURI_
string
base URI
_boostController
address
address of boost controller
_ccipController
address
address of CCIP controller
_sender
address
sender of the stake
_value
uint256
value of the token transfer
_calldata
bytes
encoded lockId (uint256) and lockingDuration (uint64)
_lockId
uint256
id of lock
_lockingDuration
uint64
new locking duration to set
_lockId
uint256
id of lock
_lockId
uint256
id of the lock
_amount
uint256
amount to withdraw from the lock
_sender
address
sender of lock
_lockId
uint256
id of lock
_sdlReceiver
address
address to receive underlying SDL on this chain
_receiver
address
receiver of lock
_lockId
uint256
id of lock
_lock
Lock
lock
_numNewRESDLTokens
uint256
number of new reSDL locks to be minted on other chain
_totalRESDLSupplyChange
int256
total reSDL supply change on other chain
_sender
address
owner of lock
_amount
uint256
amount to stake
_lockingDuration
uint64
duration of lock