Base Sepolia Testnet

Contract

0xC4d6985b9b333F333F78e4Cae5563BB009595A6C

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
236804632025-03-28 2:33:3426 days ago1743129214  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MetalayerProver

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)

File 1 of 7 : MetalayerProver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import "@hyperlane-xyz/core/contracts/libs/TypeCasts.sol";
import "../interfaces/IMetalayerRecipient.sol";

import {BaseProver} from "./BaseProver.sol";
import {Semver} from "../libs/Semver.sol";

/**
 * @title MetalayerProver
 * @author Constellation Labs
 * @notice A simple prover implementation for Eco's routing of Metalayer-settled intents.
 * @dev This implementation is designed to be used as a prover for Eco Protocol intents that are routed through Metalayer,
 * and is not designed to be used as a general-purpose prover for Metalayer intents out of the context of Eco Protocol.
 */
contract MetalayerProver is IMetalayerRecipient, BaseProver, Semver {
    using TypeCasts for bytes32;

    ProofType public constant PROOF_TYPE = ProofType.Metalayer;

    /**
     * @notice emitted on an attempt to register a claimant on an intent that has already been proven and has a claimant
     * @dev this is an event rather than an error because the expected behavior is to ignore one intent but continue with the rest
     * @param _intentHash the hash of the intent
     */
    event IntentAlreadyProven(bytes32 _intentHash);

    /**
     * @notice emitted on an unauthorized call to the handle() method
     * @param _sender the address that called the handle() method
     */
    error UnauthorizedHandle(address _sender);

    /**
     * @notice emitted when the handle() call is a result of an unauthorized dispatch() call on another chain's Router
     * @param _sender the address that called the dispatch() method
     */
    error UnauthorizedDispatch(address _sender);

    /// @notice the address of the local MetalayerRouter
    address public immutable ROUTER;

    /// @notice the address of the Inbox contract
    address public immutable INBOX;

    /**
     * @notice Initializes the addresses of the local MetalayerRouter and Eco's Inbox contract
     * @param _router the address of the local MetalayerRouter
     * @param _inbox the address of the Inbox contract
     */
    constructor(address _router, address _inbox) {
        ROUTER = _router;
        INBOX = _inbox;
    }

    /**
     * @notice Handles intents from the MetalayerRouter
     * @param -_chainId the chain ID of the intent's origin chain (not used)
     * @param _sender the address that called the dispatch() method
     * @param _message the write call data (message body)
     * @param -_reads array of read operations performed (not used)
     * @param -_readResults results of the read operations (not used)
     * @dev This function is designed to be called by the MetalayerRouter on the local chain.
     */
    function handle(
        uint32,
        address _sender,
        bytes calldata _message,
        ReadOperation[] calldata,
        bytes[] calldata
    ) external payable {
        if (ROUTER != msg.sender) {
            revert UnauthorizedHandle(msg.sender);
        }

        if (INBOX != _sender) {
            revert UnauthorizedDispatch(_sender);
        }

        (bytes32[] memory hashes, address[] memory claimants) = abi.decode(
            _message,
            (bytes32[], address[])
        );

        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 the proof type
     */
    function getProofType() external pure override returns (ProofType) {
        return PROOF_TYPE;
    }
}

File 2 of 7 : TypeCasts.sol
// 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)));
    }
}

File 3 of 7 : IMetalayerRecipient.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;

/**
 * @notice Struct defining a cross-chain read operation
 * @param sourceChainId Domain of the chain to read from
 * @param sourceContract Contract address to read from as address
 * @param callDataLength Length of the call data
 * @param callData The encoded function call data
 */
struct ReadOperation {
    uint32 sourceChainId;
    address sourceContract;
    bytes callData;
}

interface IMetalayerRecipient {
    // Here, _readResults will be the results of every read in the message, in order. This will be input by the relayer.
    function handle(
        uint32 _chainId,
        address _sender,
        bytes calldata _message, // The body of the Metalayer message, or writeCallData.
        ReadOperation[] calldata _reads,
        bytes[] calldata _readResults
    ) external payable;
}

File 4 of 7 : IProver.sol
// 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);
}

File 5 of 7 : ISemver.sol
// 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);
}

File 6 of 7 : Semver.sol
// 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";
    }
}

File 7 of 7 : BaseProver.sol
// 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];
    }
}

Settings
{
  "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":"_router","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":"PROOF_TYPE","outputs":[{"internalType":"enum IProver.ProofType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUTER","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"address","name":"_sender","type":"address"},{"internalType":"bytes","name":"_message","type":"bytes"},{"components":[{"internalType":"uint32","name":"sourceChainId","type":"uint32"},{"internalType":"address","name":"sourceContract","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct ReadOperation[]","name":"","type":"tuple[]"},{"internalType":"bytes[]","name":"","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"}]

60c034608057601f61068938819003918201601f19168301916001600160401b038311848410176085578084926040948552833981010312608057604b6020604583609b565b9201609b565b9060805260a0526040516105da90816100af823960805181818161019401526104dc015260a05181818160ae01526101c30152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b038216820360805756fe608080604052600436101561001357600080fd5b60003560e01c90816332fe7b26146104c957508063432c7640146103e757806354fd4d501461041b57806399d145b2146103e75780639bcd850f14610077578063a7d9027f146100dd578063b7010697146100985763bc8c7df21461007757600080fd5b3461009357600036600319011261009357602060405160028152f35b600080fd5b34610093576000366003190112610093576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b60a03660031901126100935760043563ffffffff811603610093576024356001600160a01b03811690819003610093576044359067ffffffffffffffff8211610093573660238301121561009357816004013567ffffffffffffffff811161009357820160248101913683116100935760643567ffffffffffffffff81116100935761016d90369060040161050b565b505060843567ffffffffffffffff81116100935761018f90369060040161050b565b5050337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316036103d2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168190036103be57506040908390031261009357602482013567ffffffffffffffff811161009357820191816043840112156100935760248301359261023761023285610562565b61053c565b93602060248187848152019260051b840101019184831161009357604401905b8282106103ae5750505060448101359067ffffffffffffffff8211610093570190806043830112156100935760248201359061029561023283610562565b92602060248186868152019460051b8301010191821161009357604401915b81831061038e5750505060005b825181101561038c57806102d76001928561057a565b51828060a01b036102e8838661057a565b5116816000526000602052838060a01b0360406000205416151560001461033c575060207fc86ca07015d7e87a46a98098d36c9fc68bc3120761e5c7a2023fc6c6869e561191604051908152a15b016102c1565b908060005260006020526040600020826bffffffffffffffffffffffff60a01b8254161790557f2b45193f790d995b36e39c4104dd1b49df6fc851b6f6ae60f2072724735b5b43600080a3610336565b005b82356001600160a01b0381168103610093578152602092830192016102b4565b8135815260209182019101610257565b63c078012160e01b60005260045260246000fd5b63188c4f9b60e01b6000523360045260246000fd5b34610093576020366003190112610093576004356000526000602052602060018060a01b0360406000205416604051908152f35b34610093576000366003190112610093576040516040810181811067ffffffffffffffff8211176104b357604052600e81526d312e382e31342d6532633132653760901b602082015260405190602082528181519182602083015260005b83811061049b5750508160006040809484010152601f80199101168101030190f35b60208282018101516040878401015285935001610479565b634e487b7160e01b600052604160045260246000fd5b34610093576000366003190112610093577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9181601f840112156100935782359167ffffffffffffffff8311610093576020808501948460051b01011161009357565b6040519190601f01601f1916820167ffffffffffffffff8111838210176104b357604052565b67ffffffffffffffff81116104b35760051b60200190565b805182101561058e5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220225088ee0ecc8f77c13034403bb755fc1ac82e6797c9de3d0c009c4b2b23a92a64736f6c634300081a0033000000000000000000000000c41de2a4243e4304813c36cd8952366dcb36106a000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e

Deployed Bytecode

0x608080604052600436101561001357600080fd5b60003560e01c90816332fe7b26146104c957508063432c7640146103e757806354fd4d501461041b57806399d145b2146103e75780639bcd850f14610077578063a7d9027f146100dd578063b7010697146100985763bc8c7df21461007757600080fd5b3461009357600036600319011261009357602060405160028152f35b600080fd5b34610093576000366003190112610093576040517f000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e6001600160a01b03168152602090f35b60a03660031901126100935760043563ffffffff811603610093576024356001600160a01b03811690819003610093576044359067ffffffffffffffff8211610093573660238301121561009357816004013567ffffffffffffffff811161009357820160248101913683116100935760643567ffffffffffffffff81116100935761016d90369060040161050b565b505060843567ffffffffffffffff81116100935761018f90369060040161050b565b5050337f000000000000000000000000c41de2a4243e4304813c36cd8952366dcb36106a6001600160a01b0316036103d2577f000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e6001600160a01b03168190036103be57506040908390031261009357602482013567ffffffffffffffff811161009357820191816043840112156100935760248301359261023761023285610562565b61053c565b93602060248187848152019260051b840101019184831161009357604401905b8282106103ae5750505060448101359067ffffffffffffffff8211610093570190806043830112156100935760248201359061029561023283610562565b92602060248186868152019460051b8301010191821161009357604401915b81831061038e5750505060005b825181101561038c57806102d76001928561057a565b51828060a01b036102e8838661057a565b5116816000526000602052838060a01b0360406000205416151560001461033c575060207fc86ca07015d7e87a46a98098d36c9fc68bc3120761e5c7a2023fc6c6869e561191604051908152a15b016102c1565b908060005260006020526040600020826bffffffffffffffffffffffff60a01b8254161790557f2b45193f790d995b36e39c4104dd1b49df6fc851b6f6ae60f2072724735b5b43600080a3610336565b005b82356001600160a01b0381168103610093578152602092830192016102b4565b8135815260209182019101610257565b63c078012160e01b60005260045260246000fd5b63188c4f9b60e01b6000523360045260246000fd5b34610093576020366003190112610093576004356000526000602052602060018060a01b0360406000205416604051908152f35b34610093576000366003190112610093576040516040810181811067ffffffffffffffff8211176104b357604052600e81526d312e382e31342d6532633132653760901b602082015260405190602082528181519182602083015260005b83811061049b5750508160006040809484010152601f80199101168101030190f35b60208282018101516040878401015285935001610479565b634e487b7160e01b600052604160045260246000fd5b34610093576000366003190112610093577f000000000000000000000000c41de2a4243e4304813c36cd8952366dcb36106a6001600160a01b03168152602090f35b9181601f840112156100935782359167ffffffffffffffff8311610093576020808501948460051b01011161009357565b6040519190601f01601f1916820167ffffffffffffffff8111838210176104b357604052565b67ffffffffffffffff81116104b35760051b60200190565b805182101561058e5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220225088ee0ecc8f77c13034403bb755fc1ac82e6797c9de3d0c009c4b2b23a92a64736f6c634300081a0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c41de2a4243e4304813c36cd8952366dcb36106a000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e

-----Decoded View---------------
Arg [0] : _router (address): 0xC41de2A4243e4304813c36Cd8952366DCb36106a
Arg [1] : _inbox (address): 0x578CCAd6a274fDE97c09D439e1E94D4FcE33328e

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c41de2a4243e4304813c36cd8952366dcb36106a
Arg [1] : 000000000000000000000000578ccad6a274fde97c09d439e1e94d4fce33328e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.