Contract

0x4Ee9dEBB3046139661b51E17bdfD54Fd63211de7

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Interchain S...6061322024-12-18 19:01:403 days ago1734548500IN
0x4Ee9dEBB...d63211de7
0 S0.000028921
Set Interchain S...4862212024-12-16 16:43:505 days ago1734367430IN
0x4Ee9dEBB...d63211de7
0 S0.000028921
Set Interchain S...4833732024-12-16 14:55:385 days ago1734360938IN
0x4Ee9dEBB...d63211de7
0 S0.000046021

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TestRecipient

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license
File 1 of 5 : TestRecipient.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;

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

import {IMessageRecipient} from "../interfaces/IMessageRecipient.sol";
import {IInterchainSecurityModule, ISpecifiesInterchainSecurityModule} from "../interfaces/IInterchainSecurityModule.sol";

contract TestRecipient is
    Ownable,
    IMessageRecipient,
    ISpecifiesInterchainSecurityModule
{
    IInterchainSecurityModule public interchainSecurityModule;
    bytes32 public lastSender;
    bytes public lastData;

    address public lastCaller;
    string public lastCallMessage;

    event ReceivedMessage(
        uint32 indexed origin,
        bytes32 indexed sender,
        uint256 indexed value,
        string message
    );

    event ReceivedCall(address indexed caller, uint256 amount, string message);

    function handle(
        uint32 _origin,
        bytes32 _sender,
        bytes calldata _data
    ) external payable virtual override {
        emit ReceivedMessage(_origin, _sender, msg.value, string(_data));
        lastSender = _sender;
        lastData = _data;
    }

    function fooBar(uint256 amount, string calldata message) external {
        emit ReceivedCall(msg.sender, amount, message);
        lastCaller = msg.sender;
        lastCallMessage = message;
    }

    function setInterchainSecurityModule(address _ism) external onlyOwner {
        interchainSecurityModule = IInterchainSecurityModule(_ism);
    }

    receive() external payable {}
}

File 2 of 5 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

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

File 4 of 5 : IInterchainSecurityModule.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;

interface IInterchainSecurityModule {
    enum Types {
        UNUSED,
        ROUTING,
        AGGREGATION,
        LEGACY_MULTISIG,
        MERKLE_ROOT_MULTISIG,
        MESSAGE_ID_MULTISIG,
        NULL, // used with relayer carrying no metadata
        CCIP_READ,
        ARB_L2_TO_L1,
        WEIGHTED_MERKLE_ROOT_MULTISIG,
        WEIGHTED_MESSAGE_ID_MULTISIG,
        OP_L2_TO_L1
    }

    /**
     * @notice Returns an enum that represents the type of security model
     * encoded by this ISM.
     * @dev Relayers infer how to fetch and format metadata.
     */
    function moduleType() external view returns (uint8);

    /**
     * @notice Defines a security model responsible for verifying interchain
     * messages based on the provided metadata.
     * @param _metadata Off-chain metadata provided by a relayer, specific to
     * the security model encoded by the module (e.g. validator signatures)
     * @param _message Hyperlane encoded interchain message
     * @return True if the message was verified
     */
    function verify(
        bytes calldata _metadata,
        bytes calldata _message
    ) external returns (bool);
}

interface ISpecifiesInterchainSecurityModule {
    function interchainSecurityModule()
        external
        view
        returns (IInterchainSecurityModule);
}

File 5 of 5 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"ReceivedCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"origin","type":"uint32"},{"indexed":true,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"ReceivedMessage","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"message","type":"string"}],"name":"fooBar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_origin","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"handle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"interchainSecurityModule","outputs":[{"internalType":"contract IInterchainSecurityModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastCallMessage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSender","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"_ism","type":"address"}],"name":"setInterchainSecurityModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610a548061007e6000396000f3fe6080604052600436106100bf5760003560e01c8063715018a611610074578063de523cf31161004e578063de523cf3146101f6578063f07c1f4714610223578063f2fde38b1461024357600080fd5b8063715018a6146101a15780638da5cb5b146101b6578063a4982fde146101e157600080fd5b80632113522a116100a55780632113522a14610118578063256fec881461016a57806356d5d4751461018e57600080fd5b80626e75ec146100cb5780630e72cc06146100f657600080fd5b366100c657005b600080fd5b3480156100d757600080fd5b506100e0610263565b6040516100ed9190610661565b60405180910390f35b34801561010257600080fd5b5061011661011136600461067b565b6102f1565b005b34801561012457600080fd5b506004546101459073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ed565b34801561017657600080fd5b5061018060025481565b6040519081526020016100ed565b61011661019c3660046106fa565b610340565b3480156101ad57600080fd5b5061011661039b565b3480156101c257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610145565b3480156101ed57600080fd5b506100e06103af565b34801561020257600080fd5b506001546101459073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022f57600080fd5b5061011661023e36600461075f565b6103bc565b34801561024f57600080fd5b5061011661025e36600461067b565b61044b565b60038054610270906107ab565b80601f016020809104026020016040519081016040528092919081815260200182805461029c906107ab565b80156102e95780601f106102be576101008083540402835291602001916102e9565b820191906000526020600020905b8154815290600101906020018083116102cc57829003601f168201915b505050505081565b6102f9610507565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b34838563ffffffff167fecdc36fa3681f5d9c559dcbc399417db6f0ac0d81a78529685a1150265971d55858560405161037a929190610847565b60405180910390a4600283905560036103948284836108e1565b5050505050565b6103a3610507565b6103ad6000610588565b565b60058054610270906107ab565b3373ffffffffffffffffffffffffffffffffffffffff167f97d8367a1f39eb9e97f262fafbb05925c0bcfe120aaad7b9737cae34f749c206848484604051610406939291906109fb565b60405180910390a2600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905560056104458284836108e1565b50505050565b610453610507565b73ffffffffffffffffffffffffffffffffffffffff81166104fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61050481610588565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000815180845260005b8181101561062357602081850181015186830182015201610607565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061067460208301846105fd565b9392505050565b60006020828403121561068d57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461067457600080fd5b60008083601f8401126106c357600080fd5b50813567ffffffffffffffff8111156106db57600080fd5b6020830191508360208285010111156106f357600080fd5b9250929050565b6000806000806060858703121561071057600080fd5b843563ffffffff8116811461072457600080fd5b935060208501359250604085013567ffffffffffffffff81111561074757600080fd5b610753878288016106b1565b95989497509550505050565b60008060006040848603121561077457600080fd5b83359250602084013567ffffffffffffffff81111561079257600080fd5b61079e868287016106b1565b9497909650939450505050565b600181811c908216806107bf57607f821691505b6020821081036107f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152600061085b6020830184866107fe565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f8211156108dc57600081815260208120601f850160051c810160208610156108b95750805b601f850160051c820191505b818110156108d8578281556001016108c5565b5050505b505050565b67ffffffffffffffff8311156108f9576108f9610863565b61090d8361090783546107ab565b83610892565b6000601f84116001811461095f57600085156109295750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610394565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156109ae578685013582556020948501946001909201910161098e565b50868210156109e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b838152604060208201526000610a156040830184866107fe565b9594505050505056fea264697066735822122064475286facb8e580365693fe954a66bf5c481b65cc442eb3f3ff5edc2668f8f64736f6c63430008130033

Deployed Bytecode

0x6080604052600436106100bf5760003560e01c8063715018a611610074578063de523cf31161004e578063de523cf3146101f6578063f07c1f4714610223578063f2fde38b1461024357600080fd5b8063715018a6146101a15780638da5cb5b146101b6578063a4982fde146101e157600080fd5b80632113522a116100a55780632113522a14610118578063256fec881461016a57806356d5d4751461018e57600080fd5b80626e75ec146100cb5780630e72cc06146100f657600080fd5b366100c657005b600080fd5b3480156100d757600080fd5b506100e0610263565b6040516100ed9190610661565b60405180910390f35b34801561010257600080fd5b5061011661011136600461067b565b6102f1565b005b34801561012457600080fd5b506004546101459073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ed565b34801561017657600080fd5b5061018060025481565b6040519081526020016100ed565b61011661019c3660046106fa565b610340565b3480156101ad57600080fd5b5061011661039b565b3480156101c257600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610145565b3480156101ed57600080fd5b506100e06103af565b34801561020257600080fd5b506001546101459073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022f57600080fd5b5061011661023e36600461075f565b6103bc565b34801561024f57600080fd5b5061011661025e36600461067b565b61044b565b60038054610270906107ab565b80601f016020809104026020016040519081016040528092919081815260200182805461029c906107ab565b80156102e95780601f106102be576101008083540402835291602001916102e9565b820191906000526020600020905b8154815290600101906020018083116102cc57829003601f168201915b505050505081565b6102f9610507565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b34838563ffffffff167fecdc36fa3681f5d9c559dcbc399417db6f0ac0d81a78529685a1150265971d55858560405161037a929190610847565b60405180910390a4600283905560036103948284836108e1565b5050505050565b6103a3610507565b6103ad6000610588565b565b60058054610270906107ab565b3373ffffffffffffffffffffffffffffffffffffffff167f97d8367a1f39eb9e97f262fafbb05925c0bcfe120aaad7b9737cae34f749c206848484604051610406939291906109fb565b60405180910390a2600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905560056104458284836108e1565b50505050565b610453610507565b73ffffffffffffffffffffffffffffffffffffffff81166104fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61050481610588565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f2565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000815180845260005b8181101561062357602081850181015186830182015201610607565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061067460208301846105fd565b9392505050565b60006020828403121561068d57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461067457600080fd5b60008083601f8401126106c357600080fd5b50813567ffffffffffffffff8111156106db57600080fd5b6020830191508360208285010111156106f357600080fd5b9250929050565b6000806000806060858703121561071057600080fd5b843563ffffffff8116811461072457600080fd5b935060208501359250604085013567ffffffffffffffff81111561074757600080fd5b610753878288016106b1565b95989497509550505050565b60008060006040848603121561077457600080fd5b83359250602084013567ffffffffffffffff81111561079257600080fd5b61079e868287016106b1565b9497909650939450505050565b600181811c908216806107bf57607f821691505b6020821081036107f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152600061085b6020830184866107fe565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f8211156108dc57600081815260208120601f850160051c810160208610156108b95750805b601f850160051c820191505b818110156108d8578281556001016108c5565b5050505b505050565b67ffffffffffffffff8311156108f9576108f9610863565b61090d8361090783546107ab565b83610892565b6000601f84116001811461095f57600085156109295750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355610394565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156109ae578685013582556020948501946001909201910161098e565b50868210156109e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b838152604060208201526000610a156040830184866107fe565b9594505050505056fea264697066735822122064475286facb8e580365693fe954a66bf5c481b65cc442eb3f3ff5edc2668f8f64736f6c63430008130033

Block Transaction 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
[ 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.