WrappedTokenBridge

The WrappedTokenBridge enables users to wrap a token and transfer it to another chain in a single transaction using CCIP. Additonally it can receive a CCIP token transfer from another chain and automatically unwrap tokens before sending them to their final destination.

This contract is used to handle stLINK <-> wstLINK transfers between the primary chain and secondary chains.

View Functions

getRouter

Returns the current CCIP router

function getRouter() public view returns (address)

Return Values

linkToken

Returns the address of the LINK token

function linkToken() external view returns (address)

Return Values

token

Returns the address of the underlying token bridged by this contract

function token() external view returns (address)

Return Values

wrappedToken

Returns the address of the wrapped token bridged by this contract

function wrappedToken() external view returns (address)

Return Values

getFee

Returns the current fee for a token transfer

function getFee(uint64 _destinationChainSelector, uint256 _amount, bool _payNative) external view returns (uint256)

Parameters

Return Values

Write Functions

setRouter

Sets the CCIP router

function setRouter(address _router) external

Parameters

onTokenTransfer

ERC677 implementation to receive a token transfer to be wrapped and sent to a destination chain

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

Parameters

transferTokens

Wraps and transfers tokens to a destination chain

function transferTokens(uint64 _destinationChainSelector, address _receiver, uint256 _amount, bool _payNative, uint256 _maxLINKFee) external payable returns (bytes32 messageId)

Parameters

recoverTokens

Withdraws tokens held by this contract

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

Parameters

Last updated