false
true
0

Contract Address Details

0x97f589D427c4DFA48e3F3F50Ff0C5b49334DdE22

Contract Name
FactoryUpgradeGate
Creator
0x111423–e70d8d at 0x5526a2–385f90
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
25864327
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify. View contract in Sourcify repository
Contract name:
FactoryUpgradeGate




Optimization enabled
true
Compiler version
v0.8.10+commit.fc410830




Optimization runs
5000
EVM Version
london




Verified at
2026-02-09T07:04:36.870282Z

Constructor Arguments

000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0

Arg [0] (address) : 0xd1d1d4e36117ab794ec5d4c78cbd3a8904e691d0

              

src/FactoryUpgradeGate.sol

// SPDX-License-Identifier: MIT
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);
    }
}
        

/

// 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;
    }
}
          

/

// 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);
}
          

/

// SPDX-License-Identifier: MIT
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;
}
          

Compiler 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":{"runs":5000,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"london","compilationTarget":{"src/FactoryUpgradeGate.sol":"FactoryUpgradeGate"}}
              

Contract ABI

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

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b5060405161067c38038061067c83398101604081905261002f91610099565b6100388161003e565b506100c9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156100ab57600080fd5b81516001600160a01b03811681146100c257600080fd5b9392505050565b6105a4806100d86000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806373995833146100515780638466a71c146100af57806389428654146100c45780638da5cb5b146100d7575b600080fd5b61009a61005f366004610404565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205460ff1690565b60405190151581526020015b60405180910390f35b6100c26100bd366004610404565b6100ff565b005b6100c26100d2366004610437565b61021b565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82811660008181526001602090815260408083209486168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905581519283528201929092527fa3a0491075ec5f5949945a6f452fb9e0619a4dacc65a568ad2da3210cc91cdab910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e657200000000000000000000000000000000000000000000604482015260640161017c565b60005b818110156103d55773ffffffffffffffffffffffffffffffffffffffff84166000908152600160208190526040822090918585858181106102e2576102e26104bd565b90506020020160208101906102f791906104ec565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557f7acfb66a4ce41040d432f980d35151e6d37f3279e6f8dbf383b0f5112271462f8484848481811061037e5761037e6104bd565b905060200201602081019061039391906104ec565b6040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301520160405180910390a1806103cd8161050e565b91505061029f565b50505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146103ff57600080fd5b919050565b6000806040838503121561041757600080fd5b610420836103db565b915061042e602084016103db565b90509250929050565b60008060006040848603121561044c57600080fd5b610455846103db565b9250602084013567ffffffffffffffff8082111561047257600080fd5b818601915086601f83011261048657600080fd5b81358181111561049557600080fd5b8760208260051b85010111156104aa57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156104fe57600080fd5b610507826103db565b9392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610567577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea26469706673582212202495cb57601c6a90b67c1ff410cd21700c1a47da1fa87fcf803fadad368af2a664736f6c634300080a0033000000000000000000000000d1d1d4e36117ab794ec5d4c78cbd3a8904e691d0

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806373995833146100515780638466a71c146100af57806389428654146100c45780638da5cb5b146100d7575b600080fd5b61009a61005f366004610404565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205460ff1690565b60405190151581526020015b60405180910390f35b6100c26100bd366004610404565b6100ff565b005b6100c26100d2366004610437565b61021b565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100a6565b60005473ffffffffffffffffffffffffffffffffffffffff163314610185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82811660008181526001602090815260408083209486168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905581519283528201929092527fa3a0491075ec5f5949945a6f452fb9e0619a4dacc65a568ad2da3210cc91cdab910160405180910390a15050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e657200000000000000000000000000000000000000000000604482015260640161017c565b60005b818110156103d55773ffffffffffffffffffffffffffffffffffffffff84166000908152600160208190526040822090918585858181106102e2576102e26104bd565b90506020020160208101906102f791906104ec565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790557f7acfb66a4ce41040d432f980d35151e6d37f3279e6f8dbf383b0f5112271462f8484848481811061037e5761037e6104bd565b905060200201602081019061039391906104ec565b6040805173ffffffffffffffffffffffffffffffffffffffff93841681529290911660208301520160405180910390a1806103cd8161050e565b91505061029f565b50505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146103ff57600080fd5b919050565b6000806040838503121561041757600080fd5b610420836103db565b915061042e602084016103db565b90509250929050565b60008060006040848603121561044c57600080fd5b610455846103db565b9250602084013567ffffffffffffffff8082111561047257600080fd5b818601915086601f83011261048657600080fd5b81358181111561049557600080fd5b8760208260051b85010111156104aa57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156104fe57600080fd5b610507826103db565b9392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610567577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b506001019056fea26469706673582212202495cb57601c6a90b67c1ff410cd21700c1a47da1fa87fcf803fadad368af2a664736f6c634300080a0033