Holesky Testnet

Contract

0x4C116BB629bff7A8373c2378bBd919f8349B8f25

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Add Timestamp21780162024-08-21 17:06:00108 days ago1724259960IN
0x4C116BB6...8349B8f25
0 ETH0.000000330.00577951
Add Timestamp21768102024-08-21 12:43:48108 days ago1724244228IN
0x4C116BB6...8349B8f25
0 ETH00.00001702
Add Timestamp21756162024-08-21 8:22:00108 days ago1724228520IN
0x4C116BB6...8349B8f25
0 ETH00.00015676
Add Timestamp21744092024-08-21 4:00:12108 days ago1724212812IN
0x4C116BB6...8349B8f25
0 ETH0.000000110.00204012
Add Timestamp21732072024-08-20 23:38:24108 days ago1724197104IN
0x4C116BB6...8349B8f25
0 ETH0.000000180.00324006
Add Timestamp21720182024-08-20 19:16:48109 days ago1724181408IN
0x4C116BB6...8349B8f25
0 ETH0.000000540.00940901
Add Timestamp21708142024-08-20 14:50:00109 days ago1724165400IN
0x4C116BB6...8349B8f25
0 ETH0.000029320.50291896
Add Timestamp21696122024-08-20 10:23:24109 days ago1724149404IN
0x4C116BB6...8349B8f25
0 ETH0.000000110.00200787
Add Timestamp21684202024-08-20 5:51:48109 days ago1724133108IN
0x4C116BB6...8349B8f25
0 ETH0.000000110.00197767
Add Timestamp21672262024-08-20 1:30:12109 days ago1724117412IN
0x4C116BB6...8349B8f25
0 ETH0.00000040.00693843
Add Timestamp21660242024-08-19 21:08:24110 days ago1724101704IN
0x4C116BB6...8349B8f25
0 ETH0.000000140.00243419
Add Timestamp21648062024-08-19 16:36:48110 days ago1724085408IN
0x4C116BB6...8349B8f25
0 ETH0.000000650.01116276
Add Timestamp21636262024-08-19 12:20:12110 days ago1724070012IN
0x4C116BB6...8349B8f25
0 ETH0.000002750.04486946
Add Timestamp21624152024-08-19 7:53:36110 days ago1724054016IN
0x4C116BB6...8349B8f25
0 ETH0.000005110.0876946
Add Timestamp21612212024-08-19 3:31:48110 days ago1724038308IN
0x4C116BB6...8349B8f25
0 ETH0.00001030.1766945
Add Timestamp21600062024-08-18 23:00:12110 days ago1724022012IN
0x4C116BB6...8349B8f25
0 ETH0.000012750.21868596
Add Timestamp21588172024-08-18 18:33:24111 days ago1724006004IN
0x4C116BB6...8349B8f25
0 ETH0.000015780.27065669
Add Timestamp21576052024-08-18 14:06:48111 days ago1723990008IN
0x4C116BB6...8349B8f25
0 ETH0.000113121.94000001
Add Timestamp21564142024-08-18 9:40:12111 days ago1723974012IN
0x4C116BB6...8349B8f25
0 ETH0.000032440.55647136
Add Timestamp21552032024-08-18 5:13:36111 days ago1723958016IN
0x4C116BB6...8349B8f25
0 ETH0.000000750.01228507
Add Timestamp21540102024-08-18 0:47:00111 days ago1723942020IN
0x4C116BB6...8349B8f25
0 ETH0.000023210.39804475
Add Timestamp21528052024-08-17 20:15:12112 days ago1723925712IN
0x4C116BB6...8349B8f25
0 ETH0.0000861.47484826
Add Timestamp21516142024-08-17 15:48:24112 days ago1723909704IN
0x4C116BB6...8349B8f25
0 ETH0.000001230.02124704
Add Timestamp21504072024-08-17 11:11:36112 days ago1723893096IN
0x4C116BB6...8349B8f25
0 ETH0.000000010.00019401
Add Timestamp21492132024-08-17 6:44:48112 days ago1723877088IN
0x4C116BB6...8349B8f25
0 ETH0.000001130.01940001
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

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)

File 1 of 2 : EigenLayerBeaconOracle.sol
// 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");
    }
}

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

Settings
{
  "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": {}
}

Contract ABI

[{"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"}]

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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.