Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AcrossAdapter

Git Source

Inherits: BaseAdapter

Title: AcrossAdapter

Adapter for settling Across bridge claims and forwarding to MetaIntentReceiver

Receives bridged tokens directly from Across and forwards actual received amounts

Functions

constructor

constructor(address receiver) BaseAdapter(receiver);

settle

Settle bridged tokens and forward actual received amount to MetaIntentReceiver

function settle(RelayedOrderOutput calldata expectedOutput) external payable returns (bytes32 payloadHash);

Parameters

NameTypeDescription
expectedOutputRelayedOrderOutputThe expected output details (amount is minimum required)

Returns

NameTypeDescription
payloadHashbytes32The payload hash returned by the receiver

_fulfillToReceiverWithAmount

Internal helper to fulfill to receiver with a specific amount

This allows us to use the expectedOutput structure but with the actual received amount

function _fulfillToReceiverWithAmount(RelayedOrderOutput calldata baseOutput, uint256 actualAmount)
    internal
    returns (bytes32 payloadHash);

_decodeMessage

Override _decodeMessage for BaseAdapter compliance

function _decodeMessage(bytes calldata message) internal pure override returns (RelayedOrderOutput memory output);

Parameters

NameTypeDescription
messagebytesThe encoded message bytes

Returns

NameTypeDescription
outputRelayedOrderOutputThe decoded RelayedOrderOutput

receive

receive() external payable override;

Errors

InsufficientSettlementAmount

error InsufficientSettlementAmount(uint256 received, uint256 expected);