CrossChainTellerBase

Git Source

Inherits: TellerWithMultiAssetSupport

Base contract for the CrossChainTeller, includes functions to overload with specific bridge method

Functions

constructor

constructor(
    address _owner,
    address _vault,
    address _accountant
)
    TellerWithMultiAssetSupport(_owner, _vault, _accountant);

depositAndBridge

function to deposit into the vault AND bridge crosschain in 1 call

function depositAndBridge(
    ERC20 depositAsset,
    uint256 depositAmount,
    uint256 minimumMint,
    BridgeData calldata data
)
    external
    payable
    requiresAuth
    nonReentrant;

Parameters

Name
Type
Description

depositAsset

ERC20

ERC20 to deposit

depositAmount

uint256

amount of deposit asset to deposit

minimumMint

uint256

minimum required shares to receive

data

BridgeData

Bridge Data

previewFee

Preview fee required to bridge shares in a given feeToken.

bridge

bridging code to be done without deposit, for users who already have vault tokens

Parameters

Name
Type
Description

shareAmount

uint256

to bridge

data

BridgeData

bridge data

_bridge

the virtual bridge function to be overridden

Parameters

Name
Type
Description

shareAmount

uint256

data

BridgeData

bridge data

Returns

Name
Type
Description

<none>

bytes32

messageId

_quote

the virtual function to override to get bridge fees

Parameters

Name
Type
Description

shareAmount

uint256

to send

data

BridgeData

bridge data

_beforeBridge

after bridge code, just an emit but can be overridden

the before bridge hook to perform additional checks

Parameters

Name
Type
Description

data

BridgeData

bridge data

_afterBridge

after bridge code, just an emit but can be overridden

Parameters

Name
Type
Description

shareAmount

uint256

share amount burned

data

BridgeData

bridge data

messageId

bytes32

message id returned when bridged

_beforeReceive

a before receive hook to call some logic before a receive is processed

_afterReceive

a hook to execute after receiving

Parameters

Name
Type
Description

shareAmount

uint256

the shareAmount that was minted

destinationChainReceiver

address

the receiver of the shares

messageId

bytes32

the message ID

Events

MessageSent

MessageReceived

Was this helpful?