Overview
The Inbox contract is the main entry point for fulfilling intents on the destination chain. It validates intent hash authenticity, executes calldata, and enables provers to claim rewards on the source chain by checking the claimants mapping.
Contract Location: contracts/Inbox.sol
Inherits: DestinationSettler, IInbox
State Variables
claimants
Mapping of intent hashes to their claimant identifiers. Stores the cross-VM compatible claimant identifier for each fulfilled intent.
executor
Reference to the Executor contract used to execute intent calls.
State-Changing Functions
fulfill
Fulfills an intent to be proven via storage proofs. Validates intent hash, executes calls, and marks as fulfilled.
The hash of the intent to fulfill
The route of the intent containing execution instructions
The hash of the reward details
Cross-VM compatible claimant identifier
Array of execution results from each call
This function is payable and requires msg.value to be at least route.nativeAmount. Any excess ETH is automatically refunded to the caller.
fulfillAndProve
Fulfills an intent and initiates proving in one transaction. Executes intent actions and sends proof message to source chain.
The hash of the intent to fulfill
The hash of the reward details
Cross-VM compatible claimant identifier
Address of prover on the destination chain
Domain ID of the source chain where the intent was created
Additional data for message formatting
Array of execution results
WARNING: sourceChainDomainID is NOT necessarily the same as chain ID.Each bridge provider uses their own domain ID mapping system:
- Hyperlane: Uses custom domain IDs that may differ from chain IDs
- LayerZero: Uses endpoint IDs that map to chains differently
- Metalayer: Uses domain IDs specific to their routing system
- Polymer: Uses chain IDs
You MUST consult the specific bridge provider’s documentation to determine the correct domain ID for the source chain.
prove
Initiates proving process for fulfilled intents. Sends message to source chain to verify intent execution.
Address of prover on the destination chain
Domain ID of the source chain
Array of intent hashes to prove
Additional data for message formatting
WARNING: sourceChainDomainID is NOT necessarily the same as chain ID.Each bridge provider uses their own domain ID mapping system:
- Hyperlane: Uses custom domain IDs that may differ from chain IDs
- LayerZero: Uses endpoint IDs that map to chains differently
- Metalayer: Uses domain IDs specific to their routing system
- Polymer: Uses chain IDs
You MUST consult the specific bridge provider’s documentation to determine the correct domain ID for the source chain.
This function can only prove intents that have already been fulfilled. It will revert with IntentNotFulfilled if any of the provided intent hashes have not been fulfilled yet.
Events
IntentFulfilled
Emitted when an intent is successfully fulfilled.
IntentProven
Emitted when an intent proof is submitted to the prover.
Errors
Thrown when the chain ID exceeds uint64 maximum value.
IntentExpired
Thrown when attempting to fulfill an intent after its deadline.
InvalidPortal
Thrown when the route.portal does not match the current contract address.
InvalidHash
Thrown when the computed intent hash does not match the provided intent hash.
IntentAlreadyFulfilled
Thrown when attempting to fulfill an intent that has already been fulfilled.
ZeroClaimant
Thrown when the claimant is bytes32(0).
InsufficientNativeAmount
Thrown when msg.value is less than route.nativeAmount.
IntentNotFulfilled
Thrown when attempting to prove an intent that has not been fulfilled.
Usage Example