Setting token allowancesThe spender in each approve step depends on the route. On routes that execute through LZMultiCall, the spender is TransferDelegate. On other routes, the spender is the bridge contract that the bridge step calls. An ERC20 transfer returns zero, one or two approve steps. The API encodes the spender in each approve step’s
data, so you do not need to look up or hardcode a contract address. You MUST execute each step as returned.You MUST NOT grant an allowance to LZMultiCall. See the warning under LZMultiCall (Wrapper).See Contract Addresses for the Wrapper and Delegate addresses on each chain.Contract architecture
On routes that execute through LZMultiCall, the user calls LZMultiCall. During that call, LZMultiCall calls TransferDelegate to transfer the user’s tokens to LZMultiCall, sends the fees to the Treasury, and then calls the bridge contract.TransferDelegate (Delegate)
On routes that execute through LZMultiCall, users approve TransferDelegate as the ERC20 spender. It has one function:delegateTransferFrom; calls from any other address revert. The call succeeds only if from has approved TransferDelegate for at least amount of token.
On these routes, the approve userStep returned by the API encodes the TransferDelegate address in its data.
LZMultiCall (Wrapper)
LZMultiCall executes an ordered list of calls in one transaction. Each call has a target address, a value and calldata. LZMultiCall does not restrict the targets or the calldata, except for calls to TransferDelegate. The API uses it to transfer the user’s tokens, pay fees, call the bridge contract, and sweep any remaining balance. Each LZMultiCall deploys its own TransferDelegate in the constructor, so the two contracts are always paired 1:1. You can look up the paired Delegate address via theTRANSFER_DELEGATE getter on any LZMultiCall deployment.
There are two execution modes:
- Direct execution:
execute(calls, quoteId). The caller is the signer. Any address can call it. The API’s bridgeuserStepuses this mode. - Signature-based execution:
execute(calls, quoteId, expiration, signer, signature). Any address can submit a batch thatsignerhas signed with EIP-712, or approved through ERC-1271 ifsigneris a contract. The signature covers the calls,quoteId, an expiration timestamp and a per-signer nonce.
from address equals the signer. A batch therefore cannot transfer tokens from any address other than the signer.
LZMultiCall has a sweep() function that transfers its full balance of the listed tokens, or of native currency, to a recipient. Only LZMultiCall itself can call sweep(), so it runs only as a call inside a batch. The API adds a sweep() call at the end of each batch it builds.
LZMultiCall is also the fee wrapper. Inside each execute() call, the batch deducts fees from the transfer amount and sends them to the Treasury before running the bridge. See Fees for details.
Treasury
The Treasury is an address, not a contract that the API calls. Each chain’s deployment has its own Treasury address. Inside the batch, LZMultiCall makes one transfer to the Treasury for each fee: a native transfer for a fee in native currency, or a token transfer for a fee in the source token. You don’t interact with the Treasury directly. The API builds the fee transfers into the bridgeuserStep.
Fees
LZMultiCall is also the fee wrapper. Insideexecute(), the batched calls deduct fees and send them to the Treasury before bridging the rest. The API builds this into the bridge userStep for you.
Fee types
Up to three fees can apply per transfer:
Zero-amount fees are omitted. A fee is charged either in the source token or in native currency. Fees in the source token are subtracted from the source amount before bridging, so the destination amount is the post-fee value. When the source token is not native, fees in native currency are added on top and paid in
msg.value.
How fees flow through the contracts
The fee mechanism depends on the token type: Native tokens (e.g., ETH):- Call
LZMultiCall.execute()withmsg.valueset to the fee plus the bridge cost. - Inside the batch, one call sends the fee to the Treasury.
- The remaining calls run the bridge.
- Approve TransferDelegate for the full source amount (fees included).
- Call
LZMultiCall.execute(). - Inside the batch, TransferDelegate pulls the full token amount from the user to the Wrapper.
- A transfer sends the fee portion from the Wrapper to Treasury.
- The remaining calls bridge the post-fee amount.
Tracking
Eachexecute() call includes a quoteId. On confirmation, LZMultiCall emits an Executed(signer, quoteId, nonce) event. The API uses this event to attribute the transfer to the API key that requested the quote, linking volume and fee data back to each integration.
How the contracts work together
A typical ERC20 cross-chain transfer from an EVM chain:- You request a quote, and then call
/build-user-stepsfor the chosen quote. The API returns zero, one or two approve steps, followed by one bridge step. It omits the approve step when the current allowance already covers the amount. - The approve step calls the ERC20 token’s
approve()with TransferDelegate as spender. - The bridge step calls LZMultiCall’s
execute()on the source chain. - Inside that execution, LZMultiCall calls
TransferDelegate.delegateTransferFrom()to pull the full token amount (fees included) from your wallet to the Wrapper. - LZMultiCall sends the fee portion to Treasury and bridges the remaining amount.
Solana
Solana does not use LZMultiCall or TransferDelegate. The API returns one transaction for the user to sign, with no approve step. It adds two kinds of instructions after the bridge instructions: a transfer from the user to the Treasury for each fee, and one call to the fee wrapper program that records thequoteId.
The user signs the fee transfers directly. The call to the fee wrapper program passes no token accounts, so it does not move tokens. Fees in the source token are deducted from the bridged amount, and fees in SOL are added on top.
Because the user signs the bridge instructions, the user is the sender of any LayerZero message, and a composer receives the user as composeFrom. You MUST sign and submit the transaction from /build-user-steps as returned. The API does not support modified or rebuilt transactions.