Holesky Testnet

Contract

0x62a1ddfD86b4c1636759d9286D3A0EC722D086e3

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Set Middleware27485372024-11-16 0:43:4817 days ago1731717828IN
0x62a1ddfD...722D086e3
0 ETH0.000001610.04790994
Set Middleware27377492024-11-14 10:21:2418 days ago1731579684IN
0x62a1ddfD...722D086e3
0 ETH0.000005280.10412154
Set Middleware26767312024-11-05 8:17:1227 days ago1730794632IN
0x62a1ddfD...722D086e3
0 ETH0.000152243.00000001
Set Middleware26700382024-11-04 8:30:1228 days ago1730709012IN
0x62a1ddfD...722D086e3
0 ETH0.000152243.00000001
Set Middleware26298742024-10-29 7:38:0035 days ago1730187480IN
0x62a1ddfD...722D086e3
0 ETH0.000000070.00143917
Set Middleware26298652024-10-29 7:36:0035 days ago1730187360IN
0x62a1ddfD...722D086e3
0 ETH0.000000050.00116612
Set Middleware26271682024-10-28 21:46:2435 days ago1730151984IN
0x62a1ddfD...722D086e3
0 ETH0.000000060.00120677
Set Middleware26239872024-10-28 10:10:1235 days ago1730110212IN
0x62a1ddfD...722D086e3
0 ETH0.000100943.00000001
Set Middleware26238992024-10-28 9:50:1235 days ago1730109012IN
0x62a1ddfD...722D086e3
0 ETH0.000152243
Set Middleware25983352024-10-24 13:13:4839 days ago1729775628IN
0x62a1ddfD...722D086e3
0 ETH0.00000030.0060673
Set Middleware25980722024-10-24 12:17:0039 days ago1729772220IN
0x62a1ddfD...722D086e3
0 ETH0.000000380.0075092

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NetworkMiddlewareService

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 3 : NetworkMiddlewareService.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

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

contract NetworkMiddlewareService is INetworkMiddlewareService {
    /**
     * @inheritdoc INetworkMiddlewareService
     */
    address public immutable NETWORK_REGISTRY;

    /**
     * @inheritdoc INetworkMiddlewareService
     */
    mapping(address network => address value) public middleware;

    constructor(
        address networkRegistry
    ) {
        NETWORK_REGISTRY = networkRegistry;
    }

    /**
     * @inheritdoc INetworkMiddlewareService
     */
    function setMiddleware(
        address middleware_
    ) external {
        if (!IRegistry(NETWORK_REGISTRY).isEntity(msg.sender)) {
            revert NotNetwork();
        }

        if (middleware[msg.sender] == middleware_) {
            revert AlreadySet();
        }

        middleware[msg.sender] = middleware_;

        emit SetMiddleware(msg.sender, middleware_);
    }
}

File 2 of 3 : INetworkMiddlewareService.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface INetworkMiddlewareService {
    error AlreadySet();
    error NotNetwork();

    /**
     * @notice Emitted when a middleware is set for a network.
     * @param network address of the network
     * @param middleware new middleware of the network
     */
    event SetMiddleware(address indexed network, address middleware);

    /**
     * @notice Get the network registry's address.
     * @return address of the network registry
     */
    function NETWORK_REGISTRY() external view returns (address);

    /**
     * @notice Get a given network's middleware.
     * @param network address of the network
     * @return middleware of the network
     */
    function middleware(
        address network
    ) external view returns (address);

    /**
     * @notice Set a new middleware for a calling network.
     * @param middleware new middleware of the network
     */
    function setMiddleware(
        address middleware
    ) external;
}

File 3 of 3 : IRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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);
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "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":[{"internalType":"address","name":"networkRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadySet","type":"error"},{"inputs":[],"name":"NotNetwork","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"network","type":"address"},{"indexed":false,"internalType":"address","name":"middleware","type":"address"}],"name":"SetMiddleware","type":"event"},{"inputs":[],"name":"NETWORK_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"network","type":"address"}],"name":"middleware","outputs":[{"internalType":"address","name":"value","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"middleware_","type":"address"}],"name":"setMiddleware","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a034606c57601f6102ef38819003918201601f19168301916001600160401b03831184841017607157808492602094604052833981010312606c57516001600160a01b0381168103606c5760805260405161026790816100888239608051818181605901526101120152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600092833560e01c918263b7d8e1a9146100d057508163bb5ed0321461008c575063c0cd7c3e1461004657600080fd5b34610088578160031936011261008857517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b9050346100cc5760203660031901126100cc576001600160a01b039035818116908190036100c857838391602095528085522054169051908152f35b8380fd5b8280fd5b849184346100c8576020918260031936011261022d576001600160a01b0381358181169590869003610205576302910f8b60e31b8152338382015284816024817f000000000000000000000000000000000000000000000000000000000000000086165afa9081156102235787916101bf575b50156101b057338652858452828620541684146101a257503380855284835281852080546001600160a01b031916851790559051928352917ff64e2a8734392e221de13f5e56deb22d308e292cad394052affa97dbaf41ec989190a280f35b905163a741a04560e01b8152fd5b5090516323d53b9760e21b8152fd5b9050843d861161021c575b601f8101601f1916820167ffffffffffffffff8111838210176102095786918391875281010312610205575180151581036102055787610143565b8680fd5b634e487b7160e01b895260418552602489fd5b503d6101ca565b84513d89823e3d90fd5b8480fdfea2646970667358221220d3a5bb51e2c97a0dbbe8a1e8099c5e183f8a18f5be5a699a0217c9e9b3db5d8264736f6c634300081900330000000000000000000000007d03b7343bf8d5cec7c0c27ece084a20113d15c9

Deployed Bytecode

0x608060408181526004918236101561001657600080fd5b600092833560e01c918263b7d8e1a9146100d057508163bb5ed0321461008c575063c0cd7c3e1461004657600080fd5b34610088578160031936011261008857517f0000000000000000000000007d03b7343bf8d5cec7c0c27ece084a20113d15c96001600160a01b03168152602090f35b5080fd5b9050346100cc5760203660031901126100cc576001600160a01b039035818116908190036100c857838391602095528085522054169051908152f35b8380fd5b8280fd5b849184346100c8576020918260031936011261022d576001600160a01b0381358181169590869003610205576302910f8b60e31b8152338382015284816024817f0000000000000000000000007d03b7343bf8d5cec7c0c27ece084a20113d15c986165afa9081156102235787916101bf575b50156101b057338652858452828620541684146101a257503380855284835281852080546001600160a01b031916851790559051928352917ff64e2a8734392e221de13f5e56deb22d308e292cad394052affa97dbaf41ec989190a280f35b905163a741a04560e01b8152fd5b5090516323d53b9760e21b8152fd5b9050843d861161021c575b601f8101601f1916820167ffffffffffffffff8111838210176102095786918391875281010312610205575180151581036102055787610143565b8680fd5b634e487b7160e01b895260418552602489fd5b503d6101ca565b84513d89823e3d90fd5b8480fdfea2646970667358221220d3a5bb51e2c97a0dbbe8a1e8099c5e183f8a18f5be5a699a0217c9e9b3db5d8264736f6c63430008190033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000007d03b7343bf8d5cec7c0c27ece084a20113d15c9

-----Decoded View---------------
Arg [0] : networkRegistry (address): 0x7d03b7343BF8d5cEC7C0C27ecE084a20113D15C9

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007d03b7343bf8d5cec7c0c27ece084a20113d15c9


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.