SDL Pool CCIP Controller Primary
The SDLPoolCCIPControllerPrimary
acts as an interface between the PrimarySDLPool
and secondary chains by handling CCIP messaging.
This contract is deployed only on the primary chain.
View Functions
getRouter
Returns the current CCIP router
Return Values
Name | Type | Description |
---|---|---|
router | address | router address |
linkToken
Returns the address of the LINK token
Return Values
Name | Type | Description |
---|---|---|
linkToken | address | address of LINK token |
sdlToken
Returns the address of the SDL token
Return Values
Name | Type | Description |
---|---|---|
sdlToken | address | address of SDL token |
sdlPool
Returns the address of the SDL pool
Return Values
Name | Type | Description |
---|---|---|
sdlPool | address | address of SDL pool |
reSDLTokenBridge
Returns the address of the reSDL bridge
Return Values
Name | Type | Description |
---|---|---|
reSDLTokenBridge | address | address of reSDL bridge |
maxLINKFee
Returns the maximum CCIP fee in LINK to be paid on outgoing messages
Return Values
Name | Type | Description |
---|---|---|
maxLINKFee | uint256 | max fee in LINK |
whitelistedDestinations
Returns the destination address for a whitelisted chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | address | id of chain |
Return Values
Name | Type | Description |
---|---|---|
destination | address | destination address |
updateExtraArgsByChain
Returns the CCIP extra args for sending updates for a whitelisted chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | address | id of chain |
Return Values
Name | Type | Description |
---|---|---|
extraArgs | byts | extra args |
rewardsExtraArgsByChain
Returns the CCIP extra args for sending rewards for a whitelisted chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | address | id of chain |
Return Values
Name | Type | Description |
---|---|---|
extraArgs | bytes | extra args |
reSDLSupplyByChain
Returns the total reSDL supply on a whitelisted chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | address | id of chain |
Return Values
Name | Type | Description |
---|---|---|
reSDLSupply | uint256 | total reSDL supply on chain |
wrappedRewardTokens
Returns the wrapper token for a reward token
Parameters
Name | Type | Description |
---|---|---|
_token | address | address of reward token |
Return Values
Name | Type | Description |
---|---|---|
wrapper | address | address of wrapper token |
rewardsInitiator
Returns the address of the rewards initator
Return Values
Name | Type | Description |
---|---|---|
rewardsInitiator | address | address of rewards initiator |
getWhitelistedChains
Returns a list of all whitelisted chains
Return Values
Name | Type | Description |
---|---|---|
chainSelectors | uint64[] | list of whitelisted chain ids |
Write Functions
setRouter
Sets the CCIP router
Parameters
Name | Type | Description |
---|---|---|
_router | address | router address |
handleOutgoingRESDL
Handles the outgoing transfer of an reSDL token to another chain
Parameters
Name | Type | Description |
---|---|---|
_destinationChainSelector | uint64 | id of the destination chain |
_sender | address | sender of the transfer |
_tokenId | uint256 | id of token |
Return Values
Name | Type | Description |
---|---|---|
receiver | address | the destination address |
token | RESDLToken | the token being transferred |
handleIncomingRESDL
Handles the incoming transfer of an reSDL token from another chain
Parameters
Name | Type | Description |
---|---|---|
_sourceChainSelector | uint64 | id of the source chain |
_receiver | address | receiver of the transfer |
_tokenId | uint256 | id of reSDL token |
_reSDLToken | RESDLToken | reSDL token |
ccipSend
Sends a CCIP message
Parameters
Name | Type | Description |
---|---|---|
_sourceChainSelector | uint64 | id of the destination chain |
_evmToAnyMessage | EVMToAntMessage | CCIP message |
ccipReceive
Processes a received CCIP message
Parameters
Name | Type | Description |
---|---|---|
_message | Any2EVMMessage | CCIP message |
recoverTokens
Withdraws tokens held by this contract
Parameters
Name | Type | Description |
---|---|---|
_tokens | address[] | list of tokens to withdraw |
_amounts | uint256[] | list of corresponding amounts to withdraw |
_receiver | address | address to receive tokens |
setMaxLINKFee
Sets the maximum LINK fee to be paid on an outgoing CCIP message
Parameters
Name | Type | Description |
---|---|---|
_maxLINKFee | uint256 | maximum fee in LINK |
setRESDLTokenBridge
Sets the address of the reSDL token bridge
Parameters
Name | Type | Description |
---|---|---|
_reSDLTokenBridge | address | address of reSDL token bridge |
distributeRewards
Claims and distributes rewards between all secondary chains
addWhitelistedChain
Whitelists a new chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | uint64 | id of chain |
_destination | address | address to receive CCIP messages on chain |
_updateExtraArgs | bytes | extraArgs for sending updates to this destination as defined in CCIP docs |
_rewardsExtraArgs | bytes | extraArgs for sending rewards to this destination as defined in CCIP docs |
removeWhitelistedChain
Removes an existing whitelisted chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | uint64 | id of chain |
approveRewardTokens
Approves the CCIP router to transfer tokens on behalf of this contract
Parameters
Name | Type | Description |
---|---|---|
_tokens | address[] | list of tokens to approve |
setWrappedRewardToken
Sets the wrapped token address for a reward token
Parameters
Name | Type | Description |
---|---|---|
_token | address | address of token |
_wrappedToken | address | address of wrapped token |
setUpdateExtraArgs
Sets the extra args used for sending updates to a chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | uint64 | id of chain |
_updateExtraArgs | bytes | extra args as defined in CCIP API |
setRewardsExtraArgs
Sets the extra args used for sending rewards to a chain
Parameters
Name | Type | Description |
---|---|---|
_chainSelector | uint64 | id of chain |
_rewardsExtraArgs | bytes | extra args as defined in CCIP API |
setRewardsInitiator
Sets the rewards initiator
Parameters
Name | Type | Description |
---|---|---|
_rewardsInitiator | address | address of rewards initiator |
Last updated