false
false

Contract Address Details

0x715d99480b77a8d9d603638e593a539e21345fdf

Contract Name
ProxyAdmin
Creator
0x88888a–872063 at 0x36c245–4ff860
Balance
0 ETH ( )
Tokens
Fetching tokens...
Transactions
2 Transactions
Transfers
0 Transfers
Gas Used
95,244
Last Balance Update
78379510
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ProxyAdmin




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
100
Verified at
2023-08-24T12:54:51.254000Z

@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)

pragma solidity ^0.8.0;

import "./TransparentUpgradeableProxy.sol";
import "../../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 Returns the current implementation of `proxy`.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("implementation()")) == 0x5c60da1b
        (bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Returns the current admin of `proxy`.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("admin()")) == 0xf851a440
        (bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Changes the admin of `proxy` to `newAdmin`.
     *
     * Requirements:
     *
     * - This contract must be the current admin of `proxy`.
     */
    function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {
        proxy.changeAdmin(newAdmin);
    }

    /**
     * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {
        proxy.upgradeTo(implementation);
    }

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

@openzeppelin/contracts/utils/StorageSlot.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @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:
 * ```
 * 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(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

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

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

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

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

Contract ABI

[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeProxyAdmin","inputs":[{"type":"address","name":"proxy","internalType":"contract TransparentUpgradeableProxy"},{"type":"address","name":"newAdmin","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getProxyAdmin","inputs":[{"type":"address","name":"proxy","internalType":"contract TransparentUpgradeableProxy"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getProxyImplementation","inputs":[{"type":"address","name":"proxy","internalType":"contract TransparentUpgradeableProxy"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgrade","inputs":[{"type":"address","name":"proxy","internalType":"contract TransparentUpgradeableProxy"},{"type":"address","name":"implementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeAndCall","inputs":[{"type":"address","name":"proxy","internalType":"contract TransparentUpgradeableProxy"},{"type":"address","name":"implementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107408061007e6000396000f3fe60806040526004361061006b5760003560e01c8063204e1c7a14610070578063715018a6146100a65780637eff275e146100bd5780638da5cb5b146100dd5780639623609d146100f257806399a88ec414610105578063f2fde38b14610125578063f3b7dead14610145575b600080fd5b34801561007c57600080fd5b5061009061008b3660046104f6565b610165565b60405161009d919061051a565b60405180910390f35b3480156100b257600080fd5b506100bb6101f6565b005b3480156100c957600080fd5b506100bb6100d836600461052e565b61023a565b3480156100e957600080fd5b506100906102cb565b6100bb61010036600461057d565b6102da565b34801561011157600080fd5b506100bb61012036600461052e565b610370565b34801561013157600080fd5b506100bb6101403660046104f6565b6103cb565b34801561015157600080fd5b506100906101603660046104f6565b61046b565b6000806000836001600160a01b031660405161018b90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b5091509150816101da57600080fd5b808060200190518101906101ee9190610653565b949350505050565b336101ff6102cb565b6001600160a01b03161461022e5760405162461bcd60e51b815260040161022590610670565b60405180910390fd5b6102386000610491565b565b336102436102cb565b6001600160a01b0316146102695760405162461bcd60e51b815260040161022590610670565b6040516308f2839760e41b81526001600160a01b03831690638f2839709061029590849060040161051a565b600060405180830381600087803b1580156102af57600080fd5b505af11580156102c3573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031690565b336102e36102cb565b6001600160a01b0316146103095760405162461bcd60e51b815260040161022590610670565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061033990869086906004016106a5565b6000604051808303818588803b15801561035257600080fd5b505af1158015610366573d6000803e3d6000fd5b5050505050505050565b336103796102cb565b6001600160a01b03161461039f5760405162461bcd60e51b815260040161022590610670565b604051631b2ce7f360e11b81526001600160a01b03831690633659cfe69061029590849060040161051a565b336103d46102cb565b6001600160a01b0316146103fa5760405162461bcd60e51b815260040161022590610670565b6001600160a01b03811661045f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610225565b61046881610491565b50565b6000806000836001600160a01b031660405161018b906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461046857600080fd5b60006020828403121561050857600080fd5b8135610513816104e1565b9392505050565b6001600160a01b0391909116815260200190565b6000806040838503121561054157600080fd5b823561054c816104e1565b9150602083013561055c816104e1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561059257600080fd5b833561059d816104e1565b925060208401356105ad816104e1565b9150604084013567ffffffffffffffff808211156105ca57600080fd5b818601915086601f8301126105de57600080fd5b8135818111156105f0576105f0610567565b604051601f8201601f19908116603f0116810190838211818310171561061857610618610567565b8160405282815289602084870101111561063157600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561066557600080fd5b8151610513816104e1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038316815260006020604081840152835180604085015260005b818110156106e1578581018301518582016060015282016106c5565b818111156106f3576000606083870101525b50601f01601f19169290920160600194935050505056fea26469706673582212208359527d705e3a7f02ce70ba36485ac49e86845670e6ec95b6948c464899cbdd64736f6c63430008090033

Deployed ByteCode

0x60806040526004361061006b5760003560e01c8063204e1c7a14610070578063715018a6146100a65780637eff275e146100bd5780638da5cb5b146100dd5780639623609d146100f257806399a88ec414610105578063f2fde38b14610125578063f3b7dead14610145575b600080fd5b34801561007c57600080fd5b5061009061008b3660046104f6565b610165565b60405161009d919061051a565b60405180910390f35b3480156100b257600080fd5b506100bb6101f6565b005b3480156100c957600080fd5b506100bb6100d836600461052e565b61023a565b3480156100e957600080fd5b506100906102cb565b6100bb61010036600461057d565b6102da565b34801561011157600080fd5b506100bb61012036600461052e565b610370565b34801561013157600080fd5b506100bb6101403660046104f6565b6103cb565b34801561015157600080fd5b506100906101603660046104f6565b61046b565b6000806000836001600160a01b031660405161018b90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101c6576040519150601f19603f3d011682016040523d82523d6000602084013e6101cb565b606091505b5091509150816101da57600080fd5b808060200190518101906101ee9190610653565b949350505050565b336101ff6102cb565b6001600160a01b03161461022e5760405162461bcd60e51b815260040161022590610670565b60405180910390fd5b6102386000610491565b565b336102436102cb565b6001600160a01b0316146102695760405162461bcd60e51b815260040161022590610670565b6040516308f2839760e41b81526001600160a01b03831690638f2839709061029590849060040161051a565b600060405180830381600087803b1580156102af57600080fd5b505af11580156102c3573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031690565b336102e36102cb565b6001600160a01b0316146103095760405162461bcd60e51b815260040161022590610670565b60405163278f794360e11b81526001600160a01b03841690634f1ef28690349061033990869086906004016106a5565b6000604051808303818588803b15801561035257600080fd5b505af1158015610366573d6000803e3d6000fd5b5050505050505050565b336103796102cb565b6001600160a01b03161461039f5760405162461bcd60e51b815260040161022590610670565b604051631b2ce7f360e11b81526001600160a01b03831690633659cfe69061029590849060040161051a565b336103d46102cb565b6001600160a01b0316146103fa5760405162461bcd60e51b815260040161022590610670565b6001600160a01b03811661045f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610225565b61046881610491565b50565b6000806000836001600160a01b031660405161018b906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461046857600080fd5b60006020828403121561050857600080fd5b8135610513816104e1565b9392505050565b6001600160a01b0391909116815260200190565b6000806040838503121561054157600080fd5b823561054c816104e1565b9150602083013561055c816104e1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561059257600080fd5b833561059d816104e1565b925060208401356105ad816104e1565b9150604084013567ffffffffffffffff808211156105ca57600080fd5b818601915086601f8301126105de57600080fd5b8135818111156105f0576105f0610567565b604051601f8201601f19908116603f0116810190838211818310171561061857610618610567565b8160405282815289602084870101111561063157600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561066557600080fd5b8151610513816104e1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038316815260006020604081840152835180604085015260005b818110156106e1578581018301518582016060015282016106c5565b818111156106f3576000606083870101525b50601f01601f19169290920160600194935050505056fea26469706673582212208359527d705e3a7f02ce70ba36485ac49e86845670e6ec95b6948c464899cbdd64736f6c63430008090033