ETH Price: $2,908.52 (-1.01%)

Contract

0xF278761576f45472bdD721EACA19317cE159c011

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
37179432025-02-21 10:09:49339 days ago1740132589  Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LeafMessageBridge

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.19 <0.9.0;

import {Ownable} from "@openzeppelin5/contracts/access/Ownable.sol";

import {ILeafMessageBridge} from "../interfaces/bridge/ILeafMessageBridge.sol";

/*

██╗   ██╗███████╗██╗      ██████╗ ██████╗ ██████╗  ██████╗ ███╗   ███╗███████╗
██║   ██║██╔════╝██║     ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝
██║   ██║█████╗  ██║     ██║   ██║██║  ██║██████╔╝██║   ██║██╔████╔██║█████╗
╚██╗ ██╔╝██╔══╝  ██║     ██║   ██║██║  ██║██╔══██╗██║   ██║██║╚██╔╝██║██╔══╝
 ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║  ██║╚██████╔╝██║ ╚═╝ ██║███████╗
  ╚═══╝  ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚═╝╚══════╝

███████╗██╗   ██╗██████╗ ███████╗██████╗  ██████╗██╗  ██╗ █████╗ ██╗███╗   ██╗
██╔════╝██║   ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║  ██║██╔══██╗██║████╗  ██║
███████╗██║   ██║██████╔╝█████╗  ██████╔╝██║     ███████║███████║██║██╔██╗ ██║
╚════██║██║   ██║██╔═══╝ ██╔══╝  ██╔══██╗██║     ██╔══██║██╔══██║██║██║╚██╗██║
███████║╚██████╔╝██║     ███████╗██║  ██║╚██████╗██║  ██║██║  ██║██║██║ ╚████║
╚══════╝ ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝

███╗   ███╗███████╗███████╗███████╗ █████╗  ██████╗ ███████╗██████╗ ██████╗ ██╗██████╗  ██████╗ ███████╗
████╗ ████║██╔════╝██╔════╝██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔══██╗██╔══██╗██║██╔══██╗██╔════╝ ██╔════╝
██╔████╔██║█████╗  ███████╗███████╗███████║██║  ███╗█████╗  ██████╔╝██████╔╝██║██║  ██║██║  ███╗█████╗
██║╚██╔╝██║██╔══╝  ╚════██║╚════██║██╔══██║██║   ██║██╔══╝  ██╔══██╗██╔══██╗██║██║  ██║██║   ██║██╔══╝
██║ ╚═╝ ██║███████╗███████║███████║██║  ██║╚██████╔╝███████╗██████╔╝██║  ██║██║██████╔╝╚██████╔╝███████╗
╚═╝     ╚═╝╚══════╝╚══════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═════╝ ╚═╝  ╚═╝╚═╝╚═════╝  ╚═════╝ ╚══════╝

*/

/// @title Velodrome Superchain Leaf Message Bridge
/// @notice General purpose message bridge contract
contract LeafMessageBridge is ILeafMessageBridge, Ownable {
    /// @inheritdoc ILeafMessageBridge
    address public immutable xerc20;
    /// @inheritdoc ILeafMessageBridge
    address public immutable voter;
    /// @inheritdoc ILeafMessageBridge
    address public module;

    constructor(address _owner, address _xerc20, address _voter, address _module) Ownable(_owner) {
        xerc20 = _xerc20;
        voter = _voter;
        module = _module;
        emit ModuleSet({_sender: _owner, _module: _module});
    }

    /// @inheritdoc ILeafMessageBridge
    function setModule(address _module) external onlyOwner {
        if (_module == address(0)) revert ZeroAddress();
        module = _module;
        emit ModuleSet({_sender: msg.sender, _module: _module});
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ILeafMessageBridge {
    error ZeroAddress();

    event ModuleSet(address indexed _sender, address indexed _module);

    /// @notice Returns the address of the xERC20 token that is bridged by this contract
    function xerc20() external view returns (address);

    /// @notice Returns the address of the module contract that is allowed to send messages x-chain
    function module() external view returns (address);

    /// @notice Returns the address of the voter contract
    /// @dev Used to verify the sender of a message
    function voter() external view returns (address);

    /// @notice Sets the address of the module contract that is allowed to send messages x-chain
    /// @dev Module handles x-chain messages
    /// @param _module The address of the new module contract
    function setModule(address _module) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Settings
{
  "remappings": [
    "@openzeppelin5/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/src/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "createX/=lib/createX/src/",
    "@nomad-xyz/=lib/ExcessivelySafeCall/",
    "@hyperlane/=node_modules/@hyperlane-xyz/",
    "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
    "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
    "ExcessivelySafeCall/=lib/ExcessivelySafeCall/src/",
    "openzeppelin/=lib/createX/lib/openzeppelin-contracts/contracts/",
    "solady/=lib/createX/lib/solady/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_xerc20","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_module","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"address","name":"_module","type":"address"}],"name":"ModuleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"module","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"}],"name":"setModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xerc20","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405234801561000f575f5ffd5b5060405161048a38038061048a83398101604081905261002e91610131565b836001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b610065816100c7565b506001600160a01b0383811660805282811660a052600180546001600160a01b03191683831690811790915560405190918616907fd997059694ba0d0bcdcfc585680c3c4d4084594b15cf0fd937037bfb279f523b905f90a350505050610182565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461012c575f5ffd5b919050565b5f5f5f5f60808587031215610144575f5ffd5b61014d85610116565b935061015b60208601610116565b925061016960408601610116565b915061017760608601610116565b905092959194509250565b60805160a0516102e86101a25f395f608301525f61011901526102e85ff3fe608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80638da5cb5b116100585780638da5cb5b146100de578063b86d5298146100ee578063f2fde38b14610101578063ffcbd8d014610114575f5ffd5b806346c96aac1461007e57806347f543bc146100c1578063715018a6146100d6575b5f5ffd5b6100a57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100d46100cf366004610285565b61013b565b005b6100d46101b5565b5f546001600160a01b03166100a5565b6001546100a5906001600160a01b031681565b6100d461010f366004610285565b6101c8565b6100a57f000000000000000000000000000000000000000000000000000000000000000081565b61014361020a565b6001600160a01b03811661016a5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fd997059694ba0d0bcdcfc585680c3c4d4084594b15cf0fd937037bfb279f523b905f90a350565b6101bd61020a565b6101c65f610236565b565b6101d061020a565b6001600160a01b0381166101fe57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61020781610236565b50565b5f546001600160a01b031633146101c65760405163118cdaa760e01b81523360048201526024016101f5565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610295575f5ffd5b81356001600160a01b03811681146102ab575f5ffd5b939250505056fea26469706673582212201ac532dda1213034ff322a4a2b44a143d16671cc5a8ee7f20a3b5a897bdce85e64736f6c634300081b0033000000000000000000000000e915aef46e1bd9b9ed2d9fe571ae9b5afbde571b0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8100000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a1123000000000000000000000000f385603a12be8b7b885222329c581fdd1c30071d

Deployed Bytecode

0x608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80638da5cb5b116100585780638da5cb5b146100de578063b86d5298146100ee578063f2fde38b14610101578063ffcbd8d014610114575f5ffd5b806346c96aac1461007e57806347f543bc146100c1578063715018a6146100d6575b5f5ffd5b6100a57f00000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a112381565b6040516001600160a01b03909116815260200160405180910390f35b6100d46100cf366004610285565b61013b565b005b6100d46101b5565b5f546001600160a01b03166100a5565b6001546100a5906001600160a01b031681565b6100d461010f366004610285565b6101c8565b6100a57f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8181565b61014361020a565b6001600160a01b03811661016a5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fd997059694ba0d0bcdcfc585680c3c4d4084594b15cf0fd937037bfb279f523b905f90a350565b6101bd61020a565b6101c65f610236565b565b6101d061020a565b6001600160a01b0381166101fe57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61020781610236565b50565b5f546001600160a01b031633146101c65760405163118cdaa760e01b81523360048201526024016101f5565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610295575f5ffd5b81356001600160a01b03811681146102ab575f5ffd5b939250505056fea26469706673582212201ac532dda1213034ff322a4a2b44a143d16671cc5a8ee7f20a3b5a897bdce85e64736f6c634300081b0033

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

000000000000000000000000e915aef46e1bd9b9ed2d9fe571ae9b5afbde571b0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8100000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a1123000000000000000000000000f385603a12be8b7b885222329c581fdd1c30071d

-----Decoded View---------------
Arg [0] : _owner (address): 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b
Arg [1] : _xerc20 (address): 0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81
Arg [2] : _voter (address): 0x97cDBCe21B6fd0585d29E539B1B99dAd328a1123
Arg [3] : _module (address): 0xF385603a12Be8b7B885222329c581FDD1C30071D

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000e915aef46e1bd9b9ed2d9fe571ae9b5afbde571b
Arg [1] : 0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a81
Arg [2] : 00000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a1123
Arg [3] : 000000000000000000000000f385603a12be8b7b885222329c581fdd1c30071d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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