WrappedTokenBridge
Last updated
Last updated
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.
Returns the current CCIP router
Name | Type | Description |
---|---|---|
Returns the address of the LINK token
Name | Type | Description |
---|---|---|
Returns the address of the underlying token bridged by this contract
Returns the address of the wrapped token bridged by this contract
Returns the current fee for a token transfer
Sets the CCIP router
ERC677 implementation to receive a token transfer to be wrapped and sent to a destination chain
Wraps and transfers tokens to a destination chain
Withdraws tokens held by 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 |
---|---|---|
router
address
router address
linkToken
address
address of LINK token
underlyingToken
address
address of underlying token
wrappedToken
address
address of wrapped token
_destinationChainSelector
uint64
id of destination chain
_amount
uint256
amount of tokens to transfer
_payNative
bool
whether fee should be paid natively or with LINK
fee
uint256
current fee
_router
address
router address
_sender
address
address of sender
_value
uint256
amount of tokens transferred
_calldata
bytes
encoded calldata consisting of destinationChainSelector (uint64), receiver (address), maxLINKFee (uint256)
_destinationChainSelector
uint64
id of destination chain
_receiver
address
address to receive tokens on destination chain
_amount
uint256
amount of tokens to transfer
_payNative
bool
whether fee should be paid natively or with LINK
_maxLINKFee
uint256
call will revert if LINK fee exceeds this value
_tokens
address[]
list of tokens to withdraw
_amounts
uint256[]
list of corresponding amounts to withdraw
_receiver
address
address to receive tokens