Holesky Testnet

Contract

0xa02C55a6306c859517A064fb34d48DFB773A4a52

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Register Operato...23081732024-09-10 13:27:366 hrs ago1725974856IN
0xa02C55a6...B773A4a52
0 ETH0.000001620.02247497
Register Operato...23064072024-09-10 6:53:3613 hrs ago1725951216IN
0xa02C55a6...B773A4a52
0 ETH0.000000070.001
Register Operato...23059002024-09-10 5:00:3614 hrs ago1725944436IN
0xa02C55a6...B773A4a52
0 ETH0.000065810.912673
Register Operato...23019852024-09-09 14:37:3629 hrs ago1725892656IN
0xa02C55a6...B773A4a52
0 ETH0.000054820.76023106
Register Operato...23013402024-09-09 12:16:1231 hrs ago1725884172IN
0xa02C55a6...B773A4a52
0 ETH0.000067850.9409
Register Operato...22988472024-09-09 3:00:3640 hrs ago1725850836IN
0xa02C55a6...B773A4a52
0 ETH0.000000370.01591861
Register Operato...22987442024-09-09 2:38:0041 hrs ago1725849480IN
0xa02C55a6...B773A4a52
0 ETH0.000011480.15924272
Register Operato...22965582024-09-08 18:44:482 days ago1725821088IN
0xa02C55a6...B773A4a52
0 ETH0.000013230.18351488
Register Operato...22893612024-09-07 16:17:123 days ago1725725832IN
0xa02C55a6...B773A4a52
0 ETH0.000024340.33757597
Register Operato...22827362024-09-06 15:56:004 days ago1725638160IN
0xa02C55a6...B773A4a52
0 ETH0.000021320.29571227
Register Operato...22818092024-09-06 12:32:004 days ago1725625920IN
0xa02C55a6...B773A4a52
0 ETH0.000040420.56061271
Register Operato...22702892024-09-04 18:12:006 days ago1725473520IN
0xa02C55a6...B773A4a52
0 ETH0.00000750.10402992
Register Operato...22688852024-09-04 13:04:126 days ago1725455052IN
0xa02C55a6...B773A4a52
0 ETH0.000090141.25
Register Operato...22684892024-09-04 11:35:486 days ago1725449748IN
0xa02C55a6...B773A4a52
0 ETH0.000216343
Register Operato...22674822024-09-04 7:52:486 days ago1725436368IN
0xa02C55a6...B773A4a52
0 ETH0.000081421.12908
Register Operato...22664862024-09-04 4:12:246 days ago1725423144IN
0xa02C55a6...B773A4a52
0 ETH0.000067850.9409
Register Operato...22661682024-09-04 3:03:006 days ago1725418980IN
0xa02C55a6...B773A4a52
0 ETH0.000086531.2
Register Operato...22628582024-09-03 14:56:487 days ago1725375408IN
0xa02C55a6...B773A4a52
0 ETH0.000013650.18930809
Register Operato...22627762024-09-03 14:39:127 days ago1725374352IN
0xa02C55a6...B773A4a52
0 ETH0.000016880.23419558
Register Operato...22625852024-09-03 13:56:007 days ago1725371760IN
0xa02C55a6...B773A4a52
0 ETH0.000014950.20742161
Register Operato...22547182024-09-02 8:52:008 days ago1725267120IN
0xa02C55a6...B773A4a52
0 ETH0.000086531.2
Register Operato...22485652024-09-01 10:19:009 days ago1725185940IN
0xa02C55a6...B773A4a52
0 ETH0.000076611.06235138
Register Operato...22411852024-08-31 7:00:1210 days ago1725087612IN
0xa02C55a6...B773A4a52
0 ETH0.000069950.97
Register Operato...22366892024-08-30 14:32:1211 days ago1725028332IN
0xa02C55a6...B773A4a52
0 ETH0.000017290.73742413
Register Operato...22366882024-08-30 14:32:0011 days ago1725028320IN
0xa02C55a6...B773A4a52
0 ETH0.000053170.73742413
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:
OperatorRegistry

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 5 : OperatorRegistry.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

import {Registry} from "./common/Registry.sol";

import {IOperatorRegistry} from "src/interfaces/IOperatorRegistry.sol";

contract OperatorRegistry is Registry, IOperatorRegistry {
    /**
     * @inheritdoc IOperatorRegistry
     */
    function registerOperator() external {
        if (isEntity(msg.sender)) {
            revert OperatorAlreadyRegistered();
        }

        _addEntity(msg.sender);
    }
}

File 2 of 5 : Registry.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

import {IRegistry} from "src/interfaces/common/IRegistry.sol";

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

abstract contract Registry is IRegistry {
    using EnumerableSet for EnumerableSet.AddressSet;

    EnumerableSet.AddressSet private _entities;

    modifier checkEntity(address account) {
        _checkEntity(account);
        _;
    }

    /**
     * @inheritdoc IRegistry
     */
    function isEntity(address entity_) public view returns (bool) {
        return _entities.contains(entity_);
    }

    /**
     * @inheritdoc IRegistry
     */
    function totalEntities() public view returns (uint256) {
        return _entities.length();
    }

    /**
     * @inheritdoc IRegistry
     */
    function entity(uint256 index) public view returns (address) {
        return _entities.at(index);
    }

    function _addEntity(address entity_) internal {
        _entities.add(entity_);

        emit AddEntity(entity_);
    }

    function _checkEntity(address account) internal view {
        if (!isEntity(account)) {
            revert EntityNotExist();
        }
    }
}

File 3 of 5 : IOperatorRegistry.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

import {IRegistry} from "./common/IRegistry.sol";

interface IOperatorRegistry is IRegistry {
    error OperatorAlreadyRegistered();

    /**
     * @notice Register the caller as an operator.
     */
    function registerOperator() external;
}

File 4 of 5 : IRegistry.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

interface IRegistry {
    error EntityNotExist();

    /**
     * @notice Emitted when an entity is added.
     * @param entity address of the added entity
     */
    event AddEntity(address indexed entity);

    /**
     * @notice Get if a given address is an entity.
     * @param account address to check
     * @return if the given address is an entity
     */
    function isEntity(address account) external view returns (bool);

    /**
     * @notice Get a total number of entities.
     * @return total number of entities added
     */
    function totalEntities() external view returns (uint256);

    /**
     * @notice Get an entity given its index.
     * @param index index of the entity to get
     * @return address of the entity
     */
    function entity(uint256 index) external view returns (address);
}

File 5 of 5 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract ABI

[{"inputs":[],"name":"EntityNotExist","type":"error"},{"inputs":[],"name":"OperatorAlreadyRegistered","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"entity","type":"address"}],"name":"AddEntity","type":"event"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"entity","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"entity_","type":"address"}],"name":"isEntity","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registerOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalEntities","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080806040523460155761024c908161001b8239f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c806314887c58146101455780632acde098146100d55780635cd8b15e146100b85763b42ba2a21461004957600080fd5b346100b55760203660031901126100b55760043581548110156100a1579080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56301546040516001600160a01b039091168152602090f35b634e487b7160e01b82526032600452602482fd5b80fd5b50346100b557806003193601126100b55760209054604051908152f35b50346100b557806003193601126100b5576100fd336000526001602052604060002054151590565b6101335761010a33610190565b50337fb919910dcefbf753bfd926ab3b1d3f85d877190c3d01ba1bd585047b99b99f0b8280a280f35b6040516342ee68b560e01b8152600490fd5b50346100b55760203660031901126100b5576004356001600160a01b03811691908290036100b5576020610186836000526001602052604060002054151590565b6040519015158152f35b600081815260016020526040812054610211578054680100000000000000008110156101fd57600181018083558110156100a15790826040927f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630155805492815260016020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212202961df432c8122f0fb5a9da9a281517c81b3bd8538fbd90d2db65c5b523f51b064736f6c63430008190033

Deployed Bytecode

0x6080604052600436101561001257600080fd5b6000803560e01c806314887c58146101455780632acde098146100d55780635cd8b15e146100b85763b42ba2a21461004957600080fd5b346100b55760203660031901126100b55760043581548110156100a1579080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56301546040516001600160a01b039091168152602090f35b634e487b7160e01b82526032600452602482fd5b80fd5b50346100b557806003193601126100b55760209054604051908152f35b50346100b557806003193601126100b5576100fd336000526001602052604060002054151590565b6101335761010a33610190565b50337fb919910dcefbf753bfd926ab3b1d3f85d877190c3d01ba1bd585047b99b99f0b8280a280f35b6040516342ee68b560e01b8152600490fd5b50346100b55760203660031901126100b5576004356001600160a01b03811691908290036100b5576020610186836000526001602052604060002054151590565b6040519015158152f35b600081815260016020526040812054610211578054680100000000000000008110156101fd57600181018083558110156100a15790826040927f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630155805492815260016020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212202961df432c8122f0fb5a9da9a281517c81b3bd8538fbd90d2db65c5b523f51b064736f6c63430008190033

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.