ETH Price: $3,475.56 (+2.20%)

Contract

0xba3e4608272fa79200BD0E4E13aEa84eCa461B0E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
190542002024-01-21 8:59:47339 days ago1705827587  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FERC721C

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 31 : FERC721C.sol
// SPDX-License-Identifier: MIT 
pragma solidity ^0.8.18;

import "@limitbreak/creator-token-contracts/contracts/erc721c/ERC721C.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/ISmartInscriptionFactory.sol";
import "./interfaces/ITokenURI.sol";
import "./interfaces/IWETH9.sol";
import "./interfaces/ISwap.sol";

contract FERC721C is ERC2981, ERC721C {
    address public immutable factoryContract;
		address public immutable tokenURIContract;
    address public immutable swapContract;
    address public immutable wethContract;
		address public immutable fercContract;

		struct TokenData {
			uint64  max;
			uint64  totalSupply;
			bool    needFerc;
			uint24  inscriptionId;
			uint24  limit;
			bytes9  tick;
		}
    TokenData internal _tokenData;

    mapping(address => uint256) internal _lastMintTimestamp; // record the last mint timestamp of account

    constructor(
				address _swapContractAddress,
				address _wethContractAddress,
				address _fercContractAddress,
				address _tokenURIContractAddress)
				ERC721OpenZeppelin("", "") {
				factoryContract = _msgSender();
				swapContract = _swapContractAddress;
				wethContract = _wethContractAddress;
				fercContract = _fercContractAddress;
				tokenURIContract = _tokenURIContractAddress;
    }

		/**
     * @dev Initialize the contract, only call by factory
     */
    function initialize(
        string calldata _tick,
        uint256 _max,
        uint256 _limit,
        uint256 _inscriptionId,
        address _deployer,
        uint96  _feeNumerator,
				bool    _needFerc,
				uint120 _operatorAllowList
    ) public {
        require(_inscriptionId > 0, "inscriptionId can not be zero");
        require(_tokenData.inscriptionId == 0, "initialized");
        require(_msgSender() == factoryContract, "only factory caontract allowed");
        _setDefaultRoyalty(_deployer, _feeNumerator);
				_setToDefaultSecurityPolicyNotOwnable(_operatorAllowList);
				_tokenData.max = uint64(_max);
				_tokenData.totalSupply = 0;
				_tokenData.needFerc = _needFerc;
				_tokenData.inscriptionId = uint24(_inscriptionId);
				_tokenData.limit = uint24(_limit);
				_tokenData.tick = bytes9(bytes(_tick));
    }
		
		/**
     * @dev Check the supports interface
     */
    function supportsInterface(bytes4 _interfaceId) public view virtual override(ERC2981, ERC721C) returns (bool) {
        return 
					_interfaceId == type(IERC721).interfaceId ||
					_interfaceId == type(IERC721Metadata).interfaceId || 
					_interfaceId == type(IERC165).interfaceId ||
					_interfaceId == type(ERC2981).interfaceId ||
					_interfaceId == type(ERC721C).interfaceId ||
					super.supportsInterface(_interfaceId);
    }

    /**
     * @dev name of NFT
     */
    function name() public view override returns (string memory) {
        return string(abi.encodePacked(_bytesToString(bytes32(_tokenData.tick)), " {ferc-721}"));
    }

    /**
     * @dev symbol of NFT
     */
    function symbol() public view override returns (string memory) {
				return _bytesToString(bytes32(_tokenData.tick));
    }

    /**
     * @dev max of token ids of NFT
		 * maximum of max is uint64
     */
    function max() public view returns (uint256) {
        return _tokenData.max;
    }

    /**
		 * Note: Smart Inscription contract was created by Clone, while ownable contract can not be cloned, the _owner always be 0x0
		 * So the factory's owner will be the owner of it. And the owner is untransferable only if you change the owner of factory contract.
     * @dev See {IERC721Metadata-owner}.
     */
		function owner() public view returns (address) {
				return ISmartInscriptionFactory(factoryContract).owner();
		}

		/**
		 * @dev See {ERC2981-_setDefaultRoyalty}
		 * @param receiver receiver of royalty
		 * @param royalty royalty rate according to ERC2981
		 */
		function setDefaultRoyalty(address receiver, uint96 royalty) public {
			_requireCallerIsContractOwner();
			_setDefaultRoyalty(receiver, royalty);
		}

    /**
     * @dev See {IERC721Metadata-limit}.
     */
    function limit() public view returns (uint256) {
        return _tokenData.limit;
    }

    /**
     * @dev See {IERC721Metadata-totalSupply}.
     */
    function totalSupply() public view returns (uint256) {
        return _tokenData.totalSupply;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 _tokenId) public view override returns (string memory res) {
        if (_tokenId <= totalSupply())
            res = ITokenURI(tokenURIContract).uri(
								symbol(),
                _tokenId,
                _tokenData.max,
                _tokenData.limit,
								ownerOf(_tokenId) == ISmartInscriptionFactory(factoryContract).bridgeContractAddress()
            );
    }

    /**
     * @dev See {IERC721Metadata-needFerc}.
     */
		function needFerc() public view returns (bool) {
			return _tokenData.needFerc;
		}

    /**
     * @dev See {IERC721Metadata-lastMintTimestamp}.
     */
    function lastMintTimestamp(address _addr) public view returns (uint256) {
        return _lastMintTimestamp[_addr];
    }

    /**
     * @dev See {IERC721Metadata-inscriptionId}.
     */
    function inscriptionId() public view returns (uint256) {
        return _tokenData.inscriptionId;
    }

    /**
     * @dev See {IERC721Metadata-tokenData}.
     */
		function tokenData() public view returns (TokenData memory) {
				return _tokenData;
		}

    /**
     * @dev See {IFERC721-mint}.
     */
    function mint(address _to) public payable {
        require(_tokenData.totalSupply < _tokenData.max / _tokenData.limit, "touch the max batch");
        require(_to != address(0), "mint to zero address");

				if(_lastMintTimestamp[_msgSender()] + ISmartInscriptionFactory(factoryContract).freezeTime() > block.timestamp) {
            // burn tips
						uint256 mintTip = ISmartInscriptionFactory(factoryContract).mintTip();
						require(mintTip > 0, "no mint tip in freeze time");
						require(IERC20(fercContract).allowance(_msgSender(), address(this)) >= mintTip, "tip allowance not enough");
						require(IERC20(fercContract).balanceOf(_msgSender()) >= mintTip, "balance of tip not enough");
						IERC20(fercContract).transferFrom(_msgSender(), address(0x01), mintTip);
						_tokenData.totalSupply++;
						_mint(_to, _tokenData.totalSupply);
        } else {
					_tokenData.totalSupply++;
					_mint(_to, _tokenData.totalSupply);
				}
    }

		function _mint(address _to, uint256 _tokenId) internal override {
        if (_tokenData.needFerc && msg.value > 0) {
            (bool success2, ) = wethContract.call{value: msg.value}("");
            IWETH9(wethContract).approve(swapContract, msg.value);
            uint256 amountIn = ISwap(swapContract).swapExactOutputSingle(
                ISmartInscriptionFactory(factoryContract).minHoldAmount(),
                msg.value,
                _msgSender()
            );
            require(success2 && amountIn > 0, "swap error");
        }

        if (_tokenData.needFerc && ISmartInscriptionFactory(factoryContract).minHoldAmount() > 0) {
						uint fercBalance = ISwap(swapContract).balanceOfFerc(_msgSender());
            require(fercBalance >= ISmartInscriptionFactory(factoryContract).minHoldAmount(), "ferc not enough");
				}

				ISmartInscriptionFactory(factoryContract).minted(_tokenData.inscriptionId,_tokenId);
        super._mint(_to, _tokenId);
        _lastMintTimestamp[_msgSender()] = block.timestamp;				
		}

		function _bytesToString(bytes32 _bytes) public pure returns (string memory) {
        uint8 i = 0;
        while(i < 32 && _bytes[i] != 0) {
            i++;
        }
        bytes memory bytesArray = new bytes(i);
        for (i = 0; i < 32 && _bytes[i] != 0; i++) {
            bytesArray[i] = _bytes[i];
        }
        return string(bytesArray);
    }

    function _requireCallerIsContractOwner() internal view virtual override {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    function _setToDefaultSecurityPolicyNotOwnable(uint120 _operatorAllowListId) internal {
				transferValidator = ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR);
        transferValidator.setTransferSecurityLevelOfCollection(address(this), TransferSecurityLevels.One);
        transferValidator.setOperatorWhitelistOfCollection(address(this), _operatorAllowListId);
    }
}

File 2 of 31 : OwnablePermissions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/Context.sol";

abstract contract OwnablePermissions is Context {
    function _requireCallerIsContractOwner() internal view virtual;
}

File 3 of 31 : ERC721C.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/CreatorTokenBase.sol";
import "../token/erc721/ERC721OpenZeppelin.sol";

/**
 * @title ERC721C
 * @author Limit Break, Inc.
 * @notice Extends OpenZeppelin's ERC721 implementation with Creator Token functionality, which
 *         allows the contract owner to update the transfer validation logic by managing a security policy in
 *         an external transfer validation security policy registry.  See {CreatorTokenTransferValidator}.
 */
abstract contract ERC721C is ERC721OpenZeppelin, CreatorTokenBase {

    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId);
    }

    /// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateBeforeTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateAfterTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }
}

/**
 * @title ERC721CInitializable
 * @author Limit Break, Inc.
 * @notice Initializable implementation of ERC721C to allow for EIP-1167 proxy clones.
 */
abstract contract ERC721CInitializable is ERC721OpenZeppelinInitializable, CreatorTokenBase {
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId);
    }

    /// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateBeforeTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize) internal virtual override {
        for (uint256 i = 0; i < batchSize;) {
            _validateAfterTransfer(from, to, firstTokenId + i);
            unchecked {
                ++i;
            }
        }
    }
}

File 4 of 31 : ICreatorToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../interfaces/ICreatorTokenTransferValidator.sol";

interface ICreatorToken {
    event TransferValidatorUpdated(address oldValidator, address newValidator);

    function getTransferValidator() external view returns (ICreatorTokenTransferValidator);
    function getSecurityPolicy() external view returns (CollectionSecurityPolicy memory);
    function getWhitelistedOperators() external view returns (address[] memory);
    function getPermittedContractReceivers() external view returns (address[] memory);
    function isOperatorWhitelisted(address operator) external view returns (bool);
    function isContractReceiverPermitted(address receiver) external view returns (bool);
    function isTransferAllowed(address caller, address from, address to) external view returns (bool);
}

File 5 of 31 : ICreatorTokenTransferValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./IEOARegistry.sol";
import "./ITransferSecurityRegistry.sol";
import "./ITransferValidator.sol";

interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {}

File 6 of 31 : IEOARegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IEOARegistry is IERC165 {
    function isVerifiedEOA(address account) external view returns (bool);
}

File 7 of 31 : ITransferSecurityRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/TransferPolicy.sol";

interface ITransferSecurityRegistry {
    event AddedToAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
    event CreatedAllowlist(AllowlistTypes indexed kind, uint256 indexed id, string indexed name);
    event ReassignedAllowlistOwnership(AllowlistTypes indexed kind, uint256 indexed id, address indexed newOwner);
    event RemovedFromAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
    event SetAllowlist(AllowlistTypes indexed kind, address indexed collection, uint120 indexed id);
    event SetTransferSecurityLevel(address indexed collection, TransferSecurityLevels level);

    function createOperatorWhitelist(string calldata name) external returns (uint120);
    function createPermittedContractReceiverAllowlist(string calldata name) external returns (uint120);
    function reassignOwnershipOfOperatorWhitelist(uint120 id, address newOwner) external;
    function reassignOwnershipOfPermittedContractReceiverAllowlist(uint120 id, address newOwner) external;
    function renounceOwnershipOfOperatorWhitelist(uint120 id) external;
    function renounceOwnershipOfPermittedContractReceiverAllowlist(uint120 id) external;
    function setTransferSecurityLevelOfCollection(address collection, TransferSecurityLevels level) external;
    function setOperatorWhitelistOfCollection(address collection, uint120 id) external;
    function setPermittedContractReceiverAllowlistOfCollection(address collection, uint120 id) external;
    function addOperatorToWhitelist(uint120 id, address operator) external;
    function addPermittedContractReceiverToAllowlist(uint120 id, address receiver) external;
    function removeOperatorFromWhitelist(uint120 id, address operator) external;
    function removePermittedContractReceiverFromAllowlist(uint120 id, address receiver) external;
    function getCollectionSecurityPolicy(address collection) external view returns (CollectionSecurityPolicy memory);
    function getWhitelistedOperators(uint120 id) external view returns (address[] memory);
    function getPermittedContractReceivers(uint120 id) external view returns (address[] memory);
    function isOperatorWhitelisted(uint120 id, address operator) external view returns (bool);
    function isContractReceiverPermitted(uint120 id, address receiver) external view returns (bool);
}

File 8 of 31 : ITransferValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/TransferPolicy.sol";

interface ITransferValidator {
    function applyCollectionTransferPolicy(address caller, address from, address to) external view;
}

File 9 of 31 : ERC721OpenZeppelin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "../../access/OwnablePermissions.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

abstract contract ERC721OpenZeppelinBase is ERC721 {

    // Token name
    string internal _contractName;

    // Token symbol
    string internal _contractSymbol;

    function name() public view virtual override returns (string memory) {
        return _contractName;
    }

    function symbol() public view virtual override returns (string memory) {
        return _contractSymbol;
    }

    function _setNameAndSymbol(string memory name_, string memory symbol_) internal {
        _contractName = name_;
        _contractSymbol = symbol_;
    }
}

abstract contract ERC721OpenZeppelin is ERC721OpenZeppelinBase {
    constructor(string memory name_, string memory symbol_) ERC721("", "") {
        _setNameAndSymbol(name_, symbol_);
    }
}

abstract contract ERC721OpenZeppelinInitializable is OwnablePermissions, ERC721OpenZeppelinBase {

    error ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();

    /// @notice Specifies whether or not the contract is initialized
    bool private _erc721Initialized;

    /// @dev Initializes parameters of ERC721 tokens.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeERC721(string memory name_, string memory symbol_) public {
        _requireCallerIsContractOwner();

        if(_erc721Initialized) {
            revert ERC721OpenZeppelinInitializable__AlreadyInitializedERC721();
        }

        _erc721Initialized = true;

        _setNameAndSymbol(name_, symbol_);
    }
}

File 10 of 31 : CreatorTokenBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenTransferValidator.sol";
import "../utils/TransferValidation.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";

/**
 * @title CreatorTokenBase
 * @author Limit Break, Inc.
 * @notice CreatorTokenBase is an abstract contract that provides basic functionality for managing token 
 * transfer policies through an implementation of ICreatorTokenTransferValidator. This contract is intended to be used
 * as a base for creator-specific token contracts, enabling customizable transfer restrictions and security policies.
 *
 * <h4>Features:</h4>
 * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
 * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
 * <ul>ICreatorToken: Implements the interface for creator tokens, providing view functions for token security policies.</ul>
 *
 * <h4>Benefits:</h4>
 * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
 * <ul>Allows creators to enforce policies such as whitelisted operators and permitted contract receivers.</ul>
 * <ul>Can be easily integrated into other token contracts as a base contract.</ul>
 *
 * <h4>Intended Usage:</h4>
 * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and 
 *   security policies.</ul>
 * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the 
 *   creator token.</ul>
 */
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {
    
    error CreatorTokenBase__InvalidTransferValidatorContract();
    error CreatorTokenBase__SetTransferValidatorFirst();

    address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x0000721C310194CcfC01E523fc93C9cCcFa2A0Ac);
    TransferSecurityLevels public constant DEFAULT_TRANSFER_SECURITY_LEVEL = TransferSecurityLevels.One;
    uint120 public constant DEFAULT_OPERATOR_WHITELIST_ID = uint120(1);

    ICreatorTokenTransferValidator public transferValidator;

    /**
     * @notice Allows the contract owner to set the transfer validator to the official validator contract
     *         and set the security policy to the recommended default settings.
     * @dev    May be overridden to change the default behavior of an individual collection.
     */
    function setToDefaultSecurityPolicy() public virtual {
        _requireCallerIsContractOwner();
        setTransferValidator(DEFAULT_TRANSFER_VALIDATOR);
        ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setTransferSecurityLevelOfCollection(address(this), DEFAULT_TRANSFER_SECURITY_LEVEL);
        ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setOperatorWhitelistOfCollection(address(this), DEFAULT_OPERATOR_WHITELIST_ID);
    }

    /**
     * @notice Allows the contract owner to set the transfer validator to a custom validator contract
     *         and set the security policy to their own custom settings.
     */
    function setToCustomValidatorAndSecurityPolicy(
        address validator, 
        TransferSecurityLevels level, 
        uint120 operatorWhitelistId, 
        uint120 permittedContractReceiversAllowlistId) public {
        _requireCallerIsContractOwner();

        setTransferValidator(validator);

        ICreatorTokenTransferValidator(validator).
            setTransferSecurityLevelOfCollection(address(this), level);

        ICreatorTokenTransferValidator(validator).
            setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);

        ICreatorTokenTransferValidator(validator).
            setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
    }

    /**
     * @notice Allows the contract owner to set the security policy to their own custom settings.
     * @dev    Reverts if the transfer validator has not been set.
     */
    function setToCustomSecurityPolicy(
        TransferSecurityLevels level, 
        uint120 operatorWhitelistId, 
        uint120 permittedContractReceiversAllowlistId) public {
        _requireCallerIsContractOwner();

        ICreatorTokenTransferValidator validator = getTransferValidator();
        if (address(validator) == address(0)) {
            revert CreatorTokenBase__SetTransferValidatorFirst();
        }

        validator.setTransferSecurityLevelOfCollection(address(this), level);
        validator.setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);
        validator.setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
    }

    /**
     * @notice Sets the transfer validator for the token contract.
     *
     * @dev    Throws when provided validator contract is not the zero address and doesn't support 
     *         the ICreatorTokenTransferValidator interface. 
     * @dev    Throws when the caller is not the contract owner.
     *
     * @dev    <h4>Postconditions:</h4>
     *         1. The transferValidator address is updated.
     *         2. The `TransferValidatorUpdated` event is emitted.
     *
     * @param transferValidator_ The address of the transfer validator contract.
     */
    function setTransferValidator(address transferValidator_) public {
        _requireCallerIsContractOwner();

        bool isValidTransferValidator = false;

        if(transferValidator_.code.length > 0) {
            try IERC165(transferValidator_).supportsInterface(type(ICreatorTokenTransferValidator).interfaceId) 
                returns (bool supportsInterface) {
                isValidTransferValidator = supportsInterface;
            } catch {}
        }

        if(transferValidator_ != address(0) && !isValidTransferValidator) {
            revert CreatorTokenBase__InvalidTransferValidatorContract();
        }

        emit TransferValidatorUpdated(address(transferValidator), transferValidator_);

        transferValidator = ICreatorTokenTransferValidator(transferValidator_);
    }

    /**
     * @notice Returns the transfer validator contract address for this token contract.
     */
    function getTransferValidator() public view override returns (ICreatorTokenTransferValidator) {
        return transferValidator;
    }

    /**
     * @notice Returns the security policy for this token contract, which includes:
     *         Transfer security level, operator whitelist id, permitted contract receiver allowlist id.
     */
    function getSecurityPolicy() public view override returns (CollectionSecurityPolicy memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getCollectionSecurityPolicy(address(this));
        }

        return CollectionSecurityPolicy({
            transferSecurityLevel: TransferSecurityLevels.Zero,
            operatorWhitelistId: 0,
            permittedContractReceiversId: 0
        });
    }

    /**
     * @notice Returns the list of all whitelisted operators for this token contract.
     * @dev    This can be an expensive call and should only be used in view-only functions.
     */
    function getWhitelistedOperators() public view override returns (address[] memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getWhitelistedOperators(
                transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId);
        }

        return new address[](0);
    }

    /**
     * @notice Returns the list of permitted contract receivers for this token contract.
     * @dev    This can be an expensive call and should only be used in view-only functions.
     */
    function getPermittedContractReceivers() public view override returns (address[] memory) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.getPermittedContractReceivers(
                transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId);
        }

        return new address[](0);
    }

    /**
     * @notice Checks if an operator is whitelisted for this token contract.
     * @param operator The address of the operator to check.
     */
    function isOperatorWhitelisted(address operator) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.isOperatorWhitelisted(
                transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId, operator);
        }

        return false;
    }

    /**
     * @notice Checks if a contract receiver is permitted for this token contract.
     * @param receiver The address of the receiver to check.
     */
    function isContractReceiverPermitted(address receiver) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            return transferValidator.isContractReceiverPermitted(
                transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId, receiver);
        }

        return false;
    }

    /**
     * @notice Determines if a transfer is allowed based on the token contract's security policy.  Use this function
     *         to simulate whether or not a transfer made by the specified `caller` from the `from` address to the `to`
     *         address would be allowed by this token's security policy.
     *
     * @notice This function only checks the security policy restrictions and does not check whether token ownership
     *         or approvals are in place. 
     *
     * @param caller The address of the simulated caller.
     * @param from   The address of the sender.
     * @param to     The address of the receiver.
     * @return       True if the transfer is allowed, false otherwise.
     */
    function isTransferAllowed(address caller, address from, address to) public view override returns (bool) {
        if (address(transferValidator) != address(0)) {
            try transferValidator.applyCollectionTransferPolicy(caller, from, to) {
                return true;
            } catch {
                return false;
            }
        }
        return true;
    }

    /**
     * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
     *      Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
     *      and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
     *
     * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
     *      set to a non-zero address.
     *
     * @param caller  The address of the caller.
     * @param from    The address of the sender.
     * @param to      The address of the receiver.
     */
    function _preValidateTransfer(
        address caller, 
        address from, 
        address to, 
        uint256 /*tokenId*/, 
        uint256 /*value*/) internal virtual override {
        if (address(transferValidator) != address(0)) {
            transferValidator.applyCollectionTransferPolicy(caller, from, to);
        }
    }
}

File 11 of 31 : TransferPolicy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

enum AllowlistTypes {
    Operators,
    PermittedContractReceivers
}

enum ReceiverConstraints {
    None,
    NoCode,
    EOA
}

enum CallerConstraints {
    None,
    OperatorWhitelistEnableOTC,
    OperatorWhitelistDisableOTC
}

enum StakerConstraints {
    None,
    CallerIsTxOrigin,
    EOA
}

enum TransferSecurityLevels {
    Zero,
    One,
    Two,
    Three,
    Four,
    Five,
    Six
}

struct TransferSecurityPolicy {
    CallerConstraints callerConstraints;
    ReceiverConstraints receiverConstraints;
}

struct CollectionSecurityPolicy {
    TransferSecurityLevels transferSecurityLevel;
    uint120 operatorWhitelistId;
    uint120 permittedContractReceiversId;
}

File 12 of 31 : TransferValidation.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @title TransferValidation
 * @author Limit Break, Inc.
 * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks.
 * Openzeppelin's ERC721 contract only provides hooks for before and after transfer.  This allows
 * developers to validate or customize transfers within the context of a mint, a burn, or a transfer.
 */
abstract contract TransferValidation is Context {
    
    error ShouldNotMintToBurnAddress();

    /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
    function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual {
        bool fromZeroAddress = from == address(0);
        bool toZeroAddress = to == address(0);

        if(fromZeroAddress && toZeroAddress) {
            revert ShouldNotMintToBurnAddress();
        } else if(fromZeroAddress) {
            _preValidateMint(_msgSender(), to, tokenId, msg.value);
        } else if(toZeroAddress) {
            _preValidateBurn(_msgSender(), from, tokenId, msg.value);
        } else {
            _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
        }
    }

    /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
    function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual {
        bool fromZeroAddress = from == address(0);
        bool toZeroAddress = to == address(0);

        if(fromZeroAddress && toZeroAddress) {
            revert ShouldNotMintToBurnAddress();
        } else if(fromZeroAddress) {
            _postValidateMint(_msgSender(), to, tokenId, msg.value);
        } else if(toZeroAddress) {
            _postValidateBurn(_msgSender(), from, tokenId, msg.value);
        } else {
            _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
        }
    }

    /// @dev Optional validation hook that fires before a mint
    function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a mint
    function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires before a burn
    function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a burn
    function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires before a transfer
    function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}

    /// @dev Optional validation hook that fires after a transfer
    function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
}

File 13 of 31 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

File 14 of 31 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

File 15 of 31 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
        return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

File 16 of 31 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 17 of 31 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _ownerOf(tokenId) != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId, 1);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

File 18 of 31 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 19 of 31 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 20 of 31 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 21 of 31 : Address.sol
// 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);
        }
    }
}

File 22 of 31 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
    }
}

File 23 of 31 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 24 of 31 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 25 of 31 : Math.sol
// 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);
        }
    }
}

File 26 of 31 : SignedMath.sol
// 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);
        }
    }
}

File 27 of 31 : Strings.sol
// 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));
    }
}

File 28 of 31 : ISmartInscriptionFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface ISmartInscriptionFactory {
	function minHoldAmount() external view returns(uint256);
	function freezeTime() external view returns(uint256);
	function mintTip() external view returns(uint);
	function minted(uint id, uint tokenId) external;
	function owner() external view returns(address);
	function bridgeContractAddress() external view returns(address);
	function transferValidator() external view returns(address);
}

File 29 of 31 : ISwap.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface ISwap {
	function swapExactInputSingle(uint256 amountIn, address recipient) external returns (uint256 amountOut);
	function swapExactOutputSingle(uint256 amountOut, uint256 amountInMaximum, address recipient) external returns (uint256 amountIn);
	function balanceOfFerc(address sender) external returns (uint256 amount);
}

File 30 of 31 : ITokenURI.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface ITokenURI {
    function uri(
			string memory tick,
			uint256 tokenId,
			uint256 max,
			uint256 limit,
			bool    depositing
		) external pure returns (string memory);

}

File 31 of 31 : IWETH9.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

interface IWETH9 {
		function deposit() external payable;
    function withdraw(uint wad) external;
    function approve(address guy, uint wad) external returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_swapContractAddress","type":"address"},{"internalType":"address","name":"_wethContractAddress","type":"address"},{"internalType":"address","name":"_fercContractAddress","type":"address"},{"internalType":"address","name":"_tokenURIContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"CreatorTokenBase__SetTransferValidatorFirst","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_OPERATOR_WHITELIST_ID","outputs":[{"internalType":"uint120","name":"","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_SECURITY_LEVEL","outputs":[{"internalType":"enum TransferSecurityLevels","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_bytes","type":"bytes32"}],"name":"_bytesToString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fercContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPermittedContractReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecurityPolicy","outputs":[{"components":[{"internalType":"enum TransferSecurityLevels","name":"transferSecurityLevel","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversId","type":"uint120"}],"internalType":"struct CollectionSecurityPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_tick","type":"string"},{"internalType":"uint256","name":"_max","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"},{"internalType":"uint256","name":"_inscriptionId","type":"uint256"},{"internalType":"address","name":"_deployer","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"},{"internalType":"bool","name":"_needFerc","type":"bool"},{"internalType":"uint120","name":"_operatorAllowList","type":"uint120"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"inscriptionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"isContractReceiverPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperatorWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"lastMintTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"max","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"needFerc","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"royalty","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomValidatorAndSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToDefaultSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenData","outputs":[{"components":[{"internalType":"uint64","name":"max","type":"uint64"},{"internalType":"uint64","name":"totalSupply","type":"uint64"},{"internalType":"bool","name":"needFerc","type":"bool"},{"internalType":"uint24","name":"inscriptionId","type":"uint24"},{"internalType":"uint24","name":"limit","type":"uint24"},{"internalType":"bytes9","name":"tick","type":"bytes9"}],"internalType":"struct FERC721C.TokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"res","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

610120346200067657601f6001600160401b03601f1962003af538819003848101831686019190848311878410176200067b5780879260809460405283398101031262000676576200005184620006b1565b9060209262000062848701620006b1565b936200007f60606200007760408a01620006b1565b9801620006b1565b956200008a62000691565b9160008084526200009a62000691565b91818352620000a862000691565b96828852620000b662000691565b958387528851888111620004a4576002549960019a8b81811c911680156200066b575b86821014620005805790818984931162000617575b508590898311600114620005ab5787926200059f575b5050600019600383901b1c1916908a1b176002555b8651888111620004a45760039788548b81811c9116801562000594575b8682101462000580579081898493116200052d575b508590898311600114620004c4578792620004b8575b5050600019828a1b1c1916908a1b1787555b805190888211620004a4576008548a81811c9116801562000499575b85821014620004855790818884931162000431575b508490888311600114620003cf578692620003c3575b505060001982891b1c191690891b176008555b8351968711620003af576009548881811c91168015620003a4575b83821014620003905785811162000347575b5081948711600114620002dc57505091849591859395620002d0575b50501b92600019911b1c1916176009555b3360805260c05260e05261010091825260a05260405161342e9182620006c78339608051828181610405015281816104ea01528181610a3401528181610fc401528181612c2201528181612ceb01528181612ee001528181612fd001526130fa015260a05182818161057701526113d3015260c051828181610c7701528181612e95015261308f015260e05182818161159c015261304e0152518181816110550152611ae30152f35b01519350388062000216565b60098352818320959493928792918316915b898383106200032c575050501062000311575b50505050811b0160095562000227565b01519060f884600019921b161c191690553880808062000301565b858701518955909701969485019488935090810190620002ee565b6009845282842086808a0160051c820192858b1062000386575b0160051c019089905b8281106200037a575050620001fa565b8581550189906200036a565b9250819262000361565b634e487b7160e01b84526022600452602484fd5b90607f1690620001e8565b634e487b7160e01b83526041600452602483fd5b015190503880620001ba565b90848c9416916008885286882092885b888282106200041a575050841162000401575b505050811b01600855620001cd565b0151600019838b1b60f8161c19169055388080620003f2565b8385015186558f97909501949384019301620003df565b909150600886528486208880850160051c8201928786106200047b575b918d91869594930160051c01915b8281106200046c575050620001a4565b8881558594508d91016200045c565b925081926200044e565b634e487b7160e01b86526022600452602486fd5b90607f16906200018f565b634e487b7160e01b85526041600452602485fd5b01519050388062000161565b90858d9416918b895287892092895b898282106200050d5750508411620004f4575b505050811b01875562000173565b0151600019838c1b60f8161c19169055388080620004e6565b91929395968291958786015181550195019301908e9594939291620004d3565b9091508987528587208980850160051c82019288861062000576575b918e91869594930160051c01915b828110620005675750506200014b565b8981558594508e910162000557565b9250819262000549565b634e487b7160e01b87526022600452602487fd5b90607f169062000136565b01519050388062000104565b90858d9416916002895287892092895b89828210620005f75750508411620005dd575b505050811b0160025562000119565b015160001960f88460031b161c19169055388080620005ce565b91929395968291958786015181550195019301908e9594939291620005bb565b909150600287528587208980850160051c82019288861062000661575b918e91869594930160051c01915b82811062000652575050620000ee565b8981558594508e910162000642565b9250819262000634565b90607f1690620000d9565b600080fd5b634e487b7160e01b600052604160045260246000fd5b60405190602082016001600160401b038111838210176200067b57604052565b51906001600160a01b0382168203620006765756fe6080604081815260048036101561001557600080fd5b600092833560e01c9081630146354614611c335750806301ffc9a714611b125780630219b44c14611ace578063024fd650146119f557806304634d8d146119b857806306fdde0314611936578063081812fc14611916578063095ea7b3146117a6578063098144d4146116e257806318160ddd1461177d5780631b25b077146117355780631c33b3281461154d57806323b872dd1461170b57806329e38d5e146116e25780632a55205a1461161a5780632e8da829146115f457806342842e0e146115cb5780634780eac114611587578063495c8bf9146115695780635d4c1d461461154d57806361347162146114225780636352211e14611402578063698f87be146113be5780636a62784214610f545780636ac5db1914610f2c5780636c3b869914610d9157806370a0823114610cfb57806386fe50ac14610cd45780638da5cb5b14610ca65780638ea8303114610c625780639050235c1461098157806395d89b41146109525780639d645a4414610923578063a22cb46514610856578063a4d66daf1461082f578063a9fc664e1461080d578063b04ce6af146107d9578063b88d4fde14610751578063bde593c61461072a578063be13197b146106f2578063be537f43146106a7578063c87b56dd14610461578063d007af5c14610434578063de11c94a146103f0578063e985e9c51461039c5763fd762d921461021d57600080fd5b3461039857608036600319011261039857610236611c5f565b9160243591600783101561034b5761024c611d6f565b606435906001600160781b038216820361039357869561026a613399565b61027381611eb3565b6001600160a01b031694853b1561038f57866102a291865180938192630368065360e61b835230898401611e56565b0381838a5af1801561038557908791610371575b5050843b1561036d57856102dd91855180938192631182550160e11b835230888401611e78565b038183895af180156103635790869161034f575b5050833b1561034b5761031c93859283855180978195829463235d10c560e21b845230908401611e78565b03925af1908115610342575061032f5750f35b61033890611db6565b61033f5780f35b80fd5b513d84823e3d90fd5b8480fd5b61035890611db6565b61034b5784386102f1565b84513d88823e3d90fd5b8580fd5b61037a90611db6565b61036d5785386102b6565b85513d89823e3d90fd5b8680fd5b600080fd5b8280fd5b5050346103ec57806003193601126103ec576020916103b9611c5f565b826103c2611c75565b9260018060a01b03809316815260078652209116600052825260ff81600020541690519015158152f35b5080fd5b5050346103ec57816003193601126103ec57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346103ec57816003193601126103ec5761045d9061045261222f565b905191829182611d2b565b0390f35b50903461039857602091826003193601126106a357803593606094600b546001600160401b03938482871c168311156104a7575b85518781528061045d818a018b611cae565b909192939496506104c568ffffffffffffffffff60b81b83166132a5565b926104cf81612539565b885163a2d2b77360e01b81526001600160a01b0394898286817f00000000000000000000000000000000000000000000000000000000000000008a165afa918215610699578b90899361063a575b509286808a99979462ffffff6105539d9c9a989560a098519e8f9b8c9a8b9a63085b2d8f60e11b8c528b015260a48a0190611cae565b9660248901528d8116604489015260a01c16606487015216911614608483015203917f0000000000000000000000000000000000000000000000000000000000000000165afa91821561062e5781926105b9575b505061045d9150929038808080610495565b9091503d8083853e6105cb8185611e1a565b8301928481850312610398578051918211610398570182601f820112156103ec578051916105f883611e3b565b9361060587519586611e1a565b83855285848401011161033f5750829161062791858061045d96019101611c8b565b38806105a7565b508451903d90823e3d90fd5b809293508b8092503d8311610692575b6106548183611e1a565b8101031261068e579260a09286808d62ffffff8c9b999661067a6105539f9e9c9a6120c2565b979a9c509598505092955097999a5061051d565b8780fd5b503d61064a565b8b513d8a823e3d90fd5b8380fd5b5050346103ec57816003193601126103ec576060906106c4612012565b908051916106d3838251611cd3565b816001600160781b039182602082015116602086015201511690820152f35b5050346103ec5760203660031901126103ec5760209181906001600160a01b0361071a611c5f565b168152600c845220549051908152f35b5050346103ec57816003193601126103ec5760209062ffffff600b5460881c169051908152f35b5090346103985760803660031901126103985761076c611c5f565b610774611c75565b84606435946001600160401b0386116103ec57366023870112156103ec57850135946107ab6107a287611e3b565b95519586611e1a565b85855236602487830101116103ec57856107d6966024602093018388013785010152604435916125fc565b80f35b50913461033f57602036600319011261033f57506107fa61045d92356132a5565b9051918291602083526020830190611cae565b833461033f57602036600319011261033f576107d661082a611c5f565b611eb3565b5050346103ec57816003193601126103ec5760209062ffffff600b5460a01c169051908152f35b509034610398578060031936011261039857610870611c5f565b9060243591821515809303610393576001600160a01b0316923384146108e157503384526007602052808420836000526020528060002060ff1981541660ff8416179055519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b6020606492519162461bcd60e51b8352820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b5050346103ec5760203660031901126103ec57602090610949610944611c5f565b6123b1565b90519015158152f35b5050346103ec57816003193601126103ec5761045d906107fa68ffffffffffffffffff60b81b600b54166132a5565b50903461039857610100366003190112610398578135916001600160401b0380841161034b573660238501121561034b578382013581811161036d576024943686838301011161038f57606435946001600160a01b0394608435919086831683036103935760a435966001600160601b03881688036103935760c435978815158099036103935760e435946001600160781b0386168603610393578a15610c205762ffffff600b5460881c16610bf057827f0000000000000000000000000000000000000000000000000000000000000000163303610bae578c9594939291610a6991612b25565b600a548571721c310194ccfc01e523fc93c9cccfa2a0ac91826001600160601b0360a01b821617600a551617803b1561036d5785600160448e8388519586948593630368065360e61b8552308b8601528401525af1801561036357908691610b9a575b5050600a541692833b1561034b57610afc938592838551809781958294631182550160e11b845230908401611e78565b03925af190811561034257509088939291610b81575b5050013568ffffffffffffffffff60b81b9181838093169160098110610b6b575b50509050169335169060ff60801b9060801b16179062ffffff60881b9060881b161762ffffff60a01b60443560a01b161717600b5580f35b8391925060090360031b1b161681903880610b33565b610b8d91929350611db6565b61038f5785908738610b12565b610ba390611db6565b61034b578438610acc565b845162461bcd60e51b8152602081860152601e818e01527f6f6e6c7920666163746f72792063616f6e747261637420616c6c6f77656400006044820152606490fd5b845162461bcd60e51b8152602081860152600b818e01526a1a5b9a5d1a585b1a5e995960aa1b6044820152606490fd5b845162461bcd60e51b8152602081860152601d818e01527f696e736372697074696f6e49642063616e206e6f74206265207a65726f0000006044820152606490fd5b5050346103ec57816003193601126103ec57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346103ec57816003193601126103ec57602090610cc3612c0d565b90516001600160a01b039091168152f35b5050346103ec57816003193601126103ec5760209060ff600b5460801c1690519015158152f35b508290346103ec5760203660031901126103ec576001600160a01b03610d1f611c5f565b16908115610d3c5760208480858581526005845220549051908152f35b608490602085519162461bcd60e51b8352820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152fd5b509190346103ec57816003193601126103ec57610dac613399565b610db4613399565b71721c310194ccfc01e523fc93c9cccfa2a0ac906000823b610ec5575b15610eb657829382600a547fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac84805160018060a01b0384168152846020820152a16001600160a01b03191617600a55823b15610e93578151630368065360e61b8152308282015260016024820152848160448183885af18015610eac57908591610e98575b5050823b15610e935783926044849284519586938492631182550160e11b84523090840152600160248401525af1908115610342575061032f5750f35b505050fd5b610ea190611db6565b610e93578338610e56565b83513d87823e3d90fd5b516332483afb60e01b81528390fd5b81516301ffc9a760e01b8152858101829052602081602481875afa829181610efc575b50610ef4575b50610dd1565b905038610eee565b610f1e91925060203d8111610f25575b610f168183611e1a565b810190611e9b565b9038610ee8565b503d610f0c565b5050346103ec57816003193601126103ec576020906001600160401b03600b54169051908152f35b50906020806003193601126106a357610f6b611c5f565b91600b54916001600160401b03928381841c1662ffffff8260a01c1680156113ab57828616048516811015611372576001600160a01b03918683161561133857338952600c8452848920548551637ebf0df760e11b81527f00000000000000000000000000000000000000000000000000000000000000008516939186828c81885afa90811561132e578c916112fd575b6110069250612995565b4210156112dd5750509082879285519384809263d60ccc4360e01b82525afa9182156112d35788926112a4575b508115611261578351636eb1769f60e11b8152338189019081523060208201527f000000000000000000000000000000000000000000000000000000000000000092909216979184908290819060400103818b5afa9081156111e3579083918a91611230575b50106111ed5783516370a0823160e01b8152338282015283816024818b5afa9081156111e3579083918a916111b2575b501061116f579060648392898651998a9485936323b872dd60e01b855233908501526001602485015260448401525af1948515611165576107d695611147575b5050600b5467ffffffffffffffff60401b6111278483851c16612c91565b831b169067ffffffffffffffff60401b1916179081600b551c1690612ca9565b8161115d92903d10610f2557610f168183611e1a565b503880611109565b82513d88823e3d90fd5b835162461bcd60e51b8152908101839052601960248201527f62616c616e6365206f6620746970206e6f7420656e6f756768000000000000006044820152606490fd5b809250858092503d83116111dc575b6111cb8183611e1a565b8101031261039357829051386110c9565b503d6111c1565b85513d8b823e3d90fd5b835162461bcd60e51b8152908101839052601860248201527f74697020616c6c6f77616e6365206e6f7420656e6f75676800000000000000006044820152606490fd5b809250858092503d831161125a575b6112498183611e1a565b810103126103935782905138611099565b503d61123f565b835162461bcd60e51b8152808801849052601a60248201527f6e6f206d696e742074697020696e20667265657a652074696d650000000000006044820152606490fd5b9091508281813d83116112cc575b6112bc8183611e1a565b8101031261039357519038611033565b503d6112b2565b84513d8a823e3d90fd5b9093506107d6975067ffffffffffffffff60401b92506111279150612c91565b90508682813d8311611327575b6113148183611e1a565b8101031261039357611006915190610ffc565b503d61130a565b88513d8e823e3d90fd5b845162461bcd60e51b815280890185905260146024820152736d696e7420746f207a65726f206164647265737360601b6044820152606490fd5b835162461bcd60e51b815280880184905260136024820152720e8deeac6d040e8d0ca40dac2f040c4c2e8c6d606b1b6044820152606490fd5b634e487b7160e01b895260128852602489fd5b5050346103ec57816003193601126103ec57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50913461033f57602036600319011261033f5750610cc360209235612539565b508290346103ec5760603660031901126103ec57803592600784101561039857602435916001600160781b03831683036106a35761145e611d6f565b611466613399565b600a546001600160a01b031693841561153d57843b1561036d578561149e97855180998192630368065360e61b835230888401611e56565b038183895af1801561036357611529575b859650843b1561036d57856114d791855180938192631182550160e11b835230888401611e78565b038183895af1801561036357908691611515575050833b1561034b5761031c93859283855180978195829463235d10c560e21b845230908401611e78565b61151e90611db6565b61034b5784876102f1565b94909561153590611db6565b9385906114af565b8351631cffe3dd60e11b81528390fd5b5050346103ec57816003193601126103ec576020905160018152f35b5050346103ec57816003193601126103ec5761045d90610452612159565b5050346103ec57816003193601126103ec57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346103ec576107d6906115df36611cf6565b919251926115ec84611dff565b8584526125fc565b5050346103ec5760203660031901126103ec57602090610949611615611c5f565b6122d2565b509190346103ec57806003193601126103ec57602435918335815260016020528181209082519161164a83611de4565b546001600160a01b0380821680855260a09290921c6020850152929190156116c0575b6001600160601b03602083015116948581029581870414901517156116ad57815184519084166001600160a01b0316815261271086046020820152604090f35b634e487b7160e01b815260118652602490fd5b905082516116cd81611de4565b8154838116825260a01c60208201529061166d565b5050346103ec57816003193601126103ec57600a5490516001600160a01b039091168152602090f35b833461033f576107d661171d36611cf6565b9161173061172b8433612697565b61259a565b61275f565b5050346103ec5760603660031901126103ec57611750611c5f565b611758611c75565b604435939091906001600160a01b038516850361033f57509261094991602094612463565b5050346103ec57816003193601126103ec57600b548151911c6001600160401b03168152602090f35b50346103985781600319360112610398576117bf611c5f565b6024359290916001600160a01b03919082806117da87612539565b169416938085146118c9578033149081156118aa575b501561184257508385526006602052842080546001600160a01b0319168317905561181a83612539565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b6020608492519162461bcd60e51b8352820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b90508652600760205281862033875260205260ff8287205416386117f0565b506020608492519162461bcd60e51b8352820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152fd5b50913461033f57602036600319011261033f5750610cc36020923561255c565b5050346103ec57816003193601126103ec5761045d9061196568ffffffffffffffffff60b81b600b54166132a5565b906119a6602b825184611982829651809260208086019101611c8b565b81016a207b666572632d3732317d60a81b602082015203600b810185520183611e1a565b51918291602083526020830190611cae565b5050346103ec5736600319011261033f576119d1611c5f565b6024356001600160601b0381168103610398576107d6916119f0613399565b612b25565b5050346103ec57816003193601126103ec5760c09160a08251611a1781611d85565b82815282602082015282848201528260608201528260808201520152805190611a3f82611d85565b600b54906001600160401b03908183169384815260208101928085841c1684528282019260ff8660801c1615158452606083019062ffffff948593848960881c16845260a06080870196868b831c168852019768ffffffffffffffffff60b81b809a16895283519a8b52511660208a0152511515908801525116606086015251166080840152511660a0820152f35b5050346103ec57816003193601126103ec57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461039857602036600319011261039857359063ffffffff60e01b821680920361039857602092506380ac58cd60e01b821491829081159081611c22575b8415611c11575b8415611c00575b8415611bef575b8415611b78575b505050519015158152f35b9293506310c8aba560e31b83149290918315611b9b575b50505090388080611b6d565b925090611bde575b8115611bb3575b50388080611b8f565b63152a902d60e11b811491508115611bcd575b5038611baa565b6301ffc9a760e01b14905038611bc6565b635b5e139f60e01b81149150611ba3565b6301ffc9a760e01b81149450611b66565b632baae9fd60e01b81149450611b5f565b6301ffc9a760e01b81149450611b58565b635b5e139f60e01b81149450611b51565b8490346103ec57816003193601126103ec578071721c310194ccfc01e523fc93c9cccfa2a0ac60209252f35b600435906001600160a01b038216820361039357565b602435906001600160a01b038216820361039357565b60005b838110611c9e5750506000910152565b8181015183820152602001611c8e565b90602091611cc781518092818552858086019101611c8b565b601f01601f1916010190565b906007821015611ce05752565b634e487b7160e01b600052602160045260246000fd5b6060906003190112610393576001600160a01b0390600435828116810361039357916024359081168103610393579060443590565b6020908160408183019282815285518094520193019160005b828110611d52575050505090565b83516001600160a01b031685529381019392810192600101611d44565b604435906001600160781b038216820361039357565b60c081019081106001600160401b03821117611da057604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111611da057604052565b606081019081106001600160401b03821117611da057604052565b604081019081106001600160401b03821117611da057604052565b602081019081106001600160401b03821117611da057604052565b90601f801991011681019081106001600160401b03821117611da057604052565b6001600160401b038111611da057601f01601f191660200190565b6001600160a01b039091168152604081019291611e769160200190611cd3565b565b6001600160a01b0390911681526001600160781b03909116602082015260400190565b90816020910312610393575180151581036103935790565b611ebb613399565b600090803b611f51575b6001600160a01b03818116929091908315159081611f48575b50611f3657600a54604080516001600160a01b0394831685168152929093166020830152917fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac91a16001600160a01b03191617600a55565b6040516332483afb60e01b8152600490fd5b90501538611ede565b6040516301ffc9a760e01b8152600481018390526020816024816001600160a01b0386165afa839181611f93575b50611f8b575b50611ec5565b915038611f85565b611fac91925060203d8111610f2557610f168183611e1a565b9038611f7f565b51906001600160781b038216820361039357565b908160609103126103935760405190611fdf82611dc9565b805160078110156103935761200a916040918452611fff60208201611fb3565b602085015201611fb3565b604082015290565b604080805161202081611dc9565b6000808252602082018190529101819052600a546001600160a01b03168061205e575081519161204f83611dc9565b81835281602084015282015290565b906060602492845193848092635caaa2a960e11b82523060048301525afa9283156120b857509161208d575090565b6120ae915060603d81116120b1575b6120a68183611e1a565b810190611fc7565b90565b503d61209c565b51903d90823e3d90fd5b51906001600160a01b038216820361039357565b9060209081838203126103935782516001600160401b0393848211610393570181601f82011215610393578051938411611da0578360051b906040519461211f85840187611e1a565b85528380860192820101928311610393578301905b828210612142575050505090565b83809161214e846120c2565b815201910190612134565b600a546001600160a01b031680612183575060405161217781611dff565b60008152600036813790565b604051635caaa2a960e11b8152306004820152606081602481855afa80156122055760206001600160781b03916000938491612211575b50015116602460405180948193633fe5df9960e01b835260048301525afa908115612205576000916121ea575090565b6120ae913d8091833e6121fd8183611e1a565b8101906120d6565b6040513d6000823e3d90fd5b612229915060603d81116120b1576120a68183611e1a565b386121ba565b600a546001600160a01b03168061224d575060405161217781611dff565b604051635caaa2a960e11b8152306004820152606081602481855afa80156122055760406001600160781b039160009384916122b4575b500151166024604051809481936305fa529b60e21b835260048301525afa908115612205576000916121ea575090565b6122cc915060603d81116120b1576120a68183611e1a565b38612284565b600a546001600160a01b031690816122eb575050600090565b604051635caaa2a960e11b815230600482015290606082602481865afa928315612205576001600160781b036020612365958195600091612393575b50015116604051809581948293636b96ef2f60e11b8452600484019092916020906001600160781b03604084019516835260018060a01b0316910152565b03915afa9081156122055760009161237b575090565b6120ae915060203d8111610f2557610f168183611e1a565b6123ab915060603d81116120b1576120a68183611e1a565b38612327565b600a546001600160a01b031690816123ca575050600090565b604051635caaa2a960e11b815230600482015290606082602481865afa928315612205576001600160781b03604061236595602095600091612445575b500151166040518095819482936309445f5360e41b8452600484019092916020906001600160781b03604084019516835260018060a01b0316910152565b61245d915060603d81116120b1576120a68183611e1a565b38612407565b600a54600093926001600160a01b039091169182612485575050505050600190565b823b1561034b5760405163050bf71960e31b81526001600160a01b03918216600482015291811660248301529290921660448301529091908190839060649082905afa91826124de575b50906124d85790565b50600190565b6124e790611db6565b386124cf565b156124f457565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600460205260409020546001600160a01b03166120ae8115156124ed565b60008181526004602052604090205461257f906001600160a01b031615156124ed565b6000908152600660205260409020546001600160a01b031690565b156125a157565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b9061262093929161261061172b8433612697565b61261b83838361275f565b612a2d565b1561262757565b60405162461bcd60e51b81528061264060048201612644565b0390fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b906001600160a01b0380806126ab84612539565b169316918383149384156126de575b5083156126c8575b50505090565b6126d49192935061255c565b16143880806126c2565b909350600052600760205260406000208260005260205260ff6040600020541692386126ba565b1561270c57565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b612785939261276d81612539565b6001600160a01b038381169690929183168714612705565b8184169081156129445790948615919060005b60019081811015612857576127ad8185612995565b50848061284f575b156127cc57604051635cbd944160e01b8152600490fd5b84156127d9575b01612798565b85600a5416806127ea575b506127d3565b803b15610393576040805163050bf71960e31b81523360048201526001600160a01b038a811660248301528b16604482015291600090839060649082905afa9081156128455750156127e45761283f90611db6565b386127e4565b513d6000823e3d90fd5b5060006127b5565b505096935091612875919450839061286e84612539565b1614612705565b8060005260066020526040928184600020956001600160601b0360a01b9687815416905584600052600560205285600020600019815401905580600052856000209460019586815401905582600052600497886020528288600020918254161790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460005b83811061290e57505050505050565b6129188184612995565b50818061293c575b15612935578451635cbd944160e01b81528690fd5b83016128ff565b506000612920565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b919082018092116129a257565b634e487b7160e01b600052601160045260246000fd5b60005b600190818110156129f7576129d08185612995565b506001600160a01b0383166129f157604051635cbd944160e01b8152600490fd5b016129bb565b50505050565b3d15612a28573d90612a0e82611e3b565b91612a1c6040519384611e1a565b82523d6000602084013e565b606090565b91926000929190813b15612b1b57602091612a839185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b0380951660248501526044840152608060648401526084830190611cae565b0393165af190829082612ad3575b5050612ac557612a9f6129fd565b80519081612ac05760405162461bcd60e51b81528061264060048201612644565b602001fd5b6001600160e01b0319161490565b909192506020813d8211612b13575b81612aef60209383611e1a565b810103126103ec5751906001600160e01b03198216820361033f5750903880612a91565b3d9150612ae2565b5050505050600190565b906001600160601b038116916127108311612bb5576001600160a01b0316918215612b70576020604051612b5881611de4565b848152015260a01b6001600160a01b03191617600055565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b604051638da5cb5b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561220557600091612c5e575090565b906020823d8211612c89575b81612c7760209383611e1a565b8101031261033f57506120ae906120c2565b3d9150612c6a565b6001600160401b038091169081146129a25760010190565b600b549160ff60009360801c168061323f575b61304c575b60ff600b5460801c1680612fba575b612e6e575b600b5460881c62ffffff16916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116803b1561036d5785809160446040978851948593849263dbe8285160e01b845260048401528960248401525af18015612e6457612e51575b5081168015612e0e57600083815260046020526040902054612e009392918391612d7a906001600160a01b031615155b15613248565b612d8482846129b8565b600082815260046020526040902054612da7906001600160a01b03161515612d74565b8087526005602052858720600181540190558187526004602052858720816001600160601b0360a01b825416179055867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46129b8565b338252600c60205242912055565b6064845162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b612e5d90959195611db6565b9338612d44565b85513d88823e3d90fd5b60405163de810b4960e01b81523360048201526020906001600160a01b03908281602481897f000000000000000000000000000000000000000000000000000000000000000087165af1908115612f815783908792612f8c575b5060405163fddacd7b60e01b815292839060049082907f0000000000000000000000000000000000000000000000000000000000000000165afa918215612f81578692612f52575b5010612f1c5750612cd5565b6064906040519062461bcd60e51b82526004820152600f60248201526e0cccae4c640dcdee840cadcdeeaced608b1b6044820152fd5b9091508281813d8311612f7a575b612f6a8183611e1a565b8101031261036d57519038612f10565b503d612f60565b6040513d88823e3d90fd5b809250813d8311612fb3575b612fa28183611e1a565b8101031261036d5751826004612ec8565b503d612f98565b5060405163fddacd7b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115613041578491613010575b501515612cd0565b90506020813d8211613039575b8161302a60209383611e1a565b810103126106a3575138613008565b3d915061301d565b6040513d86823e3d90fd5b7f00000000000000000000000000000000000000000000000000000000000000008380808034855af19061307e6129fd565b506040805163095ea7b360e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03818116600484015234602484015260209593949092908690829060449082908d9088165af180156111e357613222575b50835163fddacd7b60e01b815285816004817f000000000000000000000000000000000000000000000000000000000000000087165afa9081156111e357908692918a916131ec575b506064908a8751958694859363244a367760e11b85526004850152346024850152336044850152165af19081156131e25787916131b5575b50816131ab575b501561317b575050612cc1565b60649250519062461bcd60e51b82526004820152600a60248201526939bbb0b81032b93937b960b11b6044820152fd5b905015153861316e565b90508381813d83116131db575b6131cc8183611e1a565b8101031261038f575138613167565b503d6131c2565b83513d89823e3d90fd5b8381939492503d831161321b575b6132048183611e1a565b810103126132175751859190606461312f565b8880fd5b503d6131fa565b61323890863d8811610f2557610f168183611e1a565b50386130e6565b50341515612cbc565b1561324f57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b60ff1660ff81146129a25760010190565b9060005b60ff811660208110908161337b575b50156132cc576132c790613294565b6132a9565b9060ff809216906132dc82611e3b565b916132ea6040519384611e1a565b8083526132f9601f1991611e3b565b0190602091368385013760005b80851690838210808061335f575b15613354571561333e57845182101561333e57818488613339941a9187010153613294565b613306565b634e487b7160e01b600052603260045260246000fd5b505050935050905090565b1561333e5787831a60f81b6001600160f81b0319161515613314565b901561333e5783901a60f81b6001600160f81b0319161515386132b8565b6133a1612c0d565b336001600160a01b03909116036133b457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220af90263b73ecd00536c7cf267061b529e76be2bd4a9cd99e25dd3d82b8ca926964736f6c634300081200330000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002ecba91da63c29ea80fbe7b52632ca2d1f8e5be0000000000000000000000000d83b01f3b5612eda9849a55302bab3ce5f52df6c

Deployed Bytecode

0x6080604081815260048036101561001557600080fd5b600092833560e01c9081630146354614611c335750806301ffc9a714611b125780630219b44c14611ace578063024fd650146119f557806304634d8d146119b857806306fdde0314611936578063081812fc14611916578063095ea7b3146117a6578063098144d4146116e257806318160ddd1461177d5780631b25b077146117355780631c33b3281461154d57806323b872dd1461170b57806329e38d5e146116e25780632a55205a1461161a5780632e8da829146115f457806342842e0e146115cb5780634780eac114611587578063495c8bf9146115695780635d4c1d461461154d57806361347162146114225780636352211e14611402578063698f87be146113be5780636a62784214610f545780636ac5db1914610f2c5780636c3b869914610d9157806370a0823114610cfb57806386fe50ac14610cd45780638da5cb5b14610ca65780638ea8303114610c625780639050235c1461098157806395d89b41146109525780639d645a4414610923578063a22cb46514610856578063a4d66daf1461082f578063a9fc664e1461080d578063b04ce6af146107d9578063b88d4fde14610751578063bde593c61461072a578063be13197b146106f2578063be537f43146106a7578063c87b56dd14610461578063d007af5c14610434578063de11c94a146103f0578063e985e9c51461039c5763fd762d921461021d57600080fd5b3461039857608036600319011261039857610236611c5f565b9160243591600783101561034b5761024c611d6f565b606435906001600160781b038216820361039357869561026a613399565b61027381611eb3565b6001600160a01b031694853b1561038f57866102a291865180938192630368065360e61b835230898401611e56565b0381838a5af1801561038557908791610371575b5050843b1561036d57856102dd91855180938192631182550160e11b835230888401611e78565b038183895af180156103635790869161034f575b5050833b1561034b5761031c93859283855180978195829463235d10c560e21b845230908401611e78565b03925af1908115610342575061032f5750f35b61033890611db6565b61033f5780f35b80fd5b513d84823e3d90fd5b8480fd5b61035890611db6565b61034b5784386102f1565b84513d88823e3d90fd5b8580fd5b61037a90611db6565b61036d5785386102b6565b85513d89823e3d90fd5b8680fd5b600080fd5b8280fd5b5050346103ec57806003193601126103ec576020916103b9611c5f565b826103c2611c75565b9260018060a01b03809316815260078652209116600052825260ff81600020541690519015158152f35b5080fd5b5050346103ec57816003193601126103ec57517f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e6001600160a01b03168152602090f35b5050346103ec57816003193601126103ec5761045d9061045261222f565b905191829182611d2b565b0390f35b50903461039857602091826003193601126106a357803593606094600b546001600160401b03938482871c168311156104a7575b85518781528061045d818a018b611cae565b909192939496506104c568ffffffffffffffffff60b81b83166132a5565b926104cf81612539565b885163a2d2b77360e01b81526001600160a01b0394898286817f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e8a165afa918215610699578b90899361063a575b509286808a99979462ffffff6105539d9c9a989560a098519e8f9b8c9a8b9a63085b2d8f60e11b8c528b015260a48a0190611cae565b9660248901528d8116604489015260a01c16606487015216911614608483015203917f000000000000000000000000d83b01f3b5612eda9849a55302bab3ce5f52df6c165afa91821561062e5781926105b9575b505061045d9150929038808080610495565b9091503d8083853e6105cb8185611e1a565b8301928481850312610398578051918211610398570182601f820112156103ec578051916105f883611e3b565b9361060587519586611e1a565b83855285848401011161033f5750829161062791858061045d96019101611c8b565b38806105a7565b508451903d90823e3d90fd5b809293508b8092503d8311610692575b6106548183611e1a565b8101031261068e579260a09286808d62ffffff8c9b999661067a6105539f9e9c9a6120c2565b979a9c509598505092955097999a5061051d565b8780fd5b503d61064a565b8b513d8a823e3d90fd5b8380fd5b5050346103ec57816003193601126103ec576060906106c4612012565b908051916106d3838251611cd3565b816001600160781b039182602082015116602086015201511690820152f35b5050346103ec5760203660031901126103ec5760209181906001600160a01b0361071a611c5f565b168152600c845220549051908152f35b5050346103ec57816003193601126103ec5760209062ffffff600b5460881c169051908152f35b5090346103985760803660031901126103985761076c611c5f565b610774611c75565b84606435946001600160401b0386116103ec57366023870112156103ec57850135946107ab6107a287611e3b565b95519586611e1a565b85855236602487830101116103ec57856107d6966024602093018388013785010152604435916125fc565b80f35b50913461033f57602036600319011261033f57506107fa61045d92356132a5565b9051918291602083526020830190611cae565b833461033f57602036600319011261033f576107d661082a611c5f565b611eb3565b5050346103ec57816003193601126103ec5760209062ffffff600b5460a01c169051908152f35b509034610398578060031936011261039857610870611c5f565b9060243591821515809303610393576001600160a01b0316923384146108e157503384526007602052808420836000526020528060002060ff1981541660ff8416179055519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a380f35b6020606492519162461bcd60e51b8352820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152fd5b5050346103ec5760203660031901126103ec57602090610949610944611c5f565b6123b1565b90519015158152f35b5050346103ec57816003193601126103ec5761045d906107fa68ffffffffffffffffff60b81b600b54166132a5565b50903461039857610100366003190112610398578135916001600160401b0380841161034b573660238501121561034b578382013581811161036d576024943686838301011161038f57606435946001600160a01b0394608435919086831683036103935760a435966001600160601b03881688036103935760c435978815158099036103935760e435946001600160781b0386168603610393578a15610c205762ffffff600b5460881c16610bf057827f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e163303610bae578c9594939291610a6991612b25565b600a548571721c310194ccfc01e523fc93c9cccfa2a0ac91826001600160601b0360a01b821617600a551617803b1561036d5785600160448e8388519586948593630368065360e61b8552308b8601528401525af1801561036357908691610b9a575b5050600a541692833b1561034b57610afc938592838551809781958294631182550160e11b845230908401611e78565b03925af190811561034257509088939291610b81575b5050013568ffffffffffffffffff60b81b9181838093169160098110610b6b575b50509050169335169060ff60801b9060801b16179062ffffff60881b9060881b161762ffffff60a01b60443560a01b161717600b5580f35b8391925060090360031b1b161681903880610b33565b610b8d91929350611db6565b61038f5785908738610b12565b610ba390611db6565b61034b578438610acc565b845162461bcd60e51b8152602081860152601e818e01527f6f6e6c7920666163746f72792063616f6e747261637420616c6c6f77656400006044820152606490fd5b845162461bcd60e51b8152602081860152600b818e01526a1a5b9a5d1a585b1a5e995960aa1b6044820152606490fd5b845162461bcd60e51b8152602081860152601d818e01527f696e736372697074696f6e49642063616e206e6f74206265207a65726f0000006044820152606490fd5b5050346103ec57816003193601126103ec57517f0000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b16001600160a01b03168152602090f35b5050346103ec57816003193601126103ec57602090610cc3612c0d565b90516001600160a01b039091168152f35b5050346103ec57816003193601126103ec5760209060ff600b5460801c1690519015158152f35b508290346103ec5760203660031901126103ec576001600160a01b03610d1f611c5f565b16908115610d3c5760208480858581526005845220549051908152f35b608490602085519162461bcd60e51b8352820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152fd5b509190346103ec57816003193601126103ec57610dac613399565b610db4613399565b71721c310194ccfc01e523fc93c9cccfa2a0ac906000823b610ec5575b15610eb657829382600a547fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac84805160018060a01b0384168152846020820152a16001600160a01b03191617600a55823b15610e93578151630368065360e61b8152308282015260016024820152848160448183885af18015610eac57908591610e98575b5050823b15610e935783926044849284519586938492631182550160e11b84523090840152600160248401525af1908115610342575061032f5750f35b505050fd5b610ea190611db6565b610e93578338610e56565b83513d87823e3d90fd5b516332483afb60e01b81528390fd5b81516301ffc9a760e01b8152858101829052602081602481875afa829181610efc575b50610ef4575b50610dd1565b905038610eee565b610f1e91925060203d8111610f25575b610f168183611e1a565b810190611e9b565b9038610ee8565b503d610f0c565b5050346103ec57816003193601126103ec576020906001600160401b03600b54169051908152f35b50906020806003193601126106a357610f6b611c5f565b91600b54916001600160401b03928381841c1662ffffff8260a01c1680156113ab57828616048516811015611372576001600160a01b03918683161561133857338952600c8452848920548551637ebf0df760e11b81527f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e8516939186828c81885afa90811561132e578c916112fd575b6110069250612995565b4210156112dd5750509082879285519384809263d60ccc4360e01b82525afa9182156112d35788926112a4575b508115611261578351636eb1769f60e11b8152338189019081523060208201527f0000000000000000000000002ecba91da63c29ea80fbe7b52632ca2d1f8e5be092909216979184908290819060400103818b5afa9081156111e3579083918a91611230575b50106111ed5783516370a0823160e01b8152338282015283816024818b5afa9081156111e3579083918a916111b2575b501061116f579060648392898651998a9485936323b872dd60e01b855233908501526001602485015260448401525af1948515611165576107d695611147575b5050600b5467ffffffffffffffff60401b6111278483851c16612c91565b831b169067ffffffffffffffff60401b1916179081600b551c1690612ca9565b8161115d92903d10610f2557610f168183611e1a565b503880611109565b82513d88823e3d90fd5b835162461bcd60e51b8152908101839052601960248201527f62616c616e6365206f6620746970206e6f7420656e6f756768000000000000006044820152606490fd5b809250858092503d83116111dc575b6111cb8183611e1a565b8101031261039357829051386110c9565b503d6111c1565b85513d8b823e3d90fd5b835162461bcd60e51b8152908101839052601860248201527f74697020616c6c6f77616e6365206e6f7420656e6f75676800000000000000006044820152606490fd5b809250858092503d831161125a575b6112498183611e1a565b810103126103935782905138611099565b503d61123f565b835162461bcd60e51b8152808801849052601a60248201527f6e6f206d696e742074697020696e20667265657a652074696d650000000000006044820152606490fd5b9091508281813d83116112cc575b6112bc8183611e1a565b8101031261039357519038611033565b503d6112b2565b84513d8a823e3d90fd5b9093506107d6975067ffffffffffffffff60401b92506111279150612c91565b90508682813d8311611327575b6113148183611e1a565b8101031261039357611006915190610ffc565b503d61130a565b88513d8e823e3d90fd5b845162461bcd60e51b815280890185905260146024820152736d696e7420746f207a65726f206164647265737360601b6044820152606490fd5b835162461bcd60e51b815280880184905260136024820152720e8deeac6d040e8d0ca40dac2f040c4c2e8c6d606b1b6044820152606490fd5b634e487b7160e01b895260128852602489fd5b5050346103ec57816003193601126103ec57517f000000000000000000000000d83b01f3b5612eda9849a55302bab3ce5f52df6c6001600160a01b03168152602090f35b50913461033f57602036600319011261033f5750610cc360209235612539565b508290346103ec5760603660031901126103ec57803592600784101561039857602435916001600160781b03831683036106a35761145e611d6f565b611466613399565b600a546001600160a01b031693841561153d57843b1561036d578561149e97855180998192630368065360e61b835230888401611e56565b038183895af1801561036357611529575b859650843b1561036d57856114d791855180938192631182550160e11b835230888401611e78565b038183895af1801561036357908691611515575050833b1561034b5761031c93859283855180978195829463235d10c560e21b845230908401611e78565b61151e90611db6565b61034b5784876102f1565b94909561153590611db6565b9385906114af565b8351631cffe3dd60e11b81528390fd5b5050346103ec57816003193601126103ec576020905160018152f35b5050346103ec57816003193601126103ec5761045d90610452612159565b5050346103ec57816003193601126103ec57517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168152602090f35b5050346103ec576107d6906115df36611cf6565b919251926115ec84611dff565b8584526125fc565b5050346103ec5760203660031901126103ec57602090610949611615611c5f565b6122d2565b509190346103ec57806003193601126103ec57602435918335815260016020528181209082519161164a83611de4565b546001600160a01b0380821680855260a09290921c6020850152929190156116c0575b6001600160601b03602083015116948581029581870414901517156116ad57815184519084166001600160a01b0316815261271086046020820152604090f35b634e487b7160e01b815260118652602490fd5b905082516116cd81611de4565b8154838116825260a01c60208201529061166d565b5050346103ec57816003193601126103ec57600a5490516001600160a01b039091168152602090f35b833461033f576107d661171d36611cf6565b9161173061172b8433612697565b61259a565b61275f565b5050346103ec5760603660031901126103ec57611750611c5f565b611758611c75565b604435939091906001600160a01b038516850361033f57509261094991602094612463565b5050346103ec57816003193601126103ec57600b548151911c6001600160401b03168152602090f35b50346103985781600319360112610398576117bf611c5f565b6024359290916001600160a01b03919082806117da87612539565b169416938085146118c9578033149081156118aa575b501561184257508385526006602052842080546001600160a01b0319168317905561181a83612539565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b6020608492519162461bcd60e51b8352820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152fd5b90508652600760205281862033875260205260ff8287205416386117f0565b506020608492519162461bcd60e51b8352820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152fd5b50913461033f57602036600319011261033f5750610cc36020923561255c565b5050346103ec57816003193601126103ec5761045d9061196568ffffffffffffffffff60b81b600b54166132a5565b906119a6602b825184611982829651809260208086019101611c8b565b81016a207b666572632d3732317d60a81b602082015203600b810185520183611e1a565b51918291602083526020830190611cae565b5050346103ec5736600319011261033f576119d1611c5f565b6024356001600160601b0381168103610398576107d6916119f0613399565b612b25565b5050346103ec57816003193601126103ec5760c09160a08251611a1781611d85565b82815282602082015282848201528260608201528260808201520152805190611a3f82611d85565b600b54906001600160401b03908183169384815260208101928085841c1684528282019260ff8660801c1615158452606083019062ffffff948593848960881c16845260a06080870196868b831c168852019768ffffffffffffffffff60b81b809a16895283519a8b52511660208a0152511515908801525116606086015251166080840152511660a0820152f35b5050346103ec57816003193601126103ec57517f0000000000000000000000002ecba91da63c29ea80fbe7b52632ca2d1f8e5be06001600160a01b03168152602090f35b503461039857602036600319011261039857359063ffffffff60e01b821680920361039857602092506380ac58cd60e01b821491829081159081611c22575b8415611c11575b8415611c00575b8415611bef575b8415611b78575b505050519015158152f35b9293506310c8aba560e31b83149290918315611b9b575b50505090388080611b6d565b925090611bde575b8115611bb3575b50388080611b8f565b63152a902d60e11b811491508115611bcd575b5038611baa565b6301ffc9a760e01b14905038611bc6565b635b5e139f60e01b81149150611ba3565b6301ffc9a760e01b81149450611b66565b632baae9fd60e01b81149450611b5f565b6301ffc9a760e01b81149450611b58565b635b5e139f60e01b81149450611b51565b8490346103ec57816003193601126103ec578071721c310194ccfc01e523fc93c9cccfa2a0ac60209252f35b600435906001600160a01b038216820361039357565b602435906001600160a01b038216820361039357565b60005b838110611c9e5750506000910152565b8181015183820152602001611c8e565b90602091611cc781518092818552858086019101611c8b565b601f01601f1916010190565b906007821015611ce05752565b634e487b7160e01b600052602160045260246000fd5b6060906003190112610393576001600160a01b0390600435828116810361039357916024359081168103610393579060443590565b6020908160408183019282815285518094520193019160005b828110611d52575050505090565b83516001600160a01b031685529381019392810192600101611d44565b604435906001600160781b038216820361039357565b60c081019081106001600160401b03821117611da057604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111611da057604052565b606081019081106001600160401b03821117611da057604052565b604081019081106001600160401b03821117611da057604052565b602081019081106001600160401b03821117611da057604052565b90601f801991011681019081106001600160401b03821117611da057604052565b6001600160401b038111611da057601f01601f191660200190565b6001600160a01b039091168152604081019291611e769160200190611cd3565b565b6001600160a01b0390911681526001600160781b03909116602082015260400190565b90816020910312610393575180151581036103935790565b611ebb613399565b600090803b611f51575b6001600160a01b03818116929091908315159081611f48575b50611f3657600a54604080516001600160a01b0394831685168152929093166020830152917fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac91a16001600160a01b03191617600a55565b6040516332483afb60e01b8152600490fd5b90501538611ede565b6040516301ffc9a760e01b8152600481018390526020816024816001600160a01b0386165afa839181611f93575b50611f8b575b50611ec5565b915038611f85565b611fac91925060203d8111610f2557610f168183611e1a565b9038611f7f565b51906001600160781b038216820361039357565b908160609103126103935760405190611fdf82611dc9565b805160078110156103935761200a916040918452611fff60208201611fb3565b602085015201611fb3565b604082015290565b604080805161202081611dc9565b6000808252602082018190529101819052600a546001600160a01b03168061205e575081519161204f83611dc9565b81835281602084015282015290565b906060602492845193848092635caaa2a960e11b82523060048301525afa9283156120b857509161208d575090565b6120ae915060603d81116120b1575b6120a68183611e1a565b810190611fc7565b90565b503d61209c565b51903d90823e3d90fd5b51906001600160a01b038216820361039357565b9060209081838203126103935782516001600160401b0393848211610393570181601f82011215610393578051938411611da0578360051b906040519461211f85840187611e1a565b85528380860192820101928311610393578301905b828210612142575050505090565b83809161214e846120c2565b815201910190612134565b600a546001600160a01b031680612183575060405161217781611dff565b60008152600036813790565b604051635caaa2a960e11b8152306004820152606081602481855afa80156122055760206001600160781b03916000938491612211575b50015116602460405180948193633fe5df9960e01b835260048301525afa908115612205576000916121ea575090565b6120ae913d8091833e6121fd8183611e1a565b8101906120d6565b6040513d6000823e3d90fd5b612229915060603d81116120b1576120a68183611e1a565b386121ba565b600a546001600160a01b03168061224d575060405161217781611dff565b604051635caaa2a960e11b8152306004820152606081602481855afa80156122055760406001600160781b039160009384916122b4575b500151166024604051809481936305fa529b60e21b835260048301525afa908115612205576000916121ea575090565b6122cc915060603d81116120b1576120a68183611e1a565b38612284565b600a546001600160a01b031690816122eb575050600090565b604051635caaa2a960e11b815230600482015290606082602481865afa928315612205576001600160781b036020612365958195600091612393575b50015116604051809581948293636b96ef2f60e11b8452600484019092916020906001600160781b03604084019516835260018060a01b0316910152565b03915afa9081156122055760009161237b575090565b6120ae915060203d8111610f2557610f168183611e1a565b6123ab915060603d81116120b1576120a68183611e1a565b38612327565b600a546001600160a01b031690816123ca575050600090565b604051635caaa2a960e11b815230600482015290606082602481865afa928315612205576001600160781b03604061236595602095600091612445575b500151166040518095819482936309445f5360e41b8452600484019092916020906001600160781b03604084019516835260018060a01b0316910152565b61245d915060603d81116120b1576120a68183611e1a565b38612407565b600a54600093926001600160a01b039091169182612485575050505050600190565b823b1561034b5760405163050bf71960e31b81526001600160a01b03918216600482015291811660248301529290921660448301529091908190839060649082905afa91826124de575b50906124d85790565b50600190565b6124e790611db6565b386124cf565b156124f457565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600460205260409020546001600160a01b03166120ae8115156124ed565b60008181526004602052604090205461257f906001600160a01b031615156124ed565b6000908152600660205260409020546001600160a01b031690565b156125a157565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b9061262093929161261061172b8433612697565b61261b83838361275f565b612a2d565b1561262757565b60405162461bcd60e51b81528061264060048201612644565b0390fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b906001600160a01b0380806126ab84612539565b169316918383149384156126de575b5083156126c8575b50505090565b6126d49192935061255c565b16143880806126c2565b909350600052600760205260406000208260005260205260ff6040600020541692386126ba565b1561270c57565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b612785939261276d81612539565b6001600160a01b038381169690929183168714612705565b8184169081156129445790948615919060005b60019081811015612857576127ad8185612995565b50848061284f575b156127cc57604051635cbd944160e01b8152600490fd5b84156127d9575b01612798565b85600a5416806127ea575b506127d3565b803b15610393576040805163050bf71960e31b81523360048201526001600160a01b038a811660248301528b16604482015291600090839060649082905afa9081156128455750156127e45761283f90611db6565b386127e4565b513d6000823e3d90fd5b5060006127b5565b505096935091612875919450839061286e84612539565b1614612705565b8060005260066020526040928184600020956001600160601b0360a01b9687815416905584600052600560205285600020600019815401905580600052856000209460019586815401905582600052600497886020528288600020918254161790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460005b83811061290e57505050505050565b6129188184612995565b50818061293c575b15612935578451635cbd944160e01b81528690fd5b83016128ff565b506000612920565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b919082018092116129a257565b634e487b7160e01b600052601160045260246000fd5b60005b600190818110156129f7576129d08185612995565b506001600160a01b0383166129f157604051635cbd944160e01b8152600490fd5b016129bb565b50505050565b3d15612a28573d90612a0e82611e3b565b91612a1c6040519384611e1a565b82523d6000602084013e565b606090565b91926000929190813b15612b1b57602091612a839185604051958680958194630a85bd0160e11b9b8c845233600485015260018060a01b0380951660248501526044840152608060648401526084830190611cae565b0393165af190829082612ad3575b5050612ac557612a9f6129fd565b80519081612ac05760405162461bcd60e51b81528061264060048201612644565b602001fd5b6001600160e01b0319161490565b909192506020813d8211612b13575b81612aef60209383611e1a565b810103126103ec5751906001600160e01b03198216820361033f5750903880612a91565b3d9150612ae2565b5050505050600190565b906001600160601b038116916127108311612bb5576001600160a01b0316918215612b70576020604051612b5881611de4565b848152015260a01b6001600160a01b03191617600055565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b604051638da5cb5b60e01b81526020816004817f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e6001600160a01b03165afa90811561220557600091612c5e575090565b906020823d8211612c89575b81612c7760209383611e1a565b8101031261033f57506120ae906120c2565b3d9150612c6a565b6001600160401b038091169081146129a25760010190565b600b549160ff60009360801c168061323f575b61304c575b60ff600b5460801c1680612fba575b612e6e575b600b5460881c62ffffff16916001600160a01b037f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e8116803b1561036d5785809160446040978851948593849263dbe8285160e01b845260048401528960248401525af18015612e6457612e51575b5081168015612e0e57600083815260046020526040902054612e009392918391612d7a906001600160a01b031615155b15613248565b612d8482846129b8565b600082815260046020526040902054612da7906001600160a01b03161515612d74565b8087526005602052858720600181540190558187526004602052858720816001600160601b0360a01b825416179055867fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46129b8565b338252600c60205242912055565b6064845162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b612e5d90959195611db6565b9338612d44565b85513d88823e3d90fd5b60405163de810b4960e01b81523360048201526020906001600160a01b03908281602481897f0000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b187165af1908115612f815783908792612f8c575b5060405163fddacd7b60e01b815292839060049082907f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e165afa918215612f81578692612f52575b5010612f1c5750612cd5565b6064906040519062461bcd60e51b82526004820152600f60248201526e0cccae4c640dcdee840cadcdeeaced608b1b6044820152fd5b9091508281813d8311612f7a575b612f6a8183611e1a565b8101031261036d57519038612f10565b503d612f60565b6040513d88823e3d90fd5b809250813d8311612fb3575b612fa28183611e1a565b8101031261036d5751826004612ec8565b503d612f98565b5060405163fddacd7b60e01b81526020816004817f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e6001600160a01b03165afa908115613041578491613010575b501515612cd0565b90506020813d8211613039575b8161302a60209383611e1a565b810103126106a3575138613008565b3d915061301d565b6040513d86823e3d90fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28380808034855af19061307e6129fd565b506040805163095ea7b360e01b81527f0000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b16001600160a01b03818116600484015234602484015260209593949092908690829060449082908d9088165af180156111e357613222575b50835163fddacd7b60e01b815285816004817f00000000000000000000000085b9209d4521e6371c9fa15ed14a1c965a59460e87165afa9081156111e357908692918a916131ec575b506064908a8751958694859363244a367760e11b85526004850152346024850152336044850152165af19081156131e25787916131b5575b50816131ab575b501561317b575050612cc1565b60649250519062461bcd60e51b82526004820152600a60248201526939bbb0b81032b93937b960b11b6044820152fd5b905015153861316e565b90508381813d83116131db575b6131cc8183611e1a565b8101031261038f575138613167565b503d6131c2565b83513d89823e3d90fd5b8381939492503d831161321b575b6132048183611e1a565b810103126132175751859190606461312f565b8880fd5b503d6131fa565b61323890863d8811610f2557610f168183611e1a565b50386130e6565b50341515612cbc565b1561324f57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b60ff1660ff81146129a25760010190565b9060005b60ff811660208110908161337b575b50156132cc576132c790613294565b6132a9565b9060ff809216906132dc82611e3b565b916132ea6040519384611e1a565b8083526132f9601f1991611e3b565b0190602091368385013760005b80851690838210808061335f575b15613354571561333e57845182101561333e57818488613339941a9187010153613294565b613306565b634e487b7160e01b600052603260045260246000fd5b505050935050905090565b1561333e5787831a60f81b6001600160f81b0319161515613314565b901561333e5783901a60f81b6001600160f81b0319161515386132b8565b6133a1612c0d565b336001600160a01b03909116036133b457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220af90263b73ecd00536c7cf267061b529e76be2bd4a9cd99e25dd3d82b8ca926964736f6c63430008120033

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

0000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002ecba91da63c29ea80fbe7b52632ca2d1f8e5be0000000000000000000000000d83b01f3b5612eda9849a55302bab3ce5f52df6c

-----Decoded View---------------
Arg [0] : _swapContractAddress (address): 0x6E5AeD576c7D7Ef572F757a2ad9AEF5be28590b1
Arg [1] : _wethContractAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _fercContractAddress (address): 0x2eCBa91da63C29EA80Fbe7b52632CA2d1F8e5Be0
Arg [3] : _tokenURIContractAddress (address): 0xD83b01f3b5612eDa9849A55302Bab3CE5f52DF6c

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000006e5aed576c7d7ef572f757a2ad9aef5be28590b1
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000002ecba91da63c29ea80fbe7b52632ca2d1f8e5be0
Arg [3] : 000000000000000000000000d83b01f3b5612eda9849a55302bab3ce5f52df6c


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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