Contract

0x836664B0c0CB29B7877bCcF94159CC996528F2C3

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...8558912024-12-20 10:37:3323 hrs ago1734691053IN
0x836664B0...96528F2C3
0 S0.000028591

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xb1703AD0...E689C5df9
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
StateOracle

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
File 1 of 4 : StateOracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.27;

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

/// Oracle providing the state hash of a monitored chain.
/// To be owned and updated by UpdateManager contract.
/// @custom:security-contact [email protected]
contract StateOracle is IStateOracle, Ownable {
    bytes32 public lastState;
    uint256 public lastBlockNum;
    uint256 public lastUpdateTime;
    uint256 public immutable chainId; // of the monitored chain

    constructor(address _ownedBy, uint256 _chainId) Ownable(_ownedBy) {
        require(_chainId != 0, "Chain id not set");
        chainId = _chainId;
    }

    /// Update the state. Callable by UpdateManager.
    function update(uint256 blockNum, bytes32 stateRoot) external onlyOwner {
        require(blockNum > lastBlockNum, "Unable to revert to older state");
        lastState = stateRoot;
        lastBlockNum = blockNum;
        lastUpdateTime = block.timestamp;
    }

}

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

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

File 4 of 4 : IStateOracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.27;

/// State oracle provides the hash of a different chain state.
interface IStateOracle {
    function lastState() external view returns (bytes32);
    function lastBlockNum() external view returns (uint256);
    function lastUpdateTime() external view returns (uint256);
    function chainId() external view returns (uint256);

    function update(uint256 blockNum, bytes32 stateRoot) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_ownedBy","type":"address"},{"internalType":"uint256","name":"_chainId","type":"uint256"}],"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"},{"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":"chainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBlockNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastState","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNum","type":"uint256"},{"internalType":"bytes32","name":"stateRoot","type":"bytes32"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80639a8a0592116100585780639a8a0592146100d2578063c8f33c91146100f9578063d3b7576c14610102578063f2fde38b14610115575f5ffd5b80632df802801461008957806336899042146100a5578063715018a6146100ae5780638da5cb5b146100b8575b5f5ffd5b61009260015481565b6040519081526020015b60405180910390f35b61009260025481565b6100b6610128565b005b5f546040516001600160a01b03909116815260200161009c565b6100927f000000000000000000000000000000000000000000000000000000000000000181565b61009260035481565b6100b661011036600461025d565b61013b565b6100b661012336600461027d565b6101a5565b6101306101e2565b6101395f61020e565b565b6101436101e2565b60025482116101995760405162461bcd60e51b815260206004820152601f60248201527f556e61626c6520746f2072657665727420746f206f6c6465722073746174650060448201526064015b60405180910390fd5b60015560025542600355565b6101ad6101e2565b6001600160a01b0381166101d657604051631e4fbdf760e01b81525f6004820152602401610190565b6101df8161020e565b50565b5f546001600160a01b031633146101395760405163118cdaa760e01b8152336004820152602401610190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f6040838503121561026e575f5ffd5b50508035926020909101359150565b5f6020828403121561028d575f5ffd5b81356001600160a01b03811681146102a3575f5ffd5b939250505056fea26469706673582212209bb8f2b2e5eea460d76654c7b9b62df8ca2be98abaa188386a2928a01729a41264736f6c634300081b0033

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.