IntentSource and destination-chain Inbox implementations. It coordinates an intent’s lifecycle while per-intent vaults hold its reward.
This reference describes the Routes 2.12.0 source. Use the ABI for your deployed version.
Prerequisites
- The source and destination Portal addresses and their matching ABIs.
- The complete intent, including its route, reward, and deadlines.
- RPC access and funds for transaction gas on each chain you submit to.
- For fulfillment, the route tokens and any prover message fees.
execution object instead of reconstructing contract calldata. See Integrate the Routes API.
Source-chain operations
Several methods have struct and encoded-route overloads. Use the deployed ABI to select the correct overload. A raw ERC-20 transfer to a vault can fund its balance without emitting
IntentFunded; check funding rather than relying only on that event.
IntentPublished can be emitted more than once for the same active intent. Deduplicate by intent hash and handle chain reorganizations when indexing events.
Destination-chain fulfillment
fulfill accepts the intent hash, decoded route, reward hash, and claimant. The Portal checks the route’s deadline, Portal address, hash, and fulfillment state. It then transfers route.tokens from the caller to the Executor and runs route.calls.
The caller must approve the destination Portal for those tokens and supply at least route.nativeAmount. The claimant identifies the account that will receive the source-chain reward; it is not necessarily the transaction sender.
fulfillAndProve combines fulfillment with a call to the selected destination-side prover. prove can initiate proving separately for one or more fulfilled intent hashes.
The prover’s sourceChainDomainID may differ from the chain ID. Derive it from the selected prover’s configuration. Message fees and prover-specific data are also part of that integration.
Withdrawal and refunds
For an unproven intent, refund eligibility begins at
reward.deadline. The 2.12.0 Portal also recognizes a proven cancellation: after route.deadline, any account can call cancel or cancelAndProve on the destination Portal for an unfulfilled intent, and once that cancellation is proven on the source chain the refund is available before reward.deadline. Cancellation alone does not release funds. See Refunds by intent type for what each route shape returns.
Expiry does not automatically execute a refund. Check the transaction outcome and returned balances. See Vault for payout details.
Events and state
The contract reward states are
Initial, Funded, Withdrawn, and Refunded. They are distinct from the API’s aggregated transfer statuses.
Troubleshooting
Simulate the complete transaction and estimate gas using current chain state before submitting it.
