This section contains a full API reference of all public functions & events related to making and tracking xchain calls.
event XCalled(bytes32 transferId, uint256 nonce, bytes32 messageHash, struct TransferInfo params, address asset, uint256 amount, address local)
xcallis called on the origin domain of a transfer.
event ExternalCalldataExecuted(bytes32 transferId, bool success, bytes returnData)
Emitted when a transfer has its external data executed
event Executed(bytes32 transferId, address to, address asset, struct ExecuteArgs args, address local, uint256 amount, address caller)
executeis called on the destination domain of a transfer.
executemay be called when providing fast liquidity or when processing a reconciled (slow) transfer.
event TransferRelayerFeesIncreased(bytes32 transferId, uint256 increase, address caller)
_bumpTransferis called by an user on the origin domain both in
event SlippageUpdated(bytes32 transferId, uint256 slippage)
forceUpdateSlippageis called by an user on the destination domain
function routedTransfers(bytes32 _transferId) public view returns (address)
Gets a list of routers that routed a transfer by
function transferStatus(bytes32 _transferId) public view returns (enum DestinationTransferStatus)
Gets a transfer's status by
transferId. Note - this function MUST be called on the destination chain.
function domain() public view returns (uint32)
domainidentifier of the chain.
function xcall(uint32 _destination, address _to, address _asset, address _delegate, uint256 _amount, uint256 _slippage, bytes _callData, uint256 _relayerFee) external payable returns (bytes32)
Initiates a cross-chain transfer of funds, calldata, and/or various named properties.
For ERC20 transfers, this contract must have approval to transfer the input (transacting) assets. The adopted assets will be swapped for their local (connext-flavored) asset counterparts (i.e. bridgeable tokens) via the configured AMM if necessary. In the event that the adopted assets are local assets, no swap is needed. The local tokens will then be sent via the bridge router. If the local assets are representational for an asset on another chain, we will burn the tokens here. If the local assets are canonical (meaning that the adopted to local asset pairing is native to this chain), we will custody the tokens here.
function xcallIntoLocal(uint32 _destination, address _to, address _asset, address _delegate, uint256 _amount, uint256 _slippage, bytes _callData, uint256 _relayerFee) external payable returns (bytes32)
Helper function that xcalls as normal but forces the receipt of the local (Connext-flavored) asset at destination. This function is used typically to generate nextAssets that can be used to LP into the destination chain stableswap. Params and returned data function exactly the same way as
function execute(struct ExecuteArgs _args) external returns (bytes32)
Called on a destination domain to disburse correct assets to end recipient and execute any included calldata.
Can be called before or after
handle[reconcile] is called (regarding the same transfer), depending on whether the fast liquidity route (i.e. funds provided by routers) is being used for this transfer. As a result, executed calldata (including properties like
originSender) may or may not be verified depending on whether the reconcile has been completed (i.e. the optimistic confirmation period has elapsed).
function bumpTransfer(bytes32 _transferId) external payable
Anyone can call this function on the origin domain to increase the relayer fee for a transfer. MUST be called on the origin domain.
function bumpTransfer(bytes32 _transferId, address _relayerFeeAsset, uint256 _relayerFee) external payable
Anyone can call this function to increase the relayer fee for a transfer (using the _relayerFeeAsset specified). MUST be called on the origin domain.
function forceUpdateSlippage(struct TransferInfo _params, uint256 _slippage) external
Allows a user-specified account (
xcall) to update the slippage they are willing to take on destination transfers. MUST be called on the destination chain.
function xReceive(bytes32 _transferId, uint256 _amount, address _asset, address _originSender, uint32 _origin, bytes _callData) external returns (bytes)
Interface that the Connext contracts call into on the
_toaddress specified during
xcall. Developers MUST implement this on the destination chain to receive incoming calldata.