POL Price: $0.217485 (-0.38%)
Gas: 28 GWei
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
582236992024-06-16 8:39:08310 days ago1718527148  Contract Creation0 POL
Loading...
Loading

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

Contract Name:
EIP173OpsProxy

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : EIP173OpsProxy.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;

import "./Proxy.sol";
import {IOpsProxyFactory} from "../../../interfaces/IOpsProxyFactory.sol";

interface ERC165 {
    function supportsInterface(bytes4 id) external view returns (bool);
}

/**
 * @notice Proxy implementing EIP173 for ownership management.
 * @notice This is used for OpsProxy.
 *
 * @dev 1. custom receive can be set in implementation.
 * @dev 2. transferProxyAdmin removed.
 * @dev 3. implementation can only be set to those whitelisted on OpsProxyFactory.
 */
contract EIP173OpsProxy is Proxy {
    // ////////////////////////// STATES ///////////////////////////////////////////////////////////////////////
    IOpsProxyFactory public immutable opsProxyFactory;

    // ////////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////

    event ProxyAdminTransferred(
        address indexed previousAdmin,
        address indexed newAdmin
    );

    // /////////////////////// MODIFIERS //////////////////////////////////////////////////////////////////////
    modifier onlyWhitelistedImplementation(address _implementation) {
        require(
            opsProxyFactory.whitelistedImplementations(_implementation),
            "Implementation not whitelisted"
        );
        _;
    }

    // /////////////////////// FALLBACKS //////////////////////////////////////////////////////////////////////
    receive() external payable override {
        _fallback();
    }

    // /////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////

    constructor(
        address _opsProxyFactory,
        address implementationAddress,
        address adminAddress,
        bytes memory data
    ) payable {
        opsProxyFactory = IOpsProxyFactory(_opsProxyFactory);
        _setImplementation(implementationAddress, data);
        _setProxyAdmin(adminAddress);
    }

    // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////

    function proxyAdmin() external view returns (address) {
        return _proxyAdmin();
    }

    function supportsInterface(bytes4 id) external view returns (bool) {
        if (id == 0x01ffc9a7 || id == 0x7f5828d0) {
            return true;
        }
        if (id == 0xFFFFFFFF) {
            return false;
        }

        ERC165 implementation;
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            implementation := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
        }

        // Technically this is not standard compliant as ERC-165 require 30,000 gas which that call cannot ensure
        // because it is itself inside `supportsInterface` that might only get 30,000 gas.
        // In practise this is unlikely to be an issue.
        try implementation.supportsInterface(id) returns (bool support) {
            return support;
        } catch {
            return false;
        }
    }

    function upgradeTo(address newImplementation)
        external
        onlyProxyAdmin
        onlyWhitelistedImplementation(newImplementation)
    {
        _setImplementation(newImplementation, "");
    }

    function upgradeToAndCall(address newImplementation, bytes calldata data)
        external
        payable
        onlyProxyAdmin
        onlyWhitelistedImplementation(newImplementation)
    {
        _setImplementation(newImplementation, data);
    }

    // /////////////////////// MODIFIERS ////////////////////////////////////////////////////////////////////////

    modifier onlyProxyAdmin() {
        require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
        _;
    }

    // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////

    function _proxyAdmin() internal view returns (address adminAddress) {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            adminAddress := sload(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
            )
        }
    }

    function _setProxyAdmin(address newAdmin) internal {
        address previousAdmin = _proxyAdmin();
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            sstore(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
                newAdmin
            )
        }
        emit ProxyAdminTransferred(previousAdmin, newAdmin);
    }
}

File 2 of 3 : Proxy.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;

// EIP-1967
abstract contract Proxy {
    // /////////////////////// EVENTS ///////////////////////////////////////////////////////////////////////////

    event ProxyImplementationUpdated(
        address indexed previousImplementation,
        address indexed newImplementation
    );

    // ///////////////////// EXTERNAL ///////////////////////////////////////////////////////////////////////////

    // prettier-ignore
    receive() external payable virtual {
        revert("ETHER_REJECTED"); // explicit reject by default
    }

    fallback() external payable {
        _fallback();
    }

    // ///////////////////////// INTERNAL //////////////////////////////////////////////////////////////////////

    function _fallback() internal {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            let implementationAddress := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
            calldatacopy(0x0, 0x0, calldatasize())
            let success := delegatecall(
                gas(),
                implementationAddress,
                0x0,
                calldatasize(),
                0,
                0
            )
            let retSz := returndatasize()
            returndatacopy(0, 0, retSz)
            switch success
            case 0 {
                revert(0, retSz)
            }
            default {
                return(0, retSz)
            }
        }
    }

    function _setImplementation(address newImplementation, bytes memory data)
        internal
    {
        address previousImplementation;
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            previousImplementation := sload(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
            )
        }

        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            sstore(
                0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc,
                newImplementation
            )
        }

        emit ProxyImplementationUpdated(
            previousImplementation,
            newImplementation
        );

        if (data.length > 0) {
            (bool success, ) = newImplementation.delegatecall(data);
            if (!success) {
                assembly {
                    // This assembly ensure the revert contains the exact string data
                    let returnDataSize := returndatasize()
                    returndatacopy(0, 0, returnDataSize)
                    revert(0, returnDataSize)
                }
            }
        }
    }
}

File 3 of 3 : IOpsProxyFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

interface IOpsProxyFactory {
    /**
     * @notice Emitted when an OpsProxy is deployed.
     *
     * @param deployer Address which initiated the deployment
     * @param owner The address which the proxy is for.
     * @param proxy Address of deployed proxy.
     */
    event DeployProxy(
        address indexed deployer,
        address indexed owner,
        address indexed proxy
    );

    /**
     * @notice Emitted when OpsProxy implementation to be deployed is changed.
     *
     * @param oldImplementation Previous OpsProxy implementation.
     * @param newImplementation Current OpsProxy implementation.
     */
    event SetImplementation(
        address indexed oldImplementation,
        address indexed newImplementation
    );

    /**
     * @notice Emitted when OpsProxy implementation is added or removed from whitelist.
     *
     * @param implementation OpsProxy implementation.
     * @param whitelisted Added or removed from whitelist.
     */
    event UpdateWhitelistedImplementation(
        address indexed implementation,
        bool indexed whitelisted
    );

    /**
     * @notice Deploys OpsProxy for the msg.sender.
     *
     * @return proxy Address of deployed proxy.
     */
    function deploy() external returns (address payable proxy);

    /**
     * @notice Deploys OpsProxy for another address.
     *
     * @param owner Address to deploy the proxy for.
     *
     * @return proxy Address of deployed proxy.
     */
    function deployFor(address owner) external returns (address payable proxy);

    /**
     * @notice Sets the OpsProxy implementation that will be deployed by OpsProxyFactory.
     *
     * @param newImplementation New implementation to be set.
     */
    function setImplementation(address newImplementation) external;

    /**
     * @notice Add or remove OpsProxy implementation from the whitelist.
     *
     * @param implementation OpsProxy implementation.
     * @param whitelist Added or removed from whitelist.
     */
    function updateWhitelistedImplementations(
        address implementation,
        bool whitelist
    ) external;

    /**
     * @notice Determines the OpsProxy address when it is not deployed.
     *
     * @param account Address to determine the proxy address for.
     */
    function determineProxyAddress(address account)
        external
        view
        returns (address);

    /**
     * @return address Proxy address owned by account.
     * @return bool Whether if proxy is deployed
     */
    function getProxyOf(address account) external view returns (address, bool);

    /**
     * @return address Owner of deployed proxy.
     */
    function ownerOf(address proxy) external view returns (address);

    /**
     * @return bool Whether if implementation is whitelisted.
     */
    function whitelistedImplementations(address implementation)
        external
        view
        returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_opsProxyFactory","type":"address"},{"internalType":"address","name":"implementationAddress","type":"address"},{"internalType":"address","name":"adminAddress","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"ProxyAdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"ProxyImplementationUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"opsProxyFactory","outputs":[{"internalType":"contract IOpsProxyFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"id","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x60806040526004361061004e5760003560e01c806301ffc9a7146100675780633659cfe6146100a45780633e47158c146100cd5780634f1ef286146100f8578063ba1d0ff4146101145761005d565b3661005d5761005b61013f565b005b61006561013f565b005b34801561007357600080fd5b5061008e600480360381019061008991906107d5565b610188565b60405161009b919061081d565b60405180910390f35b3480156100b057600080fd5b506100cb60048036038101906100c69190610896565b6102d9565b005b3480156100d957600080fd5b506100e2610445565b6040516100ef91906108d2565b60405180910390f35b610112600480360381019061010d9190610952565b610454565b005b34801561012057600080fd5b506101296105f7565b6040516101369190610a11565b60405180910390f35b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc543660008037600080366000845af43d806000803e816000811461018357816000f35b816000fd5b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806101e35750637f5828d060e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b156101f157600190506102d4565b63ffffffff60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361022757600090506102d4565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490508073ffffffffffffffffffffffffffffffffffffffff166301ffc9a7846040518263ffffffff1660e01b81526004016102869190610a3b565b602060405180830381865afa9250505080156102c057506040513d601f19601f820116820180604052508101906102bd9190610a82565b60015b6102ce5760009150506102d4565b80925050505b919050565b6102e161061b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461034e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034590610b0c565b60405180910390fd5b807f00000000000000000000000044bde1bccdd06119262f1fe441fbe7341eaac18573ffffffffffffffffffffffffffffffffffffffff1663fcff48ed826040518263ffffffff1660e01b81526004016103a891906108d2565b602060405180830381865afa1580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190610a82565b610428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041f90610b78565b60405180910390fd5b6104418260405180602001604052806000815250610644565b5050565b600061044f61061b565b905090565b61045c61061b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c090610b0c565b60405180910390fd5b827f00000000000000000000000044bde1bccdd06119262f1fe441fbe7341eaac18573ffffffffffffffffffffffffffffffffffffffff1663fcff48ed826040518263ffffffff1660e01b815260040161052391906108d2565b602060405180830381865afa158015610540573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105649190610a82565b6105a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059a90610b78565b60405180910390fd5b6105f18484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610644565b50505050565b7f00000000000000000000000044bde1bccdd06119262f1fe441fbe7341eaac18581565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610354905090565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc549050827f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc558273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f5570d70a002632a7b0b3c9304cc89efb62d8da9eca0dbd7752c83b737906829660405160405180910390a360008251111561076e5760008373ffffffffffffffffffffffffffffffffffffffff16836040516107189190610c12565b600060405180830381855af49150503d8060008114610753576040519150601f19603f3d011682016040523d82523d6000602084013e610758565b606091505b505090508061076c573d806000803e806000fd5b505b505050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6107b28161077d565b81146107bd57600080fd5b50565b6000813590506107cf816107a9565b92915050565b6000602082840312156107eb576107ea610773565b5b60006107f9848285016107c0565b91505092915050565b60008115159050919050565b61081781610802565b82525050565b6000602082019050610832600083018461080e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061086382610838565b9050919050565b61087381610858565b811461087e57600080fd5b50565b6000813590506108908161086a565b92915050565b6000602082840312156108ac576108ab610773565b5b60006108ba84828501610881565b91505092915050565b6108cc81610858565b82525050565b60006020820190506108e760008301846108c3565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112610912576109116108ed565b5b8235905067ffffffffffffffff81111561092f5761092e6108f2565b5b60208301915083600182028301111561094b5761094a6108f7565b5b9250929050565b60008060006040848603121561096b5761096a610773565b5b600061097986828701610881565b935050602084013567ffffffffffffffff81111561099a57610999610778565b5b6109a6868287016108fc565b92509250509250925092565b6000819050919050565b60006109d76109d26109cd84610838565b6109b2565b610838565b9050919050565b60006109e9826109bc565b9050919050565b60006109fb826109de565b9050919050565b610a0b816109f0565b82525050565b6000602082019050610a266000830184610a02565b92915050565b610a358161077d565b82525050565b6000602082019050610a506000830184610a2c565b92915050565b610a5f81610802565b8114610a6a57600080fd5b50565b600081519050610a7c81610a56565b92915050565b600060208284031215610a9857610a97610773565b5b6000610aa684828501610a6d565b91505092915050565b600082825260208201905092915050565b7f4e4f545f415554484f52495a4544000000000000000000000000000000000000600082015250565b6000610af6600e83610aaf565b9150610b0182610ac0565b602082019050919050565b60006020820190508181036000830152610b2581610ae9565b9050919050565b7f496d706c656d656e746174696f6e206e6f742077686974656c69737465640000600082015250565b6000610b62601e83610aaf565b9150610b6d82610b2c565b602082019050919050565b60006020820190508181036000830152610b9181610b55565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015610bcc578082015181840152602081019050610bb1565b83811115610bdb576000848401525b50505050565b6000610bec82610b98565b610bf68185610ba3565b9350610c06818560208601610bae565b80840191505092915050565b6000610c1e8284610be1565b91508190509291505056fea2646970667358221220e1383b8d53f44c0189f6040dcd0147a80a9b144d114d866a2dad68295018327864736f6c634300080e0033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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