Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
23680460 | 26 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HyperProver
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IMessageRecipient} from "@hyperlane-xyz/core/contracts/interfaces/IMessageRecipient.sol"; import {TypeCasts} from "@hyperlane-xyz/core/contracts/libs/TypeCasts.sol"; import {BaseProver} from "./BaseProver.sol"; import {Semver} from "../libs/Semver.sol"; /** * @title HyperProver * @notice Prover implementation using Hyperlane's cross-chain messaging system * @dev Processes proof messages from Hyperlane mailbox and records proven intents */ contract HyperProver is IMessageRecipient, BaseProver, Semver { using TypeCasts for bytes32; /** * @notice Constant indicating this contract uses Hyperlane for proving */ ProofType public constant PROOF_TYPE = ProofType.Hyperlane; /** * @notice Emitted when attempting to prove an already-proven intent * @dev Event instead of error to allow batch processing to continue * @param _intentHash Hash of the already proven intent */ event IntentAlreadyProven(bytes32 _intentHash); /** * @notice Unauthorized call to handle() detected * @param _sender Address that attempted the call */ error UnauthorizedHandle(address _sender); /** * @notice Unauthorized dispatch detected from source chain * @param _sender Address that initiated the invalid dispatch */ error UnauthorizedDispatch(address _sender); /** * @notice Address of local Hyperlane mailbox */ address public immutable MAILBOX; /** * @notice Address of Inbox contract (same across all chains via ERC-2470) */ address public immutable INBOX; /** * @notice Initializes the HyperProver contract * @param _mailbox Address of local Hyperlane mailbox * @param _inbox Address of Inbox contract */ constructor(address _mailbox, address _inbox) { MAILBOX = _mailbox; INBOX = _inbox; } /** * @notice Handles incoming Hyperlane messages containing proof data * @dev Processes batch updates to proven intents from valid sources * param _origin Origin chain ID (unused but required by interface) * @param _sender Address that dispatched the message on source chain * @param _messageBody Encoded array of intent hashes and claimants */ function handle( uint32, bytes32 _sender, bytes calldata _messageBody ) public payable { // Verify message is from authorized mailbox if (MAILBOX != msg.sender) { revert UnauthorizedHandle(msg.sender); } // Verify dispatch originated from valid Inbox address sender = _sender.bytes32ToAddress(); if (INBOX != sender) { revert UnauthorizedDispatch(sender); } // Decode message containing intent hashes and claimants (bytes32[] memory hashes, address[] memory claimants) = abi.decode( _messageBody, (bytes32[], address[]) ); // Process each intent proof for (uint256 i = 0; i < hashes.length; i++) { (bytes32 intentHash, address claimant) = (hashes[i], claimants[i]); if (provenIntents[intentHash] != address(0)) { emit IntentAlreadyProven(intentHash); } else { provenIntents[intentHash] = claimant; emit IntentProven(intentHash, claimant); } } } /** * @notice Returns the proof type used by this prover * @return ProofType indicating Hyperlane proving mechanism */ function getProofType() external pure override returns (ProofType) { return PROOF_TYPE; } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; interface IMessageRecipient { function handle( uint32 _origin, bytes32 _sender, bytes calldata _message ) external payable; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; library TypeCasts { // alignment preserving cast function addressToBytes32(address _addr) internal pure returns (bytes32) { return bytes32(uint256(uint160(_addr))); } // alignment preserving cast function bytes32ToAddress(bytes32 _buf) internal pure returns (address) { return address(uint160(uint256(_buf))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {ISemver} from "./ISemver.sol"; /** * @title IProver * @notice Interface for proving intent fulfillment * @dev Defines required functionality for proving intent execution with different * proof mechanisms (storage or Hyperlane) */ interface IProver is ISemver { /** * @notice Types of proofs that can validate intent fulfillment * @param Storage Traditional storage-based proof mechanism * @param Hyperlane Proof using Hyperlane's cross-chain messaging */ enum ProofType { Storage, Hyperlane, Metalayer } /** * @notice Emitted when an intent is successfully proven * @param _hash Hash of the proven intent * @param _claimant Address eligible to claim the intent's rewards */ event IntentProven(bytes32 indexed _hash, address indexed _claimant); /** * @notice Gets the proof mechanism type used by this prover * @return ProofType enum indicating the prover's mechanism */ function getProofType() external pure returns (ProofType); /** * @notice Gets the address eligible to claim rewards for a proven intent * @param intentHash Hash of the intent to query * @return Address of the claimant, or zero address if unproven */ function getIntentClaimant( bytes32 intentHash ) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; /** * @title Semver Interface * @dev An interface for a contract that has a version */ interface ISemver { function version() external pure returns (string memory); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.26; import {ISemver} from "../interfaces/ISemver.sol"; abstract contract Semver is ISemver { function version() external pure returns (string memory) { return "1.8.14-e2c12e7"; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IProver} from "../interfaces/IProver.sol"; /** * @title BaseProver * @notice Base implementation for intent proving contracts * @dev Provides core storage and functionality for tracking proven intents * and their claimants */ abstract contract BaseProver is IProver { /** * @notice Mapping from intent hash to address eligible to claim rewards * @dev Zero address indicates intent hasn't been proven */ mapping(bytes32 => address) public provenIntents; /** * @notice Gets the address eligible to claim rewards for a given intent * @param intentHash Hash of the intent to query * @return Address of the claimant, or zero address if unproven */ function getIntentClaimant( bytes32 intentHash ) external view override returns (address) { return provenIntents[intentHash]; } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_mailbox","type":"address"},{"internalType":"address","name":"_inbox","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"UnauthorizedDispatch","type":"error"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"UnauthorizedHandle","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_intentHash","type":"bytes32"}],"name":"IntentAlreadyProven","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_hash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"_claimant","type":"address"}],"name":"IntentProven","type":"event"},{"inputs":[],"name":"INBOX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAILBOX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROOF_TYPE","outputs":[{"internalType":"enum IProver.ProofType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"intentHash","type":"bytes32"}],"name":"getIntentClaimant","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProofType","outputs":[{"internalType":"enum IProver.ProofType","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"bytes","name":"_messageBody","type":"bytes"}],"name":"handle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"provenIntents","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
60c034608057601f61063938819003918201601f19168301916001600160401b038311848410176085578084926040948552833981010312608057604b6020604583609b565b9201609b565b9060805260a05260405161058a90816100af823960805181818161012701526101b3015260a05181818160ae01526101f00152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b038216820360805756fe608080604052600436101561001357600080fd5b60003560e01c908163432c7640146104ba5750806354fd4d501461040c57806356d5d475146101565780637dc2b8fb1461011157806399d145b2146100dd5780639bcd850f14610077578063b7010697146100985763bc8c7df21461007757600080fd5b3461009357600036600319011261009357602060405160018152f35b600080fd5b34610093576000366003190112610093576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b34610093576020366003190112610093576004356000526000602052602060018060a01b0360406000205416604051908152f35b34610093576000366003190112610093576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b60603660031901126100935760043563ffffffff8116036100935760443567ffffffffffffffff8111610093573660238201121561009357806004013567ffffffffffffffff8111610093578101602481019036821161009357337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316036103f7576001600160a01b036024358116907f0000000000000000000000000000000000000000000000000000000000000000168190036103e357506040908390031261009357602482013567ffffffffffffffff811161009357820191816043840112156100935760248301359261025c61025785610512565b6104ec565b93602060248187848152019260051b840101019184831161009357604401905b8282106103d35750505060448101359067ffffffffffffffff821161009357019080604383011215610093576024820135906102ba61025783610512565b92602060248186868152019460051b8301010191821161009357604401915b8183106103b35750505060005b82518110156103b157806102fc6001928561052a565b51828060a01b0361030d838661052a565b5116816000526000602052838060a01b03604060002054161515600014610361575060207fc86ca07015d7e87a46a98098d36c9fc68bc3120761e5c7a2023fc6c6869e561191604051908152a15b016102e6565b908060005260006020526040600020826bffffffffffffffffffffffff60a01b8254161790557f2b45193f790d995b36e39c4104dd1b49df6fc851b6f6ae60f2072724735b5b43600080a361035b565b005b82356001600160a01b0381168103610093578152602092830192016102d9565b813581526020918201910161027c565b63c078012160e01b60005260045260246000fd5b63188c4f9b60e01b6000523360045260246000fd5b34610093576000366003190112610093576040516040810181811067ffffffffffffffff8211176104a457604052600e81526d312e382e31342d6532633132653760901b602082015260405190602082528181519182602083015260005b83811061048c5750508160006040809484010152601f80199101168101030190f35b6020828201810151604087840101528593500161046a565b634e487b7160e01b600052604160045260246000fd5b3461009357602036600319011261009357600435600090815260208181526040909120546001600160a01b0316825290f35b6040519190601f01601f1916820167ffffffffffffffff8111838210176104a457604052565b67ffffffffffffffff81116104a45760051b60200190565b805182101561053e5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220dc686fed90b042c2511dd4e8ecd9f535d4546e4a790f737d395d26c0d931363664736f6c634300081a003300000000000000000000000067493506aaeea6bf48c3094c4a6e2a5c427582bd000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c908163432c7640146104ba5750806354fd4d501461040c57806356d5d475146101565780637dc2b8fb1461011157806399d145b2146100dd5780639bcd850f14610077578063b7010697146100985763bc8c7df21461007757600080fd5b3461009357600036600319011261009357602060405160018152f35b600080fd5b34610093576000366003190112610093576040517f000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e6001600160a01b03168152602090f35b34610093576020366003190112610093576004356000526000602052602060018060a01b0360406000205416604051908152f35b34610093576000366003190112610093576040517f00000000000000000000000067493506aaeea6bf48c3094c4a6e2a5c427582bd6001600160a01b03168152602090f35b60603660031901126100935760043563ffffffff8116036100935760443567ffffffffffffffff8111610093573660238201121561009357806004013567ffffffffffffffff8111610093578101602481019036821161009357337f00000000000000000000000067493506aaeea6bf48c3094c4a6e2a5c427582bd6001600160a01b0316036103f7576001600160a01b036024358116907f000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e168190036103e357506040908390031261009357602482013567ffffffffffffffff811161009357820191816043840112156100935760248301359261025c61025785610512565b6104ec565b93602060248187848152019260051b840101019184831161009357604401905b8282106103d35750505060448101359067ffffffffffffffff821161009357019080604383011215610093576024820135906102ba61025783610512565b92602060248186868152019460051b8301010191821161009357604401915b8183106103b35750505060005b82518110156103b157806102fc6001928561052a565b51828060a01b0361030d838661052a565b5116816000526000602052838060a01b03604060002054161515600014610361575060207fc86ca07015d7e87a46a98098d36c9fc68bc3120761e5c7a2023fc6c6869e561191604051908152a15b016102e6565b908060005260006020526040600020826bffffffffffffffffffffffff60a01b8254161790557f2b45193f790d995b36e39c4104dd1b49df6fc851b6f6ae60f2072724735b5b43600080a361035b565b005b82356001600160a01b0381168103610093578152602092830192016102d9565b813581526020918201910161027c565b63c078012160e01b60005260045260246000fd5b63188c4f9b60e01b6000523360045260246000fd5b34610093576000366003190112610093576040516040810181811067ffffffffffffffff8211176104a457604052600e81526d312e382e31342d6532633132653760901b602082015260405190602082528181519182602083015260005b83811061048c5750508160006040809484010152601f80199101168101030190f35b6020828201810151604087840101528593500161046a565b634e487b7160e01b600052604160045260246000fd5b3461009357602036600319011261009357600435600090815260208181526040909120546001600160a01b0316825290f35b6040519190601f01601f1916820167ffffffffffffffff8111838210176104a457604052565b67ffffffffffffffff81116104a45760051b60200190565b805182101561053e5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220dc686fed90b042c2511dd4e8ecd9f535d4546e4a790f737d395d26c0d931363664736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000067493506aaeea6bf48c3094c4a6e2a5c427582bd000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e
-----Decoded View---------------
Arg [0] : _mailbox (address): 0x67493506aAEEa6bf48c3094C4a6E2A5c427582BD
Arg [1] : _inbox (address): 0x578CCAd6a274fDE97c09D439e1E94D4FcE33328e
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000067493506aaeea6bf48c3094c4a6e2a5c427582bd
Arg [1] : 000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.