Type references can be found in the (types directory)[/types].
The IntentSource is where intent publishing and reward claiming functionality live. Users (or actors on their behalf) can publish intents here, as well as fund intents' rewards. After an intent is fulfilled and proven, a solver can fetch their rewards here as well. This contract is not expected to hold any funds between transactions.
Parameters:
intentHash
(bytes32) The hash of the partially funded intentfunder
(address) The address providing the partial funding
Parameters:
intentHash
(bytes32) The hash of the partially funded intentfunder
(address) The address providing the partial funding
Parameters:
hash
(bytes32) Unique identifier of the intentsalt
(bytes32) Creator-provided uniqueness factorsource
(uint256) Source chain identifierdestination
(uint256) Destination chain identifierinbox
(address) Address of the receiving contract on the destination chainrouteTokens
(TokenAmount[]) Required tokens for executing destination chain callscalls
(Call[]) Instructions to execute on the destination chaincreator
(address) Intent originator addressprover
(address) Prover contract addressdeadline
(address) Timestamp for reward claim eligibilitynativeValue
(uint256) Native token reward amountrewardTokens
(TokenAmount[]) ERC20 token rewards with amounts
Parameters:
hash
(bytes32) The hash of the claimed intentrecipient
(address) The address receiving the rewards
Parameters:
hash
(bytes32) The hash of the refunded intentrecipient
(address) The address receiving the refund
Parameters:
intentHash
(bytes32) The hash of the intent
Parameters:
intentHash
(bytes32) The hash of the intent
Parameters:
intentHash
(bytes32) The hash of the intent
Parameters:
intent
(Intent) The intent to hash
Parameters:
intent
(Intent) The intent to calculate the vault address for
Parameters:
intent
(Intent) The complete intent specification
Security: This method can be called to create an intent on anyone's behalf. It does not transfer any funds. It emits an event that would give a solver all the information required to fulfill the intent, but the solver is expected to check that the intent is funded before fulfilling.
Parameters:
intent
(Intent) The complete intent specification
Security: This method is called by the user to create and completely fund an intent. It will fail if the funder does not have sufficient balance or has not given the IntentSource authority to move all the reward funds.
Parameters:
intent
(Intent) The complete intent specificationreward
(Reward) Reward structure containing distribution details
Security: This method is called by the user to completely fund an intent. It will fail if the funder does not have sufficient balance or has not given the IntentSource authority to move all the reward funds.
Parameters:
routeHash
(bytes32) The hash of the intent's route componentreward
(Reward) Reward structure containing distribution detailsfunder
(address) Address to fund the intent frompermitContract
(address) Address of the permitContract instanceallowPartial
(bool) Whether to allow partial funding
Security: This method will fail if allowPartial is false but incomplete funding is provided. Additionally, this method cannot be called for intents with nonzero native rewards.
Parameters:
intent
(Intent) The complete intent specificationfunder
(address) Address to fund the intent frompermitContract
(address) Address of the permitContract instanceallowPartial
(bool) Whether to allow partial funding
Security: This method is called by the user to create and completely fund an intent. It will fail if the funder does not have sufficient balance or has not given the IntentSource authority to move all the reward funds.
Parameters:
intent
(Intent) Intent to validate
Security: This method can be called by anyone, but the caller has no specific rights. Whether or not this method succeeds and who receives the funds if it does depend solely on the intent's proven status and expiry time, as well as the claimant address specified by the solver on the Inbox contract on fulfillment.
Parameters:
routeHash
(bytes32) The hash of the intent's route componentreward
(Reward) Reward structure containing distribution details
Security: Can withdraw anyone's intent, but only to the claimant predetermined by its solver. Withdraws to solver only if intent is proven.
Parameters:
routeHashes
(bytes32[]) Array of route component hashesreward
(Reward[]) Array of corresponding reward specifications
Security: Can withdraw anyone's intent, but only to the claimant predetermined by its solver. Withdraws to solver only if intent is proven.
Parameters:
routeHashes
(bytes32[]) Array of route component hashesreward
(Reward[]) Array of corresponding reward specifications
Security: Will fail if intent not expired.
Parameters:
routeHashes
(bytes32[]) Array of route component hashesreward
(Reward[]) Array of corresponding reward specificationstoken
(address) Token address for handling incorrect vault transfers
Security: Will fail if token is the zero address or the address of any of the reward tokens. Will also fail if intent has nonzero native token rewards and has not yet been claimed or refunded.
The Inbox is where intent fulfillment lives. Solvers fulfill intents on the Inbox via one of the contract's fulfill methods, which pulls in solver resources and executes the intent's calls on the destination chain. Once an intent has been fulfilled, any subsequent attempts to fulfill it will be reverted. The Inbox also contains some post-fulfillment proving-related logic.
Parameters:
_hash
(bytes32) the hash of the intent_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_claimant
(address) the address (on the source chain) that will receive the fulfilled intent's reward
Parameters:
_hash
(bytes32) the hash of the intent_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_claimant
(address) the address (on the source chain) that will receive the fulfilled intent's reward
Parameters:
_hash
(bytes32) the hash of the intent_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_claimant
(address) the address (on the source chain) that will receive the fulfilled intent's reward
Parameters:
_hash
(bytes32) the hash of the intent_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_claimant
(address) the address (on the source chain) that will receive the fulfilled intent's reward_prover
(address) the address of the HyperProver these intents will be proven on
Parameters:
_hash
(bytes32) the hash of the intent_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_claimant
(address) the address (on the source chain) that will receive the fulfilled intent's reward_prover
(address) the address of the Hyperlane prover
Parameters:
_mailbox
(address) address of the mailbox contract
Parameters:
_solver
(address) the address of the solver whose permissions are being changed_canSolve
(bool) whether or not _solver will be able to solve after this method is called
Allows a filler to fulfill an intent on its destination chain to be proven by the StorageProver specified in the intent. The filler also gets to predetermine the address on the destination chain that will receive the reward tokens.
Parameters:
_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_targets
(address[]) the address on the destination chain at which the instruction sets need to be executed_data
(bytes[]) the instructions to be executed on _targets_expiryTime
(uint256) the timestamp at which the intent expires_nonce
(bytes32) the nonce of the calldata. Composed of the hash on the source chain of the global nonce and chainID_claimant
(address) the address that can claim the fulfilled intent's fee on the source chain_expectedHash
(bytes32) the hash of the intent. Used to verify that the correct data is being input
Security: This method can be called by anyone, but cannot be called again for the same intent, thus preventing a double fulfillment. This method executes arbitrary calls written by the intent creator on behalf of the Inbox contract - it is important that the caller be aware of what they are executing. The Inbox will be the msg.sender for these calls. _sourceChainID, the destination's chainID, the inbox address, _targets, _data, _expiryTime, and _nonce are hashed together to form the intent's hash on the IntentSource - any incorrect inputs will result in a hash that differs from the original, and will prevent the intent's reward from being withdrawn (as this means the intent fulfilled differed from the one created). The _expectedHash input exists only to help prevent this before fulfillment.
Allows a filler to fulfill an intent on its destination chain to be proven by the HyperProver specified in the intent. After fulfilling the intent, this method packs the intentHash and claimant into a message and sends it over the Hyperlane bridge to the HyperProver on the source chain. The filler also gets to predetermine the address on the destination chain that will receive the reward tokens.
Parameters:
_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_targets
(address[]) the address on the destination chain at which the instruction sets need to be executed_data
(bytes[]) the instructions to be executed on _targets_expiryTime
(uint256) the timestamp at which the intent expires_nonce
(bytes32) the nonce of the calldata. Composed of the hash on the source chain of the global nonce and chainID_claimant
(address) the address that can claim the fulfilled intent's fee on the source chain_expectedHash
(bytes32) the hash of the intent. Used to verify that the correct data is being input_prover
(address) the address of the hyperProver on the source chain
Security: This method inherits all of the security features in fulfillstorage. This method is also payable, as funds are required to use the hyperlane bridge.
Performs the same functionality as fulfillHyperInstant, but allows the user to use a custom HyperLane relayer and pass in the corresponding metadata
Parameters:
_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_targets
(address[]) the address on the destination chain at which the instruction sets need to be executed_data
(bytes[]) the instructions to be executed on _targets_expiryTime
(uint256) the timestamp at which the intent expires_nonce
(bytes32) the nonce of the calldata. Composed of the hash on the source chain of the global nonce and chainID_claimant
(address) the address that can claim the fulfilled intent's fee on the source chain_expectedHash
(bytes32) the hash of the intent. Used to verify that the correct data is being input_prover
(address) the address of the hyperProver on the source chain_metadata
(bytes) Metadata for postDispatchHook (empty bytes if not applicable)_postDispatchHook
(address) Address of postDispatchHook (zero address if not applicable)
Security: This method inherits all of the security features in fulfillstorage. This method is also payable, as funds are required to use the hyperlane bridge. Additionally, the user is charged with the responsibility of ensuring that the passed in metadata and relayer perform according to their expectations
`Allows a filler to fulfill an intent on its destination chain to be proven by the HyperProver specified in the intent. After fulfilling the intent, this method emits an event that indicates which intent was fulfilled. Fillers of hyperprover-destined intents will listen to these events and batch process them later on. The filler also gets to predetermine the address on the destination chain that will receive the reward tokens. Note: this method is currently not supported by Eco's solver services, but has been included for completeness. Work on services for this method is ongoing.
Parameters:
_sourceChainID
(uint256) the ID of the chain where the fulfilled intent originated_targets
(address[]) the address on the destination chain at which the instruction sets need to be executed_data
(bytes[]) the instructions to be executed on _targets_expiryTime
(uint256) the timestamp at which the intent expires_nonce
(bytes32) the nonce of the calldata. Composed of the hash on the source chain of the global nonce and chainID_claimant
(address) the address that can claim the fulfilled intent's fee on the source chain_expectedHash
(bytes32) the hash of the intent. Used to verify that the correct data is being input_prover
(address) the address of the hyperProver on the source chain
Security: This method inherits all of the security features in fulfillstorage.
Allows a filler to send a batch of HyperProver-destined intents over the HyperLane bridge. This reduces the cost per intent proven, as intents that would have had to be sent in separate messages are now consolidated into one.
Parameters:
_sourceChainID
(uint256) the chainID of the source chain_prover
(address) the address of the hyperprover on the source chain_intentHashes
(bytes32[]) the hashes of the intents to be proven
Security: This method ensures that all passed-in hashes correspond to intents that have been fulfilled according to the inbox. It contains a low-level call to send native tokens, but will only do this in the event that the call to this method has a nonzero msg.value. The method is payable because the HyperLane relayer requires fees in native token in order to function.
Performs the same functionality as sendBatch, but allows the user to use a custom HyperLane relayer and pass in the corresponding metadata.
Parameters:
_sourceChainID
(uint256) the chainID of the source chain_prover
(address) the address of the hyperprover on the source chain_intentHashes
(bytes32[]) the hashes of the intents to be proven_metadata
(bytes) Metadata for postDispatchHook (empty bytes if not applicable)_postDispatchHook
(address) Address of postDispatchHook (zero address if not applicable)
Security: This method inherits all of the security features in sendBatch. Additionally, the user is charged with the responsibility of ensuring that the passed in metadata and relayer perform according to their expectations.
A passthrough method that calls the HyperLane Mailbox and fetches the cost of sending a given message. This method is used inside both the fulfillHyperInstant and sendBatch methods to ensure that the user has enough gas to send the message over HyperLane's bridge.
Parameters:
_sourceChainID
(uint256) the chainID of the source chain_messageBody
(bytes) the message body being sent over the bridge_prover
(address) the address of the hyperprover on the source chain
Security: This method inherits all of the security features in fulfillstorage. This method is also payable, as funds are required to use the hyperlane bridge.
Parameters:
_mailbox
(address) the address of the mailbox.
Security: This method can only be called by the owner of the Inbox, and can only be called if the current mailbox address is the zero address. It is intended to be called at time of construction.
Security: This method can only be called by the owner of the Inbox, and can only be called if solving is not currently public. There is no function to re-restrict solving - once it is public it cannot become private again.
Parameters:
_solver
(address) the address of the solver whose permissions are being changed_canSolve
(bool) whether or not _solver will be able to solve after this method is called
Security: This method can only be called by the owner of the Inbox. This method has no tangible effect if isSolvingPublic is true.
Parameters:
_destination
(address) the destination of the transferred funds
Security: This method can only be called by the owner of the Inbox. This method is primarily for testing purposes.
A message-based implementation of BaseProver that consumes data coming from HyperLane's message bridge sent by the Inbox on the destination chain. intentHash - claimant address pairs sent across the chain are written to the HyperProver's provenIntents mapping and are later read by the IntentSource when reward withdrawals are attempted.
Parameters:
_hash
(bytes32) the hash of the intent_claimant
(address) the address that can claim this intent's rewards
Parameters:
_hash
(bytes32) the hash of the intent
Called by the HyperLane Mailbox contract to finish the HyperProving process. This method parses the message sent via HyperLane into intent hashes and their corresponding claimant addresses, then writes them to the provenIntents mapping so that the IntentSource can read from them when a reward withdrawal is attempted.
Parameters:
_sender
(bytes32) the address that called dispatch() on the HyperLane Mailbox on the destination chain_messageBody
(bytes) the message body containing intent hashes and their corresponding claimants
Security: This method is public but there are checks in place to ensure that it reverts unless msg.sender is the local hyperlane mailbox and _sender is the destination chain's inbox. This method has direct write access to the provenIntents mapping and, therefore, gates access to the rewards for hyperproven intents.
A storage-based implementation of BaseProver that utilizes the digests posted between rollups and mainnet to verify fulfilled status of intents on the destination chain.
Parameters:
_blocknumber
(uint256) the block number corresponding to this L1 world state_L1WorldStateRoot
(bytes32) the world state root at _blockNumber
Parameters:
_destinationChainID
(uint256) the chainID of the destination chain_blocknumber
(uint256) the block number corresponding to this L2 world state_L2WorldStateRoot
(bytes32) the world state root at _blockNumber
Parameters:
_hash
(bytes32) the hash of the intent_claimant
(address) the address that can claim this intent's rewards
validates input L1 block state against the L1 oracle contract. This method does not need to be called per intent, but the L2 batch containing the intent must have been settled to L1 on or before this block.
Parameters:
rlpEncodedBlockData
(bytes) properly encoded L1 block data
Security: This method can be called by anyone. Inputting the correct block's data encoded as expected will result in its hash matching the blockhash found on the L1 oracle contract. This means that the world state root found in that block corresponds to the block on the oracle contract, and that it represents a valid state. Notably, only one block's data is present on the oracle contract at a time, so the input data must match that block specifically, or the method will revert.
Validates World state by ensuring that the passed in world state root corresponds to value in the L2 output oracle on the Settlement Layer. We submit a `StorageProof` proving that the L2 Block is included in a batch that has been settled to L1 and an `AccountProof` proving that the `StorageProof` submitted is linked to a `WorldState` for the contract that the `StorageProof` is for.
For Optimisms BedRock release we submit an outputRoot
storage proof created by concatenating
output_root = kecakk256( version_byte || state_root || withdrawal_storage_root || latest_block_hash)
Eco Protocol also allows the creation and solving of intents via the ERC-7683 interface.
An implementation of the ERC-7683 OriginSettler designed to work with Eco protocol. This contract is where intents are created and funded. Reward withdrawal has not yet been implemented within Eco's ERC7683 implementation, but it can be accomplished via the IntentSource contract.
Parameters:
orderId
(bytes32) a unique order identifier within this settlement systemresolvedOrder
(ResolvedCrossChainOrder) resolved order that would be returned by resolve if called instead of Open
Parameters:
_order
(OnchainCrossChainOrder) the onchain order containing all relevant intent data. The orderData of the order is of type OnchainCrosschainOrderData.
Security: This method will fail if the orderDataType does not match the typehash of OnchainCrosschainOrderData. This method is payable to account for users who wish to create intents that reward solvers with native tokens. A user should have approved the Eco7683OriginSettler to transfer reward tokens. This method will also fail if a user attempts to use it to open an intent that has already been funded.
Parameters:
_order
(GaslessCrossChainOrder) the gasless order containing all relevant intent data. The orderData of the order is of type GaslessCrosschainOrderData._signature
(bytes32) the intent user's signature over _order __originFillerData
(bytes) filler data for the origin chain (this is vestigial, not used and included only to maintain compatibility)
Security: This method will fail if the orderDataType does not match the typehash of GaslessCrosschainOrderData. This method is made payable in the event that the caller of this method (a solver) is opening an intent that has native token as a reward. How that solver receives the native token from the user is not within the scope of this method. This method also demands that the intent is funded in its entirety and will fail if the requisite funds have not been approved by the user. Lastly, this method will fail if the same intent has already been funded.
Parameters:
_order
(OnchainCrossChainOrder) the OnchainCrossChainOrder to be resolved
Parameters:
_order
(OnchainCrossChainOrder) the GaslessCrossChainOrder to be resolved
An implementation of the ERC-7683 DestinationSettler designed to work with Eco protocol. This is an abstract contract whose functionality is present on Eco's Inbox contract. This is where intent fulfillment lives within the ERC-7683 system.
Emitted when an intent is fulfilled via the Eco7683DestinationSettler using Hyperlane instant proving
Parameters:
_orderId
(bytes32) Hash of the fulfilled intent_solver
(address) Address that fulfilled the intent
Parameters:
_orderId
(bytes32) Unique identifier for the order being filled_originData
(bytes) Data emitted on the origin chain to parameterize the fill, equivalent to the originData field from the fillInstruction of the ResolvedCrossChainOrder. An encoded Intent struct._fillerData
(bytes) Data provided by the filler to inform the fill or express their preferences. an encoding of the ProofType (enum), claimant (address), and optionally postDispatchHook (address) and metadata (bytes) in the event that the intent is to be proven against a HyperProver.
Security: This method fails if the intent's fillDeadline has passed. It also inherits all of the security features in fulfillStorage / fulfillHyperInstantWithRelayer.