ETH Price: $3,825.91 (-12.47%)

Contract

0x5a97B0B97197299456Af841F8605543b13b12eE3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Request Redeem235504672025-10-10 23:00:3513 mins ago1760137235IN
0x5a97B0B9...b13b12eE3
0 ETH0.0076057768.88974891
Request Redeem235497872025-10-10 20:43:352 hrs ago1760129015IN
0x5a97B0B9...b13b12eE3
0 ETH0.000074120.6715037
Request Redeem235496712025-10-10 20:20:232 hrs ago1760127623IN
0x5a97B0B9...b13b12eE3
0 ETH0.000187652.67067046
Request Redeem235494332025-10-10 19:32:233 hrs ago1760124743IN
0x5a97B0B9...b13b12eE3
0 ETH0.000983688.90978282
Request Redeem235491692025-10-10 18:39:114 hrs ago1760121551IN
0x5a97B0B9...b13b12eE3
0 ETH0.000218981.90142528
Request Redeem235490612025-10-10 18:17:234 hrs ago1760120243IN
0x5a97B0B9...b13b12eE3
0 ETH0.000363.26073675
Deposit235488442025-10-10 17:33:355 hrs ago1760117615IN
0x5a97B0B9...b13b12eE3
0 ETH0.000199782.60522901
Deposit235487972025-10-10 17:24:115 hrs ago1760117051IN
0x5a97B0B9...b13b12eE3
0 ETH0.000293953.8344294
Request Redeem235487562025-10-10 17:15:595 hrs ago1760116559IN
0x5a97B0B9...b13b12eE3
0 ETH0.000419263.7983689
Request Redeem235486352025-10-10 16:50:476 hrs ago1760115047IN
0x5a97B0B9...b13b12eE3
0 ETH0.00053434.83947023
Request Deposit235485672025-10-10 16:37:116 hrs ago1760114231IN
0x5a97B0B9...b13b12eE3
0 ETH0.000665155.11246864
Deposit235481922025-10-10 15:21:597 hrs ago1760109719IN
0x5a97B0B9...b13b12eE3
0 ETH0.000367784.79511559
Deposit235481592025-10-10 15:15:237 hrs ago1760109323IN
0x5a97B0B9...b13b12eE3
0 ETH0.000319544.16625486
Deposit235479462025-10-10 14:32:118 hrs ago1760106731IN
0x5a97B0B9...b13b12eE3
0 ETH0.000094031.22627673
Cancel Request D...235478752025-10-10 14:17:118 hrs ago1760105831IN
0x5a97B0B9...b13b12eE3
0 ETH0.000119251.36691143
Request Redeem235478612025-10-10 14:14:238 hrs ago1760105663IN
0x5a97B0B9...b13b12eE3
0 ETH0.000269182.4383901
Request Deposit235477952025-10-10 14:00:599 hrs ago1760104859IN
0x5a97B0B9...b13b12eE3
0 ETH0.000293592.2564449
Deposit235476402025-10-10 13:29:599 hrs ago1760102999IN
0x5a97B0B9...b13b12eE3
0 ETH0.000143431.87013964
Request Deposit235475562025-10-10 13:13:1110 hrs ago1760101991IN
0x5a97B0B9...b13b12eE3
0 ETH0.000042470.31489196
Request Deposit235475182025-10-10 13:05:3510 hrs ago1760101535IN
0x5a97B0B9...b13b12eE3
0 ETH0.000242561.86418281
Deposit235474712025-10-10 12:56:1110 hrs ago1760100971IN
0x5a97B0B9...b13b12eE3
0 ETH0.000060160.78454089
Deposit235474692025-10-10 12:55:4710 hrs ago1760100947IN
0x5a97B0B9...b13b12eE3
0 ETH0.000059050.77023975
Deposit235474142025-10-10 12:44:3510 hrs ago1760100275IN
0x5a97B0B9...b13b12eE3
0 ETH0.000056120.73194441
Deposit235474132025-10-10 12:44:2310 hrs ago1760100263IN
0x5a97B0B9...b13b12eE3
0 ETH0.000056050.73103333
Request Redeem235473542025-10-10 12:32:3510 hrs ago1760099555IN
0x5a97B0B9...b13b12eE3
0 ETH0.000023110.20937234
View all transactions

Latest 3 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x60806040231802222025-08-20 5:32:5951 days ago1755667979
0x5a97B0B9...b13b12eE3
 Contract Creation0 ETH
0x60806040231802222025-08-20 5:32:5951 days ago1755667979
0x5a97B0B9...b13b12eE3
 Contract Creation0 ETH
0x60c06040231802222025-08-20 5:32:5951 days ago1755667979  Contract Creation0 ETH
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x5fA00313...7d2C892e8
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
OptinProxy

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 1 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";

import {LogicRegistry} from "../protocol-v2/LogicRegistry.sol";

import {
    ERC1967Utils,
    ITransparentUpgradeableProxy,
    TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import {IERC1967} from "@openzeppelin/contracts/interfaces/IERC1967.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

import {DelayProxyAdmin} from "./DelayProxyAdmin.sol";

/**
 * @dev This contract implements a proxy that is upgradeable through an associated {DelayProxyAdmin} instance.
 *
 * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
 * clashing], which can potentially be used in an attack, this contract uses the
 * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
 * things that go hand in hand:
 *
 * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
 * that call matches the {ITransparentUpgradeableProxy-upgradeToAndCall} function exposed by the proxy itself.
 * 2. If the admin calls the proxy, it can call the `upgradeToAndCall` function but any other call won't be forwarded to
 * the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating
 * the proxy admin cannot fallback to the target implementation.
 *
 * These properties mean that the admin account can only be used for upgrading the proxy, so it's best if it's a
 * dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to
 * call a function from the proxy implementation. For this reason, the proxy deploys an instance of {ProxyAdmin} and
 * allows upgrades only if they come through it. You should think of the `ProxyAdmin` instance as the administrative
 * interface of the proxy, including the ability to change who can trigger upgrades by transferring ownership.
 *
 * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not
 * inherit from that interface, and instead `upgradeToAndCall` is implicitly implemented using a custom dispatch
 * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to
 * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the
 * implementation.
 *
 * NOTE: This proxy does not inherit from {Context} deliberately. The {DelayProxyAdmin} of this contract won't send a
 * meta-transaction in any way, and any other meta-transaction setup should be made in the implementation contract.
 *
 * IMPORTANT: This contract avoids unnecessary storage reads by setting the admin only during construction as an
 * immutable variable, preventing any changes thereafter. However, the admin slot defined in ERC-1967 can still be
 * overwritten by the implementation logic pointed to by this proxy. In such cases, the contract may end up in an
 * undesirable state where the admin slot is different from the actual admin.
 *
 * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the
 * compiler will not check that there are no selector conflicts, due to the note above. A selector clash between any new
 * function and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This
 * could render the `upgradeToAndCall` function inaccessible, preventing upgradeability and compromising transparency.
 */

/// @title OptinProxy
/// @notice A transparent upgradeable proxy that allows opting into logic upgrades through a registry
/// @dev Extends TransparentUpgradeableProxy with additional logic verification through a registry
/// @custom:contact [email protected]
contract OptinProxy is ERC1967Proxy {
    // An immutable address for the admin to avoid unnecessary SLOADs before each call
    // at the expense of removing the ability to change the admin once it's set.
    // This is acceptable if the admin is always a ProxyAdmin instance or similar contract
    // with its own ability to transfer the permissions to another account.
    address private immutable _admin;

    /// @notice The immutable logic registry contract that governs which logic implementations can be used
    LogicRegistry public immutable REGISTRY;

    ///@notice The proxy caller is the current admin, and can't fallback to the proxy target.
    error ProxyDeniedAdminAccess();

    /// @notice Error thrown when an unauthorized logic update is attempted
    error UpdateNotAllowed();

    /// @notice Constructs the OptinProxy contract
    /// @dev Initializes the proxy with logic, registry, admin and initialization data
    /// @param _logic The initial logic implementation address (can be zero to use registry's default)
    /// @param _logicRegistry The address of the logic registry contract
    /// @param _initialOwner The initial owner/admin of the proxy
    /// @param _initialDelay The initial delay before which an upgrade can occur by the proxy admin
    /// @param _data The initialization data to pass to the logic contract
    constructor(
        address _logic,
        address _logicRegistry,
        address _initialOwner,
        uint256 _initialDelay,
        bytes memory _data
    ) payable ERC1967Proxy(_logicAtConstruction(_logic, _logicRegistry), _data) {
        _admin = address(new DelayProxyAdmin(_initialOwner, _initialDelay));
        // Set the storage value and emit an event for ERC-1967 compatibility
        ERC1967Utils.changeAdmin(_proxyAdmin());

        REGISTRY = LogicRegistry(_logicRegistry);
    }

    /// @dev Returns the admin of this proxy.
    function _proxyAdmin() internal virtual returns (address) {
        return _admin;
    }

    /// @notice Determines the appropriate logic address to use at construction time
    /// @dev If _logic is zero, uses registry's default. Otherwise verifies the logic is allowed
    /// @param _logic The proposed logic implementation address
    /// @param _logicRegistry The registry contract to check against
    /// @return The validated logic implementation address
    function _logicAtConstruction(address _logic, address _logicRegistry) internal view returns (address) {
        if (_logic == address(0)) {
            return LogicRegistry(_logicRegistry).defaultLogic();
        }
        if (!LogicRegistry(_logicRegistry).canUseLogic(_implementation(), _logic)) revert UpdateNotAllowed();

        return _logic;
    }

    /// @notice Handles fallback calls to the proxy
    /// @dev If caller is admin, processes upgrade calls with registry verification. Otherwise forwards transparently.
    /// @custom:behavior When msg.sender is admin:
    ///   - Only upgradeToAndCall calls are allowed
    ///   - Verifies new implementation with registry before upgrading
    /// @custom:behavior When msg.sender is not admin:
    ///   - Forwards call transparently to current implementation
    function _fallback() internal virtual override {
        if (msg.sender == _proxyAdmin()) {
            if (msg.sig != ITransparentUpgradeableProxy.upgradeToAndCall.selector) {
                revert ProxyDeniedAdminAccess();
            } else {
                // equivalent to TransparentUpgradeableProxy.dispatchUpgradeToAndCall
                // with a check to the registry first.
                (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));
                if (!REGISTRY.canUseLogic(_implementation(), newImplementation)) {
                    revert UpdateNotAllowed();
                }
                ERC1967Utils.upgradeToAndCall(newImplementation, data);
            }
        } else {
            super._fallback();
        }
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";

import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";

/// @title LogicRegistry
/// @notice Abstract contract for managing whitelisted logic implementations and default logic
/// @dev Inherits from Ownable2StepUpgradeable to provide ownership functionality with 2-step transfer
/// @dev Implements ILogicRegistry interface for standard registry functions
/// @custom:contact [email protected]
abstract contract LogicRegistry is Ownable2StepUpgradeable {
    error LogicNotWhitelisted(address Logic);
    error CantRemoveDefaultLogic();

    event DefaultLogicUpdated(address previous, address newImpl);
    event LogicAdded(address Logic);
    event LogicRemoved(address Logic);

    /// @custom:storage-location erc7201:hopper.storage.LogicRegistry
    /// @notice Storage layout for the LogicRegistry contract
    struct LogicRegistryStorage {
        /// @notice Address of the default logic implementation
        address defaultLogic;
        /// @notice Mapping of logic addresses to their whitelist status
        mapping(address logic => bool) whitelist;
    }

    // Storage slot for LogicRegistryStorage
    // keccak256(abi.encode(uint256(keccak256("hopper.storage.LogicRegistry")) - 1)) & ~bytes32(uint256(0xff));
    bytes32 private constant logicRegistryStorage = 0x1f7af4bd0bb99469a9721ca3a846842162947039ac74427c73a74c47aae0d400;

    /// @notice Returns the storage struct at the predefined slot
    /// @dev Uses assembly to access storage at a specific slot
    /// @return $ The storage struct
    function _getLogicRegistryStorage() internal pure returns (LogicRegistryStorage storage $) {
        assembly {
            $.slot := logicRegistryStorage
        }
    }

    /// @notice Updates the default logic implementation
    /// @dev Only callable by owner. Automatically adds new logic to whitelist if not already present
    /// @param _newLogic Address of the new default logic implementation
    function updateDefaultLogic(
        address _newLogic
    ) public onlyOwner {
        if (!_getLogicRegistryStorage().whitelist[_newLogic]) {
            addLogic(_newLogic);
        }
        address previous = _getLogicRegistryStorage().defaultLogic;
        _getLogicRegistryStorage().defaultLogic = _newLogic;
        emit DefaultLogicUpdated(previous, _newLogic);
    }

    /// @notice Removes a logic implementation from the whitelist
    /// @dev Only callable by owner. Does not affect default logic if removed.
    /// @param _logic Address of the logic implementation to remove
    function removeLogic(
        address _logic
    ) public onlyOwner {
        if (_logic == _getLogicRegistryStorage().defaultLogic) {
            revert CantRemoveDefaultLogic();
        }
        _getLogicRegistryStorage().whitelist[_logic] = false;
        emit LogicRemoved(_logic);
    }

    /// @notice Adds a logic implementation to the whitelist
    /// @dev Only callable by owner
    /// @param _newLogic Address of the logic implementation to add
    function addLogic(
        address _newLogic
    ) public onlyOwner {
        _getLogicRegistryStorage().whitelist[_newLogic] = true;
        emit LogicAdded(_newLogic);
    }

    /// @notice Checks if a logic implementation can be used
    /// @dev Ignores the fromLogic parameter (present in interface) and only checks whitelist status for now
    /// @param fromLogic Previous logic implementation (unused in this implementation)
    /// @param logic Address of the logic implementation to check
    /// @return True if the logic is whitelisted, false otherwise
    function canUseLogic(address fromLogic, address logic) public view returns (bool) {
        if (owner() == address(0)) return true; // logic can always be used if the protocol renounceOwnership()
        return _getLogicRegistryStorage().whitelist[logic];
    }

    /// @notice Returns the current default logic implementation address
    /// @return Address of the default logic implementation
    function defaultLogic() external view returns (address) {
        return _getLogicRegistryStorage().defaultLogic;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/TransparentUpgradeableProxy.sol)

pragma solidity ^0.8.20;

import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";
import {ERC1967Proxy} from "../ERC1967/ERC1967Proxy.sol";
import {IERC1967} from "../../interfaces/IERC1967.sol";
import {ProxyAdmin} from "./ProxyAdmin.sol";

/**
 * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}
 * does not implement this interface directly, and its upgradeability mechanism is implemented by an internal dispatch
 * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not
 * include them in the ABI so this interface must be used to interact with it.
 */
interface ITransparentUpgradeableProxy is IERC1967 {
    function upgradeToAndCall(address, bytes calldata) external payable;
}

/**
 * @dev This contract implements a proxy that is upgradeable through an associated {ProxyAdmin} instance.
 *
 * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
 * clashing], which can potentially be used in an attack, this contract uses the
 * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
 * things that go hand in hand:
 *
 * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
 * that call matches the {ITransparentUpgradeableProxy-upgradeToAndCall} function exposed by the proxy itself.
 * 2. If the admin calls the proxy, it can call the `upgradeToAndCall` function but any other call won't be forwarded to
 * the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating
 * the proxy admin cannot fallback to the target implementation.
 *
 * These properties mean that the admin account can only be used for upgrading the proxy, so it's best if it's a
 * dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to
 * call a function from the proxy implementation. For this reason, the proxy deploys an instance of {ProxyAdmin} and
 * allows upgrades only if they come through it. You should think of the `ProxyAdmin` instance as the administrative
 * interface of the proxy, including the ability to change who can trigger upgrades by transferring ownership.
 *
 * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not
 * inherit from that interface, and instead `upgradeToAndCall` is implicitly implemented using a custom dispatch
 * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to
 * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the
 * implementation.
 *
 * NOTE: This proxy does not inherit from {Context} deliberately. The {ProxyAdmin} of this contract won't send a
 * meta-transaction in any way, and any other meta-transaction setup should be made in the implementation contract.
 *
 * IMPORTANT: This contract avoids unnecessary storage reads by setting the admin only during construction as an
 * immutable variable, preventing any changes thereafter. However, the admin slot defined in ERC-1967 can still be
 * overwritten by the implementation logic pointed to by this proxy. In such cases, the contract may end up in an
 * undesirable state where the admin slot is different from the actual admin.
 *
 * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the
 * compiler will not check that there are no selector conflicts, due to the note above. A selector clash between any new
 * function and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This
 * could render the `upgradeToAndCall` function inaccessible, preventing upgradeability and compromising transparency.
 */
contract TransparentUpgradeableProxy is ERC1967Proxy {
    // An immutable address for the admin to avoid unnecessary SLOADs before each call
    // at the expense of removing the ability to change the admin once it's set.
    // This is acceptable if the admin is always a ProxyAdmin instance or similar contract
    // with its own ability to transfer the permissions to another account.
    address private immutable _admin;

    /**
     * @dev The proxy caller is the current admin, and can't fallback to the proxy target.
     */
    error ProxyDeniedAdminAccess();

    /**
     * @dev Initializes an upgradeable proxy managed by an instance of a {ProxyAdmin} with an `initialOwner`,
     * backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in
     * {ERC1967Proxy-constructor}.
     */
    constructor(address _logic, address initialOwner, bytes memory _data) payable ERC1967Proxy(_logic, _data) {
        _admin = address(new ProxyAdmin(initialOwner));
        // Set the storage value and emit an event for ERC-1967 compatibility
        ERC1967Utils.changeAdmin(_proxyAdmin());
    }

    /**
     * @dev Returns the admin of this proxy.
     */
    function _proxyAdmin() internal virtual returns (address) {
        return _admin;
    }

    /**
     * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior.
     */
    function _fallback() internal virtual override {
        if (msg.sender == _proxyAdmin()) {
            if (msg.sig != ITransparentUpgradeableProxy.upgradeToAndCall.selector) {
                revert ProxyDeniedAdminAccess();
            } else {
                _dispatchUpgradeToAndCall();
            }
        } else {
            super._fallback();
        }
    }

    /**
     * @dev Upgrade the implementation of the proxy. See {ERC1967Utils-upgradeToAndCall}.
     *
     * Requirements:
     *
     * - If `data` is empty, `msg.value` must be zero.
     */
    function _dispatchUpgradeToAndCall() private {
        (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));
        ERC1967Utils.upgradeToAndCall(newImplementation, data);
    }
}

File 4 of 18 : IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Proxy.sol)

pragma solidity ^0.8.20;

import {Proxy} from "../Proxy.sol";
import {ERC1967Utils} from "./ERC1967Utils.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an
     * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.
     *
     * Requirements:
     *
     * - If `data` is empty, `msg.value` must be zero.
     */
    constructor(address implementation, bytes memory _data) payable {
        ERC1967Utils.upgradeToAndCall(implementation, _data);
    }

    /**
     * @dev Returns the current implementation address.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function _implementation() internal view virtual override returns (address) {
        return ERC1967Utils.getImplementation();
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity "0.8.26";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

/// @custom:contact [email protected]
contract DelayProxyAdmin is ProxyAdmin {
    ///@notice The `delay` period is not terminated
    error DelayIsNotOver();

    ///@notice The `new delay` must be above `minDelay`
    error DelayTooLow(uint256 minDelay);

    ///@notice The `new delay` must be under `maxDelay`
    error DelayTooHigh(uint256 maxDelay);

    ///@notice The implemenation to update to must the one submitted previously.
    error ImplenentationInconsistent(address expected);

    /// @notice The `newImplementation` address will be enforcable at `implementationUpdateTime`
    event ImplementationUpdateSubmited(address indexed newImplementation, uint256 implementationUpdateTime);

    /// @notice The `currentDelay` will be enforcable to `newDelay`  at `delayUpdateTime`
    event DelayUpdateSubmited(uint256 currentDelay, uint256 newDelay, uint256 delayUpdateTime);

    /// @notice The `currentDelay` will be replacable by a `newDelay` period at `delayUpdateTime`
    event DelayUpdated(uint256 newDelay, uint256 oldDelay);

    /// @notice The maximum delay before which the implementation and the delay can be upgraded
    uint256 public constant MAX_DELAY = 30 days;

    /// @notice The minimum delay before which the implementation and the delay can be upgraded
    uint256 public constant MIN_DELAY = 1 days;

    /// @notice The time at which upgradeAndCall is callable
    uint256 public implementationUpdateTime;

    /// @notice The new `implementation` enforced after `upgradeAndCall`
    address public newImplementation;

    /// @notice The time at which `updateDelay` is callable
    uint256 public delayUpdateTime;

    /// @notice The new `delay` enforced after `updateDelay`
    uint256 public newDelay;

    /// @notice The time to wait before upgradeAndCall and updateDelay can be call to enforce `implementation` and
    /// `newDelay` respectively
    uint256 public delay;

    /// @notice Initializes the DelayProxyAdmin contract
    /// @dev Sets up the contract with initial owner and delay parameters
    /// @param initialOwner The address that will own this contract
    /// @param initialDelay The initial delay period that must be waited before upgrades can be executed
    constructor(address initialOwner, uint256 initialDelay) ProxyAdmin(initialOwner) {
        if (initialDelay < MIN_DELAY) {
            revert DelayTooLow(MIN_DELAY);
        }
        if (initialDelay > MAX_DELAY) {
            revert DelayTooHigh(MAX_DELAY);
        }
        implementationUpdateTime = type(uint256).max;
        delayUpdateTime = type(uint256).max;
        delay = initialDelay;
        emit DelayUpdated(initialDelay, 0);
    }

    /// @notice Submits a new delay period for future enforcement
    /// @dev Starts the timelock period for the delay update
    /// @param _delay The new delay period to be enforced after the timelock
    ///
    /// Requirements:
    /// - Must be called by the owner
    /// - The _delay must be within MIN_DELAY and MAX_DELAY bounds
    function submitDelay(
        uint256 _delay
    ) external onlyOwner {
        if (_delay < MIN_DELAY) {
            revert DelayTooLow(MIN_DELAY);
        }
        if (_delay > MAX_DELAY) {
            revert DelayTooHigh(MAX_DELAY);
        }
        newDelay = _delay;
        delayUpdateTime = block.timestamp + delay;
        emit DelayUpdateSubmited(delay, newDelay, delayUpdateTime);
    }

    /// @notice Updates the delay period to the previously submitted new delay
    /// @dev Can only be called by the owner after the delay period has passed
    ///
    /// Requirements:
    /// - Must be called by the owner
    /// - The delayUpdateTime must have passed
    function updateDelay() external onlyOwner {
        if (block.timestamp < delayUpdateTime) {
            revert DelayIsNotOver();
        }
        emit DelayUpdated(newDelay, delay);
        delay = newDelay;
        newDelay = 0;
        delayUpdateTime = type(uint256).max;
    }

    /// @notice Submits a new implementation address for future enforcement
    /// @dev Starts the timelock period for the implementation upgrade
    /// @param _implementation The new implementation to be enforced after the timelock
    ///
    /// Requirements:
    /// - Must be called by the owner
    function submitImplementation(
        address _implementation
    ) external onlyOwner {
        newImplementation = _implementation;
        implementationUpdateTime = block.timestamp + delay;
        emit ImplementationUpdateSubmited(newImplementation, implementationUpdateTime);
    }

    /// @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation.
    /// See {TransparentUpgradeableProxy-_dispatchUpgradeToAndCall}.
    ///
    /// Requirements:
    ///
    /// - This contract must be the admin of `proxy`.
    /// - If `data` is empty, `msg.value` must be zero.
    function upgradeAndCall(
        ITransparentUpgradeableProxy proxy,
        address,
        bytes memory data
    ) public payable override onlyOwner {
        if (block.timestamp < implementationUpdateTime) {
            revert DelayIsNotOver();
        }
        proxy.upgradeToAndCall{value: msg.value}(newImplementation, data);
        newImplementation = address(0);
        implementationUpdateTime = type(uint256).max;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {OwnableUpgradeable} from "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable2Step
    struct Ownable2StepStorage {
        address _pendingOwner;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable2Step")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant Ownable2StepStorageLocation = 0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00;

    function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $) {
        assembly {
            $.slot := Ownable2StepStorageLocation
        }
    }

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    function __Ownable2Step_init() internal onlyInitializing {
    }

    function __Ownable2Step_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        Ownable2StepStorage storage $ = _getOwnable2StepStorage();
        return $._pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        Ownable2StepStorage storage $ = _getOwnable2StepStorage();
        $._pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        Ownable2StepStorage storage $ = _getOwnable2StepStorage();
        delete $._pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.20;

import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/ProxyAdmin.sol)

pragma solidity ^0.8.20;

import {ITransparentUpgradeableProxy} from "./TransparentUpgradeableProxy.sol";
import {Ownable} from "../../access/Ownable.sol";

/**
 * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an
 * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.
 */
contract ProxyAdmin is Ownable {
    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgrade(address)`
     * and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev Sets the initial owner who can perform upgrades.
     */
    constructor(address initialOwner) Ownable(initialOwner) {}

    /**
     * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation.
     * See {TransparentUpgradeableProxy-_dispatchUpgradeToAndCall}.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     * - If `data` is empty, `msg.value` must be zero.
     */
    function upgradeAndCall(
        ITransparentUpgradeableProxy proxy,
        address implementation,
        bytes memory data
    ) public payable virtual onlyOwner {
        proxy.upgradeToAndCall{value: msg.value}(implementation, data);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)

pragma solidity ^0.8.20;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        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 because we don't know the 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())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback
     * function and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable
    struct OwnableStorage {
        address _owner;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;

    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
        assembly {
            $.slot := OwnableStorageLocation
        }
    }

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    function __Ownable_init(address initialOwner) internal onlyInitializing {
        __Ownable_init_unchained(initialOwner);
    }

    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        OwnableStorage storage $ = _getOwnableStorage();
        return $._owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        OwnableStorage storage $ = _getOwnableStorage();
        address oldOwner = $._owner;
        $._owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

Settings
{
  "remappings": [
    "@openzeppelin-foundry-upgrades/=dependencies/openzeppelin-foundry-upgrades-0.4.0/src/",
    "@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.0.0/",
    "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.0.0/",
    "@src/=src/",
    "@test/=test/",
    "forge-safe/=dependencies/forge-safe/src/",
    "forge-std/=dependencies/forge-std-1.9.7/src/",
    "@openzeppelin-contracts-5.0.0/=dependencies/@openzeppelin-contracts-5.0.0/",
    "@openzeppelin-contracts-upgradeable-5.0.0/=dependencies/@openzeppelin-contracts-upgradeable-5.0.0/",
    "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std-1.9.7/=dependencies/forge-std-1.9.7/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-foundry-upgrades-0.4.0/=dependencies/openzeppelin-foundry-upgrades-0.4.0/src/",
    "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_logic","type":"address"},{"internalType":"address","name":"_logicRegistry","type":"address"},{"internalType":"address","name":"_initialOwner","type":"address"},{"internalType":"uint256","name":"_initialDelay","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"ERC1967InvalidAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"ProxyDeniedAdminAccess","type":"error"},{"inputs":[],"name":"UpdateNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"REGISTRY","outputs":[{"internalType":"contract LogicRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

0x60c060405260405161154038038061154083398101604081905261002291610490565b61002c85856100a8565b8161003782826101b8565b5050828260405161004790610454565b6001600160a01b0390921682526020820152604001604051809103905ff080158015610075573d5f803e3d5ffd5b506001600160a01b031660805261009361008e60805190565b610216565b5050506001600160a01b031660a052506105f7565b5f6001600160a01b03831661011e57816001600160a01b03166345f55b3c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610117919061057b565b90506101b2565b6001600160a01b03821663f3c665f7610135610262565b856040518363ffffffff1660e01b8152600401610153929190610594565b602060405180830381865afa15801561016e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061019291906105ae565b6101af5760405163474245d760e11b815260040160405180910390fd5b50815b92915050565b6101c18261027f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561020a5761020582826102e5565b505050565b610212610358565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61023f610379565b8260405161024e929190610594565b60405180910390a161025f81610398565b50565b5f61027a5f5f80516020611520833981519152610389565b905090565b806001600160a01b03163b5f036102b45780604051634c9c8ce360e01b81526004016102ab91906105cd565b60405180910390fd5b805f805160206115208339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b60605f80846001600160a01b03168460405161030191906105e1565b5f60405180830381855af49150503d805f8114610339576040519150601f19603f3d011682016040523d82523d5f602084013e61033e565b606091505b50909250905061034f8583836103d5565b95945050505050565b34156103775760405163b398979f60e01b815260040160405180910390fd5b565b5f5f805160206115008339815191525b546001600160a01b0316919050565b6001600160a01b0381166103c1575f604051633173bdd160e11b81526004016102ab91906105cd565b805f805160206115008339815191526102c4565b6060826103ea576103e58261042b565b610424565b815115801561040157506001600160a01b0384163b155b156104215783604051639996b31560e01b81526004016102ab91906105cd565b50805b9392505050565b80511561043b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b61095180610baf83390190565b80516001600160a01b0381168114610477575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f805f805f60a086880312156104a4575f80fd5b6104ad86610461565b94506104bb60208701610461565b93506104c960408701610461565b6060870151608088015191945092506001600160401b038111156104eb575f80fd5b8601601f810188136104fb575f80fd5b80516001600160401b038111156105145761051461047c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156105425761054261047c565b6040528181528282016020018a1015610559575f80fd5b8160208401602083015e5f602083830101528093505050509295509295909350565b5f6020828403121561058b575f80fd5b61042482610461565b6001600160a01b0392831681529116602082015260400190565b5f602082840312156105be575f80fd5b81518015158114610424575f80fd5b6001600160a01b0391909116815260200190565b5f82518060208501845e5f920191825250919050565b60805160a05161059361061c5f395f81816038015260f401525f607201526105935ff3fe60806040526004361061001d575f3560e01c806306433b1b14610027575b610025610070565b005b348015610032575f80fd5b5061005a7f000000000000000000000000000000000000000000000000000000000000000081565b60405161006791906103eb565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036101c2575f356001600160e01b03191663278f794360e11b146100d2576040516334ad5dbb60e21b815260040160405180910390fd5b5f806100e136600481846103ff565b8101906100ee919061043a565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f3c665f76101296101cc565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610173573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101979190610508565b6101b45760405163474245d760e11b815260040160405180910390fd5b6101be82826101f0565b5050565b6101ca61024a565b565b5f6101eb5f8051602061053e833981519152546001600160a01b031690565b905090565b6101f98261025a565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156102425761023d82826102bd565b505050565b6101be61032f565b6101ca6102556101cc565b61034e565b806001600160a01b03163b5f0361028f5780604051634c9c8ce360e01b815260040161028691906103eb565b60405180910390fd5b5f8051602061053e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102d99190610527565b5f60405180830381855af49150503d805f8114610311576040519150601f19603f3d011682016040523d82523d5f602084013e610316565b606091505b509150915061032685838361036c565b95945050505050565b34156101ca5760405163b398979f60e01b815260040160405180910390fd5b365f80375f80365f845af43d5f803e808015610368573d5ff35b3d5ffd5b6060826103815761037c826103c2565b6103bb565b815115801561039857506001600160a01b0384163b155b156103b85783604051639996b31560e01b815260040161028691906103eb565b50805b9392505050565b8051156103d25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0391909116815260200190565b5f808585111561040d575f80fd5b83861115610419575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561044b575f80fd5b82356001600160a01b0381168114610461575f80fd5b915060208301356001600160401b0381111561047b575f80fd5b8301601f8101851361048b575f80fd5b80356001600160401b038111156104a4576104a4610426565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104d2576104d2610426565b6040528181528282016020018710156104e9575f80fd5b816020840160208301375f602083830101528093505050509250929050565b5f60208284031215610518575f80fd5b815180151581146103bb575f80fd5b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122054a7e97969c29f5ce4c21e7feeef7fb958d11e31d8152e7ae4ea8a848a71848c64736f6c634300081a0033608060405234801561000f575f80fd5b5060405161095138038061095183398101604081905261002e91610158565b81806001600160a01b03811661005e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61006781610109565b5050620151808110156100925760405163013ccc8d60e01b8152620151806004820152602401610055565b62278d008111156100bb57604051630b94129b60e31b815262278d006004820152602401610055565b5f1960018190556003556005819055604080518281525f60208201527fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee910160405180910390a1505061018f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8060408385031215610169575f80fd5b82516001600160a01b038116811461017f575f80fd5b6020939093015192949293505050565b6107b58061019c5f395ff3fe6080604052600436106100b7575f3560e01c8063033f8dbc146100bb5780634125ff90146100e3578063432efade146100f9578063554f94db1461011a578063657081b31461012e5780636a42b8f81461014d578063715018a6146101625780638b677b03146101765780638da5cb5b146101a25780639623609d146101b65780639f81aed7146101c9578063a36f141c146101df578063ad3cb1cc146101f4578063f2fde38b14610231578063f6b12cf914610250575b5f80fd5b3480156100c6575f80fd5b506100d060045481565b6040519081526020015b60405180910390f35b3480156100ee575f80fd5b506100d062278d0081565b348015610104575f80fd5b506101186101133660046105a6565b610265565b005b348015610125575f80fd5b50610118610326565b348015610139575f80fd5b506101186101483660046105d1565b6103a8565b348015610158575f80fd5b506100d060055481565b34801561016d575f80fd5b50610118610420565b348015610181575f80fd5b50600254610195906001600160a01b031681565b6040516100da91906105f3565b3480156101ad575f80fd5b50610195610433565b6101186101c436600461061b565b610441565b3480156101d4575f80fd5b506100d06201518081565b3480156101ea575f80fd5b506100d060035481565b3480156101ff575f80fd5b50610224604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100da919061071d565b34801561023c575f80fd5b5061011861024b3660046105d1565b6104e8565b34801561025b575f80fd5b506100d060015481565b61026d610525565b6201518081101561029b5760405163013ccc8d60e01b81526201518060048201526024015b60405180910390fd5b62278d008111156102c457604051630b94129b60e31b815262278d006004820152602401610292565b60048190556005546102d6904261072f565b60038190556005546004546040805192835260208301919091528101919091527fab7d3921ca5710b1f874b995128f2d434b8b28080cc90e5b7ae542d01a41dd6e9060600160405180910390a150565b61032e610525565b60035442101561035157604051634040f3a760e01b815260040160405180910390fd5b7fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee60045460055460405161038f929190918252602082015260400190565b60405180910390a1600480546005555f90555f19600355565b6103b0610525565b600280546001600160a01b0319166001600160a01b0383161790556005546103d8904261072f565b60018190556002546040519182526001600160a01b0316907fb995d606597d17deae0e0b28f4668c00c67c22d7bed7b95db2a5ac7f1b96aa2b9060200160405180910390a250565b610428610525565b6104315f610557565b565b5f546001600160a01b031690565b610449610525565b60015442101561046c57604051634040f3a760e01b815260040160405180910390fd5b60025460405163278f794360e11b81526001600160a01b0380861692634f1ef2869234926104a09216908690600401610754565b5f604051808303818588803b1580156104b7575f80fd5b505af11580156104c9573d5f803e3d5ffd5b5050600280546001600160a01b031916905550505f1960015550505050565b6104f0610525565b6001600160a01b038116610519575f604051631e4fbdf760e01b815260040161029291906105f3565b61052281610557565b50565b3361052e610433565b6001600160a01b031614610431573360405163118cdaa760e01b815260040161029291906105f3565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156105b6575f80fd5b5035919050565b6001600160a01b0381168114610522575f80fd5b5f602082840312156105e1575f80fd5b81356105ec816105bd565b9392505050565b6001600160a01b0391909116815260200190565b634e487b7160e01b5f52604160045260245ffd5b5f805f6060848603121561062d575f80fd5b8335610638816105bd565b92506020840135610648816105bd565b915060408401356001600160401b03811115610662575f80fd5b8401601f81018613610672575f80fd5b80356001600160401b0381111561068b5761068b610607565b604051601f8201601f19908116603f011681016001600160401b03811182821017156106b9576106b9610607565b6040528181528282016020018810156106d0575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6105ec60208301846106ef565b8082018082111561074e57634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03831681526040602082018190525f90610777908301846106ef565b94935050505056fea2646970667358221220e27ebccd00d28ef8e1c57bfd0e4ffadef9ac6d95a3f3cc646f6f86755492f76564736f6c634300081a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006da4d1859ba1d02d095d2246142cdad52233e27c000000000000000000000000ccbb04e47d061fc050db6567e71d1aea2ec5a472000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002a4660b88ee00000000000000000000000000000000000000000000000000000000000000600000000000000000000000006da4d1859ba1d02d095d2246142cdad52233e27c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000f87e6bb0c67d731724f3c0c346f2dc64bf8b8513000000000000000000000000dd162d32feb5beeb3805a9edc9363c736db3e14f000000000000000000000000645344436dbc3e95a64736b6381699046c8242370000000000000000000000003ea6495b919d1e5fce8dcebb1ebd9bb9f3aa9c6c0000000000000000000000005b17e284cfe4520adc807554bb3aede5883a5325000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000194175746f6e6f6d6f7573204c697175696469747920506c7573000000000000000000000000000000000000000000000000000000000000000000000000000006616c70555344000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061001d575f3560e01c806306433b1b14610027575b610025610070565b005b348015610032575f80fd5b5061005a7f0000000000000000000000006da4d1859ba1d02d095d2246142cdad52233e27c81565b60405161006791906103eb565b60405180910390f35b7f000000000000000000000000403dd779455c45d380a9d084eb75fc737ef9c2126001600160a01b031633036101c2575f356001600160e01b03191663278f794360e11b146100d2576040516334ad5dbb60e21b815260040160405180910390fd5b5f806100e136600481846103ff565b8101906100ee919061043a565b915091507f0000000000000000000000006da4d1859ba1d02d095d2246142cdad52233e27c6001600160a01b031663f3c665f76101296101cc565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610173573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101979190610508565b6101b45760405163474245d760e11b815260040160405180910390fd5b6101be82826101f0565b5050565b6101ca61024a565b565b5f6101eb5f8051602061053e833981519152546001600160a01b031690565b905090565b6101f98261025a565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156102425761023d82826102bd565b505050565b6101be61032f565b6101ca6102556101cc565b61034e565b806001600160a01b03163b5f0361028f5780604051634c9c8ce360e01b815260040161028691906103eb565b60405180910390fd5b5f8051602061053e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102d99190610527565b5f60405180830381855af49150503d805f8114610311576040519150601f19603f3d011682016040523d82523d5f602084013e610316565b606091505b509150915061032685838361036c565b95945050505050565b34156101ca5760405163b398979f60e01b815260040160405180910390fd5b365f80375f80365f845af43d5f803e808015610368573d5ff35b3d5ffd5b6060826103815761037c826103c2565b6103bb565b815115801561039857506001600160a01b0384163b155b156103b85783604051639996b31560e01b815260040161028691906103eb565b50805b9392505050565b8051156103d25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0391909116815260200190565b5f808585111561040d575f80fd5b83861115610419575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561044b575f80fd5b82356001600160a01b0381168114610461575f80fd5b915060208301356001600160401b0381111561047b575f80fd5b8301601f8101851361048b575f80fd5b80356001600160401b038111156104a4576104a4610426565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104d2576104d2610426565b6040528181528282016020018710156104e9575f80fd5b816020840160208301375f602083830101528093505050509250929050565b5f60208284031215610518575f80fd5b815180151581146103bb575f80fd5b5f82518060208501845e5f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122054a7e97969c29f5ce4c21e7feeef7fb958d11e31d8152e7ae4ea8a848a71848c64736f6c634300081a0033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.