Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x7Ed48C31f2fdC40d37407cBaBf0870B2b688368f
Balance 0 ETH
Nonce 1
Code Size 2618 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

2618 bytes
0x608060405234801561000f575f5ffd5b50600436106100e4575f3560e01c806301257c1a146100e857806301d156021461011a57806311fd3baa1461012f57806326ae21a91461014257806329ae811414610155578063316bef9814610168578063373e73f8146101875780633b6874611461019a5780633f4ba83a146101ad5780635c975abb146101b557806365fae35e146101d25780636a42b8f8146101e55780636ea5511f146101ee5780638456cb5914610201578063854b89d5146102095780639c52a7f114610234578063bf353dbb14610247578063fe0ac3e714610266575b5f5ffd5b6101076100f636600461093a565b60036020525f908152604090205481565b6040519081526020015b60405180910390f35b61012d61012836600461093a565b610279565b005b61012d61013d36600461093a565b61032f565b61012d61015036600461093a565b6103d8565b61012d61016336600461095a565b61044a565b61010761017636600461093a565b60046020525f908152604090205481565b61012d61019536600461097a565b61050d565b61012d6101a836600461093a565b6105d0565b61012d61064f565b6001546101c29060ff1681565b6040519015158152602001610111565b61012d6101e036600461093a565b6106b2565b61010760025481565b61012d6101fc36600461093a565b610712565b61012d610785565b6101c261021736600461093a565b6001600160a01b03165f9081526003602052604090205460011490565b61012d61024236600461093a565b6107ea565b61010761025536600461093a565b5f6020819052908152604090205481565b61012d61027436600461097a565b61085c565b6001600160a01b0381165f9081526004602052604081205490036102b057604051632a5f940160e11b815260040160405180910390fd5b6001600160a01b0381165f908152600460205260409020544210156102e8576040516309a1fc6560e01b815260040160405180910390fd5b6001600160a01b0381165f8181526020819052604080822060019055515f5160206109e55f395f51905f529190a26001600160a01b03165f90815260046020526040812055565b335f9081526020819052604090205460011461035e5760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0381165f90815260046020526040812054900361039557604051632a5f940160e11b815260040160405180910390fd5b6001600160a01b0381165f81815260046020526040808220829055517f12954ba8e01160103c697e7401f753d82b965f8d0a45781718b422502ff774fe9190a250565b335f908152602081905260409020546001146104075760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0381165f81815260036020526040808220829055517f1c24a27ac669c0278656c76cc711441c8dd32d21c32227dad2b42bf6271e8fae9190a250565b335f908152602081905260409020546001146104795760405163ea8e4eb560e01b815260040160405180910390fd5b816464656c617960d81b036104b6576224ea008111156104ac57604051632b11ea0760e21b815260040160405180910390fd5b60028190556104cf565b604051633db0d5b960e01b815260040160405180910390fd5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c78260405161050191815260200190565b60405180910390a25050565b335f9081526020819052604090205460011461053c5760405163ea8e4eb560e01b815260040160405180910390fd5b6040516332fd71af60e11b81526001600160a01b038316906365fae35e906105689084906004016109ab565b5f604051808303815f87803b15801561057f575f5ffd5b505af1158015610591573d5f5f3e3d5ffd5b50506040516001600160a01b038085169350851691507fe032f99b24b97d34237bef09a8f08752cb036f47cd0ff63043ae749d4ffd1883905f90a35050565b335f908152602081905260409020546001146105ff5760405163ea8e4eb560e01b815260040160405180910390fd5b60025461060c90426109bf565b6001600160a01b0382165f81815260046020526040808220849055517f642e41875b0eb08854d0256dba9a007f64aa9cd4cf23e127426c2afb166a372b9190a350565b335f9081526020819052604090205460011461067e5760405163ea8e4eb560e01b815260040160405180910390fd5b6001805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33905f90a1565b335f908152602081905260409020546001146106e15760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0381165f8181526020819052604080822060019055515f5160206109e55f395f51905f529190a250565b335f908152602081905260409020546001146107415760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0381165f8181526003602052604080822060019055517fcf09648f68da83a35dee880bfc05f635fe373c3ba860b4322a8190febc6a1ac19190a250565b335f908152602081905260409020546001146107b45760405163ea8e4eb560e01b815260040160405180910390fd5b6001805460ff1916811790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625905f90a1565b335f908152602081905260409020546001146108195760405163ea8e4eb560e01b815260040160405180910390fd5b6001600160a01b0381165f81815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b335f9081526020819052604090205460011461088b5760405163ea8e4eb560e01b815260040160405180910390fd5b604051639c52a7f160e01b81526001600160a01b03831690639c52a7f1906108b79084906004016109ab565b5f604051808303815f87803b1580156108ce575f5ffd5b505af11580156108e0573d5f5f3e3d5ffd5b50506040516001600160a01b038085169350851691507fd23b91392450f5cbcbeacb8d5fd17534719b16f8bdde4b9b637d25c3e155cd2a905f90a35050565b80356001600160a01b0381168114610935575f5ffd5b919050565b5f6020828403121561094a575f5ffd5b6109538261091f565b9392505050565b5f5f6040838503121561096b575f5ffd5b50508035926020909101359150565b5f5f6040838503121561098b575f5ffd5b6109948361091f565b91506109a26020840161091f565b90509250929050565b6001600160a01b0391909116815260200190565b808201808211156109de57634e487b7160e01b5f52601160045260245ffd5b9291505056fedd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a60a264697066735822122048296fd47b55313a2485badd0d6d2e713a42fdff035e8c321e64193c1d1bf53864736f6c634300081c0033

Verified Source Code Full Match

Compiler: v0.8.28+commit.7893614a EVM: cancun Optimization: Yes (1 runs)
Root.sol 118 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;

import {Auth} from "src/misc/Auth.sol";
import {IAuth} from "src/misc/interfaces/IAuth.sol";

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

/// @title  Root
/// @notice Core contract that is a ward on all other deployed contracts.
/// @dev    Pausing can happen instantaneously, but relying on other contracts
///         is restricted to the timelock set by the delay.
contract Root is Auth, IRoot {
    /// @dev To prevent filing a delay that would block any updates indefinitely
    uint256 internal constant MAX_DELAY = 4 weeks;

    bool public paused;
    uint256 public delay;
    mapping(address => uint256) public endorsements;
    mapping(address relyTarget => uint256 timestamp) public schedule;

    constructor(uint256 _delay, address deployer) Auth(deployer) {
        require(_delay <= MAX_DELAY, DelayTooLong());
        delay = _delay;
    }

    //----------------------------------------------------------------------------------------------
    // Administration
    //----------------------------------------------------------------------------------------------

    /// @inheritdoc IRoot
    function file(bytes32 what, uint256 data) external auth {
        if (what == "delay") {
            require(data <= MAX_DELAY, DelayTooLong());
            delay = data;
        } else {
            revert FileUnrecognizedParam();
        }
        emit File(what, data);
    }

    /// @inheritdoc IRoot
    function endorse(address user) external auth {
        endorsements[user] = 1;
        emit Endorse(user);
    }

    /// @inheritdoc IRoot
    function veto(address user) external auth {
        endorsements[user] = 0;
        emit Veto(user);
    }

    /// @inheritdoc IRoot
    function endorsed(address user) external view returns (bool) {
        return endorsements[user] == 1;
    }

    //----------------------------------------------------------------------------------------------
    // Pause management
    //----------------------------------------------------------------------------------------------

    /// @inheritdoc IRoot
    function pause() external auth {
        paused = true;
        emit Pause();
    }

    /// @inheritdoc IRoot
    function unpause() external auth {
        paused = false;
        emit Unpause();
    }

    //----------------------------------------------------------------------------------------------
    // Timelocked ward management
    //----------------------------------------------------------------------------------------------

    /// @inheritdoc IRoot
    function scheduleRely(address target) external auth {
        schedule[target] = block.timestamp + delay;
        emit ScheduleRely(target, schedule[target]);
    }

    /// @inheritdoc IRoot
    function cancelRely(address target) external auth {
        require(schedule[target] != 0, TargetNotScheduled());
        schedule[target] = 0;
        emit CancelRely(target);
    }

    /// @inheritdoc IRoot
    function executeScheduledRely(address target) external {
        require(schedule[target] != 0, TargetNotScheduled());
        require(schedule[target] <= block.timestamp, TargetNotReady());

        wards[target] = 1;
        emit Rely(target);

        schedule[target] = 0;
    }

    //----------------------------------------------------------------------------------------------
    // External contract ward management
    //----------------------------------------------------------------------------------------------

    /// @inheritdoc IRoot
    function relyContract(address target, address user) external auth {
        IAuth(target).rely(user);
        emit RelyContract(target, user);
    }

    /// @inheritdoc IRoot
    function denyContract(address target, address user) external auth {
        IAuth(target).deny(user);
        emit DenyContract(target, user);
    }
}
IRoot.sol 75 lines
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

interface IRoot {
    // --- Events ---
    event File(bytes32 indexed what, uint256 data);
    event Pause();
    event Unpause();
    event ScheduleRely(address indexed target, uint256 indexed scheduledTime);
    event CancelRely(address indexed target);
    event RelyContract(address indexed target, address indexed user);
    event DenyContract(address indexed target, address indexed user);
    event Endorse(address indexed user);
    event Veto(address indexed user);

    error DelayTooLong();
    error FileUnrecognizedParam();
    error TargetNotScheduled();
    error TargetNotReady();

    /// @notice Returns whether the root is paused
    function paused() external view returns (bool);

    /// @notice Returns the current timelock for adding new wards
    function delay() external view returns (uint256);

    /// @notice Trusted contracts within the system
    function endorsements(address target) external view returns (uint256);

    /// @notice Returns when `relyTarget` has passed the timelock
    function schedule(address relyTarget) external view returns (uint256 timestamp);

    // --- Administration ---
    /// @notice Updates a contract parameter
    /// @param what Accepts a bytes32 representation of 'delay'
    function file(bytes32 what, uint256 data) external;

    /// --- Endorsements ---
    /// @notice Endorses the `user`
    /// @dev    Endorsed users are trusted contracts in the system. They are allowed to bypass
    ///         token restrictions (e.g. the Escrow can automatically receive share class tokens by being endorsed), and
    ///         can automatically set operators in ERC-7540 vaults (e.g. the VaultRouter) is always an operator.
    function endorse(address user) external;

    /// @notice Removes the endorsed user
    function veto(address user) external;

    /// @notice Returns whether the user is endorsed
    function endorsed(address user) external view returns (bool);

    // --- Pause management ---
    /// @notice Pause any contracts that depend on `Root.paused()`
    function pause() external;

    /// @notice Unpause any contracts that depend on `Root.paused()`
    function unpause() external;

    /// --- Timelocked ward management ---
    /// @notice Schedule relying a new ward after the delay has passed
    function scheduleRely(address target) external;

    /// @notice Cancel a pending scheduled rely
    function cancelRely(address target) external;

    /// @notice Execute a scheduled rely
    /// @dev    Can be triggered by anyone since the scheduling is protected
    function executeScheduledRely(address target) external;

    /// --- External contract ward management ---
    /// @notice Make an address a ward on any contract that Root is a ward on
    function relyContract(address target, address user) external;

    /// @notice Removes an address as a ward on any contract that Root is a ward on
    function denyContract(address target, address user) external;
}
Auth.sol 35 lines
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.28;

import {IAuth} from "src/misc/interfaces/IAuth.sol";

/// @title  Auth
/// @notice Simple authentication pattern
/// @author Based on code from https://github.com/makerdao/dss
abstract contract Auth is IAuth {
    /// @inheritdoc IAuth
    mapping(address => uint256) public wards;

    constructor(address initialWard) {
        wards[initialWard] = 1;
        emit Rely(initialWard);
    }

    /// @dev Check if the msg.sender has permissions
    modifier auth() {
        require(wards[msg.sender] == 1, NotAuthorized());
        _;
    }

    /// @inheritdoc IAuth
    function rely(address user) public auth {
        wards[user] = 1;
        emit Rely(user);
    }

    /// @inheritdoc IAuth
    function deny(address user) public auth {
        wards[user] = 0;
        emit Deny(user);
    }
}
IAuth.sol 18 lines
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

interface IAuth {
    event Rely(address indexed user);
    event Deny(address indexed user);

    error NotAuthorized();

    /// @notice Returns whether the target is a ward (has admin access)
    function wards(address target) external view returns (uint256);

    /// @notice Make user a ward (give them admin access)
    function rely(address user) external;

    /// @notice Remove user as a ward (remove admin access)
    function deny(address user) external;
}

Read Contract

delay 0x6a42b8f8 → uint256
endorsed 0x854b89d5 → bool
endorsements 0x01257c1a → uint256
paused 0x5c975abb → bool
schedule 0x316bef98 → uint256
wards 0xbf353dbb → uint256

Write Contract 12 functions

These functions modify contract state and require a wallet transaction to execute.

cancelRely 0x11fd3baa
address target
deny 0x9c52a7f1
address user
denyContract 0xfe0ac3e7
address target
address user
endorse 0x6ea5511f
address user
executeScheduledRely 0x01d15602
address target
file 0x29ae8114
bytes32 what
uint256 data
pause 0x8456cb59
No parameters
rely 0x65fae35e
address user
relyContract 0x373e73f8
address target
address user
scheduleRely 0x3b687461
address target
unpause 0x3f4ba83a
No parameters
veto 0x26ae21a9
address user

Recent Transactions

No transactions found for this address