Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 121344 | 15 days ago | IN | 0 S | 0.00002859 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StateOracle
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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; } }
// 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 // 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; } }
// 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; }
{ "evmVersion": "cancun", "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
60a060405234801561000f575f5ffd5b5060405161042f38038061042f83398101604081905261002e91610101565b816001600160a01b03811661005d57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b610066816100b2565b50805f036100a95760405162461bcd60e51b815260206004820152601060248201526f10da185a5b881a59081b9bdd081cd95d60821b6044820152606401610054565b60805250610138565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f60408385031215610112575f5ffd5b82516001600160a01b0381168114610128575f5ffd5b6020939093015192949293505050565b6080516102e061014f5f395f60d701526102e05ff3fe608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80639a8a0592116100585780639a8a0592146100d2578063c8f33c91146100f9578063d3b7576c14610102578063f2fde38b14610115575f5ffd5b80632df802801461008957806336899042146100a5578063715018a6146100ae5780638da5cb5b146100b8575b5f5ffd5b61009260015481565b6040519081526020015b60405180910390f35b61009260025481565b6100b6610128565b005b5f546040516001600160a01b03909116815260200161009c565b6100927f000000000000000000000000000000000000000000000000000000000000000081565b61009260035481565b6100b661011036600461025d565b61013b565b6100b661012336600461027d565b6101a5565b6101306101e2565b6101395f61020e565b565b6101436101e2565b60025482116101995760405162461bcd60e51b815260206004820152601f60248201527f556e61626c6520746f2072657665727420746f206f6c6465722073746174650060448201526064015b60405180910390fd5b60015560025542600355565b6101ad6101e2565b6001600160a01b0381166101d657604051631e4fbdf760e01b81525f6004820152602401610190565b6101df8161020e565b50565b5f546001600160a01b031633146101395760405163118cdaa760e01b8152336004820152602401610190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f6040838503121561026e575f5ffd5b50508035926020909101359150565b5f6020828403121561028d575f5ffd5b81356001600160a01b03811681146102a3575f5ffd5b939250505056fea26469706673582212209bb8f2b2e5eea460d76654c7b9b62df8ca2be98abaa188386a2928a01729a41264736f6c634300081b003300000000000000000000000080957d62c7cc252e5dd2f8691a9afb3087f88fa10000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80639a8a0592116100585780639a8a0592146100d2578063c8f33c91146100f9578063d3b7576c14610102578063f2fde38b14610115575f5ffd5b80632df802801461008957806336899042146100a5578063715018a6146100ae5780638da5cb5b146100b8575b5f5ffd5b61009260015481565b6040519081526020015b60405180910390f35b61009260025481565b6100b6610128565b005b5f546040516001600160a01b03909116815260200161009c565b6100927f000000000000000000000000000000000000000000000000000000000000000181565b61009260035481565b6100b661011036600461025d565b61013b565b6100b661012336600461027d565b6101a5565b6101306101e2565b6101395f61020e565b565b6101436101e2565b60025482116101995760405162461bcd60e51b815260206004820152601f60248201527f556e61626c6520746f2072657665727420746f206f6c6465722073746174650060448201526064015b60405180910390fd5b60015560025542600355565b6101ad6101e2565b6001600160a01b0381166101d657604051631e4fbdf760e01b81525f6004820152602401610190565b6101df8161020e565b50565b5f546001600160a01b031633146101395760405163118cdaa760e01b8152336004820152602401610190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f6040838503121561026e575f5ffd5b50508035926020909101359150565b5f6020828403121561028d575f5ffd5b81356001600160a01b03811681146102a3575f5ffd5b939250505056fea26469706673582212209bb8f2b2e5eea460d76654c7b9b62df8ca2be98abaa188386a2928a01729a41264736f6c634300081b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000080957d62c7cc252e5dd2f8691a9afb3087f88fa10000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _ownedBy (address): 0x80957D62C7Cc252E5dd2f8691a9afB3087f88Fa1
Arg [1] : _chainId (uint256): 1
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000080957d62c7cc252e5dd2f8691a9afb3087f88fa1
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.