Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x04C04a6d...7C6F00A23 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
OptimisticBlockUpdater
Compiler Version
v0.8.14+commit.80d49f37
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2023-11-14 */ // Sources flattened with hardhat v2.19.0 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/[email protected] // Original license: 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; } } // File @openzeppelin/contracts/access/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @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 contracts/interface/IMixtureBlockUpdater.sol // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.0; interface IMixtureBlockUpdater { event ImportBlock(uint256 identifier, bytes32 blockHash, bytes32 receiptHash); function importBlock(uint256 blockNumber,bytes32 _blockHash,bytes32 _receiptsRoot,uint256 blockConfirmation) external; function checkBlock(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool); function checkBlockConfirmation(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool, uint256); } // File contracts/block/optimistic/OptimisticBlockUpdater.sol // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.14; contract OptimisticBlockUpdater is IMixtureBlockUpdater, Ownable { address public blockRouter; IMixtureBlockUpdater public oldBlockUpdater; // blockHash=>receiptsRoot =>BlockConfirmation mapping(bytes32 => mapping(bytes32 => uint256)) public blockInfos; modifier onlyBlockRouter() { require(msg.sender == blockRouter, "caller is not the block router"); _; } constructor(address _blockRouter) { blockRouter = _blockRouter; } function importBlock(uint256 blockNumber, bytes32 _blockHash, bytes32 _receiptsRoot, uint256 _blockConfirmation) external onlyBlockRouter { (bool exist,uint256 blockConfirmation) = _checkBlock(_blockHash, _receiptsRoot); require(_blockConfirmation > 0, "invalid blockConfirmation"); if (exist && _blockConfirmation <= blockConfirmation) { return; } blockInfos[_blockHash][_receiptsRoot] = _blockConfirmation; emit ImportBlock(blockNumber, _blockHash, _receiptsRoot); } function checkBlock(bytes32 _blockHash, bytes32 _receiptHash) external view returns (bool) { (bool exist,) = _checkBlock(_blockHash, _receiptHash); return exist; } function checkBlockConfirmation(bytes32 _blockHash, bytes32 _receiptHash) external view returns (bool, uint256) { return _checkBlock(_blockHash, _receiptHash); } function _checkBlock(bytes32 _blockHash, bytes32 _receiptHash) internal view returns (bool, uint256) { uint256 blockConfirmation = blockInfos[_blockHash][_receiptHash]; if (blockConfirmation > 0) { return (true, blockConfirmation); } if (address(oldBlockUpdater) != address(0)) { return oldBlockUpdater.checkBlockConfirmation(_blockHash, _receiptHash); } return (false, 0); } //---------------------------------------------------------------------------------- // onlyOwner function setBlockRouter(address _blockRouter) external onlyOwner { require(_blockRouter != address(0), "Zero address"); blockRouter = _blockRouter; } function setOldBlockUpdater(address _oldBlockUpdater) external onlyOwner { oldBlockUpdater = IMixtureBlockUpdater(_oldBlockUpdater); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_blockRouter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"identifier","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"receiptHash","type":"bytes32"}],"name":"ImportBlock","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":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"blockInfos","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"}],"name":"checkBlock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"}],"name":"checkBlockConfirmation","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptsRoot","type":"bytes32"},{"internalType":"uint256","name":"_blockConfirmation","type":"uint256"}],"name":"importBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oldBlockUpdater","outputs":[{"internalType":"contract IMixtureBlockUpdater","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":"_blockRouter","type":"address"}],"name":"setBlockRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oldBlockUpdater","type":"address"}],"name":"setOldBlockUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638da5cb5b116100715780638da5cb5b1461015e578063a4f2b42f1461016f578063be67876514610182578063cfd78d2314610195578063dc3588ea146101a8578063f2fde38b146101cb57600080fd5b806302952ab6146100ae5780631bf4864e146100ec578063254252af146101015780635ea4ed381461012b578063715018a614610156575b600080fd5b6100d96100bc3660046105e2565b600360209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b6100ff6100fa366004610604565b6101de565b005b61011461010f3660046105e2565b610208565b6040805192151583526020830191909152016100e3565b60015461013e906001600160a01b031681565b6040516001600160a01b0390911681526020016100e3565b6100ff610221565b6000546001600160a01b031661013e565b60025461013e906001600160a01b031681565b6100ff610190366004610634565b610235565b6100ff6101a3366004610604565b610372565b6101bb6101b63660046105e2565b6103e1565b60405190151581526020016100e3565b6100ff6101d9366004610604565b6103f7565b6101e6610470565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008061021584846104ca565b915091505b9250929050565b610229610470565b6102336000610592565b565b6001546001600160a01b031633146102945760405162461bcd60e51b815260206004820152601e60248201527f63616c6c6572206973206e6f742074686520626c6f636b20726f75746572000060448201526064015b60405180910390fd5b6000806102a185856104ca565b91509150600083116102f55760405162461bcd60e51b815260206004820152601960248201527f696e76616c696420626c6f636b436f6e6669726d6174696f6e00000000000000604482015260640161028b565b8180156103025750808311155b1561030e57505061036c565b600085815260036020908152604080832087845282529182902085905581518881529081018790529081018590527fa3fa2e60f4d1c7f6bd60da77a4be0625773dfb6b22c54fe77e725d03e49cdf2e9060600160405180910390a150505b50505050565b61037a610470565b6001600160a01b0381166103bf5760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b604482015260640161028b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000806103ee84846104ca565b50949350505050565b6103ff610470565b6001600160a01b0381166104645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161028b565b61046d81610592565b50565b6000546001600160a01b031633146102335760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161028b565b6000828152600360209081526040808320848452909152812054819080156104f75760019250905061021a565b6002546001600160a01b0316156105855760025460405163254252af60e01b815260048101879052602481018690526001600160a01b039091169063254252af906044016040805180830381865afa158015610557573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057b9190610666565b925092505061021a565b5060009485945092505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156105f557600080fd5b50508035926020909101359150565b60006020828403121561061657600080fd5b81356001600160a01b038116811461062d57600080fd5b9392505050565b6000806000806080858703121561064a57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561067957600080fd5b8251801515811461068957600080fd5b602093909301519294929350505056fea26469706673582212202ca1a30d2f5a282848446db2a6818cd893246b56c50306fc20a3fb47d5429bb264736f6c634300080e0033
Deployed Bytecode Sourcemap
4548:2344:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4761:65;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;413:25:1;;;401:2;386:18;4761:65:0;;;;;;;;6739:148;;;;;;:::i;:::-;;:::i;:::-;;5800:175;;;;;;:::i;:::-;;:::i;:::-;;;;933:14:1;;926:22;908:41;;980:2;965:18;;958:34;;;;881:18;5800:175:0;740:258:1;4622:26:0;;;;;-1:-1:-1;;;;;4622:26:0;;;;;;-1:-1:-1;;;;;1167:32:1;;;1149:51;;1137:2;1122:18;4622:26:0;1003:203:1;2979:103:0;;;:::i;2338:87::-;2384:7;2411:6;-1:-1:-1;;;;;2411:6:0;2338:87;;4657:43;;;;;-1:-1:-1;;;;;4657:43:0;;;5056:540;;;;;;:::i;:::-;;:::i;6559:172::-;;;;;;:::i;:::-;;:::i;5606:186::-;;;;;;:::i;:::-;;:::i;:::-;;;2002:14:1;;1995:22;1977:41;;1965:2;1950:18;5606:186:0;1837:187:1;3237:201:0;;;;;;:::i;:::-;;:::i;6739:148::-;2224:13;:11;:13::i;:::-;6823:15:::1;:56:::0;;-1:-1:-1;;;;;;6823:56:0::1;-1:-1:-1::0;;;;;6823:56:0;;;::::1;::::0;;;::::1;::::0;;6739:148::o;5800:175::-;5897:4;5903:7;5930:37;5942:10;5954:12;5930:11;:37::i;:::-;5923:44;;;;5800:175;;;;;;:::o;2979:103::-;2224:13;:11;:13::i;:::-;3044:30:::1;3071:1;3044:18;:30::i;:::-;2979:103::o:0;5056:540::-;4895:11;;-1:-1:-1;;;;;4895:11:0;4881:10;:25;4873:68;;;;-1:-1:-1;;;4873:68:0;;2231:2:1;4873:68:0;;;2213:21:1;2270:2;2250:18;;;2243:30;2309:32;2289:18;;;2282:60;2359:18;;4873:68:0;;;;;;;;;5206:10:::1;5217:25:::0;5246:38:::1;5258:10;5270:13;5246:11;:38::i;:::-;5205:79;;;;5324:1;5303:18;:22;5295:60;;;::::0;-1:-1:-1;;;5295:60:0;;2590:2:1;5295:60:0::1;::::0;::::1;2572:21:1::0;2629:2;2609:18;;;2602:30;2668:27;2648:18;;;2641:55;2713:18;;5295:60:0::1;2388:349:1::0;5295:60:0::1;5370:5;:48;;;;;5401:17;5379:18;:39;;5370:48;5366:87;;;5435:7;;;;5366:87;5463:22;::::0;;;:10:::1;:22;::::0;;;;;;;:37;;;;;;;;;:58;;;5537:51;;2944:25:1;;;2985:18;;;2978:34;;;3028:18;;;3021:34;;;5537:51:0::1;::::0;2932:2:1;2917:18;5537:51:0::1;;;;;;;5194:402;;4952:1;5056:540:::0;;;;:::o;6559:172::-;2224:13;:11;:13::i;:::-;-1:-1:-1;;;;;6643:26:0;::::1;6635:51;;;::::0;-1:-1:-1;;;6635:51:0;;3268:2:1;6635:51:0::1;::::0;::::1;3250:21:1::0;3307:2;3287:18;;;3280:30;-1:-1:-1;;;3326:18:1;;;3319:42;3378:18;;6635:51:0::1;3066:336:1::0;6635:51:0::1;6697:11;:26:::0;;-1:-1:-1;;;;;;6697:26:0::1;-1:-1:-1::0;;;;;6697:26:0;;;::::1;::::0;;;::::1;::::0;;6559:172::o;5606:186::-;5691:4;5709:10;5724:37;5736:10;5748:12;5724:11;:37::i;:::-;-1:-1:-1;5708:53:0;5606:186;-1:-1:-1;;;;5606:186:0:o;3237:201::-;2224:13;:11;:13::i;:::-;-1:-1:-1;;;;;3326:22:0;::::1;3318:73;;;::::0;-1:-1:-1;;;3318:73:0;;3609:2:1;3318:73:0::1;::::0;::::1;3591:21:1::0;3648:2;3628:18;;;3621:30;3687:34;3667:18;;;3660:62;-1:-1:-1;;;3738:18:1;;;3731:36;3784:19;;3318:73:0::1;3407:402:1::0;3318:73:0::1;3402:28;3421:8;3402:18;:28::i;:::-;3237:201:::0;:::o;2503:132::-;2384:7;2411:6;-1:-1:-1;;;;;2411:6:0;914:10;2567:23;2559:68;;;;-1:-1:-1;;;2559:68:0;;4016:2:1;2559:68:0;;;3998:21:1;;;4035:18;;;4028:30;4094:34;4074:18;;;4067:62;4146:18;;2559:68:0;3814:356:1;5983:460:0;6069:4;6123:22;;;:10;:22;;;;;;;;:36;;;;;;;;;6069:4;;6174:21;;6170:86;;6220:4;;-1:-1:-1;6226:17:0;-1:-1:-1;6212:32:0;;6170:86;6278:15;;-1:-1:-1;;;;;6278:15:0;6270:38;6266:142;;6332:15;;:64;;-1:-1:-1;;;6332:64:0;;;;;4349:25:1;;;4390:18;;;4383:34;;;-1:-1:-1;;;;;6332:15:0;;;;:38;;4322:18:1;;6332:64:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6325:71;;;;;;;6266:142;-1:-1:-1;6426:5:0;;;;-1:-1:-1;5983:460:0;-1:-1:-1;;;5983:460:0:o;3598:191::-;3672:16;3691:6;;-1:-1:-1;;;;;3708:17:0;;;-1:-1:-1;;;;;;3708:17:0;;;;;;3741:40;;3691:6;;;;;;;3741:40;;3672:16;3741:40;3661:128;3598:191;:::o;14:248:1:-;82:6;90;143:2;131:9;122:7;118:23;114:32;111:52;;;159:1;156;149:12;111:52;-1:-1:-1;;182:23:1;;;252:2;237:18;;;224:32;;-1:-1:-1;14:248:1:o;449:286::-;508:6;561:2;549:9;540:7;536:23;532:32;529:52;;;577:1;574;567:12;529:52;603:23;;-1:-1:-1;;;;;655:31:1;;645:42;;635:70;;701:1;698;691:12;635:70;724:5;449:286;-1:-1:-1;;;449:286:1:o;1447:385::-;1533:6;1541;1549;1557;1610:3;1598:9;1589:7;1585:23;1581:33;1578:53;;;1627:1;1624;1617:12;1578:53;-1:-1:-1;;1650:23:1;;;1720:2;1705:18;;1692:32;;-1:-1:-1;1771:2:1;1756:18;;1743:32;;1822:2;1807:18;1794:32;;-1:-1:-1;1447:385:1;-1:-1:-1;1447:385:1:o;4428:338::-;4504:6;4512;4565:2;4553:9;4544:7;4540:23;4536:32;4533:52;;;4581:1;4578;4571:12;4533:52;4613:9;4607:16;4666:5;4659:13;4652:21;4645:5;4642:32;4632:60;;4688:1;4685;4678:12;4632:60;4756:2;4741:18;;;;4735:25;4711:5;;4735:25;;-1:-1:-1;;;4428:338:1:o
Swarm Source
ipfs://2ca1a30d2f5a282848446db2a6818cd893246b56c50306fc20a3fb47d5429bb2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.