ETH Price: $3,255.47 (+0.58%)

Contract

0xD3ef85b707Db8132C20249272dEC7e35d50a73A3
 

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

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FactoryUpgradeGate

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 5000 runs

Other Settings:
default evmVersion
File 1 of 4 : FactoryUpgradeGate.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;

import {IFactoryUpgradeGate} from "./interfaces/IFactoryUpgradeGate.sol";
import "./utils/OwnableSkeleton.sol";

contract FactoryUpgradeGate is IFactoryUpgradeGate, OwnableSkeleton {
    mapping(address => mapping(address => bool)) private _validUpgradePaths;

    event UpgradePathRegistered(address newImpl, address oldImpl);
    event UpgradePathRemoved(address newImpl, address oldImpl);

    modifier onlyOwner() {
        require(msg.sender == owner(), "only owner");

        _;
    }

    constructor(address _owner) {
        _setOwner(_owner);
    }

    /// @notice Ensures the given upgrade path is valid and does not overwrite existing storage slots
    /// @param _newImpl The proposed implementation address
    /// @param _currentImpl The current implementation address
    function isValidUpgradePath(address _newImpl, address _currentImpl) external view returns (bool) {
        return _validUpgradePaths[_newImpl][_currentImpl];
    }

    /// @notice Registers a new safe upgrade path for an implementation
    /// @param _newImpl The new implementation
    /// @param _supportedPrevImpls Safe implementations that can upgrade to this new implementation
    function registerNewUpgradePath(address _newImpl, address[] calldata _supportedPrevImpls) external onlyOwner {
        for (uint256 i = 0; i < _supportedPrevImpls.length; i++) {
            _validUpgradePaths[_newImpl][_supportedPrevImpls[i]] = true;
            emit UpgradePathRegistered(_newImpl, _supportedPrevImpls[i]);
        }
    }

    /// @notice Unregisters an upgrade path, in case of emergency
    /// @param _newImpl the newer implementation
    /// @param _prevImpl the older implementation
    function unregisterUpgradePath(address _newImpl, address _prevImpl) external onlyOwner {
        _validUpgradePaths[_newImpl][_prevImpl] = false;
        emit UpgradePathRemoved(_newImpl, _prevImpl);
    }
}

File 2 of 4 : IFactoryUpgradeGate.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;

interface IFactoryUpgradeGate {
  function isValidUpgradePath(address _newImpl, address _currentImpl) external returns (bool);

  function registerNewUpgradePath(address _newImpl, address[] calldata _supportedPrevImpls) external;

  function unregisterUpgradePath(address _newImpl, address _prevImpl) external;
}

File 3 of 4 : OwnableSkeleton.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {IOwnable} from "../interfaces/IOwnable.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.
 *
 * This ownership interface matches OZ's ownable interface.
 */
contract OwnableSkeleton is IOwnable {
    address private _owner;

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

    function _setOwner(address newAddress) internal {
        emit OwnershipTransferred(_owner, newAddress);
        _owner = newAddress;
    }
}

File 4 of 4 : IOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

/**
 * @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.
 *
 * This ownership interface matches OZ's ownable interface.
 *
 */
interface IOwnable {
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() external view returns (address);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "base64/=lib/base64/",
    "ds-test/=lib/ds-test/src/",
    "erc721a-upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "src/=src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 5000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london"
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newImpl","type":"address"},{"indexed":false,"internalType":"address","name":"oldImpl","type":"address"}],"name":"UpgradePathRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newImpl","type":"address"},{"indexed":false,"internalType":"address","name":"oldImpl","type":"address"}],"name":"UpgradePathRemoved","type":"event"},{"inputs":[{"internalType":"address","name":"_newImpl","type":"address"},{"internalType":"address","name":"_currentImpl","type":"address"}],"name":"isValidUpgradePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newImpl","type":"address"},{"internalType":"address[]","name":"_supportedPrevImpls","type":"address[]"}],"name":"registerNewUpgradePath","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newImpl","type":"address"},{"internalType":"address","name":"_prevImpl","type":"address"}],"name":"unregisterUpgradePath","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161067c38038061067c83398101604081905261002f91610099565b6100388161003e565b506100c9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156100ab57600080fd5b81516001600160a01b03811681146100c257600080fd5b9392505050565b6105a4806100d86000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806373995833146100515780638466a71c146100af57806389428654146100c45780638da5cb5b146100d7575b600080fd5b61009a61005f366004610404565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205460ff1690565b60405190151581526020015b60405180910390f35b6100c26100bd366004610404565b6100ff565b005b6100c26100d2366004610437565b61021b565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82811660008181526001602090815260408083209486168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905581519283528201929092527fa3a0491075ec5f5949945a6f452fb9e0619a4dacc65a568ad2da3210cc91cdab910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e657200000000000000000000000000000000000000000000604482015260640161017c565b60005b818110156103d55773ffffffffffffffffffffffffffffffffffffffff84166000908152600160208190526040822090918585858181106102e2576102e26104bd565b90506020020160208101906102f791906104ec565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557f7acfb66a4ce41040d432f980d35151e6d37f3279e6f8dbf383b0f5112271462f8484848481811061037e5761037e6104bd565b905060200201602081019061039391906104ec565b6040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301520160405180910390a1806103cd8161050e565b91505061029f565b50505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146103ff57600080fd5b919050565b6000806040838503121561041757600080fd5b610420836103db565b915061042e602084016103db565b90509250929050565b60008060006040848603121561044c57600080fd5b610455846103db565b9250602084013567ffffffffffffffff8082111561047257600080fd5b818601915086601f83011261048657600080fd5b81358181111561049557600080fd5b8760208260051b85010111156104aa57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156104fe57600080fd5b610507826103db565b9392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610567577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea2646970667358221220d941c092440eed59d471ecfc17522dec4f4c4bfc0a4f6347d48cd9cf29864dd964736f6c634300080a0033000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806373995833146100515780638466a71c146100af57806389428654146100c45780638da5cb5b146100d7575b600080fd5b61009a61005f366004610404565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205460ff1690565b60405190151581526020015b60405180910390f35b6100c26100bd366004610404565b6100ff565b005b6100c26100d2366004610437565b61021b565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82811660008181526001602090815260408083209486168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905581519283528201929092527fa3a0491075ec5f5949945a6f452fb9e0619a4dacc65a568ad2da3210cc91cdab910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e657200000000000000000000000000000000000000000000604482015260640161017c565b60005b818110156103d55773ffffffffffffffffffffffffffffffffffffffff84166000908152600160208190526040822090918585858181106102e2576102e26104bd565b90506020020160208101906102f791906104ec565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557f7acfb66a4ce41040d432f980d35151e6d37f3279e6f8dbf383b0f5112271462f8484848481811061037e5761037e6104bd565b905060200201602081019061039391906104ec565b6040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301520160405180910390a1806103cd8161050e565b91505061029f565b50505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146103ff57600080fd5b919050565b6000806040838503121561041757600080fd5b610420836103db565b915061042e602084016103db565b90509250929050565b60008060006040848603121561044c57600080fd5b610455846103db565b9250602084013567ffffffffffffffff8082111561047257600080fd5b818601915086601f83011261048657600080fd5b81358181111561049557600080fd5b8760208260051b85010111156104aa57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156104fe57600080fd5b610507826103db565b9392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610567577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea2646970667358221220d941c092440eed59d471ecfc17522dec4f4c4bfc0a4f6347d48cd9cf29864dd964736f6c634300080a0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0

-----Decoded View---------------
Arg [0] : _owner (address): 0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0


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

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.