SDL Pool Secondary

The SDLPoolSecondary performs the same functions as the SDLPoolSecondary with a few restrictions. Performing any state changes on reSDL positions including minting, burning, and updating requires the action to be queued at which point the NFT will be non-transferrable until an update is sent to the primary chain (updates are sent periodically). If there are no queued actions for an reSDL NFT, it can be transferred as normal.

This contract is deployed on all supported chains besides the primary chain.

ERC721 Functions

All standard IERC721 and IERC721Metadata functions are implemented for SDLPoolSecondary

View Functions

tokenPools

Returns the rewards pool for a token

function tokenPools(address _token) external view returns (address)

Parameters

Return Values

supportedTokens

Returns a list of supported tokens

function supportedTokens() external view returns (address[])

Return Values

isTokenSupported

Returns true/false to whether a given token is supported

function isTokenSupported(address _token) public view returns (bool)

Parameters

Return Values

tokenBalances

Returns balances of supported tokens within the controller

function tokenBalances() external view returns (address[], uint256[])

Return Values

staked

Returns an account's staked amount for use by reward pools controlled by this contract

function staked(address _account) external view virtual returns (uint256)

Parameters

Return Values

totalStaked

Returns the total staked amount for use by reward pools controlled by this contract

function totalStaked() external view virtual returns (uint256)

Return Values

withdrawableRewards

Returns a list of withdrawable rewards for an account

function withdrawableRewards(address _account) external view returns (uint256[])

Parameters

Return Values

sdlToken

Returns the address of the SDL token

function sdlToken() external view returns (address)

Return Values

boostController

Returns the address of the boost controller

function boostController() external view returns (address)

Return Values

lastLockId

Returns the id of the most recently minted lock

function lastLockId() external view returns (uint256)

Return Values

ccipController

Returns the address of the CCIP controller for this contract

function ccipController() external view returns (address)

Return Values

effectiveBalanceOf

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)

function effectiveBalanceOf(address _account) external view returns (uint256)

Parameters

Return Values

totalEffectiveBalance

Returns the sum of effective balances across all accounts

function totalEffectiveBalance() external view returns (uint256)

Return Values

getLocks

Returns the list of locks that corresponds to _lockIds

function getLocks(uint256[] _lockIds) external view returns (struct SDLPool.Lock[])

Parameters

Return Values

getLockIdsByOwner

Returns a list of lockIds owned by an account

function getLockIdsByOwner(address _owner) external view returns (uint256[])

Parameters

Return Values

queuedNewLockLimit

Returns the maximum number of queued new locks an account can have at one time

function queuedNewLockLimit() external view returns (uint256)

Return Values

updateBatchIndex

Returns the index of the current update batch

function updateBatchIndex() external view returns (uint128)

Return Values

queuedRESDLSupplyChange

Returns the current queued reSDL supply change to be sent in the next update

int256 queuedRESDLSupplyChange

Return Values

getQueuedNewLocksByOwner

Returns a list of queued new locks for an owner

function getQueuedNewLocksByOwner(address _owner) external view returns (struct SDLPool.Lock[], uint256[])

Parameters

Return Values

getQueuedLockUpdates

Returns queued lock updates for a list of lock ids

function getQueuedLockUpdates(uint256[] _lockIds) external view returns (struct SDLPoolSecondary.LockUpdate[][])

Parameters

Return Values

shouldUpdate

Returns whether an update should be sent to the primary chain

function shouldUpdate() external view returns (bool)

Return Values

updateInProgress

Returns whether a cross chain update is in progress

function isUpdateInProgress() external view returns (bool)

Return Values

Write Functions

distributeTokens

Distributes token balances to their respective rewards pools

function distributeTokens(address[] _tokens) public

Parameters

distributeToken

Distributes a token to its respective rewards pool

function distributeToken(address _token) public

Parameters

withdrawRewards

Withdraws an account's earned rewards for a list of tokens

function withdrawRewards(address[] _tokens) public

Parameters

addToken

Adds a new token

function addToken(address _token, address _rewardsPool) public

Parameters

removeToken

Removes a supported token

function removeToken(address _token) external

Parameters

setBaseURI

Sets the base URI for all tokens

function setBaseURI(string _baseURI) external

Parameters

setBoostController

Sets the boost controller

function setBoostController(address _boostController) external

Parameters

setCCIPController

Sets the CCIP controller

function setCCIPController(address _ccipController) external

Parameters

onTokenTransfer

ERC677 implementation to stake/lock SDL tokens or distribute rewards

function onTokenTransfer(address _sender, uint256 _value, bytes _calldata) external

Parameters

extendLockDuration

Extends the locking duration of a lock

function extendLockDuration(uint256 _lockId, uint64 _lockingDuration) external

Parameters

initiateUnlock

Initiates the unlock period for a lock

function initiateUnlock(uint256 _lockId) external

Parameters

withdraw

Withdraws unlocked SDL

function withdraw(uint256 _lockId, uint256 _amount) external

Parameters

executeQueuedOperations

Executes queued operations for the sender

function executeQueuedOperations(uint256[] _lockIds) external

Parameters

handleOutgoingRESDL

Handles the outgoing transfer of an reSDL lock to another chain

function handleOutgoingRESDL(address _sender, uint256 _lockId, address _sdlReceiver) external returns (struct SDLPool.Lock)

Parameters

Return Values

handleIncomingRESDL

Handles the incoming transfer of an reSDL lock from another chain

function handleIncomingRESDL(address _receiver, uint256 _lockId, struct SDLPool.Lock _lock) external

Parameters

handleOutgoingUpdate

Handles an outgoing update to the primary chain

function handleOutgoingUpdate() external returns (uint256, int256)

Return Values

handleIncomingUpdate

Handles an incoming update from the primary chain

function handleIncomingUpdate(uint256 _mintStartIndex) external

Parameters

Last updated