ETH Price: $3,381.55 (+3.13%)

Contract

0xc3B2ec1d107DF4e3ccD761CbDc20182DB300dDC0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update State214677472024-12-23 21:04:355 hrs ago1734987875IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0031916218.96829258
Update State214677442024-12-23 21:03:595 hrs ago1734987839IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0030146118.22740048
Update State214645882024-12-23 10:28:1115 hrs ago1734949691IN
0xc3B2ec1d...DB300dDC0
0 ETH0.00101358.3007981
Update State214642832024-12-23 9:26:4716 hrs ago1734946007IN
0xc3B2ec1d...DB300dDC0
0 ETH0.00079166.34967331
Update State214614352024-12-22 23:52:4726 hrs ago1734911567IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000536624.39419693
Update State214611362024-12-22 22:52:2327 hrs ago1734907943IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000633265.07857026
Update State214611302024-12-22 22:51:1127 hrs ago1734907871IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000662785.42785289
Update State214576252024-12-22 11:05:2339 hrs ago1734865523IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000608044.97900402
Update State214546122024-12-22 0:59:472 days ago1734829187IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000716515.86784514
Update State214543132024-12-21 23:59:472 days ago1734825587IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000829266.65112565
Update State214543132024-12-21 23:59:472 days ago1734825587IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000829346.65112565
Update State214511152024-12-21 13:14:592 days ago1734786899IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000986487.91281039
Update State214511102024-12-21 13:13:592 days ago1734786839IN
0xc3B2ec1d...DB300dDC0
0 ETH0.00098297.88187896
Update State214480572024-12-21 2:59:112 days ago1734749951IN
0xc3B2ec1d...DB300dDC0
0 ETH0.001156138.42808
Update State214477622024-12-21 1:58:593 days ago1734746339IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000977587.84144673
Update State214477622024-12-21 1:58:593 days ago1734746339IN
0xc3B2ec1d...DB300dDC0
0 ETH0.001037657.84144673
Update State214446732024-12-20 15:37:593 days ago1734709079IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0045821736.0081188
Update State214446702024-12-20 15:37:233 days ago1734709043IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0045755435.33103743
Withdraw214425702024-12-20 8:34:353 days ago1734683675IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0018277517.95309165
Withdraw214425692024-12-20 8:34:233 days ago1734683663IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0017150716.84433304
Withdraw214425672024-12-20 8:33:593 days ago1734683639IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0015209417.95285118
Update State214417142024-12-20 5:42:113 days ago1734673331IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0013378210.51304644
Update State214417142024-12-20 5:42:113 days ago1734673331IN
0xc3B2ec1d...DB300dDC0
0 ETH0.0014691910.51304644
Update State214414152024-12-20 4:42:113 days ago1734669731IN
0xc3B2ec1d...DB300dDC0
0 ETH0.000983697.88966389
Update State214391952024-12-19 21:16:474 days ago1734643007IN
0xc3B2ec1d...DB300dDC0
0 ETH0.003992732.69469511
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:
Proxy

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license
File 1 of 9 : Proxy.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.20;

import "starkware/solidity/upgrade/ProxyStorage.sol";
import "starkware/solidity/upgrade/StorageSlots.sol";
import "starkware/solidity/components/Roles.sol";
import "starkware/solidity/libraries/Addresses.sol";

/**
  The Proxy contract implements delegation of calls to other contracts (`implementations`), with
  proper forwarding of return values and revert reasons. This pattern allows retaining the contract
  storage while replacing implementation code.

  The following operations are supported by the proxy contract:

  - :sol:func:`addImplementation`: Defines a new implementation, the data with which it should be initialized and whether this will be the last version of implementation.
  - :sol:func:`upgradeTo`: Once an implementation is added, the governor may upgrade to that implementation only after a safety time period has passed (time lock), the current implementation is not the last version and the implementation is not frozen (see :sol:mod:`FullWithdrawals`).
  - :sol:func:`removeImplementation`: Any announced implementation may be removed. Removing an implementation is especially important once it has been used for an upgrade in order to avoid an additional unwanted revert to an older version.

  The only entity allowed to perform the above operations is the proxy governor
  (see :sol:mod:`ProxyGovernance`).

  Every implementation is required to have an `initialize` function that replaces the constructor
  of a normal contract. Furthermore, the only parameter of this function is an array of bytes
  (`data`) which may be decoded arbitrarily by the `initialize` function. It is up to the
  implementation to ensure that this function cannot be run more than once if so desired.

  When an implementation is added (:sol:func:`addImplementation`) the initialization `data` is also
  announced, allowing users of the contract to analyze the full effect of an upgrade to the new
  implementation. During an :sol:func:`upgradeTo`, the `data` is provided again and only if it is
  identical to the announced `data` is the upgrade performed by pointing the proxy to the new
  implementation and calling its `initialize` function with this `data`.

  ProxyStorage contains the storage variables required by the Proxy.
  The Proxy storage variables are not in the low slot addresses (a.k.a linear storage) - to avoid
  storage collision.
*/
contract Proxy is ProxyStorage, StorageSlots, Roles {
    // Emitted when the active implementation is replaced.
    event ImplementationUpgraded(address indexed implementation, bytes initializer);

    // Emitted when an implementation is submitted as an upgrade candidate and a time lock
    // is activated.
    event ImplementationAdded(address indexed implementation, bytes initializer, bool finalize);

    // Emitted when an implementation is removed from the list of upgrade candidates.
    event ImplementationRemoved(address indexed implementation, bytes initializer, bool finalize);

    // Emitted when the implementation is finalized.
    event FinalizedImplementation(address indexed implementation);

    using Addresses for address;

    uint256 public constant MAX_UPGRADE_DELAY = 180 days;

    string public constant PROXY_VERSION = "5.0.1";

    // Initialize Roles(false) so that we cannot renounce governance.
    constructor(uint256 upgradeActivationDelay) Roles(false) {
        setUpgradeActivationDelay(upgradeActivationDelay);
        setEnableWindowDuration(14 days);
    }

    /*
      Stores the upgrade activation delay (in seconds) in the appropriate slot.
      this function does not validate the delay value, as it's checked in the getter.
    */
    function setUpgradeActivationDelay(uint256 delayInSeconds) private {
        bytes32 slot = UPGRADE_DELAY_SLOT;
        assembly {
            sstore(slot, delayInSeconds)
        }
    }

    /*
      Reads the upgrade activation delay (in seconds) at the appropriate slot.
      The returned value is capped at MAX_UPGRADE_DELAY.
      It is safer to do the capping in the getter because an upgrade
      flow might modify this value without going through the setter function.
    */
    function getUpgradeActivationDelay() public view returns (uint256 delay) {
        bytes32 slot = UPGRADE_DELAY_SLOT;
        assembly {
            delay := sload(slot)
        }

        delay = (delay < MAX_UPGRADE_DELAY) ? delay : MAX_UPGRADE_DELAY;
        return delay;
    }

    function getEnableWindowDuration() public view returns (uint256 duration) {
        bytes32 slot = ENABLE_WINDOW_DURATION_SLOT;
        assembly {
            duration := sload(slot)
        }
    }

    function setEnableWindowDuration(uint256 durationInSeconds) private {
        bytes32 slot = ENABLE_WINDOW_DURATION_SLOT;
        assembly {
            sstore(slot, durationInSeconds)
        }
    }

    /*
      Returns the address of the current implementation.
    */
    // NOLINTNEXTLINE external-function.
    function implementation() public view returns (address _implementation) {
        bytes32 slot = IMPLEMENTATION_SLOT;
        assembly {
            _implementation := sload(slot)
        }
    }

    /*
      Returns true if the implementation is frozen.
      If the implementation was not assigned yet, returns false.
    */
    function implementationIsFrozen() private returns (bool) {
        address _implementation = implementation();

        // We can't call low level implementation before it's assigned. (i.e. ZERO).
        if (_implementation == address(0x0)) {
            return false;
        }

        // NOLINTNEXTLINE: low-level-calls.
        (bool success, bytes memory returndata) = _implementation.delegatecall(
            abi.encodeWithSignature("isFrozen()")
        );
        require(success, string(returndata));
        return abi.decode(returndata, (bool));
    }

    /*
      This method blocks delegation to initialize().
      Only upgradeTo should be able to delegate call to initialize().
    */
    function initialize(
        bytes calldata /*data*/
    ) external pure {
        revert("CANNOT_CALL_INITIALIZE");
    }

    modifier notFinalized() {
        require(isNotFinalized(), "IMPLEMENTATION_FINALIZED");
        _;
    }

    /*
      Forbids calling the function if the implementation is frozen.
      This modifier relies on the lower level (logical contract) implementation of isFrozen().
    */
    modifier notFrozen() {
        require(!implementationIsFrozen(), "STATE_IS_FROZEN");
        _;
    }

    /*
      This entry point serves only transactions with empty calldata. (i.e. pure value transfer tx).
      We don't expect to receive such, thus block them.
    */
    receive() external payable {
        revert("CONTRACT_NOT_EXPECTED_TO_RECEIVE");
    }

    /*
      Contract's default function. Delegates execution to the implementation contract.
      It returns back to the external caller whatever the implementation delegated code returns.
    */
    fallback() external payable {
        address _implementation = implementation();
        require(_implementation != address(0x0), "MISSING_IMPLEMENTATION");

        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 for now, as we don't know the out size yet.
            let result := delegatecall(gas(), _implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /*
      Sets the implementation address of the proxy.
    */
    function setImplementation(address newImplementation) private {
        bytes32 slot = IMPLEMENTATION_SLOT;
        assembly {
            sstore(slot, newImplementation)
        }
    }

    /*
      Returns true if the contract is not in the finalized state.
    */
    function isNotFinalized() public view returns (bool notFinal) {
        bytes32 slot = FINALIZED_STATE_SLOT;
        uint256 slotValue;
        assembly {
            slotValue := sload(slot)
        }
        notFinal = (slotValue == 0);
    }

    /*
      Marks the current implementation as finalized.
    */
    function setFinalizedFlag() private {
        bytes32 slot = FINALIZED_STATE_SLOT;
        assembly {
            sstore(slot, 0x1)
        }
    }

    /*
      Introduce an implementation and its initialization vector,
      and start the time-lock before it can be upgraded to.
      addImplementation is not blocked when frozen or finalized.
      (upgradeTo API is blocked when finalized or frozen).
    */
    function addImplementation(
        address newImplementation,
        bytes calldata data,
        bool finalize
    ) external onlyUpgradeGovernor {
        require(newImplementation.isContract(), "ADDRESS_NOT_CONTRACT");

        bytes32 implVectorHash = keccak256(abi.encode(newImplementation, data, finalize));

        uint256 activationTime = block.timestamp + getUpgradeActivationDelay();
        uint256 lastActivationTime = activationTime + getEnableWindowDuration();

        enabledTime()[implVectorHash] = activationTime;
        expirationTime()[implVectorHash] = lastActivationTime;
        emit ImplementationAdded(newImplementation, data, finalize);
    }

    /*
      Removes a candidate implementation.
      Note that it is possible to remove the current implementation. Doing so doesn't affect the
      current implementation, but rather revokes it as a future candidate.
    */
    function removeImplementation(
        address removedImplementation,
        bytes calldata data,
        bool finalize
    ) external onlyUpgradeGovernor {
        bytes32 implVectorHash = keccak256(abi.encode(removedImplementation, data, finalize));

        // If we have initializer, we set the hash of it.
        uint256 activationTime = enabledTime()[implVectorHash];
        require(activationTime > 0, "UNKNOWN_UPGRADE_INFORMATION");
        delete enabledTime()[implVectorHash];
        delete expirationTime()[implVectorHash];
        emit ImplementationRemoved(removedImplementation, data, finalize);
    }

    /*
      Upgrades the proxy to a new implementation, with its initialization.
      to upgrade successfully, implementation must have been added time-lock agreeably
      before, and the init vector must be identical ot the one submitted before.

      Upon assignment of new implementation address,
      its initialize will be called with the initializing vector (even if empty).
      Therefore, the implementation MUST must have such a method.

      Note - Initialization data is committed to in advance, therefore it must remain valid
      until the actual contract upgrade takes place.

      Care should be taken regarding initialization data and flow when planning the contract upgrade.

      When planning contract upgrade, special care is also needed with regard to governance
      (See comments in Governance.sol).
    */
    // NOLINTNEXTLINE: reentrancy-events timestamp.
    function upgradeTo(
        address newImplementation,
        bytes calldata data,
        bool finalize
    ) external payable onlyUpgradeGovernor notFinalized notFrozen {
        bytes32 implVectorHash = keccak256(abi.encode(newImplementation, data, finalize));
        uint256 activationTime = enabledTime()[implVectorHash];
        uint256 lastActivationTime = expirationTime()[implVectorHash];
        require(activationTime > 0, "UNKNOWN_UPGRADE_INFORMATION");
        require(newImplementation.isContract(), "ADDRESS_NOT_CONTRACT");

        // On the first time an implementation is set - time-lock should not be enforced.
        require(
            activationTime <= block.timestamp || implementation() == address(0x0),
            "UPGRADE_NOT_ENABLED_YET"
        );
        require(lastActivationTime >= block.timestamp, "IMPLEMENTATION_EXPIRED");

        setImplementation(newImplementation);

        // NOLINTNEXTLINE: low-level-calls controlled-delegatecall.
        (bool success, bytes memory returndata) = newImplementation.delegatecall(
            abi.encodeWithSelector(this.initialize.selector, data)
        );
        require(success, string(returndata));

        // Verify that the new implementation is not frozen post initialization.
        // NOLINTNEXTLINE: low-level-calls controlled-delegatecall.
        (success, returndata) = newImplementation.delegatecall(
            abi.encodeWithSignature("isFrozen()")
        );
        require(success, "CALL_TO_ISFROZEN_REVERTED");
        require(!abi.decode(returndata, (bool)), "NEW_IMPLEMENTATION_FROZEN");

        // Remove implementation activation entries.
        delete enabledTime()[implVectorHash];
        delete expirationTime()[implVectorHash];

        emit ImplementationUpgraded(newImplementation, data);

        if (finalize) {
            setFinalizedFlag();
            emit FinalizedImplementation(newImplementation);
        }
    }
}

File 2 of 9 : AccessControl.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: MIT
// Based on OpenZeppelin Contract (access/AccessControl.sol)
// StarkWare modification (storage slot, change to library).

pragma solidity ^0.8.0;

import "third_party/open_zeppelin/utils/Strings.sol";

/*
  Library module that allows using contracts to implement role-based access
  control mechanisms. This is a lightweight version that doesn't allow enumerating role
  members except through off-chain means by accessing the contract event logs. Some
  applications may benefit from on-chain enumerability, for those cases see
  {AccessControlEnumerable}.
 
  Roles are referred to by their `bytes32` identifier. These should be exposed
  in the external API and be unique. The best way to achieve this is by
  using `public constant` hash digests:
 
  ```
  bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
  ```
 
  Roles can be used to represent a set of permissions. To restrict access to a
  function call, use {hasRole}:
 
  ```
  function foo() public {
      require(hasRole(MY_ROLE, msg.sender));
      ...
  }
  ```
 
  Roles can be granted and revoked dynamically via the {grantRole} and
  {revokeRole} functions. Each role has an associated admin role, and only
  accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 
  By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
  that only accounts with this role will be able to grant or revoke other
  roles. More complex role relationships can be created by using
  {_setRoleAdmin}.
 
  WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
  grant and revoke this role. Extra precautions should be taken to secure
  accounts that have been granted it.
 
  OpenZeppelin implementation changed as following:
  1. Converted to library.
  2. Storage valiable {_roles} moved outside of linear storage,
     to avoid potential storage conflicts or corruption.
  3. Removed ERC165 support.
*/
library AccessControl {
    /*
      Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     
      `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
      {RoleAdminChanged} not being emitted signaling this.
     
      Available since v3.1.
    */
    event RoleAdminChanged(
        bytes32 indexed role,
        bytes32 indexed previousAdminRole,
        bytes32 indexed newAdminRole
    );

    /*
      Emitted when `account` is granted `role`.
     
      `sender` is the account that originated the contract call, an admin role
      bearer except when using {AccessControl-_setupRole}.
    */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /*
      Emitted when `account` is revoked `role`.
     
      `sender` is the account that originated the contract call:
        - if using `revokeRole`, it is the admin role bearer
        - if using `renounceRole`, it is the role bearer (i.e. `account`).
    */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    // Context interface functions.
    function _msgSender() internal view returns (address) {
        return msg.sender;
    }

    function _msgData() internal pure returns (bytes calldata) {
        return msg.data;
    }

    // The storage variable `_roles` is located away from the contract linear area (low storage addresses)
    // to prevent potential collision/corruption in upgrade scenario.
    // Slot = Web3.keccak(text="AccesControl_Storage_Slot").
    bytes32 constant rolesSlot = 0x53e43b954ba190a7e49386f1f78b01dcd9f628db23f432fa029a7dfd6d98e8fb;

    function _roles() private pure returns (mapping(bytes32 => RoleData) storage roles) {
        assembly {
            roles.slot := rolesSlot
        }
    }

    bytes32 constant DEFAULT_ADMIN_ROLE = 0x00;

    /*
      Modifier that checks that an account has a specific role. Reverts
      with a standardized message including the required role.
      
      The format of the revert reason is given by the following regular expression:
      
      /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
      
      Available since v4.1.
    */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /*
      Returns `true` if `account` has been granted `role`.
    */
    function hasRole(bytes32 role, address account) internal view returns (bool) {
        return _roles()[role].members[account];
    }

    /*
      Revert with a standard message if `_msgSender()` is missing `role`.
      Overriding this function changes the behavior of the {onlyRole} modifier.
     
      Format of the revert message is described in {_checkRole}.
     
      Available since v4.6.
    */
    function _checkRole(bytes32 role) internal view {
        _checkRole(role, _msgSender());
    }

    /*
      Revert with a standard message if `account` is missing `role`.
     
      The format of the revert reason is given by the following regular expression:
     
       /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/.
    */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /*
      Returns the admin role that controls `role`. See {grantRole} and
      {revokeRole}.
     
      To change a role's admin, use {_setRoleAdmin}.
    */
    function getRoleAdmin(bytes32 role) internal view returns (bytes32) {
        return _roles()[role].adminRole;
    }

    /*
      Grants `role` to `account`.
     
      If `account` had not been already granted `role`, emits a {RoleGranted}
      event.
     
      Requirements:
     
      - the caller must have ``role``'s admin role.
     
      May emit a {RoleGranted} event.
    */
    function grantRole(bytes32 role, address account) internal onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /*
      Revokes `role` from `account`.
     
      If `account` had been granted `role`, emits a {RoleRevoked} event.
     
      Requirements:
     
      - the caller must have ``role``'s admin role.
     
      * May emit a {RoleRevoked} event.
    */
    function revokeRole(bytes32 role, address account) internal onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /*
      Revokes `role` from the calling account.
     
      Roles are often managed via {grantRole} and {revokeRole}: this function's
      purpose is to provide a mechanism for accounts to lose their privileges
      if they are compromised (such as when a trusted device is misplaced).
     
      If the calling account had been revoked `role`, emits a {RoleRevoked}
      event.
     
      Requirements:
     
      - the caller must be `account`.
     
      May emit a {RoleRevoked} event.
    */
    function renounceRole(bytes32 role, address account) internal {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /*
      Grants `role` to `account`.
     
      If `account` had not been already granted `role`, emits a {RoleGranted}
      event. Note that unlike {grantRole}, this function doesn't perform any
      checks on the calling account.
     
      May emit a {RoleGranted} event.
     
      [WARNING]virtual
      ====
      This function should only be called from the constructor when setting
      up the initial roles for the system.
     
      Using this function in any other way is effectively circumventing the admin
      system imposed by {AccessControl}.
      ====
     
      NOTE: This function is deprecated in favor of {_grantRole}.
    */
    function _setupRole(bytes32 role, address account) internal {
        _grantRole(role, account);
    }

    /*
      Sets `adminRole` as ``role``'s admin role.
     
      Emits a {RoleAdminChanged} event.
    */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles()[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /*
      Grants `role` to `account`.
     
      Internal function without access restriction.
     
      May emit a {RoleGranted} event.
    */
    function _grantRole(bytes32 role, address account) internal {
        if (!hasRole(role, account)) {
            _roles()[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /*
      Revokes `role` from `account`.
     
      Internal function without access restriction.
     
      May emit a {RoleRevoked} event.
    */
    function _revokeRole(bytes32 role, address account) internal {
        if (hasRole(role, account)) {
            _roles()[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 9 : Addresses.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

/*
  Common Utility Libraries.
  I. Addresses (extending address).
*/
library Addresses {
    /*
      Note: isContract function has some known limitation.
      See https://github.com/OpenZeppelin/
      openzeppelin-contracts/blob/master/contracts/utils/Address.sol.
    */
    function isContract(address account) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    function performEthTransfer(address recipient, uint256 amount) internal {
        if (amount == 0) return;
        (bool success, ) = recipient.call{value: amount}(""); // NOLINT: low-level-calls.
        require(success, "ETH_TRANSFER_FAILED");
    }

    /*
      Safe wrapper around ERC20/ERC721 calls.
      This is required because many deployed ERC20 contracts don't return a value.
      See https://github.com/ethereum/solidity/issues/4116.
    */
    function safeTokenContractCall(address tokenAddress, bytes memory callData) internal {
        require(isContract(tokenAddress), "BAD_TOKEN_ADDRESS");
        // NOLINTNEXTLINE: low-level-calls.
        (bool success, bytes memory returndata) = tokenAddress.call(callData);
        require(success, string(returndata));

        if (returndata.length > 0) {
            require(abi.decode(returndata, (bool)), "TOKEN_OPERATION_FAILED");
        }
    }
}

File 4 of 9 : NamedStorage.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

/*
  Library to provide basic storage, in storage location out of the low linear address space.

  New types of storage variables should be added here upon need.
*/
library NamedStorage {
    function bytes32ToBoolMapping(string memory tag_)
        internal
        pure
        returns (mapping(bytes32 => bool) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function bytes32ToUint256Mapping(string memory tag_)
        internal
        pure
        returns (mapping(bytes32 => uint256) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function addressToUint256Mapping(string memory tag_)
        internal
        pure
        returns (mapping(address => uint256) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function bytes32ToAddressMapping(string memory tag_)
        internal
        pure
        returns (mapping(bytes32 => address) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function uintToAddressMapping(string memory tag_)
        internal
        pure
        returns (mapping(uint256 => address) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function addressToAddressMapping(string memory tag_)
        internal
        pure
        returns (mapping(address => address) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function addressToAddressListMapping(string memory tag_)
        internal
        pure
        returns (mapping(address => address[]) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function addressToBoolMapping(string memory tag_)
        internal
        pure
        returns (mapping(address => bool) storage randomVariable)
    {
        bytes32 location = keccak256(abi.encodePacked(tag_));
        assembly {
            randomVariable.slot := location
        }
    }

    function getUintValue(string memory tag_) internal view returns (uint256 retVal) {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            retVal := sload(slot)
        }
    }

    function setUintValue(string memory tag_, uint256 value) internal {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            sstore(slot, value)
        }
    }

    function setUintValueOnce(string memory tag_, uint256 value) internal {
        require(getUintValue(tag_) == 0, "ALREADY_SET");
        setUintValue(tag_, value);
    }

    function getAddressValue(string memory tag_) internal view returns (address retVal) {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            retVal := sload(slot)
        }
    }

    function setAddressValue(string memory tag_, address value) internal {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            sstore(slot, value)
        }
    }

    function setAddressValueOnce(string memory tag_, address value) internal {
        require(getAddressValue(tag_) == address(0x0), "ALREADY_SET");
        setAddressValue(tag_, value);
    }

    function getBoolValue(string memory tag_) internal view returns (bool retVal) {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            retVal := sload(slot)
        }
    }

    function setBoolValue(string memory tag_, bool value) internal {
        bytes32 slot = keccak256(abi.encodePacked(tag_));
        assembly {
            sstore(slot, value)
        }
    }
}

File 5 of 9 : ProxyStorage.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

import "starkware/solidity/libraries/NamedStorage.sol";

/*
  Holds the Proxy-specific state variables.
  to prevent collision hazard.
*/
contract ProxyStorage {
    // Random storage slot tags.
    string constant ENABLED_TIME_TAG = "PROXY_5_ENABLED_TIME";
    string constant DISABLED_TIME_TAG = "PROXY_5_DISABLED_TIME";
    string constant INTIALIZED_TAG = "PROXY_5_INITIALIZED";

    // The time after which we can switch to the implementation.
    // Hash(implementation, data, finalize) => time.
    function enabledTime() internal pure returns (mapping(bytes32 => uint256) storage) {
        return NamedStorage.bytes32ToUint256Mapping(ENABLED_TIME_TAG);
    }

    // The time after which we can NO LONGER switch to the implementation.
    // Implementation is valid to switch in time t,  enableTime <= t  <= disableTime.
    // Hash(implementation, data, finalize) => time.
    function expirationTime() internal pure returns (mapping(bytes32 => uint256) storage) {
        return NamedStorage.bytes32ToUint256Mapping(DISABLED_TIME_TAG);
    }

    // A central storage of the flags whether implementation has been initialized.
    // Note - it can be used flexibly enough to accommodate multiple levels of initialization
    // (i.e. using different key salting schemes for different initialization levels).
    function initialized() internal pure returns (mapping(bytes32 => bool) storage) {
        return NamedStorage.bytes32ToBoolMapping(INTIALIZED_TAG);
    }
}

File 6 of 9 : Roles.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

import "starkware/solidity/libraries/RolesLib.sol";

abstract contract Roles {
    // This flag dermine if the GOVERNANCE_ADMIN role can be renounced.
    bool immutable fullyRenouncable;

    constructor(bool renounceable) {
        fullyRenouncable = renounceable;
        RolesLib.initialize();
    }

    // MODIFIERS.
    modifier onlyAppGovernor() {
        require(isAppGovernor(AccessControl._msgSender()), "ONLY_APP_GOVERNOR");
        _;
    }

    modifier onlyUpgradeGovernor() {
        require(isUpgradeGovernor(AccessControl._msgSender()), "ONLY_UPGRADE_GOVERNOR");
        _;
    }

    modifier notSelf(address account) {
        require(account != AccessControl._msgSender(), "CANNOT_PERFORM_ON_SELF");
        _;
    }

    // Is holding role.
    function isAppGovernor(address account) public view returns (bool) {
        return AccessControl.hasRole(APP_GOVERNOR, account);
    }

    function isAppRoleAdmin(address account) public view returns (bool) {
        return AccessControl.hasRole(APP_ROLE_ADMIN, account);
    }

    function isGovernanceAdmin(address account) public view returns (bool) {
        return AccessControl.hasRole(GOVERNANCE_ADMIN, account);
    }

    function isUpgradeGovernor(address account) public view returns (bool) {
        return AccessControl.hasRole(UPGRADE_GOVERNOR, account);
    }

    // Register Role.
    function registerAppGovernor(address account) external {
        AccessControl.grantRole(APP_GOVERNOR, account);
    }

    function registerAppRoleAdmin(address account) external {
        AccessControl.grantRole(APP_ROLE_ADMIN, account);
    }

    function registerGovernanceAdmin(address account) external {
        AccessControl.grantRole(GOVERNANCE_ADMIN, account);
    }

    function registerUpgradeGovernor(address account) external {
        AccessControl.grantRole(UPGRADE_GOVERNOR, account);
    }

    // Revoke Role.
    function revokeAppGovernor(address account) external {
        AccessControl.revokeRole(APP_GOVERNOR, account);
    }

    function revokeAppRoleAdmin(address account) external notSelf(account) {
        AccessControl.revokeRole(APP_ROLE_ADMIN, account);
    }

    function revokeGovernanceAdmin(address account) external notSelf(account) {
        AccessControl.revokeRole(GOVERNANCE_ADMIN, account);
    }

    function revokeUpgradeGovernor(address account) external {
        AccessControl.revokeRole(UPGRADE_GOVERNOR, account);
    }

    // Renounce Role.
    function renounceRole(bytes32 role, address account) external {
        if (role == GOVERNANCE_ADMIN && !fullyRenouncable) {
            revert("CANNOT_RENOUNCE_GOVERNANCE_ADMIN");
        }
        AccessControl.renounceRole(role, account);
    }
}

File 7 of 9 : RolesLib.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

import "starkware/solidity/libraries/AccessControl.sol";

// int.from_bytes(Web3.keccak(text="ROLE_APP_GOVERNOR"), "big") & MASK_250 .
bytes32 constant APP_GOVERNOR = bytes32(
    uint256(0xd2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de06068)
);

// int.from_bytes(Web3.keccak(text="ROLE_APP_ROLE_ADMIN"), "big") & MASK_250 .
bytes32 constant APP_ROLE_ADMIN = bytes32(
    uint256(0x03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee99)
);

// int.from_bytes(Web3.keccak(text="ROLE_GOVERNANCE_ADMIN"), "big") & MASK_250 .
bytes32 constant GOVERNANCE_ADMIN = bytes32(
    uint256(0x03711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846)
);

// int.from_bytes(Web3.keccak(text="ROLE_OPERATOR"), "big") & MASK_250 .
bytes32 constant OPERATOR = bytes32(
    uint256(0x023edb77f7c8cc9e38e8afe78954f703aeeda7fffe014eeb6e56ea84e62f6da7)
);

// int.from_bytes(Web3.keccak(text="ROLE_SECURITY_ADMIN"), "big") & MASK_250 .
bytes32 constant SECURITY_ADMIN = bytes32(
    uint256(0x026bd110619d11cfdfc28e281df893bc24828e89177318e9dbd860cdaedeb6b3)
);

// int.from_bytes(Web3.keccak(text="ROLE_SECURITY_AGENT"), "big") & MASK_250 .
bytes32 constant SECURITY_AGENT = bytes32(
    uint256(0x037693ba312785932d430dccf0f56ffedd0aa7c0f8b6da2cc4530c2717689b96)
);

// int.from_bytes(Web3.keccak(text="ROLE_TOKEN_ADMIN"), "big") & MASK_250 .
bytes32 constant TOKEN_ADMIN = bytes32(
    uint256(0x0128d63adbf6b09002c26caf55c47e2f26635807e3ef1b027218aa74c8d61a3e)
);

// int.from_bytes(Web3.keccak(text="ROLE_UPGRADE_GOVERNOR"), "big") & MASK_250 .
bytes32 constant UPGRADE_GOVERNOR = bytes32(
    uint256(0x0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228)
);

/*
  Role                |   Role Admin
  ----------------------------------------
  GOVERNANCE_ADMIN    |   GOVERNANCE_ADMIN
  UPGRADE_GOVERNOR    |   GOVERNANCE_ADMIN
  APP_ROLE_ADMIN      |   GOVERNANCE_ADMIN
  APP_GOVERNOR        |   APP_ROLE_ADMIN
  OPERATOR            |   APP_ROLE_ADMIN
  TOKEN_ADMIN         |   APP_ROLE_ADMIN
  SECURITY_ADMIN      |   SECURITY_ADMIN
  SECURITY_AGENT      |   SECURITY_ADMIN .
*/
library RolesLib {
    // INITIALIZERS.
    function governanceRolesInitialized() internal view returns (bool) {
        return AccessControl.getRoleAdmin(GOVERNANCE_ADMIN) != bytes32(0x00);
    }

    function securityRolesInitialized() internal view returns (bool) {
        return AccessControl.getRoleAdmin(SECURITY_ADMIN) != bytes32(0x00);
    }

    function initialize() internal {
        address provisional = AccessControl._msgSender();
        initialize(provisional, provisional);
    }

    function initialize(address provisionalGovernor, address provisionalSecAdmin) internal {
        if (governanceRolesInitialized()) {
            // Support Proxied contract initialization.
            // In case the Proxy already initialized the roles,
            // init will succeed IFF the provisionalGovernor is already `GovernanceAdmin`.
            require(
                AccessControl.hasRole(GOVERNANCE_ADMIN, provisionalGovernor),
                "ROLES_ALREADY_INITIALIZED"
            );
        } else {
            initGovernanceRoles(provisionalGovernor);
        }

        if (securityRolesInitialized()) {
            // If SecurityAdmin initialized,
            // then provisionalSecAdmin must already be a `SecurityAdmin`.
            // If it's not initilized - initialize it.
            require(
                AccessControl.hasRole(SECURITY_ADMIN, provisionalSecAdmin),
                "SECURITY_ROLES_ALREADY_INITIALIZED"
            );
        } else {
            initSecurityRoles(provisionalSecAdmin);
        }
    }

    function initSecurityRoles(address provisionalSecAdmin) private {
        AccessControl._setRoleAdmin(SECURITY_ADMIN, SECURITY_ADMIN);
        AccessControl._setRoleAdmin(SECURITY_AGENT, SECURITY_ADMIN);
        AccessControl._grantRole(SECURITY_ADMIN, provisionalSecAdmin);
    }

    function initGovernanceRoles(address provisionalGovernor) private {
        AccessControl._grantRole(GOVERNANCE_ADMIN, provisionalGovernor);
        AccessControl._setRoleAdmin(APP_GOVERNOR, APP_ROLE_ADMIN);
        AccessControl._setRoleAdmin(APP_ROLE_ADMIN, GOVERNANCE_ADMIN);
        AccessControl._setRoleAdmin(GOVERNANCE_ADMIN, GOVERNANCE_ADMIN);
        AccessControl._setRoleAdmin(OPERATOR, APP_ROLE_ADMIN);
        AccessControl._setRoleAdmin(TOKEN_ADMIN, APP_ROLE_ADMIN);
        AccessControl._setRoleAdmin(UPGRADE_GOVERNOR, GOVERNANCE_ADMIN);
    }
}

File 8 of 9 : StorageSlots.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity ^0.8.0;

/**
  StorageSlots holds the arbitrary storage slots used throughout the Proxy pattern.
  Storage address slots are a mechanism to define an arbitrary location, that will not be
  overlapped by the logical contracts.
*/
contract StorageSlots {
    // Storage slot with the address of the current implementation.
    // We need to keep this variable stored outside of the commonly used space,
    // so that it's not overrun by the logical implementation (the proxied contract).
    // Web3.keccak(text="StarkWare2019.implemntation-slot").
    bytes32 internal constant IMPLEMENTATION_SLOT =
        0x177667240aeeea7e35eabe3a35e18306f336219e1386f7710a6bf8783f761b24;

    // Storage slot with the address of the call-proxy current implementation.
    // We need to keep this variable stored outside of the commonly used space.
    // so that it's not overrun by the logical implementation (the proxied contract).
    // Web3.keccak(text="StarkWare2020.CallProxy.Implemntation.Slot").
    bytes32 internal constant CALL_PROXY_IMPL_SLOT =
        0x7184681641399eb4ad2fdb92114857ee6ff239f94ad635a1779978947b8843be;

    // This storage slot stores the finalization flag.
    // Once the value stored in this slot is set to non-zero
    // the proxy blocks implementation upgrades.
    // The current implementation is then referred to as Finalized.
    // Web3.keccak(text="StarkWare2019.finalization-flag-slot").
    bytes32 internal constant FINALIZED_STATE_SLOT =
        0x7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d2;

    // Storage slot to hold the upgrade delay (time-lock).
    // The intention of this slot is to allow modification using an EIC.
    // Web3.keccak(text="StarkWare.Upgradibility.Delay.Slot").
    bytes32 public constant UPGRADE_DELAY_SLOT =
        0xc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f;

    // Storage slot to hold the upgrade eanbled duration in seconds.
    // The intention of this slot is to allow modification using an EIC.
    // Web3.keccak(text="StarkWare.Upgradibility.EnableWindowDuration.Slot").
    bytes32 public constant ENABLE_WINDOW_DURATION_SLOT =
        0xb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc40590738;
}

File 9 of 9 : Strings.sol
/*
  Copyright 2019-2024 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

Settings
{
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {},
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"upgradeActivationDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"FinalizedImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"},{"indexed":false,"internalType":"bool","name":"finalize","type":"bool"}],"name":"ImplementationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"},{"indexed":false,"internalType":"bool","name":"finalize","type":"bool"}],"name":"ImplementationRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bytes","name":"initializer","type":"bytes"}],"name":"ImplementationUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ENABLE_WINDOW_DURATION_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UPGRADE_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROXY_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_DELAY_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"addImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getEnableWindowDuration","outputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUpgradeActivationDelay","outputs":[{"internalType":"uint256","name":"delay","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"_implementation","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAppGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAppRoleAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isGovernanceAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isNotFinalized","outputs":[{"internalType":"bool","name":"notFinal","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isUpgradeGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerAppGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerAppRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerGovernanceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"registerUpgradeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"removedImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"removeImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeAppGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeAppRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeGovernanceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeUpgradeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"finalize","type":"bool"}],"name":"upgradeTo","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a060405234801562000010575f80fd5b506040516200214938038062002149833981016040819052620000339162000550565b5f608081905262000043620000a0565b506200006d817fc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f55565b62000099621275007fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc4059073855565b5062000568565b33620000ad8180620000b0565b50565b620000ba6200020f565b1562000152576001600160a01b0382165f9081527fa5fdb349cc4ffac7e8ce7d3b075149d1bc847367d814e69a9beca89ef02db8b0602052604090205460ff166200014c5760405162461bcd60e51b815260206004820152601960248201527f524f4c45535f414c52454144595f494e495449414c495a45440000000000000060448201526064015b60405180910390fd5b6200015d565b6200015d8262000260565b62000167620003a3565b1562000204576001600160a01b0381165f9081527f2c11a1f9c63817dbb9f0faa966615764d2db5d6e008269e948a99e0b52181c23602052604090205460ff16620002005760405162461bcd60e51b815260206004820152602260248201527f53454355524954595f524f4c45535f414c52454144595f494e495449414c495a604482015261115160f21b606482015260840162000143565b5050565b6200020081620003f2565b5f80516020620020c98339815191525f9081525f80516020620021098339815191526020527fa5fdb349cc4ffac7e8ce7d3b075149d1bc847367d814e69a9beca89ef02db8b15481905b1415905090565b6200027a5f80516020620020c9833981519152826200045b565b620002b37ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de060685f8051602062002129833981519152620004f9565b620002db5f80516020620021298339815191525f80516020620020c9833981519152620004f9565b620002f55f80516020620020c983398151915280620004f9565b6200032f7f023edb77f7c8cc9e38e8afe78954f703aeeda7fffe014eeb6e56ea84e62f6da75f8051602062002129833981519152620004f9565b620003697f0128d63adbf6b09002c26caf55c47e2f26635807e3ef1b027218aa74c8d61a3e5f8051602062002129833981519152620004f9565b620000ad7f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec2285f80516020620020c9833981519152620004f9565b5f80516020620020e98339815191525f9081525f80516020620021098339815191526020527f2c11a1f9c63817dbb9f0faa966615764d2db5d6e008269e948a99e0b52181c2454819062000259565b6200040c5f80516020620020e983398151915280620004f9565b620004467f037693ba312785932d430dccf0f56ffedd0aa7c0f8b6da2cc4530c2717689b965f80516020620020e9833981519152620004f9565b620000ad5f80516020620020e9833981519152825b5f8281525f8051602062002109833981519152602090815260408083206001600160a01b038516845290915290205460ff1662000200575f8281525f8051602062002109833981519152602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b5f8281525f80516020620021098339815191526020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b5f6020828403121562000561575f80fd5b5051919050565b608051611b48620005815f395f6106950152611b485ff3fe608060405260043610610169575f3560e01c80637147855d116100d0578063cdd1f70d11610089578063e02904c611610063578063e02904c61461052a578063e907fa3c1461055d578063ed9ef16a14610591578063ee0e6807146105b0576101bb565b8063cdd1f70d146104d6578063d38d8d7a146104f5578063deec9c5a1461050b576101bb565b80637147855d1461041557806372a44f07146104285780638e5224ff1461043c5780639463629a1461045b578063c5ab84531461047a578063cb1cccce146104b7576101bb565b80635a5d1bb9116101225780635a5d1bb9146103375780635c60da1b146103665780635cef2e86146103995780635e3a97e7146103b85780636c04d9d5146103d75780636fc97cbf146103f6576101bb565b8063178963831461024257806320cea94d146102615780632f951985146102a757806336568abe146102c6578063439fab91146102e557806352b1e35e14610304576101bb565b366101bb5760405162461bcd60e51b815260206004820181905260248201527f434f4e54524143545f4e4f545f45585045435445445f544f5f5245434549564560448201526064015b60405180910390fd5b5f6101d15f80516020611af38339815191525490565b90506001600160a01b0381166102225760405162461bcd60e51b815260206004820152601660248201527526a4a9a9a4a723afa4a6a82622a6a2a72a20aa24a7a760511b60448201526064016101b2565b365f80375f80365f845af43d5f803e80801561023c573d5ff35b3d5ffd5b005b34801561024d575f80fd5b5061024061025c366004611735565b6105cf565b34801561026c575f80fd5b506102947fc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f81565b6040519081526020015b60405180910390f35b3480156102b2575f80fd5b506102406102c1366004611735565b6105fc565b3480156102d1575f80fd5b506102406102e036600461174e565b61067c565b3480156102f0575f80fd5b506102406102ff3660046117bd565b61070d565b34801561030f575f80fd5b506102947fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc4059073881565b348015610342575f80fd5b50610356610351366004611735565b61074e565b604051901515815260200161029e565b348015610371575f80fd5b505f80516020611af3833981519152546040516001600160a01b03909116815260200161029e565b3480156103a4575f80fd5b506102406103b3366004611809565b61077e565b3480156103c3575f80fd5b506102406103d2366004611809565b6108b8565b3480156103e2575f80fd5b506103566103f1366004611735565b610a27565b348015610401575f80fd5b50610240610410366004611735565b610a52565b610240610423366004611809565b610a7c565b348015610433575f80fd5b50610294611003565b348015610447575f80fd5b50610356610456366004611735565b611042565b348015610466575f80fd5b50610240610475366004611735565b61106d565b348015610485575f80fd5b506104aa60405180604001604052806005815260200164352e302e3160d81b81525081565b60405161029e919061188d565b3480156104c2575f80fd5b506103566104d1366004611735565b611084565b3480156104e1575f80fd5b506102406104f0366004611735565b61109c565b348015610500575f80fd5b5061029462ed4e0081565b348015610516575f80fd5b50610240610525366004611735565b6110c5565b348015610535575f80fd5b507fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc4059073854610294565b348015610568575f80fd5b507f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d25415610356565b34801561059c575f80fd5b506102406105ab366004611735565b6110ee565b3480156105bb575f80fd5b506102406105ca366004611735565b611118565b6105f97f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee9982611181565b50565b80336001600160a01b0382160361064e5760405162461bcd60e51b815260206004820152601660248201527521a0a72727aa2fa822a92327a926afa7a72fa9a2a62360511b60448201526064016101b2565b6106787f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee99836111b6565b5050565b5f80516020611ab3833981519152821480156106b657507f0000000000000000000000000000000000000000000000000000000000000000155b156107035760405162461bcd60e51b815260206004820181905260248201527f43414e4e4f545f52454e4f554e43455f474f5645524e414e43455f41444d494e60448201526064016101b2565b61067882826111e6565b60405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f43414c4c5f494e495449414c495a4560501b60448201526064016101b2565b5f6107787ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de0606883611260565b92915050565b61078733610a27565b6107a35760405162461bcd60e51b81526004016101b2906118bf565b5f848484846040516020016107bb9493929190611916565b6040516020818303038152906040528051906020012090505f6107dc611296565b5f838152602091909152604090205490508061083a5760405162461bcd60e51b815260206004820152601b60248201527f554e4b4e4f574e5f555047524144455f494e464f524d4154494f4e000000000060448201526064016101b2565b610842611296565b5f83815260209190915260408120556108596112d1565b5f8381526020019081526020015f205f9055856001600160a01b03167fe99b980b5259f200e4c1da973ff0251b6d9aaa144714c8773976ecd62b8ebe8d8686866040516108a89392919061194d565b60405180910390a2505050505050565b6108c133610a27565b6108dd5760405162461bcd60e51b81526004016101b2906118bf565b6001600160a01b0384163b61092b5760405162461bcd60e51b8152602060048201526014602482015273105111149154d4d7d393d517d0d3d395149050d560621b60448201526064016101b2565b5f848484846040516020016109439493929190611916565b6040516020818303038152906040528051906020012090505f610964611003565b61096e9042611986565b90505f6109997fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc405907385490565b6109a39083611986565b9050816109ae611296565b5f8581526020919091526040902055806109c66112d1565b5f8581526020019081526020015f2081905550866001600160a01b03167f723a7080d63c133cf338e44e00705cc1b7b2bde7e88d6218a8d62710a329ce1b878787604051610a169392919061194d565b60405180910390a250505050505050565b5f6107787f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec22883611260565b6105f97f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec22882611181565b610a8533610a27565b610aa15760405162461bcd60e51b81526004016101b2906118bf565b7f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d25415610b105760405162461bcd60e51b815260206004820152601860248201527f494d504c454d454e544154494f4e5f46494e414c495a4544000000000000000060448201526064016101b2565b610b18611308565b15610b575760405162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b60448201526064016101b2565b5f84848484604051602001610b6f9493929190611916565b6040516020818303038152906040528051906020012090505f610b90611296565b5f83815260209190915260408120549150610ba96112d1565b5f8481526020919091526040902054905081610c075760405162461bcd60e51b815260206004820152601b60248201527f554e4b4e4f574e5f555047524144455f494e464f524d4154494f4e000000000060448201526064016101b2565b6001600160a01b0387163b610c555760405162461bcd60e51b8152602060048201526014602482015273105111149154d4d7d393d517d0d3d395149050d560621b60448201526064016101b2565b4282111580610c8057505f610c755f80516020611af38339815191525490565b6001600160a01b0316145b610ccc5760405162461bcd60e51b815260206004820152601760248201527f555047524144455f4e4f545f454e41424c45445f59455400000000000000000060448201526064016101b2565b42811015610d155760405162461bcd60e51b815260206004820152601660248201527512535413115351539510551253d397d156141254915160521b60448201526064016101b2565b610d2a875f80516020611af383398151915255565b5f80886001600160a01b031663439fab9160e01b8989604051602401610d51929190611999565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610d8f91906119b4565b5f60405180830381855af49150503d805f8114610dc7576040519150601f19603f3d011682016040523d82523d5f602084013e610dcc565b606091505b5091509150818190610df15760405162461bcd60e51b81526004016101b2919061188d565b5060408051600481526024810182526020810180516001600160e01b03166333eeb14760e01b17905290516001600160a01b038b1691610e30916119b4565b5f60405180830381855af49150503d805f8114610e68576040519150601f19603f3d011682016040523d82523d5f602084013e610e6d565b606091505b50909250905081610ec05760405162461bcd60e51b815260206004820152601960248201527f43414c4c5f544f5f495346524f5a454e5f52455645525445440000000000000060448201526064016101b2565b80806020019051810190610ed491906119cf565b15610f215760405162461bcd60e51b815260206004820152601960248201527f4e45575f494d504c454d454e544154494f4e5f46524f5a454e0000000000000060448201526064016101b2565b610f29611296565b5f8681526020919091526040812055610f406112d1565b5f8681526020019081526020015f205f9055886001600160a01b03167fff14288d542bc1c1d15a652cb52af735f065c0c9d70b48e454a203c2607335448989604051610f8d929190611999565b60405180910390a28515610ff857610fc460017f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d255565b6040516001600160a01b038a16907fc13b75a5f14b69ebdc2431a5d475b3bff371abe251b5064144306fbd9c4de35c905f90a25b505050505050505050565b7fc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f80549062ed4e00821061103a5762ed4e0061103c565b815b91505090565b5f6107787f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee9983611260565b6105f95f80516020611ab383398151915282611181565b5f6107785f80516020611ab383398151915283611260565b6105f97ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de0606882611181565b6105f97ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de06068826111b6565b6105f97f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228826111b6565b80336001600160a01b0382160361116a5760405162461bcd60e51b815260206004820152601660248201527521a0a72727aa2fa822a92327a926afa7a72fa9a2a62360511b60448201526064016101b2565b6106785f80516020611ab3833981519152836111b6565b5f8281525f80516020611ad383398151915260205260409020600101546111a7816113f7565b6111b18383611401565b505050565b5f8281525f80516020611ad383398151915260205260409020600101546111dc816113f7565b6111b18383611475565b6001600160a01b03811633146112565760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016101b2565b6106788282611475565b5f9182525f80516020611ad3833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f6112cc6040518060400160405280601481526020017350524f58595f355f454e41424c45445f54494d4560601b8152506114e7565b905090565b5f6112cc6040518060400160405280601581526020017450524f58595f355f44495341424c45445f54494d4560581b8152506114e7565b5f8061131f5f80516020611af38339815191525490565b90506001600160a01b038116611336575f91505090565b60408051600481526024810182526020810180516001600160e01b03166333eeb14760e01b17905290515f9182916001600160a01b03851691611378916119b4565b5f60405180830381855af49150503d805f81146113b0576040519150601f19603f3d011682016040523d82523d5f602084013e6113b5565b606091505b50915091508181906113da5760405162461bcd60e51b81526004016101b2919061188d565b50808060200190518101906113ef91906119cf565b935050505090565b6105f98133611519565b61140b8282611260565b610678575f8281525f80516020611ad3833981519152602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b61147f8282611260565b15610678575f8281525f80516020611ad3833981519152602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f80826040516020016114fa91906119b4565b60408051601f1981840301815291905280516020909101209392505050565b6115238282611260565b6106785761153b816001600160a01b0316601461157d565b61154683602061157d565b6040516020016115579291906119ea565b60408051601f198184030181529082905262461bcd60e51b82526101b29160040161188d565b60605f61158b836002611a5e565b611596906002611986565b67ffffffffffffffff8111156115ae576115ae611a75565b6040519080825280601f01601f1916602001820160405280156115d8576020820181803683370190505b509050600360fc1b815f815181106115f2576115f2611a89565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061162057611620611a89565b60200101906001600160f81b03191690815f1a9053505f611642846002611a5e565b61164d906001611986565b90505b60018111156116c4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061168157611681611a89565b1a60f81b82828151811061169757611697611a89565b60200101906001600160f81b03191690815f1a90535060049490941c936116bd81611a9d565b9050611650565b5083156117135760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016101b2565b9392505050565b80356001600160a01b0381168114611730575f80fd5b919050565b5f60208284031215611745575f80fd5b6117138261171a565b5f806040838503121561175f575f80fd5b8235915061176f6020840161171a565b90509250929050565b5f8083601f840112611788575f80fd5b50813567ffffffffffffffff81111561179f575f80fd5b6020830191508360208285010111156117b6575f80fd5b9250929050565b5f80602083850312156117ce575f80fd5b823567ffffffffffffffff8111156117e4575f80fd5b6117f085828601611778565b90969095509350505050565b80151581146105f9575f80fd5b5f805f806060858703121561181c575f80fd5b6118258561171a565b9350602085013567ffffffffffffffff811115611840575f80fd5b61184c87828801611778565b9094509250506040850135611860816117fc565b939692955090935050565b5f5b8381101561188557818101518382015260200161186d565b50505f910152565b602081525f82518060208401526118ab81604085016020870161186b565b601f01601f19169190910160400192915050565b60208082526015908201527427a7262cafaaa823a920a222afa3a7ab22a92727a960591b604082015260600190565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6001600160a01b03851681526060602082018190525f9061193a90830185876118ee565b9050821515604083015295945050505050565b604081525f6119606040830185876118ee565b90508215156020830152949350505050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561077857610778611972565b602081525f6119ac6020830184866118ee565b949350505050565b5f82516119c581846020870161186b565b9190910192915050565b5f602082840312156119df575f80fd5b8151611713816117fc565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351611a2181601785016020880161186b565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611a5281602884016020880161186b565b01602801949350505050565b808202811582820484141761077857610778611972565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81611aab57611aab611972565b505f19019056fe03711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c84184653e43b954ba190a7e49386f1f78b01dcd9f628db23f432fa029a7dfd6d98e8fb177667240aeeea7e35eabe3a35e18306f336219e1386f7710a6bf8783f761b24a2646970667358221220dca08f97999ee9587ebdb7e3e91e743c1b9c5202db419d33657316ee32cd0d8364736f6c6343000814003303711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846026bd110619d11cfdfc28e281df893bc24828e89177318e9dbd860cdaedeb6b353e43b954ba190a7e49386f1f78b01dcd9f628db23f432fa029a7dfd6d98e8fb03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee990000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405260043610610169575f3560e01c80637147855d116100d0578063cdd1f70d11610089578063e02904c611610063578063e02904c61461052a578063e907fa3c1461055d578063ed9ef16a14610591578063ee0e6807146105b0576101bb565b8063cdd1f70d146104d6578063d38d8d7a146104f5578063deec9c5a1461050b576101bb565b80637147855d1461041557806372a44f07146104285780638e5224ff1461043c5780639463629a1461045b578063c5ab84531461047a578063cb1cccce146104b7576101bb565b80635a5d1bb9116101225780635a5d1bb9146103375780635c60da1b146103665780635cef2e86146103995780635e3a97e7146103b85780636c04d9d5146103d75780636fc97cbf146103f6576101bb565b8063178963831461024257806320cea94d146102615780632f951985146102a757806336568abe146102c6578063439fab91146102e557806352b1e35e14610304576101bb565b366101bb5760405162461bcd60e51b815260206004820181905260248201527f434f4e54524143545f4e4f545f45585045435445445f544f5f5245434549564560448201526064015b60405180910390fd5b5f6101d15f80516020611af38339815191525490565b90506001600160a01b0381166102225760405162461bcd60e51b815260206004820152601660248201527526a4a9a9a4a723afa4a6a82622a6a2a72a20aa24a7a760511b60448201526064016101b2565b365f80375f80365f845af43d5f803e80801561023c573d5ff35b3d5ffd5b005b34801561024d575f80fd5b5061024061025c366004611735565b6105cf565b34801561026c575f80fd5b506102947fc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f81565b6040519081526020015b60405180910390f35b3480156102b2575f80fd5b506102406102c1366004611735565b6105fc565b3480156102d1575f80fd5b506102406102e036600461174e565b61067c565b3480156102f0575f80fd5b506102406102ff3660046117bd565b61070d565b34801561030f575f80fd5b506102947fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc4059073881565b348015610342575f80fd5b50610356610351366004611735565b61074e565b604051901515815260200161029e565b348015610371575f80fd5b505f80516020611af3833981519152546040516001600160a01b03909116815260200161029e565b3480156103a4575f80fd5b506102406103b3366004611809565b61077e565b3480156103c3575f80fd5b506102406103d2366004611809565b6108b8565b3480156103e2575f80fd5b506103566103f1366004611735565b610a27565b348015610401575f80fd5b50610240610410366004611735565b610a52565b610240610423366004611809565b610a7c565b348015610433575f80fd5b50610294611003565b348015610447575f80fd5b50610356610456366004611735565b611042565b348015610466575f80fd5b50610240610475366004611735565b61106d565b348015610485575f80fd5b506104aa60405180604001604052806005815260200164352e302e3160d81b81525081565b60405161029e919061188d565b3480156104c2575f80fd5b506103566104d1366004611735565b611084565b3480156104e1575f80fd5b506102406104f0366004611735565b61109c565b348015610500575f80fd5b5061029462ed4e0081565b348015610516575f80fd5b50610240610525366004611735565b6110c5565b348015610535575f80fd5b507fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc4059073854610294565b348015610568575f80fd5b507f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d25415610356565b34801561059c575f80fd5b506102406105ab366004611735565b6110ee565b3480156105bb575f80fd5b506102406105ca366004611735565b611118565b6105f97f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee9982611181565b50565b80336001600160a01b0382160361064e5760405162461bcd60e51b815260206004820152601660248201527521a0a72727aa2fa822a92327a926afa7a72fa9a2a62360511b60448201526064016101b2565b6106787f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee99836111b6565b5050565b5f80516020611ab3833981519152821480156106b657507f0000000000000000000000000000000000000000000000000000000000000000155b156107035760405162461bcd60e51b815260206004820181905260248201527f43414e4e4f545f52454e4f554e43455f474f5645524e414e43455f41444d494e60448201526064016101b2565b61067882826111e6565b60405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f43414c4c5f494e495449414c495a4560501b60448201526064016101b2565b5f6107787ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de0606883611260565b92915050565b61078733610a27565b6107a35760405162461bcd60e51b81526004016101b2906118bf565b5f848484846040516020016107bb9493929190611916565b6040516020818303038152906040528051906020012090505f6107dc611296565b5f838152602091909152604090205490508061083a5760405162461bcd60e51b815260206004820152601b60248201527f554e4b4e4f574e5f555047524144455f494e464f524d4154494f4e000000000060448201526064016101b2565b610842611296565b5f83815260209190915260408120556108596112d1565b5f8381526020019081526020015f205f9055856001600160a01b03167fe99b980b5259f200e4c1da973ff0251b6d9aaa144714c8773976ecd62b8ebe8d8686866040516108a89392919061194d565b60405180910390a2505050505050565b6108c133610a27565b6108dd5760405162461bcd60e51b81526004016101b2906118bf565b6001600160a01b0384163b61092b5760405162461bcd60e51b8152602060048201526014602482015273105111149154d4d7d393d517d0d3d395149050d560621b60448201526064016101b2565b5f848484846040516020016109439493929190611916565b6040516020818303038152906040528051906020012090505f610964611003565b61096e9042611986565b90505f6109997fb00a6109e73dbe7bbf8d3f18fb9221d2d024dc2671e3d5ff02532ccc405907385490565b6109a39083611986565b9050816109ae611296565b5f8581526020919091526040902055806109c66112d1565b5f8581526020019081526020015f2081905550866001600160a01b03167f723a7080d63c133cf338e44e00705cc1b7b2bde7e88d6218a8d62710a329ce1b878787604051610a169392919061194d565b60405180910390a250505050505050565b5f6107787f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec22883611260565b6105f97f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec22882611181565b610a8533610a27565b610aa15760405162461bcd60e51b81526004016101b2906118bf565b7f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d25415610b105760405162461bcd60e51b815260206004820152601860248201527f494d504c454d454e544154494f4e5f46494e414c495a4544000000000000000060448201526064016101b2565b610b18611308565b15610b575760405162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b60448201526064016101b2565b5f84848484604051602001610b6f9493929190611916565b6040516020818303038152906040528051906020012090505f610b90611296565b5f83815260209190915260408120549150610ba96112d1565b5f8481526020919091526040902054905081610c075760405162461bcd60e51b815260206004820152601b60248201527f554e4b4e4f574e5f555047524144455f494e464f524d4154494f4e000000000060448201526064016101b2565b6001600160a01b0387163b610c555760405162461bcd60e51b8152602060048201526014602482015273105111149154d4d7d393d517d0d3d395149050d560621b60448201526064016101b2565b4282111580610c8057505f610c755f80516020611af38339815191525490565b6001600160a01b0316145b610ccc5760405162461bcd60e51b815260206004820152601760248201527f555047524144455f4e4f545f454e41424c45445f59455400000000000000000060448201526064016101b2565b42811015610d155760405162461bcd60e51b815260206004820152601660248201527512535413115351539510551253d397d156141254915160521b60448201526064016101b2565b610d2a875f80516020611af383398151915255565b5f80886001600160a01b031663439fab9160e01b8989604051602401610d51929190611999565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051610d8f91906119b4565b5f60405180830381855af49150503d805f8114610dc7576040519150601f19603f3d011682016040523d82523d5f602084013e610dcc565b606091505b5091509150818190610df15760405162461bcd60e51b81526004016101b2919061188d565b5060408051600481526024810182526020810180516001600160e01b03166333eeb14760e01b17905290516001600160a01b038b1691610e30916119b4565b5f60405180830381855af49150503d805f8114610e68576040519150601f19603f3d011682016040523d82523d5f602084013e610e6d565b606091505b50909250905081610ec05760405162461bcd60e51b815260206004820152601960248201527f43414c4c5f544f5f495346524f5a454e5f52455645525445440000000000000060448201526064016101b2565b80806020019051810190610ed491906119cf565b15610f215760405162461bcd60e51b815260206004820152601960248201527f4e45575f494d504c454d454e544154494f4e5f46524f5a454e0000000000000060448201526064016101b2565b610f29611296565b5f8681526020919091526040812055610f406112d1565b5f8681526020019081526020015f205f9055886001600160a01b03167fff14288d542bc1c1d15a652cb52af735f065c0c9d70b48e454a203c2607335448989604051610f8d929190611999565b60405180910390a28515610ff857610fc460017f7d433c6f837e8f93009937c466c82efbb5ba621fae36886d0cac433c5d0aa7d255565b6040516001600160a01b038a16907fc13b75a5f14b69ebdc2431a5d475b3bff371abe251b5064144306fbd9c4de35c905f90a25b505050505050505050565b7fc21dbb3089fcb2c4f4c6a67854ab4db2b0f233ea4b21b21f912d52d18fc5db1f80549062ed4e00821061103a5762ed4e0061103c565b815b91505090565b5f6107787f03e615638e0b79444a70f8c695bf8f2a47033bf1cf95691ec3130f64939cee9983611260565b6105f95f80516020611ab383398151915282611181565b5f6107785f80516020611ab383398151915283611260565b6105f97ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de0606882611181565b6105f97ed2ead78c620e94b02d0a996e99298c59ddccfa1d8a0149080ac3a20de06068826111b6565b6105f97f0251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228826111b6565b80336001600160a01b0382160361116a5760405162461bcd60e51b815260206004820152601660248201527521a0a72727aa2fa822a92327a926afa7a72fa9a2a62360511b60448201526064016101b2565b6106785f80516020611ab3833981519152836111b6565b5f8281525f80516020611ad383398151915260205260409020600101546111a7816113f7565b6111b18383611401565b505050565b5f8281525f80516020611ad383398151915260205260409020600101546111dc816113f7565b6111b18383611475565b6001600160a01b03811633146112565760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016101b2565b6106788282611475565b5f9182525f80516020611ad3833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f6112cc6040518060400160405280601481526020017350524f58595f355f454e41424c45445f54494d4560601b8152506114e7565b905090565b5f6112cc6040518060400160405280601581526020017450524f58595f355f44495341424c45445f54494d4560581b8152506114e7565b5f8061131f5f80516020611af38339815191525490565b90506001600160a01b038116611336575f91505090565b60408051600481526024810182526020810180516001600160e01b03166333eeb14760e01b17905290515f9182916001600160a01b03851691611378916119b4565b5f60405180830381855af49150503d805f81146113b0576040519150601f19603f3d011682016040523d82523d5f602084013e6113b5565b606091505b50915091508181906113da5760405162461bcd60e51b81526004016101b2919061188d565b50808060200190518101906113ef91906119cf565b935050505090565b6105f98133611519565b61140b8282611260565b610678575f8281525f80516020611ad3833981519152602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b61147f8282611260565b15610678575f8281525f80516020611ad3833981519152602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f80826040516020016114fa91906119b4565b60408051601f1981840301815291905280516020909101209392505050565b6115238282611260565b6106785761153b816001600160a01b0316601461157d565b61154683602061157d565b6040516020016115579291906119ea565b60408051601f198184030181529082905262461bcd60e51b82526101b29160040161188d565b60605f61158b836002611a5e565b611596906002611986565b67ffffffffffffffff8111156115ae576115ae611a75565b6040519080825280601f01601f1916602001820160405280156115d8576020820181803683370190505b509050600360fc1b815f815181106115f2576115f2611a89565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061162057611620611a89565b60200101906001600160f81b03191690815f1a9053505f611642846002611a5e565b61164d906001611986565b90505b60018111156116c4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061168157611681611a89565b1a60f81b82828151811061169757611697611a89565b60200101906001600160f81b03191690815f1a90535060049490941c936116bd81611a9d565b9050611650565b5083156117135760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016101b2565b9392505050565b80356001600160a01b0381168114611730575f80fd5b919050565b5f60208284031215611745575f80fd5b6117138261171a565b5f806040838503121561175f575f80fd5b8235915061176f6020840161171a565b90509250929050565b5f8083601f840112611788575f80fd5b50813567ffffffffffffffff81111561179f575f80fd5b6020830191508360208285010111156117b6575f80fd5b9250929050565b5f80602083850312156117ce575f80fd5b823567ffffffffffffffff8111156117e4575f80fd5b6117f085828601611778565b90969095509350505050565b80151581146105f9575f80fd5b5f805f806060858703121561181c575f80fd5b6118258561171a565b9350602085013567ffffffffffffffff811115611840575f80fd5b61184c87828801611778565b9094509250506040850135611860816117fc565b939692955090935050565b5f5b8381101561188557818101518382015260200161186d565b50505f910152565b602081525f82518060208401526118ab81604085016020870161186b565b601f01601f19169190910160400192915050565b60208082526015908201527427a7262cafaaa823a920a222afa3a7ab22a92727a960591b604082015260600190565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b6001600160a01b03851681526060602082018190525f9061193a90830185876118ee565b9050821515604083015295945050505050565b604081525f6119606040830185876118ee565b90508215156020830152949350505050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561077857610778611972565b602081525f6119ac6020830184866118ee565b949350505050565b5f82516119c581846020870161186b565b9190910192915050565b5f602082840312156119df575f80fd5b8151611713816117fc565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351611a2181601785016020880161186b565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611a5281602884016020880161186b565b01602801949350505050565b808202811582820484141761077857610778611972565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f81611aab57611aab611972565b505f19019056fe03711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c84184653e43b954ba190a7e49386f1f78b01dcd9f628db23f432fa029a7dfd6d98e8fb177667240aeeea7e35eabe3a35e18306f336219e1386f7710a6bf8783f761b24a2646970667358221220dca08f97999ee9587ebdb7e3e91e743c1b9c5202db419d33657316ee32cd0d8364736f6c63430008140033

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

0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : upgradeActivationDelay (uint256): 0

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


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.