Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x67a5Aa90EFB317e0cA2c1A68abF5e67C1FB4822c
Balance 0.007705 ETH
Nonce 1
Code Size 1058 bytes
Proxy EIP-1967 Proxy Implementation: 0x684D162a...4160
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1058 bytes
0x6080604052600436106100435760003560e01c80633659cfe61461005a5780635c60da1b1461007a5780638f283970146100ab578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b50610050610075366004610395565b6100f2565b34801561008657600080fd5b5061008f610137565b6040516001600160a01b03909116815260200160405180910390f35b3480156100b757600080fd5b506100506100c6366004610395565b61017f565b3480156100d757600080fd5b5061008f6101c1565b6100f06100eb610204565b610246565b565b6100fa61026a565b6001600160a01b0316336001600160a01b03161461012b57604051637bfa4b9f60e01b815260040160405180910390fd5b6101348161029a565b50565b600061014161026a565b6001600160a01b0316336001600160a01b03161461017257604051637bfa4b9f60e01b815260040160405180910390fd5b61017a610204565b905090565b61018761026a565b6001600160a01b0316336001600160a01b0316146101b857604051637bfa4b9f60e01b815260040160405180910390fd5b61013481610315565b60006101cb61026a565b6001600160a01b0316336001600160a01b0316146101fc57604051637bfa4b9f60e01b815260040160405180910390fd5b61017a61026a565b600061023761023460017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6103c5565b90565b546001600160a01b0316919050565b3660008037600080366000845af43d6000803e808015610265573d6000f35b3d6000fd5b600061023761023460017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61046103c5565b806001600160a01b03163b6000036102c55760405163340aafcd60e11b815260040160405180910390fd5b806102f461023460017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6103c5565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0381166103665760405162461bcd60e51b815260206004820152601460248201527361646d696e203d207a65726f206164647265737360601b604482015260640160405180910390fd5b806102f461023460017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61046103c5565b6000602082840312156103a757600080fd5b81356001600160a01b03811681146103be57600080fd5b9392505050565b818103818111156103e657634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220206ce079f5f5eda25f623ace696e2a2a4aaa858c60bf7963a7837b96677bfb8a64736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: paris Optimization: Yes (200 runs)
TransparentProxy.sol 114 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;

import "@openzeppelin/contracts/proxy/Proxy.sol";

/// @title Contract used to deploy contracts via proxy
contract TransparentProxy is Proxy {

    // 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
    bytes32 private constant IMPLEMENTATION_SLOT = bytes32(uint(keccak256("eip1967.proxy.implementation")) - 1);
    // 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
    bytes32 private constant ADMIN_SLOT = bytes32(uint(keccak256("eip1967.proxy.admin")) - 1);

    error NotAdmin();
    error InvalidImplementation();

    constructor(address _impl) {
        _setImplementation(_impl);
        _setAdmin(msg.sender);
    }

    receive() external payable {
        _fallback();
    }

    /// @dev Indicates that the function can be called only by user who has Admin role.
    modifier onlyAdmin() {
        if (msg.sender != _getAdmin()) {
            revert NotAdmin();
        }
        _;
        
    }
     /**
     * @dev Changes the admin address. Only the current admin can call this function.
     * @param _admin The new admin address.
     */
    function changeAdmin(address _admin) external onlyAdmin {
        _setAdmin(_admin);
    }

    /**
     * @dev Upgrades the implementation to a new address. Only the current admin can call this function.
     * @param newImplementation The address of the new implementation.
     */
    function upgradeTo(address newImplementation) external onlyAdmin {
        _setImplementation(newImplementation);
    }

    /**
     * @dev Returns the current admin address.
     * @return The current admin address.
     */
    function admin() external onlyAdmin view returns (address) {
        return _getAdmin();
    }

    /**
     * @dev Returns the current implementation address.
     * @return The current implementation address.
     */
    function implementation() external onlyAdmin view returns (address) {
        return _implementation();
    }

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

    /**
     * @dev Returns the current admin address.
     * @return The current admin address.
     */
    function _getAdmin() private view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Sets the admin address.
     * @param _admin The new admin address.
     */
    function _setAdmin(address _admin) private {
        require(_admin != address(0), "admin = zero address");
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = _admin;
    }

    /**
     * @dev Sets the implementation address.
     * @param newImplementation The address of the new implementation.
     */
    function _setImplementation(address newImplementation) private {
        if(newImplementation.code.length == 0){
            revert InvalidImplementation();
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }
}

library StorageSlot {
    struct AddressSlot {
        address value;
    }

    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }
}
Proxy.sol 69 lines
// 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();
    }
}

Read Contract

admin 0xf851a440 → address
implementation 0x5c60da1b → address

Write Contract 2 functions

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

changeAdmin 0x8f283970
address _admin
upgradeTo 0x3659cfe6
address newImplementation

Recent Transactions

No transactions found for this address