CrossChainOPTellerWithMultiAssetSupport

Git Source

Inherits: CrossChainTellerBase

LayerZero implementation of CrossChainTeller

State Variables

messenger

ICrossDomainMessenger public immutable messenger;

peer

address public peer;

maxMessageGas

uint32 public maxMessageGas;

minMessageGas

uint32 public minMessageGas;

nonce

uint128 public nonce;

Functions

constructor

setPeer

Callable by OWNER_ROLE.

Parameters

Name
Type
Description

_peer

address

new peer to set

setGasBounds

Callable by OWNER_ROLE.

Parameters

Name
Type
Description

newMinMessageGas

uint32

the new minMessageGas bound

newMaxMessageGas

uint32

the new maxMessageGas bound

receiveBridgeMessage

Function for OP Messenger to call to receive a message and mint the shares on this chain

Parameters

Name
Type
Description

receiver

address

to receive the shares

shareMintAmount

uint256

amount of shares to mint

messageId

bytes32

_bridge

the virtual bridge function to execute Optimism messenger sendMessage()

Parameters

Name
Type
Description

shareAmount

uint256

data

BridgeData

bridge data

Returns

Name
Type
Description

messageId

bytes32

messageId

_beforeBridge

before bridge hook to check gas bound and revert if someone's paying a fee

Parameters

Name
Type
Description

data

BridgeData

bridge data

_quote

the virtual function to override to get bridge fees, always zero for OP

Parameters

Name
Type
Description

shareAmount

uint256

to send

data

BridgeData

bridge data

Errors

CrossChainOPTellerWithMultiAssetSupport_OnlyMessenger

CrossChainOPTellerWithMultiAssetSupport_OnlyPeerAsSender

CrossChainOPTellerWithMultiAssetSupport_NoFee

CrossChainOPTellerWithMultiAssetSupport_GasOutOfBounds

Was this helpful?