Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 1,113 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Timestamp | 2178016 | 108 days ago | IN | 0 ETH | 0.00000033 | ||||
Add Timestamp | 2176810 | 108 days ago | IN | 0 ETH | 0 | ||||
Add Timestamp | 2175616 | 108 days ago | IN | 0 ETH | 0 | ||||
Add Timestamp | 2174409 | 108 days ago | IN | 0 ETH | 0.00000011 | ||||
Add Timestamp | 2173207 | 108 days ago | IN | 0 ETH | 0.00000018 | ||||
Add Timestamp | 2172018 | 109 days ago | IN | 0 ETH | 0.00000054 | ||||
Add Timestamp | 2170814 | 109 days ago | IN | 0 ETH | 0.00002932 | ||||
Add Timestamp | 2169612 | 109 days ago | IN | 0 ETH | 0.00000011 | ||||
Add Timestamp | 2168420 | 109 days ago | IN | 0 ETH | 0.00000011 | ||||
Add Timestamp | 2167226 | 109 days ago | IN | 0 ETH | 0.0000004 | ||||
Add Timestamp | 2166024 | 110 days ago | IN | 0 ETH | 0.00000014 | ||||
Add Timestamp | 2164806 | 110 days ago | IN | 0 ETH | 0.00000065 | ||||
Add Timestamp | 2163626 | 110 days ago | IN | 0 ETH | 0.00000275 | ||||
Add Timestamp | 2162415 | 110 days ago | IN | 0 ETH | 0.00000511 | ||||
Add Timestamp | 2161221 | 110 days ago | IN | 0 ETH | 0.0000103 | ||||
Add Timestamp | 2160006 | 110 days ago | IN | 0 ETH | 0.00001275 | ||||
Add Timestamp | 2158817 | 111 days ago | IN | 0 ETH | 0.00001578 | ||||
Add Timestamp | 2157605 | 111 days ago | IN | 0 ETH | 0.00011312 | ||||
Add Timestamp | 2156414 | 111 days ago | IN | 0 ETH | 0.00003244 | ||||
Add Timestamp | 2155203 | 111 days ago | IN | 0 ETH | 0.00000075 | ||||
Add Timestamp | 2154010 | 111 days ago | IN | 0 ETH | 0.00002321 | ||||
Add Timestamp | 2152805 | 112 days ago | IN | 0 ETH | 0.000086 | ||||
Add Timestamp | 2151614 | 112 days ago | IN | 0 ETH | 0.00000123 | ||||
Add Timestamp | 2150407 | 112 days ago | IN | 0 ETH | 0.00000001 | ||||
Add Timestamp | 2149213 | 112 days ago | IN | 0 ETH | 0.00000113 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
EigenLayerBeaconOracle
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IBeaconChainOracle} from "./IBeaconChainOracle.sol"; /// @title EigenLayerBeaconOracle /// @author Succinct Labs contract EigenLayerBeaconOracle is IBeaconChainOracle { /// @notice The address of the beacon roots precompile. /// @dev https://eips.ethereum.org/EIPS/eip-4788 address internal constant BEACON_ROOTS = 0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02; /// @notice The maximum number of slots to search through to handle skipped slots. /// @dev This is 1 day worth of slots. uint256 internal constant MAX_SLOT_ATTEMPTS = 7200; /// @notice The size of the beacon block root ring buffer. uint256 internal constant BUFFER_LENGTH = 8191; /// @notice The timestamp to block root mapping. mapping(uint256 => bytes32) public timestampToBlockRoot; /// @notice The genesis block timestamp. uint256 public immutable GENESIS_BLOCK_TIMESTAMP; /// @notice The event emitted when a new block is added to the oracle. event EigenLayerBeaconOracleUpdate(uint256 slot, uint256 timestamp, bytes32 blockRoot); /// @notice Block timestamp does not correspond to a valid slot. error InvalidBlockTimestamp(); /// @notice Timestamp out of range. error TimestampOutOfRange(); constructor( uint256 _genesisBlockTimestamp ) { // Set the genesis block timestamp. GENESIS_BLOCK_TIMESTAMP = _genesisBlockTimestamp; } function addTimestamp(uint256 _targetTimestamp) external { // If the targetTimestamp is not guaranteed to be within the beacon block root ring buffer, revert. if ((block.timestamp - _targetTimestamp) >= (BUFFER_LENGTH * 12)) { revert TimestampOutOfRange(); } // If _targetTimestamp corresponds to slot n, then the block root for slot n - 1 is returned. (bool success, ) = BEACON_ROOTS.staticcall(abi.encode(_targetTimestamp)); if (!success) { revert InvalidBlockTimestamp(); } uint256 slot = (_targetTimestamp - GENESIS_BLOCK_TIMESTAMP) / 12; // Find the block root for the target timestamp. bytes32 blockRoot = findBlockRoot(uint64(slot)); // Add the block root to the mapping. timestampToBlockRoot[_targetTimestamp] = blockRoot; // Emit the event. emit EigenLayerBeaconOracleUpdate(slot, _targetTimestamp, blockRoot); } /// @notice findBlockRoot takes a valid slot _targetSlot and returns the block root corresponding to _targetSlot. /// @param _targetSlot The slot to start searching from. /// @return blockRoot The beacon root of the first available slot found. /// @dev Given slot N+1's timestamp, BEACON_ROOTS returns the beacon block root corresponding to slot N. function findBlockRoot(uint64 _targetSlot) public view returns (bytes32 blockRoot) { uint64 currSlot = _targetSlot + 1; bool success; bytes memory result; for (uint64 i = 0; i < MAX_SLOT_ATTEMPTS; i++) { uint256 currTimestamp = GENESIS_BLOCK_TIMESTAMP + (currSlot * 12); (success, result) = BEACON_ROOTS.staticcall(abi.encode(currTimestamp)); if (success && result.length > 0) { return (abi.decode(result, (bytes32))); } currSlot++; } revert("No available slot found"); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; /** * @title Interface for the BeaconStateOracle contract. * @author Layr Labs, Inc. * @notice Terms of Service: https://docs.eigenlayer.xyz/overview/terms-of-service */ interface IBeaconChainOracle { /// @notice The block number to state root mapping. function timestampToBlockRoot(uint256 timestamp) external view returns (bytes32); }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
[{"inputs":[{"internalType":"uint256","name":"_genesisBlockTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidBlockTimestamp","type":"error"},{"inputs":[],"name":"TimestampOutOfRange","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"blockRoot","type":"bytes32"}],"name":"EigenLayerBeaconOracleUpdate","type":"event"},{"inputs":[],"name":"GENESIS_BLOCK_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_targetTimestamp","type":"uint256"}],"name":"addTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_targetSlot","type":"uint64"}],"name":"findBlockRoot","outputs":[{"internalType":"bytes32","name":"blockRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"timestampToBlockRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b5060405161060c38038061060c83398101604081905261002f91610037565b608052610050565b60006020828403121561004957600080fd5b5051919050565b6080516105946100786000396000818160b0015281816101b0015261028e01526105946000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631bb90003146100515780635b6ae8c014610066578063643599f21461008b578063aa4a95c7146100ab575b600080fd5b61006461005f3660046103d6565b6100d2565b005b6100796100743660046103ef565b610246565b60405190815260200160405180910390f35b6100796100993660046103d6565b60006020819052908152604090205481565b6100797f000000000000000000000000000000000000000000000000000000000000000081565b6100df611fff600c610436565b6100e98242610453565b1061010757604051637944e66d60e11b815260040160405180910390fd5b6040805160208101839052600091720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f198184030181529082905261014591610466565b600060405180830381855afa9150503d8060008114610180576040519150601f19603f3d011682016040523d82523d6000602084013e610185565b606091505b50509050806101a757604051634d0b0a4160e01b815260040160405180910390fd5b6000600c6101d57f000000000000000000000000000000000000000000000000000000000000000085610453565b6101df9190610495565b905060006101ec82610246565b6000858152602081815260409182902083905581518581529081018790529081018290529091507fc8bd73742a63a8ef565902b94304e65f46c90f6974df076790e322b8f7cbeba09060600160405180910390a150505050565b6000806102548360016104b7565b90506000606060005b611c208167ffffffffffffffff16101561038957600061027e85600c6104df565b6102b29067ffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000061050b565b6040805160208101839052919250720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f19818403018152908290526102f091610466565b600060405180830381855afa9150503d806000811461032b576040519150601f19603f3d011682016040523d82523d6000602084013e610330565b606091505b509094509250838015610344575060008351115b15610368578280602001905181019061035d919061051e565b979650505050505050565b8461037281610537565b95505050808061038190610537565b91505061025d565b5060405162461bcd60e51b815260206004820152601760248201527f4e6f20617661696c61626c6520736c6f7420666f756e64000000000000000000604482015260640160405180910390fd5b6000602082840312156103e857600080fd5b5035919050565b60006020828403121561040157600080fd5b813567ffffffffffffffff8116811461041957600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761044d5761044d610420565b92915050565b8181038181111561044d5761044d610420565b6000825160005b81811015610487576020818601810151858301520161046d565b506000920191825250919050565b6000826104b257634e487b7160e01b600052601260045260246000fd5b500490565b67ffffffffffffffff8181168382160190808211156104d8576104d8610420565b5092915050565b67ffffffffffffffff81811683821602808216919082811461050357610503610420565b505092915050565b8082018082111561044d5761044d610420565b60006020828403121561053057600080fd5b5051919050565b600067ffffffffffffffff80831681810361055457610554610420565b600101939250505056fea2646970667358221220febbf18bcff76db980b8423ded3082985c21db16bc39cb8ccecbdc8b83a8c90864736f6c634300081600330000000000000000000000000000000000000000000000000000000065156ac0
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631bb90003146100515780635b6ae8c014610066578063643599f21461008b578063aa4a95c7146100ab575b600080fd5b61006461005f3660046103d6565b6100d2565b005b6100796100743660046103ef565b610246565b60405190815260200160405180910390f35b6100796100993660046103d6565b60006020819052908152604090205481565b6100797f0000000000000000000000000000000000000000000000000000000065156ac081565b6100df611fff600c610436565b6100e98242610453565b1061010757604051637944e66d60e11b815260040160405180910390fd5b6040805160208101839052600091720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f198184030181529082905261014591610466565b600060405180830381855afa9150503d8060008114610180576040519150601f19603f3d011682016040523d82523d6000602084013e610185565b606091505b50509050806101a757604051634d0b0a4160e01b815260040160405180910390fd5b6000600c6101d57f0000000000000000000000000000000000000000000000000000000065156ac085610453565b6101df9190610495565b905060006101ec82610246565b6000858152602081815260409182902083905581518581529081018790529081018290529091507fc8bd73742a63a8ef565902b94304e65f46c90f6974df076790e322b8f7cbeba09060600160405180910390a150505050565b6000806102548360016104b7565b90506000606060005b611c208167ffffffffffffffff16101561038957600061027e85600c6104df565b6102b29067ffffffffffffffff167f0000000000000000000000000000000000000000000000000000000065156ac061050b565b6040805160208101839052919250720f3df6d732807ef1319fb7b8bb8522d0beac02910160408051601f19818403018152908290526102f091610466565b600060405180830381855afa9150503d806000811461032b576040519150601f19603f3d011682016040523d82523d6000602084013e610330565b606091505b509094509250838015610344575060008351115b15610368578280602001905181019061035d919061051e565b979650505050505050565b8461037281610537565b95505050808061038190610537565b91505061025d565b5060405162461bcd60e51b815260206004820152601760248201527f4e6f20617661696c61626c6520736c6f7420666f756e64000000000000000000604482015260640160405180910390fd5b6000602082840312156103e857600080fd5b5035919050565b60006020828403121561040157600080fd5b813567ffffffffffffffff8116811461041957600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761044d5761044d610420565b92915050565b8181038181111561044d5761044d610420565b6000825160005b81811015610487576020818601810151858301520161046d565b506000920191825250919050565b6000826104b257634e487b7160e01b600052601260045260246000fd5b500490565b67ffffffffffffffff8181168382160190808211156104d8576104d8610420565b5092915050565b67ffffffffffffffff81811683821602808216919082811461050357610503610420565b505092915050565b8082018082111561044d5761044d610420565b60006020828403121561053057600080fd5b5051919050565b600067ffffffffffffffff80831681810361055457610554610420565b600101939250505056fea2646970667358221220febbf18bcff76db980b8423ded3082985c21db16bc39cb8ccecbdc8b83a8c90864736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000065156ac0
-----Decoded View---------------
Arg [0] : _genesisBlockTimestamp (uint256): 1695902400
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000065156ac0
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.