execute.
The behavior below follows the Executor source.
Execution flow
- The Portal pulls
route.tokensfrom the fulfillment caller into the Executor. - The Portal calls
executewithroute.callsandroute.nativeAmount. - The Executor calls each target in array order, forwarding that call’s
valueanddata. - It returns the array of return data if all calls complete without reverting.
msg.sender. A call uses the target’s own storage, not the Portal’s storage.
Call fields
Use the deployed ABI’s field order when encoding tuples. The source
Call struct orders fields as target, data, value.
Failure behavior
If any call reverts, all changes in that destination fulfillment transaction roll back. This does not reverse an earlier source-chain funding transaction.
A call that returns
false without reverting is still a successful low-level call. The Executor does not interpret return values or establish arbitrary postconditions. Encode the required checks in the route or called contracts.
Asset handling
The Executor has no per-user balance accounting and does not automatically sweep leftover ERC-20 tokens or native currency. Your calls must transfer or consume the assets intended for the recipient. Approvals and token balances are state in the token contracts even though the Executor has no mutable execution storage of its own.Preparing calls
Before submitting a fulfillment:- Verify each target, spender, recipient, and amount.
- Include approvals required by downstream contracts.
- Encode output constraints for swaps and deposits where applicable.
- Simulate the entire fulfillment and estimate gas with the actual route tokens and native value.
