Holesky Testnet

Contract

0x70818a53ddE5c2e78Edfb6f6b277Be9a71fa894E

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Set Middleware26273032024-10-28 22:15:0045 days ago1730153700IN
0x70818a53...a71fa894E
0 ETH0.000000060.00120677
Set Middleware25794942024-10-21 17:05:0053 days ago1729530300IN
0x70818a53...a71fa894E
0 ETH0.000005070.10000001
Set Middleware25592142024-10-18 16:15:2456 days ago1729268124IN
0x70818a53...a71fa894E
0 ETH0.000000080.00162858
Set Middleware24644702024-10-04 7:53:3670 days ago1728028416IN
0x70818a53...a71fa894E
0 ETH0.000000760.02264827
Set Middleware24174232024-09-27 6:01:4877 days ago1727416908IN
0x70818a53...a71fa894E
0 ETH0.000123062.42500001
Set Middleware23989062024-09-24 10:42:2480 days ago1727174544IN
0x70818a53...a71fa894E
0 ETH0.000003110.09267865
Set Middleware23605902024-09-18 15:53:3686 days ago1726674816IN
0x70818a53...a71fa894E
0 ETH0.000011410.22494921
Set Middleware23278692024-09-13 14:19:3691 days ago1726237176IN
0x70818a53...a71fa894E
0 ETH0.000004380.08639614
Set Middleware22361952024-08-30 12:43:36105 days ago1725021816IN
0x70818a53...a71fa894E
0 ETH0.000000140.00280102
Set Middleware21817032024-08-22 6:30:48113 days ago1724308248IN
0x70818a53...a71fa894E
0 ETH0.000000250.005

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 "src/interfaces/service/INetworkMiddlewareService.sol";
import {IRegistry} from "src/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: BUSL-1.1
pragma solidity 0.8.25;

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

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

60a034606c57601f6102ef38819003918201601f19168301916001600160401b03831184841017607157808492602094604052833981010312606c57516001600160a01b0381168103606c5760805260405161026790816100888239608051818181605901526101120152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600092833560e01c918263b7d8e1a9146100d057508163bb5ed0321461008c575063c0cd7c3e1461004657600080fd5b34610088578160031936011261008857517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b9050346100cc5760203660031901126100cc576001600160a01b039035818116908190036100c857838391602095528085522054169051908152f35b8380fd5b8280fd5b849184346100c8576020918260031936011261022d576001600160a01b0381358181169590869003610205576302910f8b60e31b8152338382015284816024817f000000000000000000000000000000000000000000000000000000000000000086165afa9081156102235787916101bf575b50156101b057338652858452828620541684146101a257503380855284835281852080546001600160a01b031916851790559051928352917ff64e2a8734392e221de13f5e56deb22d308e292cad394052affa97dbaf41ec989190a280f35b905163a741a04560e01b8152fd5b5090516323d53b9760e21b8152fd5b9050843d861161021c575b601f8101601f1916820167ffffffffffffffff8111838210176102095786918391875281010312610205575180151581036102055787610143565b8680fd5b634e487b7160e01b895260418552602489fd5b503d6101ca565b84513d89823e3d90fd5b8480fdfea2646970667358221220893719a69d0000c015cf18a65f11afa8370ff98c5877e2d940e9b70fd1191e2f64736f6c634300081900330000000000000000000000005dea088d2be1473d948895cc26104bcf103cef3e

Deployed Bytecode

0x608060408181526004918236101561001657600080fd5b600092833560e01c918263b7d8e1a9146100d057508163bb5ed0321461008c575063c0cd7c3e1461004657600080fd5b34610088578160031936011261008857517f0000000000000000000000005dea088d2be1473d948895cc26104bcf103cef3e6001600160a01b03168152602090f35b5080fd5b9050346100cc5760203660031901126100cc576001600160a01b039035818116908190036100c857838391602095528085522054169051908152f35b8380fd5b8280fd5b849184346100c8576020918260031936011261022d576001600160a01b0381358181169590869003610205576302910f8b60e31b8152338382015284816024817f0000000000000000000000005dea088d2be1473d948895cc26104bcf103cef3e86165afa9081156102235787916101bf575b50156101b057338652858452828620541684146101a257503380855284835281852080546001600160a01b031916851790559051928352917ff64e2a8734392e221de13f5e56deb22d308e292cad394052affa97dbaf41ec989190a280f35b905163a741a04560e01b8152fd5b5090516323d53b9760e21b8152fd5b9050843d861161021c575b601f8101601f1916820167ffffffffffffffff8111838210176102095786918391875281010312610205575180151581036102055787610143565b8680fd5b634e487b7160e01b895260418552602489fd5b503d6101ca565b84513d89823e3d90fd5b8480fdfea2646970667358221220893719a69d0000c015cf18a65f11afa8370ff98c5877e2d940e9b70fd1191e2f64736f6c63430008190033

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

0000000000000000000000005dea088d2be1473d948895cc26104bcf103cef3e

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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005dea088d2be1473d948895cc26104bcf103cef3e


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.