ETH Price: $2,046.32 (-1.96%)

Contract

0xa2ffeE0a4C874DAe7EA475eb3E329295DF8e7609
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Proxy Con...231952302025-08-22 7:50:23212 days ago1755849023IN
0xa2ffeE0a...5DF8e7609
0 ETH0.001106342.21608465
Create Proxy Con...231949522025-08-22 6:54:35212 days ago1755845675IN
0xa2ffeE0a...5DF8e7609
0 ETH0.00106952.14384232
Create Proxy Con...231892832025-08-21 11:53:35213 days ago1755777215IN
0xa2ffeE0a...5DF8e7609
0 ETH0.001117442.23833306
Create Proxy Con...231891192025-08-21 11:20:47213 days ago1755775247IN
0xa2ffeE0a...5DF8e7609
0 ETH0.001104832.2148345
Update Authorize...231807222025-08-20 7:13:23214 days ago1755674003IN
0xa2ffeE0a...5DF8e7609
0 ETH0.00006582.17630968
Create Proxy Con...227197612025-06-16 21:28:23279 days ago1750109303IN
0xa2ffeE0a...5DF8e7609
0 ETH0.000813971.63226414
Create Proxy Con...223809852025-04-30 9:31:47326 days ago1746005507IN
0xa2ffeE0a...5DF8e7609
0 ETH0.00046820.93803262
Create Proxy Con...223809132025-04-30 9:16:59326 days ago1746004619IN
0xa2ffeE0a...5DF8e7609
0 ETH0.000446240.89457836
Create Proxy Con...223745072025-04-29 11:46:11327 days ago1745927171IN
0xa2ffeE0a...5DF8e7609
0 ETH0.000540551.08290744
Create Proxy Con...223743162025-04-29 11:07:59327 days ago1745924879IN
0xa2ffeE0a...5DF8e7609
0 ETH0.000519081.04057026
Create Proxy Con...223733312025-04-29 7:49:35327 days ago1745912975IN
0xa2ffeE0a...5DF8e7609
0 ETH0.00043790.87722215
Create Proxy Con...223731732025-04-29 7:17:59327 days ago1745911079IN
0xa2ffeE0a...5DF8e7609
0 ETH0.000460.89156708

Latest 11 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x60806040231952302025-08-22 7:50:23212 days ago1755849023
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040231949522025-08-22 6:54:35212 days ago1755845675
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040231892832025-08-21 11:53:35213 days ago1755777215
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040231891192025-08-21 11:20:47213 days ago1755775247
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040227197612025-06-16 21:28:23279 days ago1750109303
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223809852025-04-30 9:31:47326 days ago1746005507
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223809132025-04-30 9:16:59326 days ago1746004619
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223745072025-04-29 11:46:11327 days ago1745927171
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223743162025-04-29 11:07:59327 days ago1745924879
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223733312025-04-29 7:49:35327 days ago1745912975
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
0x60806040223731732025-04-29 7:17:59327 days ago1745911079
0xa2ffeE0a...5DF8e7609
 Contract Creation0 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TLCreatorFactory

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 2000 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/*//////////////////////////////////////////////////////////////////////////
                            TLCreator
//////////////////////////////////////////////////////////////////////////*/

/// @title TLCreator.sol
/// @notice Transient Labs Core Creator Contract
/// @dev This works for either ERC721TL or ERC1155TL contracts; just need to change the implementation.
/// @author transientlabs.xyz
/// @custom:version 2.3.0
contract TLCreatorFactory is Ownable {
    using ECDSA for bytes32;
    address internal constant ADDRESS_ZERO = address(0);
    bytes data;

    // Address that calls this contract function
    address public authorizedAddress;

    enum ContractType {
        ERC721TL,
        ERC1155TL
    }

    // Structure to store contract information
    struct ContractInfo {
        string name;
        ContractType contractType;
        address contractOwner;
        bool isStoryEnable;
        bool isFrozen;
    }

    struct ContractDetails {
        address implementation;
        string name;
        string symbol;
        bool enableStory;
        bool frozen;
        ContractType contractType;
        uint256 timestamp;
        uint256 defaultRoyaltyPercentage;
        address defaultRoyaltyRecipient;
        address initOwner;
        address blockListRegistry;
        address[] admins;
        address conduit;
    }

    // Mapping from contract address to ContractInfo
    mapping(address => ContractInfo) public contractInfoMap;

    address[] public createdContracts;

    // Event to trigger the creation of new ERC721TL contract address.
    event NewCollectionCreated(
        address indexed contractAddress,
        ContractInfo contractInfo
    );
    
    event FrozenStatusChanged(ContractInfo contractInfo, address contractAddress);
    event AuthorizedAddressUpdated(address authorizedAddress);
    error NotContractOwner();
    error SameFrozenStatus();
    error ZeroAddress();
    error InvalidSigner();
    error SignatureExpired();

    constructor(address _authorizedAddress) {
        checkZeroAddress(_authorizedAddress);
        authorizedAddress = _authorizedAddress;
    }

    /**
     * @dev Function to update the authorized address allowed to call certain functions
     * @param newAddress The new authorize address.
     */
    function updateAuthorizedAddress(address newAddress) external onlyOwner {
        require(
            authorizedAddress != newAddress,
            "TLCreatorFactory::updateAuthorizedAddress: New address should not be equal to previous address"
        );
        checkZeroAddress(newAddress);
        authorizedAddress = newAddress;
        emit AuthorizedAddressUpdated(authorizedAddress);
    }

    /**
     * @dev This function deploys a proxy contract.
     * @param encodedData The contract details passed in encoded format.
     * @param signature The signature of the caller.
     */
    function createProxyContract(
        bytes memory encodedData,
        bytes memory signature
    ) external returns (address) {
        ContractDetails memory details = abi.decode(
            encodedData,
            (ContractDetails)
        );
        {
            address signer = keccak256(abi.encodePacked(encodedData))
                .toEthSignedMessageHash()
                .recover(signature);
                
            if (signer != authorizedAddress) {
                revert InvalidSigner();
            }
            if (block.timestamp > details.timestamp) {
                revert SignatureExpired();
            }
            checkZeroAddress(details.initOwner);
            checkZeroAddress(details.blockListRegistry);
        }
        address deployedContract = address(
            new ERC1967Proxy(
                details.implementation,
                abi.encodeWithSelector(
                    0xe5350399, // selector for "initContract(string,string,address,uint256,address,address[],bool,address,address)"
                    details.name,
                    details.symbol,
                    details.defaultRoyaltyRecipient,
                    details.defaultRoyaltyPercentage,
                    details.initOwner,
                    details.admins,
                    details.enableStory,
                    details.blockListRegistry,
                    details.conduit,
                    details.frozen
                )
            )
        );
        createdContracts.push(deployedContract);
        {  
            ContractInfo memory contractInfo = ContractInfo({
                name: details.name,
                contractType: details.contractType,
                contractOwner: details.initOwner,
                isStoryEnable: details.enableStory,
                isFrozen: details.frozen
            });
            // Store contract information in the mapping
            contractInfoMap[deployedContract] = contractInfo; 
            emit NewCollectionCreated(deployedContract, contractInfo);
        }
        return deployedContract;
    }

    /**
     * @dev This function updates the frozen flag in the contract details.
     * @param contractAddress The address of the contract for which the frozen flag is to be updated.
     * @param status The boolean value indicating the new status of the flag.
     */
    function updateIsFrozen(address contractAddress, bool status) external {
        ContractInfo storage contractInfo = contractInfoMap[contractAddress];
        if (contractInfo.contractOwner != msg.sender) {
            revert NotContractOwner();
        }
        if (contractInfo.isFrozen == status) {
            revert SameFrozenStatus();
        }
        contractInfo.isFrozen = status;
        emit FrozenStatusChanged(contractInfo, contractAddress);
    }

    /**
     * @dev Checks if an address is not the zero address.
     * @param anyAddress The address to be checked.
     * Requirements:
     * - The provided address must not be the zero address.
     * Reverts with an error message if the address is the zero address.
     */
    function checkZeroAddress(address anyAddress) internal pure {
        require(
            anyAddress != ADDRESS_ZERO,
            "TLCreatorFactory: Address should not be equal to zero address"
        );
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 4 of 15 : IERC1967.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

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

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)

pragma solidity ^0.8.0;

import "../Proxy.sol";
import "./ERC1967Upgrade.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy, ERC1967Upgrade {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializing the storage of the proxy like a Solidity constructor.
     */
    constructor(address _logic, bytes memory _data) payable {
        _upgradeToAndCall(_logic, _data, false);
    }

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        return ERC1967Upgrade._getImplementation();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../interfaces/IERC1967.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967Upgrade is IERC1967 {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overridden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

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:
 * ```solidity
 * 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`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

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

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

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

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

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "evmVersion": "london",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_authorizedAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"NotContractOwner","type":"error"},{"inputs":[],"name":"SameFrozenStatus","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"authorizedAddress","type":"address"}],"name":"AuthorizedAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"enum TLCreatorFactory.ContractType","name":"contractType","type":"uint8"},{"internalType":"address","name":"contractOwner","type":"address"},{"internalType":"bool","name":"isStoryEnable","type":"bool"},{"internalType":"bool","name":"isFrozen","type":"bool"}],"indexed":false,"internalType":"struct TLCreatorFactory.ContractInfo","name":"contractInfo","type":"tuple"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"FrozenStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"enum TLCreatorFactory.ContractType","name":"contractType","type":"uint8"},{"internalType":"address","name":"contractOwner","type":"address"},{"internalType":"bool","name":"isStoryEnable","type":"bool"},{"internalType":"bool","name":"isFrozen","type":"bool"}],"indexed":false,"internalType":"struct TLCreatorFactory.ContractInfo","name":"contractInfo","type":"tuple"}],"name":"NewCollectionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"authorizedAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contractInfoMap","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"enum TLCreatorFactory.ContractType","name":"contractType","type":"uint8"},{"internalType":"address","name":"contractOwner","type":"address"},{"internalType":"bool","name":"isStoryEnable","type":"bool"},{"internalType":"bool","name":"isFrozen","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"createProxyContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"createdContracts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"updateAuthorizedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"updateIsFrozen","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162001dc238038062001dc2833981016040819052620000349162000144565b6200003f3362000070565b6200004a81620000c0565b600280546001600160a01b0319166001600160a01b039290921691909117905562000176565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116620001415760405162461bcd60e51b815260206004820152603d60248201527f544c43726561746f72466163746f72793a20416464726573732073686f756c6460448201527f206e6f7420626520657175616c20746f207a65726f2061646472657373000000606482015260840160405180910390fd5b50565b6000602082840312156200015757600080fd5b81516001600160a01b03811681146200016f57600080fd5b9392505050565b611c3c80620001866000396000f3fe60806040523480156200001157600080fd5b5060043610620000b05760003560e01c80637bb201a9116200007f578063912146361162000062578063912146361462000149578063f2fde38b1462000160578063f49b133d146200017757600080fd5b80637bb201a914620001205780638da5cb5b146200013757600080fd5b80630881139714620000b557806328d389bc14620000e95780635539d4001462000102578063715018a61462000116575b600080fd5b620000cc620000c636600462000e18565b620001a1565b6040516001600160a01b0390911681526020015b60405180910390f35b62000100620000fa36600462000e48565b620001cc565b005b600254620000cc906001600160a01b031681565b62000100620002f1565b620000cc6200013136600462000f6d565b62000309565b6000546001600160a01b0316620000cc565b620001006200015a36600462000fe7565b6200075c565b620001006200017136600462000e48565b62000893565b6200018e6200018836600462000e48565b62000929565b604051620000e0959493929190620010b2565b60048181548110620001b257600080fd5b6000918252602090912001546001600160a01b0316905081565b620001d662000a21565b6002546001600160a01b03808316911603620002855760405162461bcd60e51b815260206004820152605e60248201527f544c43726561746f72466163746f72793a3a757064617465417574686f72697a60448201527f6564416464726573733a204e657720616464726573732073686f756c64206e6f60648201527f7420626520657175616c20746f2070726576696f757320616464726573730000608482015260a4015b60405180910390fd5b620002908162000a7d565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe12f594f8990d16225e1238de64b5ef16fbe78fbb1a70f64e3a82274e9554c0a9060200160405180910390a150565b620002fb62000a21565b62000307600062000afb565b565b6000808380602001905181019062000322919062001216565b9050600062000392846200038b8760405160200162000342919062001390565b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b9062000b58565b6002549091506001600160a01b03808316911614620003dd576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160c001514211156200041c576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6200042c82610120015162000a7d565b6200043c82610140015162000a7d565b506000816000015163e5350399836020015184604001518561010001518660e0015187610120015188610160015189606001518a61014001518b61018001518c608001516040516024016200049b9a99989796959493929190620013ae565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051620004ea9062000e0a565b620004f792919062001481565b604051809103906000f08015801562000514573d6000803e3d6000fd5b50600480546001808201835560009283527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385161790556040805160a0808201909252602087810151825291870151949550929390830191811115620005a257620005a262001079565b81526020018461012001516001600160a01b031681526020018460600151151581526020018460800151151581525090508060036000846001600160a01b03166001600160a01b03168152602001908152602001600020600082015181600001908162000610919062001534565b50602082015160018083018054909160ff199091169083818111156200063a576200063a62001079565b02179055506040828101516001909201805460608501516080909501511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff9515157501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff6001600160a01b0396871661010002167fffffffffffffffffffff000000000000000000000000000000000000000000ff909316929092179190911794909416939093179092559051908316907f531e1ae6528a82df16b9c4209e0c9005dc28333077ad05fd48074b8090c15c9e906200074b90849062001601565b60405180910390a250949350505050565b6001600160a01b03808316600090815260036020526040902060018101549091610100909104163314620007bc576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115158160010160169054906101000a900460ff161515036200080b576040517f3ecb9f4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff16760100000000000000000000000000000000000000000000841515021790556040517f1afff855d23dff54076bc9a8a203e649da817aea67d25e3ff4af0e0fe485462c906200088690839086906200166b565b60405180910390a1505050565b6200089d62000a21565b6001600160a01b0381166200091b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016200027c565b620009268162000afb565b50565b6003602052600090815260409020805481906200094690620014a5565b80601f01602080910402602001604051908101604052809291908181526020018280546200097490620014a5565b8015620009c55780601f106200099957610100808354040283529160200191620009c5565b820191906000526020600020905b815481529060010190602001808311620009a757829003601f168201915b5050506001909301549192505060ff808216916001600160a01b03610100820416917501000000000000000000000000000000000000000000820481169176010000000000000000000000000000000000000000000090041685565b6000546001600160a01b03163314620003075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200027c565b6001600160a01b038116620009265760405162461bcd60e51b815260206004820152603d60248201527f544c43726561746f72466163746f72793a20416464726573732073686f756c6460448201527f206e6f7420626520657175616c20746f207a65726f206164647265737300000060648201526084016200027c565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600062000b69858562000b80565b9150915062000b788162000bc9565b509392505050565b600080825160410362000bba5760208301516040840151606085015160001a62000bad8782858562000d41565b9450945050505062000bc2565b506000905060025b9250929050565b600081600481111562000be05762000be062001079565b0362000be95750565b600181600481111562000c005762000c0062001079565b0362000c4f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016200027c565b600281600481111562000c665762000c6662001079565b0362000cb55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016200027c565b600381600481111562000ccc5762000ccc62001079565b03620009265760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016200027c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111562000d7a575060009050600362000e01565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801562000dcf573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662000dfa5760006001925092505062000e01565b9150600090505b94509492505050565b6104c5806200176b83390190565b60006020828403121562000e2b57600080fd5b5035919050565b6001600160a01b03811681146200092657600080fd5b60006020828403121562000e5b57600080fd5b813562000e688162000e32565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff8111828210171562000eac5762000eac62000e6f565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171562000ede5762000ede62000e6f565b604052919050565b600067ffffffffffffffff82111562000f035762000f0362000e6f565b50601f01601f191660200190565b600082601f83011262000f2357600080fd5b813562000f3a62000f348262000ee6565b62000eb2565b81815284602083860101111562000f5057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562000f8157600080fd5b823567ffffffffffffffff8082111562000f9a57600080fd5b62000fa88683870162000f11565b9350602085013591508082111562000fbf57600080fd5b5062000fce8582860162000f11565b9150509250929050565b80151581146200092657600080fd5b6000806040838503121562000ffb57600080fd5b8235620010088162000e32565b915060208301356200101a8162000fd8565b809150509250929050565b60005b838110156200104257818101518382015260200162001028565b50506000910152565b600081518084526200106581602086016020860162001025565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b60028110620010ae57634e487b7160e01b600052602160045260246000fd5b9052565b60a081526000620010c760a08301886200104b565b9050620010d860208301876200108f565b6001600160a01b039490941660408201529115156060830152151560809091015292915050565b80516200110c8162000e32565b919050565b600082601f8301126200112357600080fd5b81516200113462000f348262000ee6565b8181528460208386010111156200114a57600080fd5b6200115d82602083016020870162001025565b949350505050565b80516200110c8162000fd8565b8051600281106200110c57600080fd5b600082601f8301126200119457600080fd5b8151602067ffffffffffffffff821115620011b357620011b362000e6f565b8160051b620011c482820162000eb2565b9283528481018201928281019087851115620011df57600080fd5b83870192505b848310156200120b578251620011fb8162000e32565b82529183019190830190620011e5565b979650505050505050565b6000602082840312156200122957600080fd5b815167ffffffffffffffff808211156200124257600080fd5b908301906101a082860312156200125857600080fd5b6200126262000e85565b6200126d83620010ff565b81526020830151828111156200128257600080fd5b620012908782860162001111565b602083015250604083015182811115620012a957600080fd5b620012b78782860162001111565b604083015250620012cb6060840162001165565b6060820152620012de6080840162001165565b6080820152620012f160a0840162001172565b60a082015260c083015160c082015260e083015160e08201526101006200131a818501620010ff565b908201526101206200132e848201620010ff565b9082015261014062001342848201620010ff565b9082015261016083810151838111156200135b57600080fd5b620013698882870162001182565b828401525050610180915062001381828401620010ff565b91810191909152949350505050565b60008251620013a481846020870162001025565b9190910192915050565b6000610140808352620013c48184018e6200104b565b9050602083820381850152620013db828e6200104b565b6001600160a01b038d81166040870152606086018d90528b8116608087015285820360a08701528a51808352838c019450909183019060005b818110156200143457855184168352948401949184019160010162001414565b505089151560c087015293506200144a92505050565b6001600160a01b03851660e08301526001600160a01b0384166101008301528215156101208301529b9a5050505050505050505050565b6001600160a01b03831681526040602082015260006200115d60408301846200104b565b600181811c90821680620014ba57607f821691505b602082108103620014db57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200152f57600081815260208120601f850160051c810160208610156200150a5750805b601f850160051c820191505b818110156200152b5782815560010162001516565b5050505b505050565b815167ffffffffffffffff81111562001551576200155162000e6f565b6200156981620015628454620014a5565b84620014e1565b602080601f831160018114620015a15760008415620015885750858301515b600019600386901b1c1916600185901b1785556200152b565b600085815260208120601f198616915b82811015620015d257888601518255948401946001909101908401620015b1565b5085821015620015f15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825160a060208401526200161f60c08401826200104b565b905060208401516200163560408501826200108f565b506001600160a01b0360408501511660608401526060840151151560808401526080840151151560a08401528091505092915050565b6040815260a0604082015260008084546200168681620014a5565b8060e0860152610100600180841660008114620016ac5760018114620016c757620016fa565b60ff198516838901528284151560051b8901019550620016fa565b8960005260208060002060005b86811015620016f15781548b8201870152908401908201620016d4565b8a018501975050505b508801549250620017159150506060850160ff83166200108f565b600881901c6001600160a01b031660808501526200173d60a0850160ff8360a81c1615159052565b6200175260c0850160ff8360b01c1615159052565b506001600160a01b0384166020840152905062000e6856fe60806040526040516104c53803806104c5833981016040819052610022916102de565b61002e82826000610035565b50506103fb565b61003e83610061565b60008251118061004b5750805b1561005c5761005a83836100a1565b505b505050565b61006a816100cd565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100c6838360405180606001604052806027815260200161049e60279139610180565b9392505050565b6001600160a01b0381163b61013f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080856001600160a01b03168560405161019d91906103ac565b600060405180830381855af49150503d80600081146101d8576040519150601f19603f3d011682016040523d82523d6000602084013e6101dd565b606091505b5090925090506101ef868383876101f9565b9695505050505050565b60608315610268578251600003610261576001600160a01b0385163b6102615760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610136565b5081610272565b610272838361027a565b949350505050565b81511561028a5781518083602001fd5b8060405162461bcd60e51b815260040161013691906103c8565b634e487b7160e01b600052604160045260246000fd5b60005b838110156102d55781810151838201526020016102bd565b50506000910152565b600080604083850312156102f157600080fd5b82516001600160a01b038116811461030857600080fd5b60208401519092506001600160401b038082111561032557600080fd5b818501915085601f83011261033957600080fd5b81518181111561034b5761034b6102a4565b604051601f8201601f19908116603f01168101908382118183101715610373576103736102a4565b8160405282815288602084870101111561038c57600080fd5b61039d8360208301602088016102ba565b80955050505050509250929050565b600082516103be8184602087016102ba565b9190910192915050565b60208152600082518060208401526103e78160408501602087016102ba565b601f01601f19169190910160400192915050565b6095806104096000396000f3fe608060405236601057600e6013565b005b600e5b601f601b6021565b6065565b565b600060607f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156083573d6000f35b3d6000fdfea164736f6c6343000813000a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000813000a000000000000000000000000fbc325dd684d46df076850cc29ae1084e2ee5221

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620000b05760003560e01c80637bb201a9116200007f578063912146361162000062578063912146361462000149578063f2fde38b1462000160578063f49b133d146200017757600080fd5b80637bb201a914620001205780638da5cb5b146200013757600080fd5b80630881139714620000b557806328d389bc14620000e95780635539d4001462000102578063715018a61462000116575b600080fd5b620000cc620000c636600462000e18565b620001a1565b6040516001600160a01b0390911681526020015b60405180910390f35b62000100620000fa36600462000e48565b620001cc565b005b600254620000cc906001600160a01b031681565b62000100620002f1565b620000cc6200013136600462000f6d565b62000309565b6000546001600160a01b0316620000cc565b620001006200015a36600462000fe7565b6200075c565b620001006200017136600462000e48565b62000893565b6200018e6200018836600462000e48565b62000929565b604051620000e0959493929190620010b2565b60048181548110620001b257600080fd5b6000918252602090912001546001600160a01b0316905081565b620001d662000a21565b6002546001600160a01b03808316911603620002855760405162461bcd60e51b815260206004820152605e60248201527f544c43726561746f72466163746f72793a3a757064617465417574686f72697a60448201527f6564416464726573733a204e657720616464726573732073686f756c64206e6f60648201527f7420626520657175616c20746f2070726576696f757320616464726573730000608482015260a4015b60405180910390fd5b620002908162000a7d565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe12f594f8990d16225e1238de64b5ef16fbe78fbb1a70f64e3a82274e9554c0a9060200160405180910390a150565b620002fb62000a21565b62000307600062000afb565b565b6000808380602001905181019062000322919062001216565b9050600062000392846200038b8760405160200162000342919062001390565b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b9062000b58565b6002549091506001600160a01b03808316911614620003dd576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160c001514211156200041c576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6200042c82610120015162000a7d565b6200043c82610140015162000a7d565b506000816000015163e5350399836020015184604001518561010001518660e0015187610120015188610160015189606001518a61014001518b61018001518c608001516040516024016200049b9a99989796959493929190620013ae565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051620004ea9062000e0a565b620004f792919062001481565b604051809103906000f08015801562000514573d6000803e3d6000fd5b50600480546001808201835560009283527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0385161790556040805160a0808201909252602087810151825291870151949550929390830191811115620005a257620005a262001079565b81526020018461012001516001600160a01b031681526020018460600151151581526020018460800151151581525090508060036000846001600160a01b03166001600160a01b03168152602001908152602001600020600082015181600001908162000610919062001534565b50602082015160018083018054909160ff199091169083818111156200063a576200063a62001079565b02179055506040828101516001909201805460608501516080909501511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff9515157501000000000000000000000000000000000000000000027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff6001600160a01b0396871661010002167fffffffffffffffffffff000000000000000000000000000000000000000000ff909316929092179190911794909416939093179092559051908316907f531e1ae6528a82df16b9c4209e0c9005dc28333077ad05fd48074b8090c15c9e906200074b90849062001601565b60405180910390a250949350505050565b6001600160a01b03808316600090815260036020526040902060018101549091610100909104163314620007bc576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115158160010160169054906101000a900460ff161515036200080b576040517f3ecb9f4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810180547fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff16760100000000000000000000000000000000000000000000841515021790556040517f1afff855d23dff54076bc9a8a203e649da817aea67d25e3ff4af0e0fe485462c906200088690839086906200166b565b60405180910390a1505050565b6200089d62000a21565b6001600160a01b0381166200091b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016200027c565b620009268162000afb565b50565b6003602052600090815260409020805481906200094690620014a5565b80601f01602080910402602001604051908101604052809291908181526020018280546200097490620014a5565b8015620009c55780601f106200099957610100808354040283529160200191620009c5565b820191906000526020600020905b815481529060010190602001808311620009a757829003601f168201915b5050506001909301549192505060ff808216916001600160a01b03610100820416917501000000000000000000000000000000000000000000820481169176010000000000000000000000000000000000000000000090041685565b6000546001600160a01b03163314620003075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200027c565b6001600160a01b038116620009265760405162461bcd60e51b815260206004820152603d60248201527f544c43726561746f72466163746f72793a20416464726573732073686f756c6460448201527f206e6f7420626520657175616c20746f207a65726f206164647265737300000060648201526084016200027c565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600062000b69858562000b80565b9150915062000b788162000bc9565b509392505050565b600080825160410362000bba5760208301516040840151606085015160001a62000bad8782858562000d41565b9450945050505062000bc2565b506000905060025b9250929050565b600081600481111562000be05762000be062001079565b0362000be95750565b600181600481111562000c005762000c0062001079565b0362000c4f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016200027c565b600281600481111562000c665762000c6662001079565b0362000cb55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016200027c565b600381600481111562000ccc5762000ccc62001079565b03620009265760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016200027c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111562000d7a575060009050600362000e01565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801562000dcf573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662000dfa5760006001925092505062000e01565b9150600090505b94509492505050565b6104c5806200176b83390190565b60006020828403121562000e2b57600080fd5b5035919050565b6001600160a01b03811681146200092657600080fd5b60006020828403121562000e5b57600080fd5b813562000e688162000e32565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040516101a0810167ffffffffffffffff8111828210171562000eac5762000eac62000e6f565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171562000ede5762000ede62000e6f565b604052919050565b600067ffffffffffffffff82111562000f035762000f0362000e6f565b50601f01601f191660200190565b600082601f83011262000f2357600080fd5b813562000f3a62000f348262000ee6565b62000eb2565b81815284602083860101111562000f5057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562000f8157600080fd5b823567ffffffffffffffff8082111562000f9a57600080fd5b62000fa88683870162000f11565b9350602085013591508082111562000fbf57600080fd5b5062000fce8582860162000f11565b9150509250929050565b80151581146200092657600080fd5b6000806040838503121562000ffb57600080fd5b8235620010088162000e32565b915060208301356200101a8162000fd8565b809150509250929050565b60005b838110156200104257818101518382015260200162001028565b50506000910152565b600081518084526200106581602086016020860162001025565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b60028110620010ae57634e487b7160e01b600052602160045260246000fd5b9052565b60a081526000620010c760a08301886200104b565b9050620010d860208301876200108f565b6001600160a01b039490941660408201529115156060830152151560809091015292915050565b80516200110c8162000e32565b919050565b600082601f8301126200112357600080fd5b81516200113462000f348262000ee6565b8181528460208386010111156200114a57600080fd5b6200115d82602083016020870162001025565b949350505050565b80516200110c8162000fd8565b8051600281106200110c57600080fd5b600082601f8301126200119457600080fd5b8151602067ffffffffffffffff821115620011b357620011b362000e6f565b8160051b620011c482820162000eb2565b9283528481018201928281019087851115620011df57600080fd5b83870192505b848310156200120b578251620011fb8162000e32565b82529183019190830190620011e5565b979650505050505050565b6000602082840312156200122957600080fd5b815167ffffffffffffffff808211156200124257600080fd5b908301906101a082860312156200125857600080fd5b6200126262000e85565b6200126d83620010ff565b81526020830151828111156200128257600080fd5b620012908782860162001111565b602083015250604083015182811115620012a957600080fd5b620012b78782860162001111565b604083015250620012cb6060840162001165565b6060820152620012de6080840162001165565b6080820152620012f160a0840162001172565b60a082015260c083015160c082015260e083015160e08201526101006200131a818501620010ff565b908201526101206200132e848201620010ff565b9082015261014062001342848201620010ff565b9082015261016083810151838111156200135b57600080fd5b620013698882870162001182565b828401525050610180915062001381828401620010ff565b91810191909152949350505050565b60008251620013a481846020870162001025565b9190910192915050565b6000610140808352620013c48184018e6200104b565b9050602083820381850152620013db828e6200104b565b6001600160a01b038d81166040870152606086018d90528b8116608087015285820360a08701528a51808352838c019450909183019060005b818110156200143457855184168352948401949184019160010162001414565b505089151560c087015293506200144a92505050565b6001600160a01b03851660e08301526001600160a01b0384166101008301528215156101208301529b9a5050505050505050505050565b6001600160a01b03831681526040602082015260006200115d60408301846200104b565b600181811c90821680620014ba57607f821691505b602082108103620014db57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200152f57600081815260208120601f850160051c810160208610156200150a5750805b601f850160051c820191505b818110156200152b5782815560010162001516565b5050505b505050565b815167ffffffffffffffff81111562001551576200155162000e6f565b6200156981620015628454620014a5565b84620014e1565b602080601f831160018114620015a15760008415620015885750858301515b600019600386901b1c1916600185901b1785556200152b565b600085815260208120601f198616915b82811015620015d257888601518255948401946001909101908401620015b1565b5085821015620015f15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825160a060208401526200161f60c08401826200104b565b905060208401516200163560408501826200108f565b506001600160a01b0360408501511660608401526060840151151560808401526080840151151560a08401528091505092915050565b6040815260a0604082015260008084546200168681620014a5565b8060e0860152610100600180841660008114620016ac5760018114620016c757620016fa565b60ff198516838901528284151560051b8901019550620016fa565b8960005260208060002060005b86811015620016f15781548b8201870152908401908201620016d4565b8a018501975050505b508801549250620017159150506060850160ff83166200108f565b600881901c6001600160a01b031660808501526200173d60a0850160ff8360a81c1615159052565b6200175260c0850160ff8360b01c1615159052565b506001600160a01b0384166020840152905062000e6856fe60806040526040516104c53803806104c5833981016040819052610022916102de565b61002e82826000610035565b50506103fb565b61003e83610061565b60008251118061004b5750805b1561005c5761005a83836100a1565b505b505050565b61006a816100cd565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100c6838360405180606001604052806027815260200161049e60279139610180565b9392505050565b6001600160a01b0381163b61013f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080856001600160a01b03168560405161019d91906103ac565b600060405180830381855af49150503d80600081146101d8576040519150601f19603f3d011682016040523d82523d6000602084013e6101dd565b606091505b5090925090506101ef868383876101f9565b9695505050505050565b60608315610268578251600003610261576001600160a01b0385163b6102615760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610136565b5081610272565b610272838361027a565b949350505050565b81511561028a5781518083602001fd5b8060405162461bcd60e51b815260040161013691906103c8565b634e487b7160e01b600052604160045260246000fd5b60005b838110156102d55781810151838201526020016102bd565b50506000910152565b600080604083850312156102f157600080fd5b82516001600160a01b038116811461030857600080fd5b60208401519092506001600160401b038082111561032557600080fd5b818501915085601f83011261033957600080fd5b81518181111561034b5761034b6102a4565b604051601f8201601f19908116603f01168101908382118183101715610373576103736102a4565b8160405282815288602084870101111561038c57600080fd5b61039d8360208301602088016102ba565b80955050505050509250929050565b600082516103be8184602087016102ba565b9190910192915050565b60208152600082518060208401526103e78160408501602087016102ba565b601f01601f19169190910160400192915050565b6095806104096000396000f3fe608060405236601057600e6013565b005b600e5b601f601b6021565b6065565b565b600060607f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156083573d6000f35b3d6000fdfea164736f6c6343000813000a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000813000a

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

000000000000000000000000fbc325dd684d46df076850cc29ae1084e2ee5221

-----Decoded View---------------
Arg [0] : _authorizedAddress (address): 0xfBc325Dd684d46DF076850CC29aE1084E2EE5221

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


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.