SDL Pool CCIP Controller Secondary

Acts as interface between the SDLPoolSecondary and the primary chain by handling CCIP messaging.

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

View Functions

getRouter

Returns the current CCIP router

function getRouter() public view returns (address)

Return Values

NameTypeDescription

router

address

router address

linkToken

Returns the address of the LINK token

function linkToken() external view returns (address)

Return Values

NameTypeDescription

linkToken

address

address of LINK token

sdlToken

Returns the address of the SDL token

function sdlToken() external view returns (address)

Return Values

NameTypeDescription

sdlToken

address

address of SDL token

sdlPool

Returns the address of the SDL pool

function sdlPool() external view returns (address)

Return Values

NameTypeDescription

sdlPool

address

address of SDL pool

reSDLTokenBridge

Returns the address of the reSDL bridge

function reSDLTokenBridge() external view returns (address)

Return Values

NameTypeDescription

reSDLTokenBridge

address

address of reSDL bridge

maxLINKFee

Returns the maximum CCIP fee in LINK to be paid on outgoing messages

function maxLINKFee() external view returns (uint256)

Return Values

NameTypeDescription

maxLINKFee

uint256

max fee in LINK

primaryChainSelector

Returns the id of the primary chain

function primaryChainSelector() external view returns (uint64)

Return Values

NameTypeDescription

primaryChainSelector

uint64

id of primary chain

primaryChainDestination

Returns the CCIP receiver address on the primary chain

function primaryChainDestination() external view returns (address)

Return Values

NameTypeDescription

primaryChainDestination

address

receiver address

extraArgs

Returns the CCIP extra args used for sending updates to the primary chain

function extraArgs() external view returns (bytes)

Return Values

NameTypeDescription

extraArgs

bytes

extra args

shouldUpdate

Returns whether there have been state changes that should be sent to the primary chain

function shouldUpdate() external view returns (bool)

Return Values

NameTypeDescription

shouldUpdate

bool

whether state changes have occurred

checkUpkeep

Returns whether an update to the primary chain should be initiated

function checkUpkeep(bytes) external view returns (bool, bytes)

Return Values

NameTypeDescription

upkeepNeeded

bool

whether an update should be initiated

Write Functions

setRouter

Sets the CCIP router

function setRouter(address _router) external

Parameters

NameTypeDescription

_router

address

router address

handleOutgoingRESDL

Handles the outgoing transfer of an reSDL token to another chain

function handleOutgoingRESDL(uint64 _destinationChainSelector, address _sender, uint256 _tokenId) external virtual returns (address, struct ISDLPool.RESDLToken)

Parameters

NameTypeDescription

_destinationChainSelector

uint64

id of the destination chain

_sender

address

sender of the transfer

_tokenId

uint256

id of token

Return Values

NameTypeDescription

receiver

address

the destination address

token

RESDLToken

the token being transferred

handleIncomingRESDL

Handles the incoming transfer of an reSDL token from another chain

function handleIncomingRESDL(uint64 _sourceChainSelector, address _receiver, uint256 _tokenId, struct ISDLPool.RESDLToken _reSDLToken) external virtual

Parameters

NameTypeDescription

_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

function ccipSend(uint64 _destinationChainSelector, struct Client.EVM2AnyMessage _evmToAnyMessage) external payable returns (bytes32)

Parameters

NameTypeDescription

_sourceChainSelector

uint64

id of the destination chain

_evmToAnyMessage

EVMToAntMessage

CCIP message

ccipReceive

Processes a received CCIP message

function ccipReceive(struct Client.Any2EVMMessage _message) external

Parameters

NameTypeDescription

_message

Any2EVMMessage

CCIP message

recoverTokens

Withdraws tokens held by this contract

function recoverTokens(address[] _tokens, uint256[] _amounts, address _receiver) external

Parameters

NameTypeDescription

_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

function setMaxLINKFee(uint256 _maxLINKFee) external

Parameters

NameTypeDescription

_maxLINKFee

uint256

maximum fee in LINK

setRESDLTokenBridge

Sets the address of the reSDL token bridge

function setRESDLTokenBridge(address _reSDLTokenBridge) external

Parameters

NameTypeDescription

_reSDLTokenBridge

address

address of reSDL token bridge

performUpkeep

Initiates an update to the primary chain if update conditions are met

function performUpkeep(bytes) external

setExtraArgs

Sets the extra args for sending updates to the primary chain

function setExtraArgs(bytes _extraArgs) external

Parameters

NameTypeDescription

_extraArgs

bytes

extra args as defined in CCIP API

Last updated