ETH Price: $3,216.76 (+2.58%)

Contract

0x5c23cfb52220E4Af285959c12Fa8C8E344177885
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
146454322022-04-24 4:49:36931 days ago1650775776  Contract Creation0 ETH
Loading...
Loading

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

Contract Name:
Proxy

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : Proxy.sol
pragma solidity ^0.7.0;

// SPDX-License-Identifier: MIT OR Apache-2.0



import "./Ownable.sol";
import "./Upgradeable.sol";
import "./UpgradeableMaster.sol";

/// @title Proxy Contract
/// @dev NOTICE: Proxy must implement UpgradeableMaster interface to prevent calling some function of it not by master of proxy
/// @author Matter Labs
contract Proxy is Upgradeable, UpgradeableMaster, Ownable {
    /// @dev Storage position of "target" (actual implementation address: keccak256('eip1967.proxy.implementation') - 1)
    bytes32 private constant targetPosition = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /// @notice Contract constructor
    /// @dev Calls Ownable contract constructor and initialize target
    /// @param target Initial implementation address
    /// @param targetInitializationParameters Target initialization parameters
    constructor(address target, bytes memory targetInitializationParameters) Ownable(msg.sender) {
        setTarget(target);
        (bool initializationSuccess, ) =
        getTarget().delegatecall(abi.encodeWithSignature("initialize(bytes)", targetInitializationParameters));
        require(initializationSuccess, "uin11"); // uin11 - target initialization failed
    }

    /// @notice Intercepts initialization calls
    function initialize(bytes calldata) external pure {
        revert("ini11"); // ini11 - interception of initialization call
    }

    /// @notice Intercepts upgrade calls
    function upgrade(bytes calldata) external pure {
        revert("upg11"); // upg11 - interception of upgrade call
    }

    /// @notice Returns target of contract
    /// @return target Actual implementation address
    function getTarget() public view returns (address target) {
        bytes32 position = targetPosition;
        assembly {
            target := sload(position)
        }
    }

    /// @notice Sets new target of contract
    /// @param _newTarget New actual implementation address
    function setTarget(address _newTarget) internal {
        bytes32 position = targetPosition;
        assembly {
            sstore(position, _newTarget)
        }
    }

    /// @notice Upgrades target
    /// @param newTarget New target
    /// @param newTargetUpgradeParameters New target upgrade parameters
    function upgradeTarget(address newTarget, bytes calldata newTargetUpgradeParameters) external override {
        requireMaster(msg.sender);

        setTarget(newTarget);
        (bool upgradeSuccess, ) =
        getTarget().delegatecall(abi.encodeWithSignature("upgrade(bytes)", newTargetUpgradeParameters));
        require(upgradeSuccess, "ufu11"); // ufu11 - target upgrade failed
    }

    /// @notice Performs a delegatecall to the contract implementation
    /// @dev Fallback function allowing to perform a delegatecall to the given implementation
    /// This function will return whatever the implementation call returns
    function _fallback() internal {
        address _target = getTarget();
        assembly {
            // The pointer to the free memory slot
            let ptr := mload(0x40)
            // Copy function signature and arguments from calldata at zero position into memory at pointer position
            calldatacopy(ptr, 0x0, calldatasize())
            // Delegatecall method of the implementation contract, returns 0 on error
            let result := delegatecall(gas(), _target, ptr, calldatasize(), 0x0, 0)
            // Get the size of the last return data
            let size := returndatasize()
            // Copy the size length of bytes from return data at zero position to pointer position
            returndatacopy(ptr, 0x0, size)
            // Depending on result value
            switch result
                case 0 {
                    // End execution and revert state changes
                    revert(ptr, size)
                }
                default {
                    // Return data with length of size at pointers position
                    return(ptr, size)
                }
        }
    }

    /// @notice Will run when no functions matches call data
    fallback() external payable {
        _fallback();
    }

    /// @notice Same as fallback but called when calldata is empty
    receive() external payable {
        _fallback();
    }

    /// UpgradeableMaster functions
    /// @notice Notice period before activation preparation status of upgrade mode
    function getNoticePeriod() external override returns (uint256) {
        (bool success, bytes memory result) = getTarget().delegatecall(abi.encodeWithSignature("getNoticePeriod()"));
        require(success, "unp11"); // unp11 - upgradeNoticePeriod delegatecall failed
        return abi.decode(result, (uint256));
    }

    /// @notice Notifies proxy contract that notice period started
    function upgradeNoticePeriodStarted() external override {
        requireMaster(msg.sender);
        (bool success, ) = getTarget().delegatecall(abi.encodeWithSignature("upgradeNoticePeriodStarted()"));
        require(success, "nps11"); // nps11 - upgradeNoticePeriodStarted delegatecall failed
    }

    /// @notice Notifies proxy contract that upgrade preparation status is activated
    function upgradePreparationStarted() external override {
        requireMaster(msg.sender);
        (bool success, ) = getTarget().delegatecall(abi.encodeWithSignature("upgradePreparationStarted()"));
        require(success, "ups11"); // ups11 - upgradePreparationStarted delegatecall failed
    }

    /// @notice Notifies proxy contract that upgrade canceled
    function upgradeCanceled() external override {
        requireMaster(msg.sender);
        (bool success, ) = getTarget().delegatecall(abi.encodeWithSignature("upgradeCanceled()"));
        require(success, "puc11"); // puc11 - upgradeCanceled delegatecall failed
    }

    /// @notice Notifies proxy contract that upgrade finishes
    function upgradeFinishes() external override {
        requireMaster(msg.sender);
        (bool success, ) = getTarget().delegatecall(abi.encodeWithSignature("upgradeFinishes()"));
        require(success, "puf11"); // puf11 - upgradeFinishes delegatecall failed
    }

    /// @notice Checks that contract is ready for upgrade
    /// @return bool flag indicating that contract is ready for upgrade
    function isReadyForUpgrade() external override returns (bool) {
        (bool success, bytes memory result) = getTarget().delegatecall(abi.encodeWithSignature("isReadyForUpgrade()"));
        require(success, "rfu11"); // rfu11 - readyForUpgrade delegatecall failed
        return abi.decode(result, (bool));
    }
}

File 2 of 4 : Ownable.sol
pragma solidity ^0.7.0;

// SPDX-License-Identifier: MIT OR Apache-2.0



/// @title Ownable Contract
/// @author Matter Labs
// NO CHANGE
contract Ownable {
    /// @dev Storage position of the masters address (keccak256('eip1967.proxy.admin') - 1)
    bytes32 private constant masterPosition = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /// @notice Contract constructor
    /// @dev Sets msg sender address as masters address
    /// @param masterAddress Master address
    constructor(address masterAddress) {
        setMaster(masterAddress);
    }

    /// @notice Check if specified address is master
    /// @param _address Address to check
    function requireMaster(address _address) internal view {
        require(_address == getMaster(), "1c"); // oro11 - only by master
    }

    /// @notice Returns contract masters address
    /// @return master Master's address
    function getMaster() public view returns (address master) {
        bytes32 position = masterPosition;
        assembly {
            master := sload(position)
        }
    }

    /// @dev Sets new masters address
    /// @param _newMaster New master's address
    function setMaster(address _newMaster) internal {
        bytes32 position = masterPosition;
        assembly {
            sstore(position, _newMaster)
        }
    }

    /// @notice Transfer mastership of the contract to new master
    /// @param _newMaster New masters address
    function transferMastership(address _newMaster) external {
        requireMaster(msg.sender);
        require(_newMaster != address(0), "1d"); // otp11 - new masters address can't be zero address
        setMaster(_newMaster);
    }
}

File 3 of 4 : Upgradeable.sol
pragma solidity ^0.7.0;

// SPDX-License-Identifier: MIT OR Apache-2.0



/// @title Interface of the upgradeable contract
/// @author Matter Labs
interface Upgradeable {
    /// @notice Upgrades target of upgradeable contract
    /// @param newTarget New target
    /// @param newTargetInitializationParameters New target initialization parameters
    function upgradeTarget(address newTarget, bytes calldata newTargetInitializationParameters) external;
}

File 4 of 4 : UpgradeableMaster.sol
pragma solidity ^0.7.0;

// SPDX-License-Identifier: MIT OR Apache-2.0



/// @title Interface of the upgradeable master contract (defines notice period duration and allows finish upgrade during preparation of it)
/// @author Matter Labs
interface UpgradeableMaster {
    /// @notice Notice period before activation preparation status of upgrade mode
    function getNoticePeriod() external returns (uint256);

    /// @notice Notifies contract that notice period started
    function upgradeNoticePeriodStarted() external;

    /// @notice Notifies contract that upgrade preparation status is activated
    function upgradePreparationStarted() external;

    /// @notice Notifies contract that upgrade canceled
    function upgradeCanceled() external;

    /// @notice Notifies contract that upgrade finishes
    function upgradeFinishes() external;

    /// @notice Checks that contract is ready for upgrade
    /// @return bool flag indicating that contract is ready for upgrade
    function isReadyForUpgrade() external returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"targetInitializationParameters","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"getMaster","outputs":[{"internalType":"address","name":"master","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNoticePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTarget","outputs":[{"internalType":"address","name":"target","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"isReadyForUpgrade","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMaster","type":"address"}],"name":"transferMastership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"upgrade","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"upgradeCanceled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeFinishes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeNoticePeriodStarted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradePreparationStarted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTarget","type":"address"},{"internalType":"bytes","name":"newTargetUpgradeParameters","type":"bytes"}],"name":"upgradeTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106100ab5760003560e01c806378b91e701161006457806378b91e70146102b6578063871b8ff1146102cb5780638773334c146102e0578063b269b9ae14610309578063c3f596871461031e578063f00e6a2a14610351576100ba565b806325394645146100c25780632a3174f41461013f5780633b154b7314610166578063439fab911461017b5780635a99719e146101f85780636fc4914014610229576100ba565b366100ba576100b8610366565b005b6100b8610366565b3480156100ce57600080fd5b506100b8600480360360208110156100e557600080fd5b81019060208101813564010000000081111561010057600080fd5b82018360208201111561011257600080fd5b8035906020019184600183028401116401000000008311171561013457600080fd5b509092509050610397565b34801561014b57600080fd5b506101546103cc565b60408051918252519081900360200190f35b34801561017257600080fd5b506100b86104fe565b34801561018757600080fd5b506100b86004803603602081101561019e57600080fd5b8101906020810181356401000000008111156101b957600080fd5b8201836020820111156101cb57600080fd5b803590602001918460018302840111640100000000831117156101ed57600080fd5b50909250905061061a565b34801561020457600080fd5b5061020d61064f565b604080516001600160a01b039092168252519081900360200190f35b34801561023557600080fd5b506100b86004803603604081101561024c57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561027757600080fd5b82018360208201111561028957600080fd5b803590602001918460018302840111640100000000831117156102ab57600080fd5b509092509050610674565b3480156102c257600080fd5b506100b86107d4565b3480156102d757600080fd5b506100b86108ed565b3480156102ec57600080fd5b506102f5610a06565b604080519115158252519081900360200190f35b34801561031557600080fd5b506100b8610b1a565b34801561032a57600080fd5b506100b86004803603602081101561034157600080fd5b50356001600160a01b0316610c33565b34801561035d57600080fd5b5061020d610c85565b6000610370610c85565b905060405136600082376000803683855af43d806000843e818015610393578184f35b8184fd5b6040805162461bcd60e51b8152602060048201526005602482015264757067313160d81b604482015290519081900360640190fd5b60008060006103d9610c85565b60408051600481526024810182526020810180516001600160e01b0316630a8c5d3d60e21b178152915181516001600160a01b039490941693919290918291908083835b6020831061043c5780518252601f19909201916020918201910161041d565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b5091509150816104e0576040805162461bcd60e51b8152602060048201526005602482015264756e70313160d81b604482015290519081900360640190fd5b8080602001905160208110156104f557600080fd5b50519250505090565b61050733610caa565b6000610511610c85565b60408051600481526024810182526020810180516001600160e01b0316633b154b7360e01b178152915181516001600160a01b039490941693919290918291908083835b602083106105745780518252601f199092019160209182019101610555565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146105d4576040519150601f19603f3d011682016040523d82523d6000602084013e6105d9565b606091505b5050905080610617576040805162461bcd60e51b81526020600482015260056024820152646e7073313160d81b604482015290519081900360640190fd5b50565b6040805162461bcd60e51b8152602060048201526005602482015264696e69313160d81b604482015290519081900360640190fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61067d33610caa565b61068683610cfc565b6000610690610c85565b6001600160a01b031683836040516024018080602001828103825284848281815260200192508082843760008382015260408051601f909201601f1990811690940182810390940182529283526020810180516001600160e01b0316632539464560e01b17815292518151919750955085945091925081905083835b6020831061072b5780518252601f19909201916020918201910161070c565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461078b576040519150601f19603f3d011682016040523d82523d6000602084013e610790565b606091505b50509050806107ce576040805162461bcd60e51b8152602060048201526005602482015264756675313160d81b604482015290519081900360640190fd5b50505050565b6107dd33610caa565b60006107e7610c85565b60408051600481526024810182526020810180516001600160e01b031663078b91e760e41b178152915181516001600160a01b039490941693919290918291908083835b6020831061084a5780518252601f19909201916020918201910161082b565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146108aa576040519150601f19603f3d011682016040523d82523d6000602084013e6108af565b606091505b5050905080610617576040805162461bcd60e51b8152602060048201526005602482015264757073313160d81b604482015290519081900360640190fd5b6108f633610caa565b6000610900610c85565b60408051600481526024810182526020810180516001600160e01b031663871b8ff160e01b178152915181516001600160a01b039490941693919290918291908083835b602083106109635780518252601f199092019160209182019101610944565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146109c3576040519150601f19603f3d011682016040523d82523d6000602084013e6109c8565b606091505b5050905080610617576040805162461bcd60e51b8152602060048201526005602482015264707563313160d81b604482015290519081900360640190fd5b6000806000610a13610c85565b60408051600481526024810182526020810180516001600160e01b03166321dcccd360e21b178152915181516001600160a01b039490941693919290918291908083835b60208310610a765780518252601f199092019160209182019101610a57565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610ad6576040519150601f19603f3d011682016040523d82523d6000602084013e610adb565b606091505b5091509150816104e0576040805162461bcd60e51b8152602060048201526005602482015264726675313160d81b604482015290519081900360640190fd5b610b2333610caa565b6000610b2d610c85565b60408051600481526024810182526020810180516001600160e01b0316635934dcd760e11b178152915181516001600160a01b039490941693919290918291908083835b60208310610b905780518252601f199092019160209182019101610b71565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610bf0576040519150601f19603f3d011682016040523d82523d6000602084013e610bf5565b606091505b5050905080610617576040805162461bcd60e51b8152602060048201526005602482015264707566313160d81b604482015290519081900360640190fd5b610c3c33610caa565b6001600160a01b038116610c7c576040805162461bcd60e51b81526020600482015260026024820152610c5960f21b604482015290519081900360640190fd5b61061781610d20565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b610cb261064f565b6001600160a01b0316816001600160a01b031614610617576040805162461bcd60e51b8152602060048201526002602482015261316360f01b604482015290519081900360640190fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035556fea2646970667358221220c5a1a968196eed4d887dca2b228b2c6abc91a15d3cd9f1ca5daadc086186ecbb64736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.