MON Price: $0.018861 (+2.96%)

Contract

0xc319b3Cf8afDcdbcA551aa6e61A89359b8f46056

Overview

MON Balance

Monad Chain LogoMonad Chain LogoMonad Chain Logo52,203.294243823380690062 MON

MON Value

$984.61 (@ $0.02/MON)

Token Holdings

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...504810592026-01-23 0:28:3438 hrs ago1769128114IN
0xc319b3Cf...9b8f46056
0 MON0.00810991102
Set Approval For...498937242026-01-20 6:57:484 days ago1768892268IN
0xc319b3Cf...9b8f46056
0 MON0.00810991102
Set Approval For...488736072026-01-15 13:02:399 days ago1768482159IN
0xc319b3Cf...9b8f46056
0 MON0.00567691102
Set Approval For...487292112026-01-14 20:49:079 days ago1768423747IN
0xc319b3Cf...9b8f46056
0 MON0.00553238104
Set Approval For...485209612026-01-13 21:31:4810 days ago1768339908IN
0xc319b3Cf...9b8f46056
0 MON0.00594721102
Set Approval For...480611652026-01-11 18:20:4812 days ago1768155648IN
0xc319b3Cf...9b8f46056
0 MON0.00361732102
Set Approval For...477500662026-01-10 7:41:3514 days ago1768030895IN
0xc319b3Cf...9b8f46056
0 MON0.00360753102
Set Approval For...477500482026-01-10 7:41:2814 days ago1768030888IN
0xc319b3Cf...9b8f46056
0 MON0.00361732102
Set Approval For...461491122026-01-02 21:11:4521 days ago1767388305IN
0xc319b3Cf...9b8f46056
0 MON0.00540343101.94
Set Approval For...459532452026-01-01 23:23:3722 days ago1767309817IN
0xc319b3Cf...9b8f46056
0 MON0.00566327101.94
Transfer From455854572025-12-31 6:27:0724 days ago1767162427IN
0xc319b3Cf...9b8f46056
0 MON0.01471677101.94
Set Approval For...442808242025-12-25 4:48:0430 days ago1766638084IN
0xc319b3Cf...9b8f46056
0 MON0.00567691102
Set Approval For...440932822025-12-24 7:54:5331 days ago1766562893IN
0xc319b3Cf...9b8f46056
0 MON0.00553238104
Set Approval For...435016952025-12-21 13:57:5434 days ago1766325474IN
0xc319b3Cf...9b8f46056
0 MON0.00645231121.728
Set Approval For...430282902025-12-19 9:15:2836 days ago1766135728IN
0xc319b3Cf...9b8f46056
0 MON0.00540661102
Set Approval For...428804262025-12-18 16:47:5236 days ago1766076472IN
0xc319b3Cf...9b8f46056
0 MON0.00542918102.06
Transfer From428405302025-12-18 12:21:1837 days ago1766060478IN
0xc319b3Cf...9b8f46056
0 MON0.01362301102
Set Approval For...426917672025-12-17 19:47:1337 days ago1766000833IN
0xc319b3Cf...9b8f46056
0 MON0.00567691102
Set Approval For...426846712025-12-17 18:59:5037 days ago1765997990IN
0xc319b3Cf...9b8f46056
0 MON0.00595314102.10004247
Set Approval For...424311932025-12-16 14:46:5339 days ago1765896413IN
0xc319b3Cf...9b8f46056
0 MON0.00585156110
Set Approval For...424311792025-12-16 14:46:4739 days ago1765896407IN
0xc319b3Cf...9b8f46056
0 MON0.00594182112
Set Approval For...424198792025-12-16 13:30:2039 days ago1765891820IN
0xc319b3Cf...9b8f46056
0 MON0.00594731102
Set Approval For...420496042025-12-14 20:12:1240 days ago1765743132IN
0xc319b3Cf...9b8f46056
0 MON0.0077777140
Transfer From417380732025-12-13 9:22:5542 days ago1765617775IN
0xc319b3Cf...9b8f46056
0 MON0.053352102.6
Set Approval For...417009152025-12-13 5:14:1242 days ago1765602852IN
0xc319b3Cf...9b8f46056
0 MON0.00630937118.60622304
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
400212642025-12-05 9:26:1350 days ago1764926773
0xc319b3Cf...9b8f46056
18.19944245 MON
400210462025-12-05 9:24:4650 days ago1764926686
0xc319b3Cf...9b8f46056
37.8178851 MON
400210172025-12-05 9:24:3450 days ago1764926674
0xc319b3Cf...9b8f46056
37.82820264 MON
400209852025-12-05 9:24:2150 days ago1764926661
0xc319b3Cf...9b8f46056
37.78666336 MON
400208582025-12-05 9:23:3050 days ago1764926610
0xc319b3Cf...9b8f46056
18.86470311 MON
400208292025-12-05 9:23:1950 days ago1764926599
0xc319b3Cf...9b8f46056
18.71166396 MON
400208002025-12-05 9:23:0750 days ago1764926587
0xc319b3Cf...9b8f46056
19.35500484 MON
400207672025-12-05 9:22:5450 days ago1764926574
0xc319b3Cf...9b8f46056
19.12029668 MON
400206432025-12-05 9:22:0450 days ago1764926524
0xc319b3Cf...9b8f46056
0.38798574 MON
399216422025-12-04 22:19:1450 days ago1764886754
0xc319b3Cf...9b8f46056
3.0983821 MON
399201712025-12-04 22:09:2450 days ago1764886164
0xc319b3Cf...9b8f46056
3.21568832 MON
399141372025-12-04 21:29:0050 days ago1764883740
0xc319b3Cf...9b8f46056
15.67800494 MON
399127412025-12-04 21:19:3850 days ago1764883178
0xc319b3Cf...9b8f46056
3.1099803 MON
399126022025-12-04 21:18:4350 days ago1764883123
0xc319b3Cf...9b8f46056
3.1141793 MON
399118802025-12-04 21:13:5350 days ago1764882833
0xc319b3Cf...9b8f46056
3.11958946 MON
399053262025-12-04 20:30:0050 days ago1764880200
0xc319b3Cf...9b8f46056
3.1316188 MON
399034112025-12-04 20:17:1150 days ago1764879431
0xc319b3Cf...9b8f46056
2.89891365 MON
398970482025-12-04 19:34:3650 days ago1764876876
0xc319b3Cf...9b8f46056
3.04458494 MON
398850612025-12-04 18:14:1850 days ago1764872058
0xc319b3Cf...9b8f46056
3.11437832 MON
398802612025-12-04 17:42:1050 days ago1764870130
0xc319b3Cf...9b8f46056
13.33900396 MON
398801122025-12-04 17:41:1150 days ago1764870071
0xc319b3Cf...9b8f46056
3.0833275 MON
398731092025-12-04 16:54:1850 days ago1764867258
0xc319b3Cf...9b8f46056
5.2188873 MON
398674832025-12-04 16:16:3950 days ago1764864999
0xc319b3Cf...9b8f46056
3.02547154 MON
398673452025-12-04 16:15:4350 days ago1764864943
0xc319b3Cf...9b8f46056
3.22124439 MON
398672832025-12-04 16:15:1950 days ago1764864919
0xc319b3Cf...9b8f46056
3.05187992 MON
View All Internal Transactions
Loading...
Loading

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

Contract Name:
KingdomlyNFTStandardV3

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : KingdomlyNFTStandardV3.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {Context as OZContext} from "@openzeppelin/contracts/utils/Context.sol";
import {ERC721AC} from "@creator-token-standards/src/erc721c/ERC721AC.sol";
import {IDelegateRegistry} from "src/utils/IDelegateRegistry.sol";
import {IKingdomlyFeeContract} from "src/utils/IKingdomlyFeeContract.sol";
import {IDelegateRegistry} from "src/utils/IDelegateRegistry.sol";
import {IKingdomlyFeeContract} from "src/utils/IKingdomlyFeeContract.sol";

contract KingdomlyNFTStandardV3 is ERC721AC, ERC2981, Ownable, ReentrancyGuard {
    struct BaseVariables {
        string name;
        string symbol;
        address ownerPayoutAddress;
        string initialBaseURI;
        uint256 maxSupply;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                              ERRORS                              */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    error KingdomlyNFTStandardV3__MintInactive();
    error KingdomlyNFTStandardV3__MintOnBehalfNotActive();
    error KingdomlyNFTStandardV3__AddressZero();
    error KingdomlyNFTStandardV3__Unauthorized(address caller);
    error KingdomlyNFTStandardV3__InvalidOperation(string reason);
    error KingdomlyNFTStandardV3__ExceedsMaxSupply(uint256 requested, uint256 available);
    error KingdomlyNFTStandardV3__InsufficientEther(uint256 required, uint256 provided);
    error KingdomlyNFTStandardV3__ExceedsMaxPerWallet(uint256 requested, uint256 allowed);
    error KingdomlyNFTStandardV3__ExceedsMintQuota(uint256 requested, uint256 allowed);
    error KingdomlyNFTStandardV3__ExceedsMaxMintGroupSupply(uint256 requested, uint256 available);
    error KingdomlyNFTStandardV3__MintGroupInactive(uint256 mintGroup);
    error KingdomlyNFTStandardV3__NotInPresale(address caller, uint256 mintGroup);
    error KingdomlyNFTStandardV3__MintGroupDoesNotExist(uint256 mintGroup);
    error KingdomlyNFTStandardV3__ArrayLengthMismatch();
    error KingdomlyNFTStandardV3__InvalidKingdomlyFeeContract();
    error KingdomlyNFTStandardV3__InvalidKingdomlyAdminAddress();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                              EVENTS                              */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    event BatchMetadataUpdate(uint256 indexed fromTokenId, uint256 indexed toTokenId);
    event TokensMinted(address indexed recipient, uint256 amount, uint256 mintGroup);
    event TokensDelegateMinted(address indexed vault, address indexed hotWallet, uint256 amount, uint256 mintGroup);
    event SalePriceChanged(uint256 indexed mintGroup, uint256 newPrice);
    event PublicMaxMintPerWalletChanged(uint256 newMaxMintPerWallet);
    event PreSaleMintStatusChanged(bool status, uint256 mintGroupId);
    event PreSaleMintScheduledStartTimestampChanged(uint256 timestamp, uint256 mintGroupId);
    event KingdomlyFeeContractChanged(address feeContractAddress);
    event KingdomlyAdminChanged(address kingdomlyAdmin);
    event MintOnBehalfStatusChanged(bool status);
    event CreatorFeeUpdated(uint256 newCreatorFee);
    event MintFeeUpdated(uint256 newMintFee);
    event MintQuotasAdded(uint256 mintGroup, uint256 numberOfAddresses);
    event MintOnBehalfUpdated(bool newStatus);
    event MintStatusUpdated(bool newStatus);
    event MaxPerMintGroupUpdated(uint256 mintGroup, uint256 newMax);
    event MintLiveTimestampUpdated(uint256 timestamp);
    event OwnerPayoutAddressUpdated(address newOwnerPayoutAddress);
    event DefaultRoyaltyUpdated(address receiver, uint96 feeNumerator);
    event TokenRoyaltyUpdated(uint256 tokenId, address receiver, uint96 feeNumerator);
    event NftsAirdropped(uint256 recipients, uint256 amount);
    event MintFundsWithdrew();
    event FeeFundsWithdrew();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                        STORAGE VARIABLES                         */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    uint256 private constant BASIS_POINTS = 10000;
    address private constant DELEGATE_REGISTRY = 0x00000000000000447e69651d841bD8D104Bed493;
    uint256 private immutable i_maxSupply;
    address private immutable i_feeAddress;
    uint256 private s_threeDollarsInCents;
    uint256 private s_scheduledMintLiveTimestamp;
    uint256 private s_creatorFeeBasisPoints = 300;
    uint256 private s_publicMaxMintPerWallet;
    uint256[] private s_activeMintGroups;
    bool private s_contractMintLive;
    bool private s_mintOnBehalfActive;
    string private s_baseURI;
    address private s_ownerPayoutAddress;
    address private s_kingdomlyAdmin;
    address private s_kingdomlyPriceOracleContract;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                             MAPPINGS                             */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    mapping(address => uint256) private s_pendingBalances;
    mapping(uint256 => uint256) private s_mintPrice;
    mapping(uint256 => uint256) private s_maxSupplyPerMintGroup;
    mapping(uint256 => uint256) private s_mintGroupMints;
    mapping(uint256 => uint256) private s_presaleScheduledStartTimestamp;
    mapping(address => mapping(uint256 => uint256)) private s_addressMints;
    mapping(uint256 => mapping(address => uint256)) private s_mintQuotas;
    mapping(uint256 => bool) private s_contractPresaleActive;

    constructor(
        BaseVariables memory _baseVariables,
        uint256[] memory _maxSupplyPerMintGroup,
        uint256[] memory _mintPrice,
        uint256 _publicMaxMintPerWallet,
        uint96 _royaltyPercentage,
        address _owner,
        address _royaltyPayoutAddress
    ) ERC721AC(_baseVariables.name, _baseVariables.symbol) Ownable(_owner) {
        if (_mintPrice.length != _maxSupplyPerMintGroup.length) {
            revert KingdomlyNFTStandardV3__ArrayLengthMismatch();
        }
        uint256 totalMaxSupplyPerMintGroup = 0;
        for (uint256 i = 0; i < _maxSupplyPerMintGroup.length; i++) {
            totalMaxSupplyPerMintGroup += _maxSupplyPerMintGroup[i];
            s_maxSupplyPerMintGroup[i] = _maxSupplyPerMintGroup[i];
            s_mintPrice[i] = _mintPrice[i];
            s_mintGroupMints[i] = 0;
            s_activeMintGroups.push(i);
        }
        if (totalMaxSupplyPerMintGroup > _baseVariables.maxSupply) {
            revert KingdomlyNFTStandardV3__InvalidOperation({
                reason: "Max supply per mint group exceeds total max supply"
            });
        }
        i_maxSupply = _baseVariables.maxSupply;
        s_contractMintLive = false;
        s_scheduledMintLiveTimestamp = 0;
        s_baseURI = _baseVariables.initialBaseURI;
        s_ownerPayoutAddress = _baseVariables.ownerPayoutAddress;
        i_feeAddress = 0x10317Fa93da2a2e6d7B8e29D2BC2e6B95f2ECc84;
        s_kingdomlyAdmin = 0x89695e9D4C489128471798766f1EE4b2a8AB5B5B;
        s_kingdomlyPriceOracleContract = 0x92cC6a35f1714cFC7a374F64117A024d1d74cdB6;
        s_publicMaxMintPerWallet = _publicMaxMintPerWallet;

        /**
         * Set default royalty for ERC2981
         */
        _setDefaultRoyalty(_royaltyPayoutAddress, _royaltyPercentage);
        s_threeDollarsInCents = 300;
    }

    /**
     * @notice Mints NFTs to the caller for a specific mint group
     * @param amount Amount of NFTs to be minted
     * @param mintGroup Id of mint group
     * @return totalCostWithFee Total cost of the mint for batch mint
     */
    function batchMint(uint256 amount, uint256 mintGroup) external payable returns (uint256 totalCostWithFee) {
        totalCostWithFee = _batchMint(msg.sender, amount, mintGroup, msg.sender);
        emit TokensMinted(msg.sender, amount, mintGroup);
        _refundExcessEther(totalCostWithFee);
    }

    /**
     * @notice Mints NFTs on behalf of a vault using delegation
     * @param amount Number of tokens to mint.
     * @param mintGroup Identifier for the minting group or phase.
     * @param vault The vault whose delegation is being exercised.
     */
    function delegatedMint(uint256 amount, uint256 mintGroup, address vault)
        external
        payable
        returns (uint256 totalCostWithFee)
    {
        // Verify delegation
        if (!IDelegateRegistry(DELEGATE_REGISTRY).checkDelegateForContract(msg.sender, vault, address(this), "")) {
            revert KingdomlyNFTStandardV3__Unauthorized(vault);
        }

        totalCostWithFee = _batchMint(vault, amount, mintGroup, msg.sender);
        emit TokensDelegateMinted(vault, msg.sender, amount, mintGroup);
        _refundExcessEther(totalCostWithFee);
    }

    /**
     * @notice Mints NFTs to a specified receiver address
     * @param amount The number of tokens to mint
     * @param mintGroup The mint group ID
     * @param receiver The address to mint the tokens to
     */
    function mintOnBehalf(uint256 amount, uint256 mintGroup, address receiver)
        external
        payable
        returns (uint256 totalCostWithFee)
    {
        if (!s_mintOnBehalfActive) {
            revert KingdomlyNFTStandardV3__MintOnBehalfNotActive();
        }
        totalCostWithFee = _batchMint(receiver, amount, mintGroup, receiver);
        emit TokensMinted(receiver, amount, mintGroup);
        _refundExcessEther(totalCostWithFee);
    }

    /**
     * @notice Allows the contract owner to withdraw the funds that have been paid into the contract
     */
    function withdrawMintFunds() external nonReentrant {
        _withdrawFor(s_ownerPayoutAddress);
        _withdrawFor(i_feeAddress);
        emit MintFundsWithdrew();
    }

    /**
     * @notice Allows the fee address to withdraw their portion of the funds
     */
    function withdrawFeeFunds() external nonReentrant {
        _withdrawFor(i_feeAddress);
        emit FeeFundsWithdrew();
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                    KINGDOMLY ADMIN FUNCTIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    /**
     * @notice Sets the creator fee basis points for Kingdomly
     * @param _creatorFeeBasisPoints The new creator fee for kingdomly
     */
    function setCreatorFee(uint256 _creatorFeeBasisPoints) external isKingdomlyAdmin {
        if (_creatorFeeBasisPoints > BASIS_POINTS) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Creator fee cannot exceed 100%"});
        }
        s_creatorFeeBasisPoints = _creatorFeeBasisPoints;
        emit CreatorFeeUpdated(_creatorFeeBasisPoints);
    }

    /**
     * @notice Updates the Kingdomly price oracle contract address
     * @param _kingdomlyPriceOracleContract address of new kingdomly price oracle contract
     */
    function setNewKingdomlyPriceOracleContract(address _kingdomlyPriceOracleContract) external isKingdomlyAdmin {
        if (_kingdomlyPriceOracleContract == address(0)) {
            revert KingdomlyNFTStandardV3__InvalidKingdomlyFeeContract();
        }
        s_kingdomlyPriceOracleContract = _kingdomlyPriceOracleContract;
        emit KingdomlyFeeContractChanged(address(_kingdomlyPriceOracleContract));
    }

    /**
     * @notice Updates the Kingdomly admin address
     * @param _kingdomlyAdmin Address to be the new Kingdomly Admin
     */
    function setNewKingdomlyAdmin(address _kingdomlyAdmin) external isKingdomlyAdmin {
        if (_kingdomlyAdmin == address(0)) {
            revert KingdomlyNFTStandardV3__InvalidKingdomlyAdminAddress();
        }
        s_kingdomlyAdmin = _kingdomlyAdmin;
        emit KingdomlyAdminChanged(address(_kingdomlyAdmin));
    }

    /**
     * @notice Sets the fee amount in cents for minting operations
     * @param _newCents New fee per mint
     */
    function setThreeDollarsInCents(uint256 _newCents) external isKingdomlyAdmin {
        s_threeDollarsInCents = _newCents;
        emit MintFeeUpdated(_newCents);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                         OWNER FUNCTIONS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    /**
     *
     * @param addressToAdd Addresses to change mint quota
     * @param mintGroup mint ID group of addresses to change mint quota
     * @param _mintQuotas mint quotas address in array
     * @notice Changed add to presale to set mint quota for individual addresses.
     */
    function setMintQuota(address[] memory addressToAdd, uint256 mintGroup, uint256[] memory _mintQuotas)
        external
        onlyOwner
    {
        if (addressToAdd.length != _mintQuotas.length) {
            revert KingdomlyNFTStandardV3__ArrayLengthMismatch();
        }

        if (!isMintGroupActive(mintGroup)) {
            initializeNewMintGroup(mintGroup);
        }

        uint256 addressesToAddLength = addressToAdd.length;

        for (uint256 i = 0; i < addressesToAddLength; i++) {
            s_mintQuotas[mintGroup][addressToAdd[i]] = _mintQuotas[i];
        }
        emit MintQuotasAdded(mintGroup, addressesToAddLength);
    }

    /**
     * @notice Sets the maximum number of tokens that can be minted in a batch of the public mint group
     */
    function setPublicMaxMintPerWallet(uint256 _newPublicMaxMintPerWallet) external onlyOwner {
        s_publicMaxMintPerWallet = _newPublicMaxMintPerWallet;
        emit PublicMaxMintPerWalletChanged(_newPublicMaxMintPerWallet);
    }

    /**
     * @notice Sets the mint on behalf status
     * @param status new mint on behalf status
     */
    function setMintOnBehalfStatus(bool status) external onlyOwner {
        s_mintOnBehalfActive = status;
        emit MintOnBehalfUpdated(status);
    }

    /**
     * @notice Changes the price to mint a token of a specific mint group id
     * @param newMintPrice New mint Price
     * @param mintGroup Mint ID to change price
     */
    function changeSalePrice(uint256 newMintPrice, uint256 mintGroup) external onlyOwner {
        //Checks if mintGroup already exists inside activeMintGroups. This allows the contract to adjust the mappings for new mint groups
        if (!isMintGroupActive(mintGroup)) {
            initializeNewMintGroup(mintGroup);
        }
        s_mintPrice[mintGroup] = newMintPrice;
        emit SalePriceChanged(mintGroup, newMintPrice);
    }

    /**
     * @notice Changes the minting status. Only the contract owner can call this function.
     * @param status new status of mint
     */
    function changeMintStatus(bool status) external onlyOwner {
        if (s_contractMintLive == status) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Mint status is already the one you entered"});
        }
        if (!status) {
            s_scheduledMintLiveTimestamp = 0;
        }
        s_contractMintLive = status;
        emit MintStatusUpdated(status);
    }

    /**
     * @notice Changes the max mint per mint group
     * @param mintGroup mint ID of the group to change max mint
     * @param newMax the new max mint per mint group
     */
    function setNewMaxPerMintGroup(uint256 mintGroup, uint256 newMax) external onlyOwner {
        //Checks if mintGroup already exists inside activeMintGroups. This allows the contract to adjust the mappings for new mint groups
        if (!isMintGroupActive(mintGroup)) {
            initializeNewMintGroup(mintGroup);
        }

        // Checker if new max exceeds total supply
        uint256 totalMaxMintPerMG = 0;
        uint256 activeMintGroupsLength = s_activeMintGroups.length;
        for (uint256 i = 0; i < activeMintGroupsLength; i++) {
            if (s_activeMintGroups[i] == mintGroup) {
                totalMaxMintPerMG += newMax; // Use the new max for the specified mintGroup
            } else {
                totalMaxMintPerMG += s_maxSupplyPerMintGroup[s_activeMintGroups[i]];
            }
        }

        if (totalMaxMintPerMG > i_maxSupply) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "New supply per mint group exceeds total supply."});
        }

        s_maxSupplyPerMintGroup[mintGroup] = newMax;
        emit MaxPerMintGroupUpdated(mintGroup, newMax);
    }

    /**
     * @notice Starts or stops presale minting for a specific mint group
     * @param presaleStatus status for presale
     * @param mintGroup mintGroup to change presale status
     */
    function stopOrStartpresaleMint(bool presaleStatus, uint256 mintGroup) external onlyOwner {
        // Checks if mintGroup already exists inside activeMintGroups.
        if (!isMintGroupActive(mintGroup)) {
            revert KingdomlyNFTStandardV3__MintGroupDoesNotExist({mintGroup: mintGroup});
        }
        s_contractPresaleActive[mintGroup] = presaleStatus;
        if (!presaleStatus) {
            s_presaleScheduledStartTimestamp[mintGroup] = 0;
        }
        emit PreSaleMintStatusChanged(presaleStatus, mintGroup);
    }

    /**
     * @notice Schedules when presale minting will start for a specific mint group
     * @param startTimestamp timestamp of the mintGroup to start
     * @param mintGroup mint ID to change start presale timestamp
     */
    function schedulePresaleMintStart(uint256 startTimestamp, uint256 mintGroup) external onlyOwner {
        if (!isMintGroupActive(mintGroup)) {
            revert KingdomlyNFTStandardV3__MintGroupDoesNotExist({mintGroup: mintGroup});
        }
        s_presaleScheduledStartTimestamp[mintGroup] = startTimestamp;
        emit PreSaleMintScheduledStartTimestampChanged(startTimestamp, mintGroup);
    }

    /**
     * @notice Sets the base URI for the token metadata. Only the contract owner can call this function.
     * @param newBaseURI the newBASEURI for the token metadata
     */
    function setBaseURI(string memory newBaseURI) external onlyOwner {
        s_baseURI = newBaseURI;
        emit BatchMetadataUpdate(1, type(uint256).max);
    }

    /**
     * @notice Sets the timestamp when minting should begin
     * @param timestamp The Unix timestamp when minting should begin
     */
    function setMintLiveTimestamp(uint256 timestamp) external onlyOwner {
        s_scheduledMintLiveTimestamp = timestamp;
        emit MintLiveTimestampUpdated(timestamp);
    }

    /**
     * @notice Updates the owner's payout address and transfers pending balance to new address
     * @dev Transfers existing balance from old to new address, then updates ownerPayoutAddress
     * @param newOwnerPayoutAddress The new address for owner payouts
     */
    function setOwnerPayoutAddress(address newOwnerPayoutAddress) external onlyOwner {
        if (newOwnerPayoutAddress == address(0)) {
            revert KingdomlyNFTStandardV3__AddressZero();
        }
        uint256 ownerBalance = s_pendingBalances[s_ownerPayoutAddress];
        s_pendingBalances[newOwnerPayoutAddress] += ownerBalance;
        s_pendingBalances[s_ownerPayoutAddress] = 0;
        s_ownerPayoutAddress = newOwnerPayoutAddress;
        emit OwnerPayoutAddressUpdated(newOwnerPayoutAddress);
    }

    /**
     * @notice Sets the default royalty recipient and fee percentage for all tokens
     * @dev Calls internal _setDefaultRoyalty function. Only callable by owner
     * @param receiver Address that will receive royalty payments
     * @param feeNumerator Royalty fee as basis points (e.g., 250 = 2.5%)
     */
    function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwner {
        _setDefaultRoyalty(receiver, feeNumerator);
        emit DefaultRoyaltyUpdated(receiver, feeNumerator);
    }

    /**
     * @notice Sets royalty recipient and fee for a specific token, overriding default royalty
     * @dev Calls internal _setTokenRoyalty function. Only callable by owner
     * @param tokenId The token ID to set specific royalty for
     * @param receiver Address that will receive royalty payments for this token
     * @param feeNumerator Royalty fee as basis points (e.g., 250 = 2.5%)
     */
    function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external onlyOwner {
        _setTokenRoyalty(tokenId, receiver, feeNumerator);
        emit TokenRoyaltyUpdated(tokenId, receiver, feeNumerator);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                        AIRDROP FUNCTIONS                         */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    /**
     * @notice Airdrops NFTs to multiple recipients with a fixed fee charged to the owner
     * @param recipients Recipent to receive NFTs
     * @param amounts the number of NFTs to airdrop per recipient
     * @dev Modified airdrop function to charge the owner threeDollarsEth per mint
     */
    function airdropNFTs(address[] memory recipients, uint256[] memory amounts)
        external
        payable
        onlyOwner
        returns (uint256 totalCharge)
    {
        uint256 amountLengths = amounts.length;
        if (recipients.length != amountLengths) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Mismatch between recipients and amounts"});
        }
        uint256 totalNFTToMint = 0;
        for (uint256 i = 0; i < amountLengths; i++) {
            totalNFTToMint += amounts[i];
        }
        if (totalSupply() + totalNFTToMint > i_maxSupply) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Airdrop exceeds max supply"});
        }
        totalCharge = quoteAirdropFees(totalNFTToMint);
        if (msg.value < totalCharge) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Not enough Ether sent for the airdrop charge"});
        }

        s_pendingBalances[i_feeAddress] += totalCharge; // Fee goes to the fee address
        uint256 recipientsLength = recipients.length;
        for (uint256 j = 0; j < recipientsLength; j++) {
            uint256 nftAmount = amounts[j];
            _safeMint(recipients[j], nftAmount); // Mint NFTs to recipients
        }
        emit NftsAirdropped(recipientsLength, totalNFTToMint);

        _refundExcessEther(totalCharge);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                            MODIFIERS                             */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    /**
     * @dev Ensures the caller is the Kingdomly Admin.
     */
    modifier isKingdomlyAdmin() {
        if (msg.sender != s_kingdomlyAdmin) {
            revert KingdomlyNFTStandardV3__Unauthorized(msg.sender);
        }
        _;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                          VIEW FUNCTIONS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/

    function maxSupply() external view returns (uint256) {
        return i_maxSupply;
    }

    function threeDollarsInCents() external view returns (uint256) {
        return s_threeDollarsInCents;
    }

    function scheduledMintLiveTimestamp() external view returns (uint256) {
        return s_scheduledMintLiveTimestamp;
    }

    function creatorFeeBasisPoints() external view returns (uint256) {
        return s_creatorFeeBasisPoints;
    }

    function publicMaxMintPerWallet() external view returns (uint256) {
        return s_publicMaxMintPerWallet;
    }

    function activeMintGroups() external view returns (uint256[] memory) {
        return s_activeMintGroups;
    }

    function contractMintLive() external view returns (bool) {
        return s_contractMintLive;
    }

    function mintOnBehalfActive() external view returns (bool) {
        return s_mintOnBehalfActive;
    }

    function baseURI() external view returns (string memory) {
        return s_baseURI;
    }

    function feeAddress() external view returns (address) {
        return i_feeAddress;
    }

    function ownerPayoutAddress() external view returns (address) {
        return s_ownerPayoutAddress;
    }

    function kingdomlyAdmin() external view returns (address) {
        return s_kingdomlyAdmin;
    }

    function kingdomlyPriceOracleContract() external view returns (address) {
        return s_kingdomlyPriceOracleContract;
    }

    function delegateRegistry() external pure returns (address) {
        return DELEGATE_REGISTRY;
    }

    function mintPrice(uint256 mintGroup) external view returns (uint256) {
        return s_mintPrice[mintGroup];
    }

    function maxSupplyPerMintGroup(uint256 mintGroup) external view returns (uint256) {
        return s_maxSupplyPerMintGroup[mintGroup];
    }

    function mintGroupMints(uint256 mintGroup) external view returns (uint256) {
        return s_mintGroupMints[mintGroup];
    }

    function presaleScheduledStartTimestamp(uint256 mintGroup) external view returns (uint256) {
        return s_presaleScheduledStartTimestamp[mintGroup];
    }

    function mintQuotas(uint256 mintGroup, address minter) external view returns (uint256) {
        return s_mintQuotas[mintGroup][minter];
    }

    function contractPresaleActive(uint256 mintGroup) external view returns (bool) {
        return s_contractPresaleActive[mintGroup];
    }

    /**
     * @notice Checks if a mint operation is valid for the given parameters
     * @param amount Amount of ERC
     * @param mintGroup mintGroup to check if eligible to mint
     * @param minterAddress Address to mint
     */
    function canMintCheck(uint256 amount, uint256 mintGroup, address minterAddress)
        external
        view
        returns (bool, string memory)
    {
        if (amount == 0) {
            return (false, "InvalidOperation");
        }

        // Pre-conditions checks
        if (!mintLive()) {
            return (false, "MintInactive");
        }

        if (!s_contractPresaleActive[mintGroup]) {
            if (
                s_presaleScheduledStartTimestamp[mintGroup] == 0
                    || block.timestamp <= s_presaleScheduledStartTimestamp[mintGroup]
            ) {
                return (false, "MintGroupInactive");
            }
        }

        if (mintGroup != 0) {
            if (s_mintQuotas[mintGroup][minterAddress] == 0) {
                return (false, "NotInPresale");
            }

            if (amount > s_mintQuotas[mintGroup][minterAddress]) {
                return (false, "ExceedsMintQuota");
            }
        } else {
            if (amount + s_addressMints[minterAddress][mintGroup] > s_publicMaxMintPerWallet) {
                return (false, "ExceedsPublicMaxMintPerWallet");
            }
        }

        if (s_mintGroupMints[mintGroup] + amount > s_maxSupplyPerMintGroup[mintGroup]) {
            return (false, "ExceedsMaxMintGroupSupply");
        }

        if (totalSupply() + amount > i_maxSupply) {
            return (false, "ExceedsMaxSupply");
        }

        return (true, "");
    }

    /**
     * @notice Checks if a delegated mint operation is valid for the given parameters
     * @param amount amount of NFTs to be minted
     * @param mintGroup mint group id to check mint eligibility
     * @param vault Vault address with mint quota
     * @param minterAddress Minter address that vault delgated to
     */
    function canDelegateMintCheck(uint256 amount, uint256 mintGroup, address vault, address minterAddress)
        external
        view
        returns (bool, string memory)
    {
        if (!IDelegateRegistry(DELEGATE_REGISTRY).checkDelegateForContract(minterAddress, vault, address(this), "")) {
            return (false, "Unauthorized");
        }

        if (amount == 0) {
            return (false, "InvalidOperation");
        }

        // Pre-conditions checks
        if (!mintLive()) {
            return (false, "MintInactive");
        }

        if (!s_contractPresaleActive[mintGroup]) {
            if (
                s_presaleScheduledStartTimestamp[mintGroup] == 0
                    || block.timestamp <= s_presaleScheduledStartTimestamp[mintGroup]
            ) {
                return (false, "MintGroupInactive");
            }
        }

        if (mintGroup != 0) {
            if (s_mintQuotas[mintGroup][vault] == 0) {
                return (false, "NotInPresale");
            }

            if (amount > s_mintQuotas[mintGroup][vault]) {
                return (false, "ExceedsMintQuota");
            }
        } else {
            if (amount + s_addressMints[vault][mintGroup] > s_publicMaxMintPerWallet) {
                return (false, "ExceedsPublicMaxPerWallet");
            }
        }
        if (s_mintGroupMints[mintGroup] + amount > s_maxSupplyPerMintGroup[mintGroup]) {
            return (false, "ExceedsMaxMintGroupSupply");
        }

        if (totalSupply() + amount > i_maxSupply) {
            return (false, "ExceedsMaxSupply");
        }

        return (true, "");
    }

    /**
     * @notice Quote the total cost of minting a batch of tokens
     * @dev This is the same price for both the owner and the delegate
     * @param mintGroup The mint group ID
     * @param amount The number of tokens to mint
     * @return totalCostWithFee The total cost of minting the batch, including the minter fee
     * @return mintingCost The base cost of minting without any fees
     * @return minterFee The fixed $3 fee per token minted
     * @return creatorFee The 3% fee calculated from the base minting cost
     */
    function quoteBatchMint(uint256 mintGroup, uint256 amount)
        public
        view
        returns (uint256 totalCostWithFee, uint256 mintingCost, uint256 minterFee, uint256 creatorFee)
    {
        mintingCost = s_mintPrice[mintGroup] * amount;
        minterFee = threeDollarsEth() * amount;
        creatorFee = (mintingCost * s_creatorFeeBasisPoints) / BASIS_POINTS;
        totalCostWithFee = mintingCost + minterFee + creatorFee;
    }

    /**
     * @notice Checks the balance pending withdrawal for the sender.
     */
    function checkPendingBalance() external view returns (uint256) {
        return s_pendingBalances[msg.sender];
    }

    /**
     * @notice Checks the balance pending withdrawal for the user.
     */
    function checkPendingBalanceFor(address user) external view returns (uint256) {
        return s_pendingBalances[user];
    }

    /**
     * @notice Returns whether this contract supports the given interface
     */
    function supportsInterface(bytes4 interfaceId) public view override(ERC721AC, ERC2981) returns (bool) {
        return ERC721AC.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId);
    }

    /**
     * @notice Checks if a mint group ID is active
     */
    function isMintGroupActive(uint256 mintGroup) private view returns (bool) {
        uint256 activeMintGroupsLength = s_activeMintGroups.length;
        for (uint256 i = 0; i < activeMintGroupsLength; i++) {
            if (s_activeMintGroups[i] == mintGroup) {
                return true;
            }
        }
        return false;
    }

    /**
     * @notice Returns whether minting is currently live
     */
    function mintLive() public view returns (bool) {
        if (!s_contractMintLive) {
            if (s_scheduledMintLiveTimestamp == 0 || block.timestamp <= s_scheduledMintLiveTimestamp) {
                return false;
            }
        }
        return true;
    }

    /**
     * @notice Returns the current cost of $3 in ETH using the price oracle
     */
    function threeDollarsEth() public view returns (uint256) {
        uint256 oneDollarInWei = IKingdomlyFeeContract(s_kingdomlyPriceOracleContract).getOneDollarInWei();
        return (oneDollarInWei * s_threeDollarsInCents) / 100;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        if (bytes(s_baseURI).length == 0) {
            return "";
        }
        if (bytes(s_baseURI)[bytes(s_baseURI).length - 1] != bytes("/")[0]) {
            return s_baseURI;
        }
        return string(abi.encodePacked(s_baseURI, _toString(tokenId)));
    }

    /**
     * @notice Returns the creator fee percentage
     */
    function getCreatorFeePercentage() external view returns (uint256) {
        return (s_creatorFeeBasisPoints * 100) / BASIS_POINTS;
    }

    /**
     * @notice Calculates the total cost for airdropping a given amount of tokens
     * @param amount The number of tokens to mint
     * @return totalAirdropCostWithFee The total cost of minting the batch ($0.33 per nft)
     */
    function quoteAirdropFees(uint256 amount) public view returns (uint256 totalAirdropCostWithFee) {
        totalAirdropCostWithFee = (threeDollarsEth() * amount * 11) / 100;
    }

    /**
     * @notice Checker whether presale is already active both on timestmap and the mapping
     */
    function presaleActive(uint256 mintGroup) external view returns (bool) {
        if (!s_contractPresaleActive[mintGroup]) {
            if (
                s_presaleScheduledStartTimestamp[mintGroup] == 0
                    || block.timestamp <= s_presaleScheduledStartTimestamp[mintGroup]
            ) {
                return false;
            }
        }

        return true;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:´:°•.°*/
    /*                        INTERNAL FUNCTIONS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•.•°:°.*/
    /**
     * @notice Initializes a new mint group with default values
     */
    function initializeNewMintGroup(uint256 mintGroup) internal {
        s_mintPrice[mintGroup] = 0;
        s_maxSupplyPerMintGroup[mintGroup] = 0;
        s_mintGroupMints[mintGroup] = 0;
        s_activeMintGroups.push(mintGroup);
    }

    /**
     * @notice Internal function to handle batch minting logic
     */
    function _batchMint(address quotaHolder, uint256 amount, uint256 mintGroup, address receiver)
        internal
        returns (uint256)
    {
        if (amount == 0) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Amount must be greater than 0"});
        }

        // Pre-conditions checks
        if (!mintLive()) {
            revert KingdomlyNFTStandardV3__MintInactive();
        }

        if (!s_contractPresaleActive[mintGroup]) {
            if (
                s_presaleScheduledStartTimestamp[mintGroup] == 0
                    || block.timestamp <= s_presaleScheduledStartTimestamp[mintGroup]
            ) {
                revert KingdomlyNFTStandardV3__MintGroupInactive({mintGroup: mintGroup});
            }
        }

        // Checks required for non public mint
        if (mintGroup != 0) {
            if (s_mintQuotas[mintGroup][quotaHolder] == 0) {
                revert KingdomlyNFTStandardV3__NotInPresale({caller: quotaHolder, mintGroup: mintGroup});
            }

            if (amount > s_mintQuotas[mintGroup][quotaHolder]) {
                revert KingdomlyNFTStandardV3__ExceedsMintQuota({
                    requested: amount,
                    allowed: s_mintQuotas[mintGroup][quotaHolder]
                });
            }
            s_mintQuotas[mintGroup][quotaHolder] -= amount;
        } else {
            if (amount + s_addressMints[quotaHolder][mintGroup] > s_publicMaxMintPerWallet) {
                revert KingdomlyNFTStandardV3__ExceedsMaxPerWallet({
                    requested: amount,
                    allowed: s_publicMaxMintPerWallet - s_addressMints[quotaHolder][mintGroup]
                });
            }
        }

        // Check mint group supply limits
        if (s_mintGroupMints[mintGroup] + amount > s_maxSupplyPerMintGroup[mintGroup]) {
            revert KingdomlyNFTStandardV3__ExceedsMaxMintGroupSupply({
                requested: amount,
                available: s_maxSupplyPerMintGroup[mintGroup] - s_mintGroupMints[mintGroup]
            });
        }

        // Check total supply limit
        if (totalSupply() + amount > i_maxSupply) {
            revert KingdomlyNFTStandardV3__ExceedsMaxSupply({requested: amount, available: i_maxSupply - totalSupply()});
        }

        // Calculate fees, check if we have enough msg.value
        (uint256 totalCostWithFee, uint256 mintingCost, uint256 minterFee, uint256 creatorFee) =
            quoteBatchMint(mintGroup, amount);

        if (msg.value < totalCostWithFee) {
            revert KingdomlyNFTStandardV3__InsufficientEther({required: totalCostWithFee, provided: msg.value});
        }

        uint256 totalFee = minterFee + creatorFee;

        s_addressMints[quotaHolder][mintGroup] += amount;

        // Update balances
        s_pendingBalances[i_feeAddress] += totalFee;
        s_pendingBalances[s_ownerPayoutAddress] += mintingCost - creatorFee;

        // Finalize minting
        s_mintGroupMints[mintGroup] += amount;
        _safeMint(receiver, amount);

        return totalCostWithFee;
    }

    /**
     * @notice Internal function to withdraw funds for a specific user
     */
    function _withdrawFor(address user) internal returns (uint256 payout) {
        payout = s_pendingBalances[user];
        s_pendingBalances[user] = 0;
        (bool success,) = payable(user).call{value: payout}("");
        if (!success) {
            revert KingdomlyNFTStandardV3__InvalidOperation({reason: "Withdraw Transfer Failed"});
        }
    }

    /**
     * @notice Internal function to refund excess Ether sent in a transaction
     */
    function _refundExcessEther(uint256 totalCharge) internal {
        uint256 excess = msg.value - totalCharge;
        if (excess > 0) {
            (bool success,) = payable(msg.sender).call{value: excess}("");
            if (!success) {
                s_pendingBalances[msg.sender] += excess;
            }
        }
    }

    /**
     * @notice Overrides the start token ID function from the ERC721A contract
     */
    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    /**
     * @notice Returns the base URI for the token metadata
     */
    function _baseURI() internal view override returns (string memory) {
        return s_baseURI;
    }

    /**
     * @notice Internal function to check if caller is contract owner
     */
    function _requireCallerIsContractOwner() internal view virtual override {
        _checkOwner();
    }

    /**
     * @notice Returns the message data for the current call
     */
    function _msgData() internal view override(OZContext) returns (bytes calldata) {
        return super._msgData();
    }

    /**
     * @notice Returns the sender of the current call
     */
    function _msgSender() internal view override(OZContext) returns (address) {
        return super._msgSender();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

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

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.20;

import {IERC2981} from "../../interfaces/IERC2981.sol";
import {IERC165, ERC165} from "../../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 ERC. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

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

    /**
     * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1).
     */
    error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);

    /**
     * @dev The default royalty receiver is invalid.
     */
    error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);

    /**
     * @dev The royalty set for a specific `tokenId` is invalid (eg. (numerator / denominator) >= 1).
     */
    error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);

    /**
     * @dev The royalty receiver for `tokenId` is invalid.
     */
    error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);

    /// @inheritdoc IERC165
    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 returns (address receiver, uint256 amount) {
        RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId];
        address royaltyReceiver = _royaltyInfo.receiver;
        uint96 royaltyFraction = _royaltyInfo.royaltyFraction;

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

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

        return (royaltyReceiver, 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 {
        uint256 denominator = _feeDenominator();
        if (feeNumerator > denominator) {
            // Royalty fee will exceed the sale price
            revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator);
        }
        if (receiver == address(0)) {
            revert ERC2981InvalidDefaultRoyaltyReceiver(address(0));
        }

        _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 {
        uint256 denominator = _feeDenominator();
        if (feeNumerator > denominator) {
            // Royalty fee will exceed the sale price
            revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator);
        }
        if (receiver == address(0)) {
            revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0));
        }

        _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];
    }
}

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

pragma solidity ^0.8.20;

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

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

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../utils/AutomaticValidatorTransferApproval.sol";
import "../utils/CreatorTokenBase.sol";
import "erc721a/contracts/ERC721A.sol";
import {TOKEN_TYPE_ERC721} from "@limitbreak/permit-c/Constants.sol";

/**
 * @title ERC721AC
 * @author Limit Break, Inc.
 * @notice Extends Azuki's ERC721-A 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 ERC721AC is ERC721A, CreatorTokenBase, AutomaticValidatorTransferApproval {

    constructor(string memory name_, string memory symbol_) CreatorTokenBase() ERC721A(name_, symbol_) {}

    /**
     * @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved
     *         for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) {
        isApproved = super.isApprovedForAll(owner, operator);

        if (!isApproved) {
            if (autoApproveTransfersFromValidator) {
                isApproved = operator == address(getTransferValidator());
            }
        }
    }

    /**
     * @notice Indicates whether the contract implements the specified interface.
     * @dev Overrides supportsInterface in ERC165.
     * @param interfaceId The interface id
     * @return true if the contract implements the specified interface, false otherwise
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return 
        interfaceId == type(ICreatorToken).interfaceId || 
        interfaceId == type(ICreatorTokenLegacy).interfaceId || 
        super.supportsInterface(interfaceId);
    }

    /**
     * @notice Returns the function selector for the transfer validator's validation function to be called 
     * @notice for transaction simulation. 
     */
    function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) {
        functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256)"));
        isViewFunction = true;
    }

    /// @dev Ties the erc721a _beforeTokenTransfers hook to more granular transfer validation logic
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        for (uint256 i = 0; i < quantity;) {
            _validateBeforeTransfer(from, to, startTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Ties the erc721a _afterTokenTransfer hook to more granular transfer validation logic
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        for (uint256 i = 0; i < quantity;) {
            _validateAfterTransfer(from, to, startTokenId + i);
            unchecked {
                ++i;
            }
        }
    }

    function _msgSenderERC721A() internal view virtual override returns (address) {
        return _msgSender();
    }

    function _tokenType() internal pure override returns(uint16) {
        return uint16(TOKEN_TYPE_ERC721);
    }
}

// SPDX-License-Identifier: CC0-1.0
pragma solidity >=0.8.13;

/**
 * @title IDelegateRegistry
 * @custom:version 2.0
 * @custom:author foobar (0xfoobar)
 * @notice A standalone immutable registry storing delegated permissions from one address to another
 */
interface IDelegateRegistry {
    /// @notice Delegation type, NONE is used when a delegation does not exist or is revoked
    enum DelegationType {
        NONE,
        ALL,
        CONTRACT,
        ERC721,
        ERC20,
        ERC1155
    }

    /// @notice Struct for returning delegations
    struct Delegation {
        DelegationType type_;
        address to;
        address from;
        bytes32 rights;
        address contract_;
        uint256 tokenId;
        uint256 amount;
    }

    /// @notice Emitted when an address delegates or revokes rights for their entire wallet
    event DelegateAll(address indexed from, address indexed to, bytes32 rights, bool enable);

    /// @notice Emitted when an address delegates or revokes rights for a contract address
    event DelegateContract(
        address indexed from, address indexed to, address indexed contract_, bytes32 rights, bool enable
    );

    /// @notice Emitted when an address delegates or revokes rights for an ERC721 tokenId
    event DelegateERC721(
        address indexed from,
        address indexed to,
        address indexed contract_,
        uint256 tokenId,
        bytes32 rights,
        bool enable
    );

    /// @notice Emitted when an address delegates or revokes rights for an amount of ERC20 tokens
    event DelegateERC20(
        address indexed from, address indexed to, address indexed contract_, bytes32 rights, uint256 amount
    );

    /// @notice Emitted when an address delegates or revokes rights for an amount of an ERC1155 tokenId
    event DelegateERC1155(
        address indexed from,
        address indexed to,
        address indexed contract_,
        uint256 tokenId,
        bytes32 rights,
        uint256 amount
    );

    /// @notice Thrown if multicall calldata is malformed
    error MulticallFailed();

    /**
     * -----------  WRITE -----------
     */

    /**
     * @notice Call multiple functions in the current contract and return the data from all of them if they all succeed
     * @param data The encoded function data for each of the calls to make to this contract
     * @return results The results from each of the calls passed in via data
     */
    function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for all contracts
     * @param to The address to act as delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateAll(address to, bytes32 rights, bool enable) external payable returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific contract
     * @param to The address to act as delegate
     * @param contract_ The contract whose rights are being delegated
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateContract(address to, address contract_, bytes32 rights, bool enable)
        external
        payable
        returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific ERC721 token
     * @param to The address to act as delegate
     * @param contract_ The contract whose rights are being delegated
     * @param tokenId The token id to delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC721(address to, address contract_, uint256 tokenId, bytes32 rights, bool enable)
        external
        payable
        returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC20 tokens
     * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound)
     * @param to The address to act as delegate
     * @param contract_ The address for the fungible token contract
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param amount The amount to delegate, > 0 delegates and 0 revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC20(address to, address contract_, bytes32 rights, uint256 amount)
        external
        payable
        returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC1155 tokens
     * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound)
     * @param to The address to act as delegate
     * @param contract_ The address of the contract that holds the token
     * @param tokenId The token id to delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param amount The amount of that token id to delegate, > 0 delegates and 0 revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC1155(address to, address contract_, uint256 tokenId, bytes32 rights, uint256 amount)
        external
        payable
        returns (bytes32 delegationHash);

    /**
     * ----------- CHECKS -----------
     */

    /**
     * @notice Check if `to` is a delegate of `from` for the entire wallet
     * @param to The potential delegate address
     * @param from The potential address who delegated rights
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on the from's behalf
     */
    function checkDelegateForAll(address to, address from, bytes32 rights) external view returns (bool);

    /**
     * @notice Check if `to` is a delegate of `from` for the specified `contract_` or the entire wallet
     * @param to The delegated address to check
     * @param contract_ The specific contract address being checked
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on from's behalf for entire wallet or that specific contract
     */
    function checkDelegateForContract(address to, address from, address contract_, bytes32 rights)
        external
        view
        returns (bool);

    /**
     * @notice Check if `to` is a delegate of `from` for the specific `contract` and `tokenId`, the entire `contract_`, or the entire wallet
     * @param to The delegated address to check
     * @param contract_ The specific contract address being checked
     * @param tokenId The token id for the token to delegating
     * @param from The wallet that issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on from's behalf for entire wallet, that contract, or that specific tokenId
     */
    function checkDelegateForERC721(address to, address from, address contract_, uint256 tokenId, bytes32 rights)
        external
        view
        returns (bool);

    /**
     * @notice Returns the amount of ERC20 tokens the delegate is granted rights to act on the behalf of
     * @param to The delegated address to check
     * @param contract_ The address of the token contract
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return balance The delegated balance, which will be 0 if the delegation does not exist
     */
    function checkDelegateForERC20(address to, address from, address contract_, bytes32 rights)
        external
        view
        returns (uint256);

    /**
     * @notice Returns the amount of a ERC1155 tokens the delegate is granted rights to act on the behalf of
     * @param to The delegated address to check
     * @param contract_ The address of the token contract
     * @param tokenId The token id to check the delegated amount of
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return balance The delegated balance, which will be 0 if the delegation does not exist
     */
    function checkDelegateForERC1155(address to, address from, address contract_, uint256 tokenId, bytes32 rights)
        external
        view
        returns (uint256);

    /**
     * ----------- ENUMERATIONS -----------
     */

    /**
     * @notice Returns all enabled delegations a given delegate has received
     * @param to The address to retrieve delegations for
     * @return delegations Array of Delegation structs
     */
    function getIncomingDelegations(address to) external view returns (Delegation[] memory delegations);

    /**
     * @notice Returns all enabled delegations an address has given out
     * @param from The address to retrieve delegations for
     * @return delegations Array of Delegation structs
     */
    function getOutgoingDelegations(address from) external view returns (Delegation[] memory delegations);

    /**
     * @notice Returns all hashes associated with enabled delegations an address has received
     * @param to The address to retrieve incoming delegation hashes for
     * @return delegationHashes Array of delegation hashes
     */
    function getIncomingDelegationHashes(address to) external view returns (bytes32[] memory delegationHashes);

    /**
     * @notice Returns all hashes associated with enabled delegations an address has given out
     * @param from The address to retrieve outgoing delegation hashes for
     * @return delegationHashes Array of delegation hashes
     */
    function getOutgoingDelegationHashes(address from) external view returns (bytes32[] memory delegationHashes);

    /**
     * @notice Returns the delegations for a given array of delegation hashes
     * @param delegationHashes is an array of hashes that correspond to delegations
     * @return delegations Array of Delegation structs, return empty structs for nonexistent or revoked delegations
     */
    function getDelegationsFromHashes(bytes32[] calldata delegationHashes)
        external
        view
        returns (Delegation[] memory delegations);

    /**
     * ----------- STORAGE ACCESS -----------
     */

    /**
     * @notice Allows external contracts to read arbitrary storage slots
     */
    function readSlot(bytes32 location) external view returns (bytes32);

    /**
     * @notice Allows external contracts to read an arbitrary array of storage slots
     */
    function readSlots(bytes32[] calldata locations) external view returns (bytes32[] memory);
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

/**
 * @title IKingdomlyFeeContract
 * @notice Interface for the KingdomlyFeeContract that handles ETH/USD price feeds and fee calculations
 */
interface IKingdomlyFeeContract {
    error InsufficientUpdateFee(uint256 requiredFee);
    error ContractNotVerified(address contractAddress);

    function getOneDollarInWei() external view returns (uint256);
    function updateOracleAndGetOneDollarInWei(bytes[] calldata pythPriceUpdate) external payable returns (uint256);
    function updateMaxPriceAgeInSeconds(uint256 _maxPriceAgeInSeconds) external;
    function owner() external view returns (address);
    function transferOwnership(address newOwner) external;
    function renounceOwnership() external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC2981.sol)

pragma solidity >=0.6.2;

import {IERC165} from "../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.
 */
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.
     *
     * NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the
     * royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /// @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

import "../access/OwnablePermissions.sol";

/**
 * @title AutomaticValidatorTransferApproval
 * @author Limit Break, Inc.
 * @notice Base contract mix-in that provides boilerplate code giving the contract owner the
 *         option to automatically approve a 721-C transfer validator implementation for transfers.
 */
abstract contract AutomaticValidatorTransferApproval is OwnablePermissions {

    /// @dev Emitted when the automatic approval flag is modified by the creator.
    event AutomaticApprovalOfTransferValidatorSet(bool autoApproved);

    /// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens.
    bool public autoApproveTransfersFromValidator;

    /**
     * @notice Sets if the transfer validator is automatically approved as an operator for all token owners.
     * 
     * @dev    Throws when the caller is not the contract owner.
     * 
     * @param autoApprove If true, the collection's transfer validator will be automatically approved to
     *                    transfer holder's tokens.
     */
    function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external {
        _requireCallerIsContractOwner();
        autoApproveTransfersFromValidator = autoApprove;
        emit AutomaticApprovalOfTransferValidatorSet(autoApprove);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenLegacy.sol";
import "../interfaces/ITransferValidator.sol";
import "./TransferValidation.sol";
import "../interfaces/ITransferValidatorSetTokenType.sol";

/**
 * @title CreatorTokenBase
 * @author Limit Break, Inc.
 * @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token 
 * transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3. 
 * 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>
 *
 * <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 account and codehash blacklists, whitelists, and graylists.</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>
 *
 * <h4>Compatibility:</h4>
 * <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul>
 */
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {

    /// @dev Thrown when setting a transfer validator address that has no deployed code.
    error CreatorTokenBase__InvalidTransferValidatorContract();

    /// @dev The default transfer validator that will be used if no transfer validator has been set by the creator.
    address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C008fdff27BF06E7E123956E2Fe03B63342e3);

    /// @dev Used to determine if the default transfer validator is applied.
    /// @dev Set to true when the creator sets a transfer validator address.
    bool private isValidatorInitialized;
    /// @dev Address of the transfer validator to apply to transactions.
    address private transferValidator;

    constructor() {
        _emitDefaultTransferValidator();
        _registerTokenType(DEFAULT_TRANSFER_VALIDATOR);
    }

    /**
     * @notice Sets the transfer validator for the token contract.
     *
     * @dev    Throws when provided validator contract is not the zero address and does not have code.
     * @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 = transferValidator_.code.length > 0;

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

        emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_);

        isValidatorInitialized = true;
        transferValidator = transferValidator_;

        _registerTokenType(transferValidator_);
    }

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

        if (validator == address(0)) {
            if (!isValidatorInitialized) {
                validator = DEFAULT_TRANSFER_VALIDATOR;
            }
        }
    }

    /**
     * @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 Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
     *      transfer validator is expected to pre-validate the transfer.
     *
     * @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.
     * @param tokenId The token id being transferred.
     */
    function _preValidateTransfer(
        address caller, 
        address from, 
        address to, 
        uint256 tokenId, 
        uint256 /*value*/) internal virtual override {
        address validator = getTransferValidator();

        if (validator != address(0)) {
            if (msg.sender == validator) {
                return;
            }

            ITransferValidator(validator).validateTransfer(caller, from, to, tokenId);
        }
    }

    /**
     * @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 Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
     *      transfer validator is expected to pre-validate the transfer.
     * 
     * @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator.
     * @dev The `tokenId` for ERC20 tokens should be set to `0`.
     *
     * @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.
     * @param tokenId The token id being transferred.
     * @param amount  The amount of token being transferred.
     */
    function _preValidateTransfer(
        address caller, 
        address from, 
        address to, 
        uint256 tokenId, 
        uint256 amount,
        uint256 /*value*/) internal virtual override {
        address validator = getTransferValidator();

        if (validator != address(0)) {
            if (msg.sender == validator) {
                return;
            }

            ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount);
        }
    }

    function _tokenType() internal virtual pure returns(uint16);

    function _registerTokenType(address validator) internal {
        if (validator != address(0)) {
            uint256 validatorCodeSize;
            assembly {
                validatorCodeSize := extcodesize(validator)
            }
            if(validatorCodeSize > 0) {
                try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) {
                } catch { }
            }
        }
    }

    /**
     * @dev  Used during contract deployment for constructable and cloneable creator tokens
     * @dev  to emit the `TransferValidatorUpdated` event signaling the validator for the contract
     * @dev  is the default transfer validator.
     */
    function _emitDefaultTransferValidator() internal {
        emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR);
    }
}

File 13 of 22 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

        if (_msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                revert ApprovalCallerNotOwnerNorApproved();
            }

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @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. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 14 of 22 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @dev Constant bytes32 value of 0x000...000
bytes32 constant ZERO_BYTES32 = bytes32(0);

/// @dev Constant value of 0
uint256 constant ZERO = 0;
/// @dev Constant value of 1
uint256 constant ONE = 1;

/// @dev Constant value representing an open order in storage
uint8 constant ORDER_STATE_OPEN = 0;
/// @dev Constant value representing a filled order in storage
uint8 constant ORDER_STATE_FILLED = 1;
/// @dev Constant value representing a cancelled order in storage
uint8 constant ORDER_STATE_CANCELLED = 2;

/// @dev Constant value representing the ERC721 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC721 = 721;
/// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC1155 = 1155;
/// @dev Constant value representing the ERC20 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC20 = 20;

/// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s`
bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

/// @dev EIP-712 typehash used for validating signature based stored approvals
bytes32 constant UPDATE_APPROVAL_TYPEHASH =
    keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)");

/// @dev EIP-712 typehash used for validating a single use permit without additional data
bytes32 constant SINGLE_USE_PERMIT_TYPEHASH =
    keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)");

/// @dev EIP-712 typehash used for validating a single use permit with additional data
string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB =
    "PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,";

/// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills
string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB =
    "PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,";

/// @dev Pausable flag for stored approval transfers of ERC721 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0;
/// @dev Pausable flag for stored approval transfers of ERC1155 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1;
/// @dev Pausable flag for stored approval transfers of ERC20 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2;

/// @dev Pausable flag for single use permit transfers of ERC721 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3;
/// @dev Pausable flag for single use permit transfers of ERC1155 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4;
/// @dev Pausable flag for single use permit transfers of ERC20 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5;

/// @dev Pausable flag for order fill transfers of ERC1155 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6;
/// @dev Pausable flag for order fill transfers of ERC20 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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 16 of 22 : 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;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ICreatorToken {
    event TransferValidatorUpdated(address oldValidator, address newValidator);
    function getTransferValidator() external view returns (address validator);
    function setTransferValidator(address validator) external;
    function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ICreatorTokenLegacy {
    event TransferValidatorUpdated(address oldValidator, address newValidator);
    function getTransferValidator() external view returns (address validator);
    function setTransferValidator(address validator) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITransferValidator {
    function applyCollectionTransferPolicy(address caller, address from, address to) external view;
    function validateTransfer(address caller, address from, address to) external view;
    function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
    function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;

    function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
    function afterAuthorizedTransfer(address token, uint256 tokenId) external;
    function beforeAuthorizedTransfer(address operator, address token) external;
    function afterAuthorizedTransfer(address token) external;
    function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
    function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
    function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}

// 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 {
    
    /// @dev Thrown when the from and to address are both the zero address.
    error ShouldNotMintToBurnAddress();

    /*************************************************************************/
    /*                      Transfers Without Amounts                        */
    /*************************************************************************/

    /// @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 {}

    /*************************************************************************/
    /*                         Transfers With Amounts                        */
    /*************************************************************************/

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

        if(fromZeroAddress && toZeroAddress) {
            revert ShouldNotMintToBurnAddress();
        } else if(fromZeroAddress) {
            _preValidateMint(_msgSender(), to, tokenId, amount, msg.value);
        } else if(toZeroAddress) {
            _preValidateBurn(_msgSender(), from, tokenId, amount, msg.value);
        } else {
            _preValidateTransfer(_msgSender(), from, to, tokenId, amount, 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, uint256 amount) internal virtual {
        bool fromZeroAddress = from == address(0);
        bool toZeroAddress = to == address(0);

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface ITransferValidatorSetTokenType {
    function setTokenTypeOfCollection(address collection, uint16 tokenType) external;
}

// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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`,
     * 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 be 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * 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 payable;

    /**
     * @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 payable;

    /**
     * @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);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @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);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@creator-token-standards/=lib/creator-token-standards/",
    "@ERC721A/=lib/ERC721A/",
    "@limitbreak/permit-c/=lib/creator-token-standards/lib/PermitC/src/",
    "@opensea/tstorish/=lib/creator-token-standards/lib/tstorish/src/",
    "@rari-capital/solmate/=lib/creator-token-standards/lib/PermitC/lib/solmate/",
    "ERC721A/=lib/ERC721A/contracts/",
    "PermitC/=lib/creator-token-standards/lib/PermitC/",
    "creator-token-standards/=lib/creator-token-standards/",
    "ds-test/=lib/seaport-deploy/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "erc721a/=lib/creator-token-standards/lib/ERC721A/",
    "forge-gas-metering/=lib/creator-token-standards/lib/PermitC/lib/forge-gas-metering/",
    "forge-std/=lib/forge-std/src/",
    "foundry-devops/=lib/foundry-devops/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "murky/=lib/creator-token-standards/lib/murky/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/creator-token-standards/lib/PermitC/lib/openzeppelin-contracts/contracts/",
    "pyth-sdk-solidity/=lib/pyth-sdk-solidity/",
    "seaport-core/=lib/seaport-deploy/lib/seaport-core/src/",
    "seaport-deploy/=lib/seaport-deploy/",
    "seaport-types/=lib/seaport-deploy/lib/seaport-core/lib/seaport-types/",
    "solady/=lib/creator-token-standards/lib/PermitC/lib/forge-gas-metering/lib/solady/",
    "solmate/=lib/creator-token-standards/lib/PermitC/lib/solmate/src/",
    "tstorish/=lib/creator-token-standards/lib/tstorish/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": true,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"ownerPayoutAddress","type":"address"},{"internalType":"string","name":"initialBaseURI","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"internalType":"struct KingdomlyNFTStandardV3.BaseVariables","name":"_baseVariables","type":"tuple"},{"internalType":"uint256[]","name":"_maxSupplyPerMintGroup","type":"uint256[]"},{"internalType":"uint256[]","name":"_mintPrice","type":"uint256[]"},{"internalType":"uint256","name":"_publicMaxMintPerWallet","type":"uint256"},{"internalType":"uint96","name":"_royaltyPercentage","type":"uint96"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_royaltyPayoutAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__AddressZero","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__ArrayLengthMismatch","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"name":"KingdomlyNFTStandardV3__ExceedsMaxMintGroupSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"allowed","type":"uint256"}],"name":"KingdomlyNFTStandardV3__ExceedsMaxPerWallet","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"name":"KingdomlyNFTStandardV3__ExceedsMaxSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"allowed","type":"uint256"}],"name":"KingdomlyNFTStandardV3__ExceedsMintQuota","type":"error"},{"inputs":[{"internalType":"uint256","name":"required","type":"uint256"},{"internalType":"uint256","name":"provided","type":"uint256"}],"name":"KingdomlyNFTStandardV3__InsufficientEther","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__InvalidKingdomlyAdminAddress","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__InvalidKingdomlyFeeContract","type":"error"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"KingdomlyNFTStandardV3__InvalidOperation","type":"error"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"KingdomlyNFTStandardV3__MintGroupDoesNotExist","type":"error"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"KingdomlyNFTStandardV3__MintGroupInactive","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__MintInactive","type":"error"},{"inputs":[],"name":"KingdomlyNFTStandardV3__MintOnBehalfNotActive","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"KingdomlyNFTStandardV3__NotInPresale","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"KingdomlyNFTStandardV3__Unauthorized","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","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":false,"internalType":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newCreatorFee","type":"uint256"}],"name":"CreatorFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltyUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"FeeFundsWithdrew","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"kingdomlyAdmin","type":"address"}],"name":"KingdomlyAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"feeContractAddress","type":"address"}],"name":"KingdomlyFeeContractChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mintGroup","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"MaxPerMintGroupUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMintFee","type":"uint256"}],"name":"MintFeeUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"MintFundsWithdrew","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"MintLiveTimestampUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"MintOnBehalfStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"newStatus","type":"bool"}],"name":"MintOnBehalfUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mintGroup","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberOfAddresses","type":"uint256"}],"name":"MintQuotasAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"newStatus","type":"bool"}],"name":"MintStatusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"recipients","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NftsAirdropped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwnerPayoutAddress","type":"address"}],"name":"OwnerPayoutAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintGroupId","type":"uint256"}],"name":"PreSaleMintScheduledStartTimestampChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"},{"indexed":false,"internalType":"uint256","name":"mintGroupId","type":"uint256"}],"name":"PreSaleMintStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxMintPerWallet","type":"uint256"}],"name":"PublicMaxMintPerWalletChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"mintGroup","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"SalePriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":true,"internalType":"address","name":"hotWallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"TokensDelegateMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"TokensMinted","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_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activeMintGroups","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"airdropNFTs","outputs":[{"internalType":"uint256","name":"totalCharge","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"batchMint","outputs":[{"internalType":"uint256","name":"totalCostWithFee","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"address","name":"minterAddress","type":"address"}],"name":"canDelegateMintCheck","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"address","name":"minterAddress","type":"address"}],"name":"canMintCheck","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"changeMintStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMintPrice","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"changeSalePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkPendingBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"checkPendingBalanceFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractMintLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"contractPresaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"creatorFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegateRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"delegatedMint","outputs":[{"internalType":"uint256","name":"totalCostWithFee","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeAddress","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":"getCreatorFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingdomlyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingdomlyPriceOracleContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"maxSupplyPerMintGroup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"mintGroupMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mintOnBehalf","outputs":[{"internalType":"uint256","name":"totalCostWithFee","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintOnBehalfActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"address","name":"minter","type":"address"}],"name":"mintQuotas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"ownerPayoutAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"presaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"presaleScheduledStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMaxMintPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"quoteAirdropFees","outputs":[{"internalType":"uint256","name":"totalAirdropCostWithFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"quoteBatchMint","outputs":[{"internalType":"uint256","name":"totalCostWithFee","type":"uint256"},{"internalType":"uint256","name":"mintingCost","type":"uint256"},{"internalType":"uint256","name":"minterFee","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","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":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"schedulePresaleMintStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scheduledMintLiveTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_creatorFeeBasisPoints","type":"uint256"}],"name":"setCreatorFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"setMintLiveTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setMintOnBehalfStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addressToAdd","type":"address[]"},{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"uint256[]","name":"_mintQuotas","type":"uint256[]"}],"name":"setMintQuota","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_kingdomlyAdmin","type":"address"}],"name":"setNewKingdomlyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_kingdomlyPriceOracleContract","type":"address"}],"name":"setNewKingdomlyPriceOracleContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintGroup","type":"uint256"},{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setNewMaxPerMintGroup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwnerPayoutAddress","type":"address"}],"name":"setOwnerPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPublicMaxMintPerWallet","type":"uint256"}],"name":"setPublicMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCents","type":"uint256"}],"name":"setThreeDollarsInCents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"presaleStatus","type":"bool"},{"internalType":"uint256","name":"mintGroup","type":"uint256"}],"name":"stopOrStartpresaleMint","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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"threeDollarsEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"threeDollarsInCents","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFeeFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawMintFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x60c060405261012c600f5534801562000016575f80fd5b50604051620050753803806200507583398101604081905262000039916200068e565b86516020880151839190818160026200005383826200087d565b5060036200006282826200087d565b505060015f55506200007362000317565b6200009273721c008fdff27bf06e7e123956e2fe03b63342e362000365565b50506001600160a01b038116620000c357604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b620000ce81620003e5565b506001600c558551855114620000f757604051639a4d025360e01b815260040160405180910390fd5b5f805b8751811015620001db5787818151811062000119576200011962000949565b6020026020010151826200012e91906200095d565b915087818151811062000145576200014562000949565b602002602001015160195f8381526020019081526020015f208190555086818151811062000177576200017762000949565b6020908102919091018101515f83815260188352604080822092909255601a90925281208190556011805460018181018355919092527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6890910182905501620000fa565b5087608001518111156200024e57604051637efdc7b760e01b815260206004820152603260248201527f4d617820737570706c7920706572206d696e742067726f7570206578636565646044820152717320746f74616c206d617820737570706c7960701b6064820152608401620000ba565b60808089015190526012805460ff191690555f600e5560608801516013906200027890826200087d565b506040880151601480546001600160a01b039092166001600160a01b03199283161790557310317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc8460a0526015805482167389695e9d4c489128471798766f1ee4b2a8ab5b5b179055601680549091167392cc6a35f1714cfc7a374f64117a024d1d74cdb6179055601085905562000302828562000436565b505061012c600d555062000983945050505050565b604080515f815273721c008fdff27bf06e7e123956e2fe03b63342e360208201527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a1565b6001600160a01b03811615620003e257803b8015620003e0576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b158015620003cc575f80fd5b505af1925050508015620003de575060015b505b505b50565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6127106001600160601b0382168110156200047757604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401620000ba565b6001600160a01b038316620004a257604051635b6cc80560e11b81525f6004820152602401620000ba565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b634e487b7160e01b5f52604160045260245ffd5b60405160a081016001600160401b0381118282101715620005155762000515620004dc565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620005465762000546620004dc565b604052919050565b5f82601f8301126200055e575f80fd5b81516001600160401b038111156200057a576200057a620004dc565b602062000590601f8301601f191682016200051b565b8281528582848701011115620005a4575f80fd5b5f5b83811015620005c3578581018301518282018401528201620005a6565b505f928101909101919091529392505050565b80516001600160a01b0381168114620005ed575f80fd5b919050565b5f82601f83011262000602575f80fd5b815160206001600160401b03821115620006205762000620620004dc565b8160051b620006318282016200051b565b92835284810182019282810190878511156200064b575f80fd5b83870192505b848310156200066c5782518252918301919083019062000651565b979650505050505050565b80516001600160601b0381168114620005ed575f80fd5b5f805f805f805f60e0888a031215620006a5575f80fd5b87516001600160401b0380821115620006bc575f80fd5b9089019060a0828c031215620006d0575f80fd5b620006da620004f0565b825182811115620006e9575f80fd5b620006f78d8286016200054e565b8252506020830151828111156200070c575f80fd5b6200071a8d8286016200054e565b6020830152506200072e60408401620005d6565b604082015260608301518281111562000745575f80fd5b620007538d8286016200054e565b606083015250608083015160808201528099505060208a01519150808211156200077b575f80fd5b620007898b838c01620005f2565b975060408a01519150808211156200079f575f80fd5b50620007ae8a828b01620005f2565b95505060608801519350620007c66080890162000677565b9250620007d660a08901620005d6565b9150620007e660c08901620005d6565b905092959891949750929550565b600181811c908216806200080957607f821691505b6020821081036200082857634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620003de57805f5260205f20601f840160051c81016020851015620008555750805b601f840160051c820191505b8181101562000876575f815560010162000861565b5050505050565b81516001600160401b03811115620008995762000899620004dc565b620008b181620008aa8454620007f4565b846200082e565b602080601f831160018114620008e7575f8415620008cf5750858301515b5f19600386901b1c1916600185901b17855562000941565b5f85815260208120601f198616915b828110156200091757888601518255948401946001909101908401620008f6565b50858210156200093557878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52603260045260245ffd5b808201808211156200097d57634e487b7160e01b5f52601160045260245ffd5b92915050565b60805160a05161468a620009eb5f395f818161073401528181611a7101528181611c7d015281816124a301526133c601525f8181610b61015281816111ae015281816123a7015281816129d601528181612d89015281816132a801526132ef015261468a5ff3fe608060405260043610610442575f3560e01c80638816ad8a11610236578063cfe0b08311610134578063e8656fcc116100b3578063f30874ea11610078578063f30874ea14610d07578063f34657ec14610d1b578063f72171f114610d48578063f81823f114610d67578063fea414b614610d86575f80fd5b8063e8656fcc14610c8e578063e985e9c514610ca2578063eab506f214610cc1578063ebf39a4114610cd5578063f2fde38b14610ce8575f80fd5b8063e213b5f6116100f9578063e213b5f614610be3578063e5fd114514610bf6578063e6087db014610c21578063e690f9eb14610c4c578063e6a72acf14610c63575f80fd5b8063cfe0b08314610b34578063d5abeb0114610b53578063d722ab2614610b85578063db0dbb7114610b99578063db5e446514610bc7575f80fd5b8063a8ddf8f6116101c0578063b88d4fde11610185578063b88d4fde14610ab0578063bacfae6314610ac3578063c82e474b14610ae2578063c87b56dd14610b01578063ce55c66a14610b20575f80fd5b8063a8ddf8f614610a17578063a9fc664e14610a36578063ae4e494214610a55578063b3978a8614610a72578063b80f8fb414610a91575f80fd5b80639ad4d529116102065780639ad4d529146109895780639e05d240146109a8578063a22cb465146109c7578063a75c3ad9146109e6578063a88eab9a146109fa575f80fd5b80638816ad8a146109305780638da5cb5b14610944578063905d7b331461096157806395d89b4114610975575f80fd5b806331f72d7711610343578063604a2d7c116102cd5780636e75e2e2116102925780636e75e2e21461088957806370a08231146108bd578063715018a6146108dc5780637b8cbc6a146108f05780638034824214610911575f80fd5b8063604a2d7c146107fa5780636221d13c146108195780636352211e1461083957806363691c93146108585780636c0360eb14610875575f80fd5b8063429408d311610313578063429408d31461076b5780634a5bd2fd1461077e57806355f804b31461079d578063581636dd146107bc5780635944c753146107db575f80fd5b806331f72d77146106e85780633f598d8514610707578063412753581461072657806342842e0e14610758575f80fd5b80630dd16fd5116103cf57806318160ddd1161039457806318160ddd1461061957806322536c031461062d57806323b872dd1461066c57806324a663c31461067f5780632a55205a146106aa575f80fd5b80630dd16fd5146105955780630ed64eff146105b457806311f7acb9146105c757806313bfffac146105e657806317d791d014610605575f80fd5b806306fdde031161041557806306fdde0314610507578063081812fc14610528578063095ea7b314610547578063098144d41461055a5780630d705df61461056e575f80fd5b8063014635461461044657806301d2718e1461048a57806301ffc9a7146104b757806304634d8d146104e6575b5f80fd5b348015610451575f80fd5b5061046d73721c008fdff27bf06e7e123956e2fe03b63342e381565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610495575f80fd5b506104a96104a4366004613d37565b610da6565b604051908152602001610481565b3480156104c2575f80fd5b506104d66104d1366004613d76565b610dcf565b6040519015158152602001610481565b3480156104f1575f80fd5b50610505610500366004613da7565b610de8565b005b348015610512575f80fd5b5061051b610e49565b6040516104819190613e1c565b348015610533575f80fd5b5061046d610542366004613e2e565b610ed9565b610505610555366004613e45565b610f1b565b348015610565575f80fd5b5061046d610fb9565b348015610579575f80fd5b506040805163657711f560e11b81526001602082015201610481565b3480156105a0575f80fd5b506105056105af366004613e2e565b610ff3565b6104a96105c2366004613e6d565b6110b4565b3480156105d2575f80fd5b506105056105e1366004613e6d565b611108565b3480156105f1575f80fd5b506c447e69651d841bd8d104bed49361046d565b348015610610575f80fd5b50600d546104a9565b348015610624575f80fd5b506104a9611286565b348015610638575f80fd5b5061064c610647366004613e6d565b611292565b604080519485526020850193909352918301526060820152608001610481565b61050561067a366004613e8d565b611305565b34801561068a575f80fd5b506104a9610699366004613e2e565b5f9081526019602052604090205490565b3480156106b5575f80fd5b506106c96106c4366004613e6d565b6114ae565b604080516001600160a01b039093168352602083019190915201610481565b3480156106f3575f80fd5b50610505610702366004613e2e565b611531565b348015610712575f80fd5b50610505610721366004613ec6565b61156e565b348015610731575f80fd5b507f000000000000000000000000000000000000000000000000000000000000000061046d565b610505610766366004613e8d565b611610565b6104a9610779366004613edf565b61162f565b348015610789575f80fd5b506104d6610798366004613e2e565b6116bc565b3480156107a8575f80fd5b506105056107b7366004613fab565b61170c565b3480156107c7575f80fd5b506105056107d63660046140e2565b611752565b3480156107e6575f80fd5b506105056107f536600461414a565b61183e565b348015610805575f80fd5b50610505610814366004613e2e565b6118a6565b348015610824575f80fd5b506008546104d690600160a81b900460ff1681565b348015610844575f80fd5b5061046d610853366004613e2e565b611908565b348015610863575f80fd5b506015546001600160a01b031661046d565b348015610880575f80fd5b5061051b611912565b348015610894575f80fd5b506104a96108a3366004613ec6565b6001600160a01b03165f9081526017602052604090205490565b3480156108c8575f80fd5b506104a96108d7366004613ec6565b611921565b3480156108e7575f80fd5b5061050561196e565b3480156108fb575f80fd5b50610904611981565b604051610481919061417a565b34801561091c575f80fd5b5061050561092b366004613e6d565b6119d6565b34801561093b575f80fd5b506010546104a9565b34801561094f575f80fd5b50600b546001600160a01b031661046d565b34801561096c575f80fd5b50610505611a4e565b348015610980575f80fd5b5061051b611ac8565b348015610994575f80fd5b506105056109a3366004613ec6565b611ad7565b3480156109b3575f80fd5b506105056109c23660046141ca565b611ba3565b3480156109d2575f80fd5b506105056109e13660046141e5565b611bf8565b3480156109f1575f80fd5b50610505611c70565b348015610a05575f80fd5b506016546001600160a01b031661046d565b348015610a22575f80fd5b50610505610a313660046141ca565b611cd4565b348015610a41575f80fd5b50610505610a50366004613ec6565b611d95565b348015610a60575f80fd5b506014546001600160a01b031661046d565b348015610a7d575f80fd5b50610505610a8c36600461421a565b611e52565b348015610a9c575f80fd5b506104a9610aab366004613e2e565b611ee8565b610505610abe366004614236565b611f13565b348015610ace575f80fd5b50610505610add366004613e2e565b611f5d565b348015610aed575f80fd5b50610505610afc366004613e6d565b611f9a565b348015610b0c575f80fd5b5061051b610b1b366004613e2e565b612008565b348015610b2b575f80fd5b506104a96121a2565b348015610b3f575f80fd5b50610505610b4e366004613ec6565b61223a565b348015610b5e575f80fd5b507f00000000000000000000000000000000000000000000000000000000000000006104a9565b348015610b90575f80fd5b506104a96122dc565b348015610ba4575f80fd5b506104d6610bb3366004613e2e565b5f908152601e602052604090205460ff1690565b348015610bd2575f80fd5b50601254610100900460ff166104d6565b6104a9610bf13660046142ad565b6122fe565b348015610c01575f80fd5b506104a9610c10366004613e2e565b5f908152601a602052604090205490565b348015610c2c575f80fd5b506104a9610c3b366004613e2e565b5f908152601b602052604090205490565b348015610c57575f80fd5b5060125460ff166104d6565b348015610c6e575f80fd5b506104a9610c7d366004613e2e565b5f9081526018602052604090205490565b348015610c99575f80fd5b506104d6612586565b348015610cad575f80fd5b506104d6610cbc36600461430d565b6125b3565b348015610ccc575f80fd5b50600f546104a9565b6104a9610ce3366004613edf565b612616565b348015610cf3575f80fd5b50610505610d02366004613ec6565b612724565b348015610d12575f80fd5b50600e546104a9565b348015610d26575f80fd5b50610d3a610d35366004613edf565b612761565b604051610481929190614335565b348015610d53575f80fd5b50610d3a610d6236600461434f565b612a5a565b348015610d72575f80fd5b50610505610d813660046141ca565b612e0e565b348015610d91575f80fd5b50335f908152601760205260409020546104a9565b5f828152601d602090815260408083206001600160a01b03851684529091529020545b92915050565b5f610dd982612e5f565b80610dc95750610dc982612e9e565b610df0612ed2565b610dfa8282612eff565b604080516001600160a01b03841681526001600160601b03831660208201527fe12d7d5bdb8218a22277dca8f854dd4573a1cea3d3e4808dc567df9eb1c14bf491015b60405180910390a15050565b606060028054610e5890614392565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8490614392565b8015610ecf5780601f10610ea657610100808354040283529160200191610ecf565b820191905f5260205f20905b815481529060010190602001808311610eb257829003601f168201915b5050505050905090565b5f610ee382612fa1565b610f00576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f610f2582611908565b9050336001600160a01b03821614610f5e57610f4181336125b3565b610f5e576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60085461010090046001600160a01b031680610ff05760085460ff16610ff0575073721c008fdff27bf06e7e123956e2fe03b63342e35b90565b6015546001600160a01b031633146110255760405163842942e760e01b81523360048201526024015b60405180910390fd5b61271081111561107857604051637efdc7b760e01b815260206004820152601e60248201527f43726561746f72206665652063616e6e6f742065786365656420313030250000604482015260640161101c565b600f8190556040518181527f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4906020015b60405180910390a150565b5f6110c133848433612fd3565b604080518581526020810185905291925033917f2e8ac5177a616f2aec08c3048f5021e4e9743ece034e8d83ba5caf76688bb475910160405180910390a2610dc98161347e565b611110612ed2565b61111982613506565b6111265761112682613552565b6011545f90815b818110156111ab578460118281548110611149576111496143c4565b905f5260205f200154036111685761116184846143ec565b92506111a3565b60195f6011838154811061117e5761117e6143c4565b905f5260205f20015481526020019081526020015f2054836111a091906143ec565b92505b60010161112d565b507f000000000000000000000000000000000000000000000000000000000000000082111561123557604051637efdc7b760e01b815260206004820152602f60248201527f4e657720737570706c7920706572206d696e742067726f75702065786365656460448201526e39903a37ba30b61039bab838363c9760891b606482015260840161101c565b5f8481526019602090815260409182902085905581518681529081018590527fc74d73204d60f017689ed8a7d2897fd47e6292076e672b13ce375923f69c656391015b60405180910390a150505050565b6001545f54035f190190565b5f828152601860205260408120548190819081906112b19086906143ff565b9250846112bc6121a2565b6112c691906143ff565b9150612710600f54846112d991906143ff565b6112e39190614416565b9050806112f083856143ec565b6112fa91906143ec565b935092959194509250565b5f61130f826135aa565b9050836001600160a01b0316816001600160a01b0316146113425760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b0388169091141761138e5761137186336125b3565b61138e57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166113b557604051633a954ecd60e21b815260040160405180910390fd5b6113c28686866001613613565b80156113cc575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b8416900361145857600184015f818152600460205260408120549003611456575f548114611456575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46114a68686866001613640565b505050505050565b5f828152600a6020526040812080548291906001600160a01b03811690600160a01b90046001600160601b0316816115015750506009546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106115186001600160601b038416896143ff565b6115229190614416565b92989297509195505050505050565b611539612ed2565b600e8190556040518181527fb1bc7dc7d5b317e68abf16112f87f25a24a822b7aaa9e2a254eb3b5808933ad2906020016110a9565b6015546001600160a01b0316331461159b5760405163842942e760e01b815233600482015260240161101c565b6001600160a01b0381166115c257604051630f43d6db60e11b815260040160405180910390fd5b601680546001600160a01b0319166001600160a01b0383169081179091556040519081527f65b193217dd691927510cfa45296799f4dc5a6b0d113a7f1863661cd57b1587f906020016110a9565b61162a83838360405180602001604052805f815250611f13565b505050565b6012545f90610100900460ff166116595760405163c63984f960e01b815260040160405180910390fd5b61166582858585612fd3565b60408051868152602081018690529192506001600160a01b038416917f2e8ac5177a616f2aec08c3048f5021e4e9743ece034e8d83ba5caf76688bb475910160405180910390a26116b58161347e565b9392505050565b5f818152601e602052604081205460ff16611704575f828152601b602052604090205415806116f857505f828152601b60205260409020544211155b1561170457505f919050565b506001919050565b611714612ed2565b60136117208282614479565b506040515f19906001907f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c905f90a350565b61175a612ed2565b805183511461177c57604051639a4d025360e01b815260040160405180910390fd5b61178582613506565b6117925761179282613552565b82515f5b81811015611807578281815181106117b0576117b06143c4565b6020026020010151601d5f8681526020019081526020015f205f8784815181106117dc576117dc6143c4565b6020908102919091018101516001600160a01b031682528101919091526040015f2055600101611796565b5060408051848152602081018390527f874f4e098e128b6092829ba750219e43c833868ff793f4c1536f93b04a27ec119101611278565b611846612ed2565b611851838383613666565b604080518481526001600160a01b03841660208201526001600160601b0383168183015290517fe361b60b9164428d036a601ec08552e653bfe8c44389b8a4ebfd47281eb8741a9181900360600190a1505050565b6015546001600160a01b031633146118d35760405163842942e760e01b815233600482015260240161101c565b600d8190556040518181527f38fbb1c8b109c430f0c030e7ed076cf5611a307773a4e8e365601e8f8bceaec6906020016110a9565b5f610dc9826135aa565b606060138054610e5890614392565b5f6001600160a01b038216611949576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526005602052604090205467ffffffffffffffff1690565b611976612ed2565b61197f5f613726565b565b60606011805480602002602001604051908101604052809291908181526020018280548015610ecf57602002820191905f5260205f20905b8154815260200190600101908083116119b9575050505050905090565b6119de612ed2565b6119e781613506565b611a0757604051636475d44d60e11b81526004810182905260240161101c565b5f818152601b602090815260409182902084905581518481529081018390527fb024af7f651e94348c4e66cfe71f68a3f246eff857f95f105766bc15f4ea84fc9101610e3d565b611a56613777565b601454611a6b906001600160a01b03166137a1565b50611a957f00000000000000000000000000000000000000000000000000000000000000006137a1565b506040517f65468e7cff4dccc05a87b2db7058aa5c3031a6e5a7d9f6fa9b07b65d3e14d3df905f90a161197f6001600c55565b606060038054610e5890614392565b611adf612ed2565b6001600160a01b038116611b0657604051631b9ff7bd60e31b815260040160405180910390fd5b6014546001600160a01b039081165f9081526017602052604080822054928416825281208054839290611b3a9084906143ec565b9091555050601480546001600160a01b039081165f9081526017602090815260408083209290925583546001600160a01b031916928616928317909355519081527f937cd4111b6e42c519ce72e02c45f214f86ed57dfd6c76bac42800c589f236a09101610e3d565b611bab613859565b60088054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc906110a990831515815260200190565b335f8181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c64911515815260200190565b60405180910390a35050565b611c78613777565b611ca17f00000000000000000000000000000000000000000000000000000000000000006137a1565b506040517f3cd2753931cda989a8f32cafb5722df4da75268e6b1aa88d9649dcd762ee4704905f90a161197f6001600c55565b611cdc612ed2565b60125481151560ff909116151503611d4a57604051637efdc7b760e01b815260206004820152602a60248201527f4d696e742073746174757320697320616c726561647920746865206f6e6520796044820152691bdd48195b9d195c995960b21b606482015260840161101c565b80611d54575f600e555b6012805460ff19168215159081179091556040519081527fba05b2d00ab98bd1b179e3718215e855be66c8e2662226717f54d603374b3efd906020016110a9565b611d9d613859565b6001600160a01b038116803b15159015801590611db8575080155b15611dd6576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac611dff610fb9565b604080516001600160a01b03928316815291851660208301520160405180910390a1600880546001600160a01b038416610100026001600160a81b0319909116176001179055611e4e82613861565b5050565b611e5a612ed2565b611e6381613506565b611e8357604051636475d44d60e11b81526004810182905260240161101c565b5f818152601e60205260409020805460ff191683151517905581611eb0575f818152601b60205260408120555b604080518315158152602081018390527fd88af4ad8d3188d34ada8f4e850b4b6b3b2610392d5c8ffffa63b28ae831da549101610e3d565b5f606482611ef46121a2565b611efe91906143ff565b611f0990600b6143ff565b610dc99190614416565b611f1e848484611305565b6001600160a01b0383163b15611f5757611f3a848484846138df565b611f57576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b611f65612ed2565b60108190556040518181527f5fff94c6e6b965e0b1ec9d784c16667a985a3b42719c669c82954603edf42191906020016110a9565b611fa2612ed2565b611fab81613506565b611fb857611fb881613552565b5f81815260186020526040908190208390555181907fa7e52343431f792020e7cb8411a08014688ca11782fd5709fa2531b3d74ba45790611ffc9085815260200190565b60405180910390a25050565b606061201382612fa1565b61203057604051630a14c4b560e41b815260040160405180910390fd5b6013805461203d90614392565b90505f0361205857505060408051602081019091525f815290565b604080518082019091526001808252602f60f81b602090920182905260138054909190829061208690614392565b612091929150614535565b815461209c90614392565b81106120aa576120aa6143c4565b8154600116156120c757905f5260205f2090602091828204019190065b9054901a600160f81b026001600160f81b0319161461217057601380546120ed90614392565b80601f016020809104026020016040519081016040528092919081815260200182805461211990614392565b80156121645780601f1061213b57610100808354040283529160200191612164565b820191905f5260205f20905b81548152906001019060200180831161214757829003601f168201915b50505050509050919050565b601361217b836139c3565b60405160200161218c929190614548565b6040516020818303038152906040529050919050565b5f8060165f9054906101000a90046001600160a01b03166001600160a01b031663b40886866040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121f4573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061221891906145cb565b90506064600d548261222a91906143ff565b6122349190614416565b91505090565b6015546001600160a01b031633146122675760405163842942e760e01b815233600482015260240161101c565b6001600160a01b03811661228e576040516369a7bc2760e11b815260040160405180910390fd5b601580546001600160a01b0319166001600160a01b0383169081179091556040519081527f4aff483de8d5f9c3145910b41bbe3e64979c064f8f139bcdf47fc6ab7a969ded906020016110a9565b5f612710600f5460646122ef91906143ff565b6122f99190614416565b905090565b5f612307612ed2565b81518351811461236a57604051637efdc7b760e01b815260206004820152602760248201527f4d69736d61746368206265747765656e20726563697069656e747320616e6420604482015266616d6f756e747360c81b606482015260840161101c565b5f805b828110156123a457848181518110612387576123876143c4565b60200260200101518261239a91906143ec565b915060010161236d565b507f0000000000000000000000000000000000000000000000000000000000000000816123cf611286565b6123d991906143ec565b111561242857604051637efdc7b760e01b815260206004820152601a60248201527f41697264726f702065786365656473206d617820737570706c79000000000000604482015260640161101c565b61243181611ee8565b92508234101561249957604051637efdc7b760e01b815260206004820152602c60248201527f4e6f7420656e6f7567682045746865722073656e7420666f722074686520616960448201526b7264726f702063686172676560a01b606482015260840161101c565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f90815260176020526040812080548592906124e09084906143ec565b909155505084515f5b8181101561253a575f868281518110612504576125046143c4565b60200260200101519050612531888381518110612523576125236143c4565b602002602001015182613a06565b506001016124e9565b5060408051828152602081018490527fec989a99e74aa2b32bea8be51e40e3c35cc638231053bee9466c31508b3bcbf6910160405180910390a161257d8461347e565b50505092915050565b6012545f9060ff166125ad57600e5415806125a35750600e544211155b156125ad57505f90565b50600190565b6001600160a01b038281165f9081526007602090815260408083209385168352929052205460ff1680610dc957600854600160a81b900460ff1615610dc9576125fa610fb9565b6001600160a01b0316826001600160a01b031614905092915050565b604051638988eea960e01b81523360048201526001600160a01b03821660248201523060448201525f60648201819052906c447e69651d841bd8d104bed49390638988eea990608401602060405180830381865afa15801561267a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061269e91906145e2565b6126c65760405163842942e760e01b81526001600160a01b038316600482015260240161101c565b6126d282858533612fd3565b604080518681526020810186905291925033916001600160a01b038516917fce55cbb6a167cf85969795eda1f8d0a2e0152274849017210ca560bd3c963f7f910160405180910390a36116b58161347e565b61272c612ed2565b6001600160a01b03811661275557604051631e4fbdf760e01b81525f600482015260240161101c565b61275e81613726565b50565b5f6060845f0361279b57505060408051808201909152601081526f24b73b30b634b227b832b930ba34b7b760811b60208201525f90612a52565b6127a3612586565b6127d357505060408051808201909152600c81526b4d696e74496e61637469766560a01b60208201525f90612a52565b5f848152601e602052604090205460ff16612845575f848152601b6020526040902054158061280f57505f848152601b60205260409020544211155b156128455750506040805180820190915260118152704d696e7447726f7570496e61637469766560781b60208201525f90612a52565b83156128fd575f848152601d602090815260408083206001600160a01b0387168452909152812054900361289f57505060408051808201909152600c81526b4e6f74496e50726573616c6560a01b60208201525f90612a52565b5f848152601d602090815260408083206001600160a01b03871684529091529020548511156128f857505060408051808201909152601081526f457863656564734d696e7451756f746160801b60208201525f90612a52565b612970565b6010546001600160a01b0384165f908152601c6020908152604080832088845290915290205461292d90876143ec565b111561297057505060408051808201909152601d81527f457863656564735075626c69634d61784d696e7450657257616c6c657400000060208201525f90612a52565b5f84815260196020908152604080832054601a909252909120546129959087906143ec565b11156129d4575050604080518082019091526019815278457863656564734d61784d696e7447726f7570537570706c7960381b60208201525f90612a52565b7f0000000000000000000000000000000000000000000000000000000000000000856129fe611286565b612a0891906143ec565b1115612a3e57505060408051808201909152601081526f457863656564734d6178537570706c7960801b60208201525f90612a52565b505060408051602081019091525f81526001905b935093915050565b604051638988eea960e01b81526001600160a01b038083166004830152831660248201523060448201525f60648201819052906060906c447e69651d841bd8d104bed49390638988eea990608401602060405180830381865afa158015612ac3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ae791906145e2565b612b1757505060408051808201909152600c81526b155b985d5d1a1bdc9a5e995960a21b60208201525f90612e05565b855f03612b4e57505060408051808201909152601081526f24b73b30b634b227b832b930ba34b7b760811b60208201525f90612e05565b612b56612586565b612b8657505060408051808201909152600c81526b4d696e74496e61637469766560a01b60208201525f90612e05565b5f858152601e602052604090205460ff16612bf8575f858152601b60205260409020541580612bc257505f858152601b60205260409020544211155b15612bf85750506040805180820190915260118152704d696e7447726f7570496e61637469766560781b60208201525f90612e05565b8415612cb0575f858152601d602090815260408083206001600160a01b03881684529091528120549003612c5257505060408051808201909152600c81526b4e6f74496e50726573616c6560a01b60208201525f90612e05565b5f858152601d602090815260408083206001600160a01b0388168452909152902054861115612cab57505060408051808201909152601081526f457863656564734d696e7451756f746160801b60208201525f90612e05565b612d23565b6010546001600160a01b0385165f908152601c60209081526040808320898452909152902054612ce090886143ec565b1115612d2357505060408051808201909152601981527f457863656564735075626c69634d617850657257616c6c65740000000000000060208201525f90612e05565b5f85815260196020908152604080832054601a90925290912054612d489088906143ec565b1115612d87575050604080518082019091526019815278457863656564734d61784d696e7447726f7570537570706c7960381b60208201525f90612e05565b7f000000000000000000000000000000000000000000000000000000000000000086612db1611286565b612dbb91906143ec565b1115612df157505060408051808201909152601081526f457863656564734d6178537570706c7960801b60208201525f90612e05565b505060408051602081019091525f81526001905b94509492505050565b612e16612ed2565b601280548215156101000261ff00199091161790556040517f4d1d0d52375c9625f1fd48b3844cf51f7dabb49be8f98732c607fe86c43fd2dc906110a990831515815260200190565b5f6001600160e01b03198216632b435fdb60e21b1480612e8f57506001600160e01b0319821663503e914d60e11b145b80610dc95750610dc982613a1f565b5f6001600160e01b0319821663152a902d60e11b1480610dc957506301ffc9a760e01b6001600160e01b0319831614610dc9565b600b546001600160a01b0316331461197f5760405163118cdaa760e01b815233600482015260240161101c565b6127106001600160601b038216811015612f3e57604051636f483d0960e01b81526001600160601b03831660048201526024810182905260440161101c565b6001600160a01b038316612f6757604051635b6cc80560e11b81525f600482015260240161101c565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b5f81600111158015612fb357505f5482105b8015610dc95750505f90815260046020526040902054600160e01b161590565b5f835f0361302457604051637efdc7b760e01b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161101c565b61302c612586565b61304957604051634c7203e360e01b815260040160405180910390fd5b5f838152601e602052604090205460ff166130a6575f838152601b6020526040902054158061308557505f838152601b60205260409020544211155b156130a6576040516360a62d3960e11b81526004810184905260240161101c565b82156131ab575f838152601d602090815260408083206001600160a01b038916845290915281205490036130ff576040516351ddd35360e01b81526001600160a01b03861660048201526024810184905260440161101c565b5f838152601d602090815260408083206001600160a01b038916845290915290205484111561316f575f838152601d602090815260408083206001600160a01b03891684529091529081902054905163039135a560e11b815261101c918691600401918252602082015260400190565b5f838152601d602090815260408083206001600160a01b0389168452909152812080548692906131a0908490614535565b909155506132349050565b6010546001600160a01b0386165f908152601c602090815260408083208784529091529020546131db90866143ec565b1115613234576001600160a01b0385165f908152601c60209081526040808320868452909152902054601054859161321291614535565b604051635603493b60e11b81526004810192909252602482015260440161101c565b5f83815260196020908152604080832054601a909252909120546132599086906143ec565b11156132a6575f838152601a6020908152604080832054601990925290912054859161328491614535565b60405163463df51d60e11b81526004810192909252602482015260440161101c565b7f0000000000000000000000000000000000000000000000000000000000000000846132d0611286565b6132da91906143ec565b111561333557836132e9611286565b613313907f0000000000000000000000000000000000000000000000000000000000000000614535565b60405163954d722f60e01b81526004810192909252602482015260440161101c565b5f805f806133438789611292565b935093509350935083341015613375576040516333b08cdf60e21b81526004810185905234602482015260440161101c565b5f61338082846143ec565b6001600160a01b038b165f908152601c602090815260408083208c8452909152812080549293508b929091906133b79084906143ec565b90915550506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f90815260176020526040812080548392906134039084906143ec565b9091555061341390508285614535565b6014546001600160a01b03165f908152601760205260408120805490919061343c9084906143ec565b90915550505f888152601a6020526040812080548b929061345e9084906143ec565b9091555061346e9050878a613a06565b509293505050505b949350505050565b5f6134898234614535565b90508015611e4e576040515f90339083908381818185875af1925050503d805f81146134d0576040519150601f19603f3d011682016040523d82523d5f602084013e6134d5565b606091505b505090508061162a57335f90815260176020526040812080548492906134fc9084906143ec565b9091555050505050565b6011545f90815b81811015613549578360118281548110613529576135296143c4565b905f5260205f20015403613541575060019392505050565b60010161350d565b505f9392505050565b5f81815260186020908152604080832083905560198252808320839055601a90915281208190556011805460018101825591527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c680155565b5f81806001116135fa575f548110156135fa575f8181526004602052604081205490600160e01b821690036135f8575b805f036116b557505f19015f818152600460205260409020546135da565b505b604051636f96cda160e11b815260040160405180910390fd5b5f5b8181101561363957613631858561362c84876143ec565b613a6c565b600101613615565b5050505050565b5f5b818110156136395761365e858561365984876143ec565b613ac2565b600101613642565b6127106001600160601b0382168110156136ac5760405163dfd1fc1b60e01b8152600481018590526001600160601b03831660248201526044810182905260640161101c565b6001600160a01b0383166136dc57604051634b4f842960e11b8152600481018590525f602482015260440161101c565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600a90529190942093519051909116600160a01b029116179055565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6002600c540361379a57604051633ee5aeb560e01b815260040160405180910390fd5b6002600c55565b6001600160a01b0381165f81815260176020526040808220805490839055905190929083908381818185875af1925050503d805f81146137fc576040519150601f19603f3d011682016040523d82523d5f602084013e613801565b606091505b505090508061385357604051637efdc7b760e01b815260206004820152601860248201527f5769746864726177205472616e73666572204661696c65640000000000000000604482015260640161101c565b50919050565b61197f612ed2565b6001600160a01b0381161561275e57803b8015611e4e576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b1580156138c5575f80fd5b505af19250505080156138d6575060015b15611e4e575050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906139139033908990889088906004016145fd565b6020604051808303815f875af192505050801561394d575060408051601f3d908101601f1916820190925261394a91810190614639565b60015b6139a9573d80801561397a576040519150601f19603f3d011682016040523d82523d5f602084013e61397f565b606091505b5080515f036139a1576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613476565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806139dc5750819003601f19909101908152919050565b611e4e828260405180602001604052805f815250613b09565b5f6301ffc9a760e01b6001600160e01b031983161480613a4f57506380ac58cd60e01b6001600160e01b03198316145b80610dc95750506001600160e01b031916635b5e139f60e01b1490565b6001600160a01b038381161590831615818015613a865750805b15613aa457604051635cbd944160e01b815260040160405180910390fd5b8115613ab0575b613639565b80613aab576136393386868634613b6b565b6001600160a01b038381161590831615818015613adc5750805b15613afa57604051635cbd944160e01b815260040160405180910390fd5b81613aab5780613aab57613639565b613b138383613c0f565b6001600160a01b0383163b1561162a575f548281035b613b3b5f8683806001019450866138df565b613b58576040516368d2bf6b60e11b815260040160405180910390fd5b818110613b2957815f5414613639575f80fd5b5f613b74610fb9565b90506001600160a01b038116156114a6576001600160a01b0381163303613b9b5750613639565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea906084015f6040518083038186803b158015613bf1575f80fd5b505afa158015613c03573d5f803e3d5ffd5b50505050505050505050565b5f805490829003613c335760405163b562e8dd60e01b815260040160405180910390fd5b613c3f5f848385613613565b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114613ceb5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101613cb5565b50815f03613d0b57604051622e076360e81b815260040160405180910390fd5b5f90815561162a9150848385613640565b80356001600160a01b0381168114613d32575f80fd5b919050565b5f8060408385031215613d48575f80fd5b82359150613d5860208401613d1c565b90509250929050565b6001600160e01b03198116811461275e575f80fd5b5f60208284031215613d86575f80fd5b81356116b581613d61565b80356001600160601b0381168114613d32575f80fd5b5f8060408385031215613db8575f80fd5b613dc183613d1c565b9150613d5860208401613d91565b5f5b83811015613de9578181015183820152602001613dd1565b50505f910152565b5f8151808452613e08816020860160208601613dcf565b601f01601f19169290920160200192915050565b602081525f6116b56020830184613df1565b5f60208284031215613e3e575f80fd5b5035919050565b5f8060408385031215613e56575f80fd5b613e5f83613d1c565b946020939093013593505050565b5f8060408385031215613e7e575f80fd5b50508035926020909101359150565b5f805f60608486031215613e9f575f80fd5b613ea884613d1c565b9250613eb660208501613d1c565b9150604084013590509250925092565b5f60208284031215613ed6575f80fd5b6116b582613d1c565b5f805f60608486031215613ef1575f80fd5b8335925060208401359150613f0860408501613d1c565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613f4e57613f4e613f11565b604052919050565b5f67ffffffffffffffff831115613f6f57613f6f613f11565b613f82601f8401601f1916602001613f25565b9050828152838383011115613f95575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215613fbb575f80fd5b813567ffffffffffffffff811115613fd1575f80fd5b8201601f81018413613fe1575f80fd5b61347684823560208401613f56565b5f67ffffffffffffffff82111561400957614009613f11565b5060051b60200190565b5f82601f830112614022575f80fd5b8135602061403761403283613ff0565b613f25565b8083825260208201915060208460051b870101935086841115614058575f80fd5b602086015b8481101561407b5761406e81613d1c565b835291830191830161405d565b509695505050505050565b5f82601f830112614095575f80fd5b813560206140a561403283613ff0565b8083825260208201915060208460051b8701019350868411156140c6575f80fd5b602086015b8481101561407b57803583529183019183016140cb565b5f805f606084860312156140f4575f80fd5b833567ffffffffffffffff8082111561410b575f80fd5b61411787838801614013565b9450602086013593506040860135915080821115614133575f80fd5b5061414086828701614086565b9150509250925092565b5f805f6060848603121561415c575f80fd5b8335925061416c60208501613d1c565b9150613f0860408501613d91565b602080825282518282018190525f9190848201906040850190845b818110156141b157835183529284019291840191600101614195565b50909695505050505050565b801515811461275e575f80fd5b5f602082840312156141da575f80fd5b81356116b5816141bd565b5f80604083850312156141f6575f80fd5b6141ff83613d1c565b9150602083013561420f816141bd565b809150509250929050565b5f806040838503121561422b575f80fd5b8235613e5f816141bd565b5f805f8060808587031215614249575f80fd5b61425285613d1c565b935061426060208601613d1c565b925060408501359150606085013567ffffffffffffffff811115614282575f80fd5b8501601f81018713614292575f80fd5b6142a187823560208401613f56565b91505092959194509250565b5f80604083850312156142be575f80fd5b823567ffffffffffffffff808211156142d5575f80fd5b6142e186838701614013565b935060208501359150808211156142f6575f80fd5b5061430385828601614086565b9150509250929050565b5f806040838503121561431e575f80fd5b61432783613d1c565b9150613d5860208401613d1c565b8215158152604060208201525f6134766040830184613df1565b5f805f8060808587031215614362575f80fd5b843593506020850135925061437960408601613d1c565b915061438760608601613d1c565b905092959194509250565b600181811c908216806143a657607f821691505b60208210810361385357634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610dc957610dc96143d8565b8082028115828204841417610dc957610dc96143d8565b5f8261443057634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561162a57805f5260205f20601f840160051c8101602085101561445a5750805b601f840160051c820191505b81811015613639575f8155600101614466565b815167ffffffffffffffff81111561449357614493613f11565b6144a7816144a18454614392565b84614435565b602080601f8311600181146144da575f84156144c35750858301515b5f19600386901b1c1916600185901b1785556114a6565b5f85815260208120601f198616915b82811015614508578886015182559484019460019091019084016144e9565b508582101561452557878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610dc957610dc96143d8565b5f80845461455581614392565b6001828116801561456d5760018114614582576145ae565b60ff19841687528215158302870194506145ae565b885f526020805f205f5b858110156145a55781548a82015290840190820161458c565b50505082870194505b5050505083516145c2818360208801613dcf565b01949350505050565b5f602082840312156145db575f80fd5b5051919050565b5f602082840312156145f2575f80fd5b81516116b5816141bd565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061462f90830184613df1565b9695505050505050565b5f60208284031215614649575f80fd5b81516116b581613d6156fea2646970667358221220ca10348d863fb190314cd97833a4c176d8fe2389be3d359c8df853f92ead3e2b64736f6c6343000818003300000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000d0a2b0400fc578f0c123e1a4aee0c765e3dbe197000000000000000000000000d0a2b0400fc578f0c123e1a4aee0c765e3dbe19700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000d0a2b0400fc578f0c123e1a4aee0c765e3dbe197000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000003e700000000000000000000000000000000000000000000000000000000000000064d6f6e756b69000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d4f4e554b4900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f62616679626569667a66376f7069613677657279796a337a6f696f74747468746465766c7735337779727133716c637364666d3635356c347872792f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000002570000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405260043610610442575f3560e01c80638816ad8a11610236578063cfe0b08311610134578063e8656fcc116100b3578063f30874ea11610078578063f30874ea14610d07578063f34657ec14610d1b578063f72171f114610d48578063f81823f114610d67578063fea414b614610d86575f80fd5b8063e8656fcc14610c8e578063e985e9c514610ca2578063eab506f214610cc1578063ebf39a4114610cd5578063f2fde38b14610ce8575f80fd5b8063e213b5f6116100f9578063e213b5f614610be3578063e5fd114514610bf6578063e6087db014610c21578063e690f9eb14610c4c578063e6a72acf14610c63575f80fd5b8063cfe0b08314610b34578063d5abeb0114610b53578063d722ab2614610b85578063db0dbb7114610b99578063db5e446514610bc7575f80fd5b8063a8ddf8f6116101c0578063b88d4fde11610185578063b88d4fde14610ab0578063bacfae6314610ac3578063c82e474b14610ae2578063c87b56dd14610b01578063ce55c66a14610b20575f80fd5b8063a8ddf8f614610a17578063a9fc664e14610a36578063ae4e494214610a55578063b3978a8614610a72578063b80f8fb414610a91575f80fd5b80639ad4d529116102065780639ad4d529146109895780639e05d240146109a8578063a22cb465146109c7578063a75c3ad9146109e6578063a88eab9a146109fa575f80fd5b80638816ad8a146109305780638da5cb5b14610944578063905d7b331461096157806395d89b4114610975575f80fd5b806331f72d7711610343578063604a2d7c116102cd5780636e75e2e2116102925780636e75e2e21461088957806370a08231146108bd578063715018a6146108dc5780637b8cbc6a146108f05780638034824214610911575f80fd5b8063604a2d7c146107fa5780636221d13c146108195780636352211e1461083957806363691c93146108585780636c0360eb14610875575f80fd5b8063429408d311610313578063429408d31461076b5780634a5bd2fd1461077e57806355f804b31461079d578063581636dd146107bc5780635944c753146107db575f80fd5b806331f72d77146106e85780633f598d8514610707578063412753581461072657806342842e0e14610758575f80fd5b80630dd16fd5116103cf57806318160ddd1161039457806318160ddd1461061957806322536c031461062d57806323b872dd1461066c57806324a663c31461067f5780632a55205a146106aa575f80fd5b80630dd16fd5146105955780630ed64eff146105b457806311f7acb9146105c757806313bfffac146105e657806317d791d014610605575f80fd5b806306fdde031161041557806306fdde0314610507578063081812fc14610528578063095ea7b314610547578063098144d41461055a5780630d705df61461056e575f80fd5b8063014635461461044657806301d2718e1461048a57806301ffc9a7146104b757806304634d8d146104e6575b5f80fd5b348015610451575f80fd5b5061046d73721c008fdff27bf06e7e123956e2fe03b63342e381565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610495575f80fd5b506104a96104a4366004613d37565b610da6565b604051908152602001610481565b3480156104c2575f80fd5b506104d66104d1366004613d76565b610dcf565b6040519015158152602001610481565b3480156104f1575f80fd5b50610505610500366004613da7565b610de8565b005b348015610512575f80fd5b5061051b610e49565b6040516104819190613e1c565b348015610533575f80fd5b5061046d610542366004613e2e565b610ed9565b610505610555366004613e45565b610f1b565b348015610565575f80fd5b5061046d610fb9565b348015610579575f80fd5b506040805163657711f560e11b81526001602082015201610481565b3480156105a0575f80fd5b506105056105af366004613e2e565b610ff3565b6104a96105c2366004613e6d565b6110b4565b3480156105d2575f80fd5b506105056105e1366004613e6d565b611108565b3480156105f1575f80fd5b506c447e69651d841bd8d104bed49361046d565b348015610610575f80fd5b50600d546104a9565b348015610624575f80fd5b506104a9611286565b348015610638575f80fd5b5061064c610647366004613e6d565b611292565b604080519485526020850193909352918301526060820152608001610481565b61050561067a366004613e8d565b611305565b34801561068a575f80fd5b506104a9610699366004613e2e565b5f9081526019602052604090205490565b3480156106b5575f80fd5b506106c96106c4366004613e6d565b6114ae565b604080516001600160a01b039093168352602083019190915201610481565b3480156106f3575f80fd5b50610505610702366004613e2e565b611531565b348015610712575f80fd5b50610505610721366004613ec6565b61156e565b348015610731575f80fd5b507f00000000000000000000000010317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc8461046d565b610505610766366004613e8d565b611610565b6104a9610779366004613edf565b61162f565b348015610789575f80fd5b506104d6610798366004613e2e565b6116bc565b3480156107a8575f80fd5b506105056107b7366004613fab565b61170c565b3480156107c7575f80fd5b506105056107d63660046140e2565b611752565b3480156107e6575f80fd5b506105056107f536600461414a565b61183e565b348015610805575f80fd5b50610505610814366004613e2e565b6118a6565b348015610824575f80fd5b506008546104d690600160a81b900460ff1681565b348015610844575f80fd5b5061046d610853366004613e2e565b611908565b348015610863575f80fd5b506015546001600160a01b031661046d565b348015610880575f80fd5b5061051b611912565b348015610894575f80fd5b506104a96108a3366004613ec6565b6001600160a01b03165f9081526017602052604090205490565b3480156108c8575f80fd5b506104a96108d7366004613ec6565b611921565b3480156108e7575f80fd5b5061050561196e565b3480156108fb575f80fd5b50610904611981565b604051610481919061417a565b34801561091c575f80fd5b5061050561092b366004613e6d565b6119d6565b34801561093b575f80fd5b506010546104a9565b34801561094f575f80fd5b50600b546001600160a01b031661046d565b34801561096c575f80fd5b50610505611a4e565b348015610980575f80fd5b5061051b611ac8565b348015610994575f80fd5b506105056109a3366004613ec6565b611ad7565b3480156109b3575f80fd5b506105056109c23660046141ca565b611ba3565b3480156109d2575f80fd5b506105056109e13660046141e5565b611bf8565b3480156109f1575f80fd5b50610505611c70565b348015610a05575f80fd5b506016546001600160a01b031661046d565b348015610a22575f80fd5b50610505610a313660046141ca565b611cd4565b348015610a41575f80fd5b50610505610a50366004613ec6565b611d95565b348015610a60575f80fd5b506014546001600160a01b031661046d565b348015610a7d575f80fd5b50610505610a8c36600461421a565b611e52565b348015610a9c575f80fd5b506104a9610aab366004613e2e565b611ee8565b610505610abe366004614236565b611f13565b348015610ace575f80fd5b50610505610add366004613e2e565b611f5d565b348015610aed575f80fd5b50610505610afc366004613e6d565b611f9a565b348015610b0c575f80fd5b5061051b610b1b366004613e2e565b612008565b348015610b2b575f80fd5b506104a96121a2565b348015610b3f575f80fd5b50610505610b4e366004613ec6565b61223a565b348015610b5e575f80fd5b507f00000000000000000000000000000000000000000000000000000000000003e76104a9565b348015610b90575f80fd5b506104a96122dc565b348015610ba4575f80fd5b506104d6610bb3366004613e2e565b5f908152601e602052604090205460ff1690565b348015610bd2575f80fd5b50601254610100900460ff166104d6565b6104a9610bf13660046142ad565b6122fe565b348015610c01575f80fd5b506104a9610c10366004613e2e565b5f908152601a602052604090205490565b348015610c2c575f80fd5b506104a9610c3b366004613e2e565b5f908152601b602052604090205490565b348015610c57575f80fd5b5060125460ff166104d6565b348015610c6e575f80fd5b506104a9610c7d366004613e2e565b5f9081526018602052604090205490565b348015610c99575f80fd5b506104d6612586565b348015610cad575f80fd5b506104d6610cbc36600461430d565b6125b3565b348015610ccc575f80fd5b50600f546104a9565b6104a9610ce3366004613edf565b612616565b348015610cf3575f80fd5b50610505610d02366004613ec6565b612724565b348015610d12575f80fd5b50600e546104a9565b348015610d26575f80fd5b50610d3a610d35366004613edf565b612761565b604051610481929190614335565b348015610d53575f80fd5b50610d3a610d6236600461434f565b612a5a565b348015610d72575f80fd5b50610505610d813660046141ca565b612e0e565b348015610d91575f80fd5b50335f908152601760205260409020546104a9565b5f828152601d602090815260408083206001600160a01b03851684529091529020545b92915050565b5f610dd982612e5f565b80610dc95750610dc982612e9e565b610df0612ed2565b610dfa8282612eff565b604080516001600160a01b03841681526001600160601b03831660208201527fe12d7d5bdb8218a22277dca8f854dd4573a1cea3d3e4808dc567df9eb1c14bf491015b60405180910390a15050565b606060028054610e5890614392565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8490614392565b8015610ecf5780601f10610ea657610100808354040283529160200191610ecf565b820191905f5260205f20905b815481529060010190602001808311610eb257829003601f168201915b5050505050905090565b5f610ee382612fa1565b610f00576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f610f2582611908565b9050336001600160a01b03821614610f5e57610f4181336125b3565b610f5e576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60085461010090046001600160a01b031680610ff05760085460ff16610ff0575073721c008fdff27bf06e7e123956e2fe03b63342e35b90565b6015546001600160a01b031633146110255760405163842942e760e01b81523360048201526024015b60405180910390fd5b61271081111561107857604051637efdc7b760e01b815260206004820152601e60248201527f43726561746f72206665652063616e6e6f742065786365656420313030250000604482015260640161101c565b600f8190556040518181527f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4906020015b60405180910390a150565b5f6110c133848433612fd3565b604080518581526020810185905291925033917f2e8ac5177a616f2aec08c3048f5021e4e9743ece034e8d83ba5caf76688bb475910160405180910390a2610dc98161347e565b611110612ed2565b61111982613506565b6111265761112682613552565b6011545f90815b818110156111ab578460118281548110611149576111496143c4565b905f5260205f200154036111685761116184846143ec565b92506111a3565b60195f6011838154811061117e5761117e6143c4565b905f5260205f20015481526020019081526020015f2054836111a091906143ec565b92505b60010161112d565b507f00000000000000000000000000000000000000000000000000000000000003e782111561123557604051637efdc7b760e01b815260206004820152602f60248201527f4e657720737570706c7920706572206d696e742067726f75702065786365656460448201526e39903a37ba30b61039bab838363c9760891b606482015260840161101c565b5f8481526019602090815260409182902085905581518681529081018590527fc74d73204d60f017689ed8a7d2897fd47e6292076e672b13ce375923f69c656391015b60405180910390a150505050565b6001545f54035f190190565b5f828152601860205260408120548190819081906112b19086906143ff565b9250846112bc6121a2565b6112c691906143ff565b9150612710600f54846112d991906143ff565b6112e39190614416565b9050806112f083856143ec565b6112fa91906143ec565b935092959194509250565b5f61130f826135aa565b9050836001600160a01b0316816001600160a01b0316146113425760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b0388169091141761138e5761137186336125b3565b61138e57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166113b557604051633a954ecd60e21b815260040160405180910390fd5b6113c28686866001613613565b80156113cc575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b8416900361145857600184015f818152600460205260408120549003611456575f548114611456575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46114a68686866001613640565b505050505050565b5f828152600a6020526040812080548291906001600160a01b03811690600160a01b90046001600160601b0316816115015750506009546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106115186001600160601b038416896143ff565b6115229190614416565b92989297509195505050505050565b611539612ed2565b600e8190556040518181527fb1bc7dc7d5b317e68abf16112f87f25a24a822b7aaa9e2a254eb3b5808933ad2906020016110a9565b6015546001600160a01b0316331461159b5760405163842942e760e01b815233600482015260240161101c565b6001600160a01b0381166115c257604051630f43d6db60e11b815260040160405180910390fd5b601680546001600160a01b0319166001600160a01b0383169081179091556040519081527f65b193217dd691927510cfa45296799f4dc5a6b0d113a7f1863661cd57b1587f906020016110a9565b61162a83838360405180602001604052805f815250611f13565b505050565b6012545f90610100900460ff166116595760405163c63984f960e01b815260040160405180910390fd5b61166582858585612fd3565b60408051868152602081018690529192506001600160a01b038416917f2e8ac5177a616f2aec08c3048f5021e4e9743ece034e8d83ba5caf76688bb475910160405180910390a26116b58161347e565b9392505050565b5f818152601e602052604081205460ff16611704575f828152601b602052604090205415806116f857505f828152601b60205260409020544211155b1561170457505f919050565b506001919050565b611714612ed2565b60136117208282614479565b506040515f19906001907f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c905f90a350565b61175a612ed2565b805183511461177c57604051639a4d025360e01b815260040160405180910390fd5b61178582613506565b6117925761179282613552565b82515f5b81811015611807578281815181106117b0576117b06143c4565b6020026020010151601d5f8681526020019081526020015f205f8784815181106117dc576117dc6143c4565b6020908102919091018101516001600160a01b031682528101919091526040015f2055600101611796565b5060408051848152602081018390527f874f4e098e128b6092829ba750219e43c833868ff793f4c1536f93b04a27ec119101611278565b611846612ed2565b611851838383613666565b604080518481526001600160a01b03841660208201526001600160601b0383168183015290517fe361b60b9164428d036a601ec08552e653bfe8c44389b8a4ebfd47281eb8741a9181900360600190a1505050565b6015546001600160a01b031633146118d35760405163842942e760e01b815233600482015260240161101c565b600d8190556040518181527f38fbb1c8b109c430f0c030e7ed076cf5611a307773a4e8e365601e8f8bceaec6906020016110a9565b5f610dc9826135aa565b606060138054610e5890614392565b5f6001600160a01b038216611949576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526005602052604090205467ffffffffffffffff1690565b611976612ed2565b61197f5f613726565b565b60606011805480602002602001604051908101604052809291908181526020018280548015610ecf57602002820191905f5260205f20905b8154815260200190600101908083116119b9575050505050905090565b6119de612ed2565b6119e781613506565b611a0757604051636475d44d60e11b81526004810182905260240161101c565b5f818152601b602090815260409182902084905581518481529081018390527fb024af7f651e94348c4e66cfe71f68a3f246eff857f95f105766bc15f4ea84fc9101610e3d565b611a56613777565b601454611a6b906001600160a01b03166137a1565b50611a957f00000000000000000000000010317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc846137a1565b506040517f65468e7cff4dccc05a87b2db7058aa5c3031a6e5a7d9f6fa9b07b65d3e14d3df905f90a161197f6001600c55565b606060038054610e5890614392565b611adf612ed2565b6001600160a01b038116611b0657604051631b9ff7bd60e31b815260040160405180910390fd5b6014546001600160a01b039081165f9081526017602052604080822054928416825281208054839290611b3a9084906143ec565b9091555050601480546001600160a01b039081165f9081526017602090815260408083209290925583546001600160a01b031916928616928317909355519081527f937cd4111b6e42c519ce72e02c45f214f86ed57dfd6c76bac42800c589f236a09101610e3d565b611bab613859565b60088054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc906110a990831515815260200190565b335f8181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c64911515815260200190565b60405180910390a35050565b611c78613777565b611ca17f00000000000000000000000010317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc846137a1565b506040517f3cd2753931cda989a8f32cafb5722df4da75268e6b1aa88d9649dcd762ee4704905f90a161197f6001600c55565b611cdc612ed2565b60125481151560ff909116151503611d4a57604051637efdc7b760e01b815260206004820152602a60248201527f4d696e742073746174757320697320616c726561647920746865206f6e6520796044820152691bdd48195b9d195c995960b21b606482015260840161101c565b80611d54575f600e555b6012805460ff19168215159081179091556040519081527fba05b2d00ab98bd1b179e3718215e855be66c8e2662226717f54d603374b3efd906020016110a9565b611d9d613859565b6001600160a01b038116803b15159015801590611db8575080155b15611dd6576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac611dff610fb9565b604080516001600160a01b03928316815291851660208301520160405180910390a1600880546001600160a01b038416610100026001600160a81b0319909116176001179055611e4e82613861565b5050565b611e5a612ed2565b611e6381613506565b611e8357604051636475d44d60e11b81526004810182905260240161101c565b5f818152601e60205260409020805460ff191683151517905581611eb0575f818152601b60205260408120555b604080518315158152602081018390527fd88af4ad8d3188d34ada8f4e850b4b6b3b2610392d5c8ffffa63b28ae831da549101610e3d565b5f606482611ef46121a2565b611efe91906143ff565b611f0990600b6143ff565b610dc99190614416565b611f1e848484611305565b6001600160a01b0383163b15611f5757611f3a848484846138df565b611f57576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b611f65612ed2565b60108190556040518181527f5fff94c6e6b965e0b1ec9d784c16667a985a3b42719c669c82954603edf42191906020016110a9565b611fa2612ed2565b611fab81613506565b611fb857611fb881613552565b5f81815260186020526040908190208390555181907fa7e52343431f792020e7cb8411a08014688ca11782fd5709fa2531b3d74ba45790611ffc9085815260200190565b60405180910390a25050565b606061201382612fa1565b61203057604051630a14c4b560e41b815260040160405180910390fd5b6013805461203d90614392565b90505f0361205857505060408051602081019091525f815290565b604080518082019091526001808252602f60f81b602090920182905260138054909190829061208690614392565b612091929150614535565b815461209c90614392565b81106120aa576120aa6143c4565b8154600116156120c757905f5260205f2090602091828204019190065b9054901a600160f81b026001600160f81b0319161461217057601380546120ed90614392565b80601f016020809104026020016040519081016040528092919081815260200182805461211990614392565b80156121645780601f1061213b57610100808354040283529160200191612164565b820191905f5260205f20905b81548152906001019060200180831161214757829003601f168201915b50505050509050919050565b601361217b836139c3565b60405160200161218c929190614548565b6040516020818303038152906040529050919050565b5f8060165f9054906101000a90046001600160a01b03166001600160a01b031663b40886866040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121f4573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061221891906145cb565b90506064600d548261222a91906143ff565b6122349190614416565b91505090565b6015546001600160a01b031633146122675760405163842942e760e01b815233600482015260240161101c565b6001600160a01b03811661228e576040516369a7bc2760e11b815260040160405180910390fd5b601580546001600160a01b0319166001600160a01b0383169081179091556040519081527f4aff483de8d5f9c3145910b41bbe3e64979c064f8f139bcdf47fc6ab7a969ded906020016110a9565b5f612710600f5460646122ef91906143ff565b6122f99190614416565b905090565b5f612307612ed2565b81518351811461236a57604051637efdc7b760e01b815260206004820152602760248201527f4d69736d61746368206265747765656e20726563697069656e747320616e6420604482015266616d6f756e747360c81b606482015260840161101c565b5f805b828110156123a457848181518110612387576123876143c4565b60200260200101518261239a91906143ec565b915060010161236d565b507f00000000000000000000000000000000000000000000000000000000000003e7816123cf611286565b6123d991906143ec565b111561242857604051637efdc7b760e01b815260206004820152601a60248201527f41697264726f702065786365656473206d617820737570706c79000000000000604482015260640161101c565b61243181611ee8565b92508234101561249957604051637efdc7b760e01b815260206004820152602c60248201527f4e6f7420656e6f7567682045746865722073656e7420666f722074686520616960448201526b7264726f702063686172676560a01b606482015260840161101c565b6001600160a01b037f00000000000000000000000010317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc84165f90815260176020526040812080548592906124e09084906143ec565b909155505084515f5b8181101561253a575f868281518110612504576125046143c4565b60200260200101519050612531888381518110612523576125236143c4565b602002602001015182613a06565b506001016124e9565b5060408051828152602081018490527fec989a99e74aa2b32bea8be51e40e3c35cc638231053bee9466c31508b3bcbf6910160405180910390a161257d8461347e565b50505092915050565b6012545f9060ff166125ad57600e5415806125a35750600e544211155b156125ad57505f90565b50600190565b6001600160a01b038281165f9081526007602090815260408083209385168352929052205460ff1680610dc957600854600160a81b900460ff1615610dc9576125fa610fb9565b6001600160a01b0316826001600160a01b031614905092915050565b604051638988eea960e01b81523360048201526001600160a01b03821660248201523060448201525f60648201819052906c447e69651d841bd8d104bed49390638988eea990608401602060405180830381865afa15801561267a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061269e91906145e2565b6126c65760405163842942e760e01b81526001600160a01b038316600482015260240161101c565b6126d282858533612fd3565b604080518681526020810186905291925033916001600160a01b038516917fce55cbb6a167cf85969795eda1f8d0a2e0152274849017210ca560bd3c963f7f910160405180910390a36116b58161347e565b61272c612ed2565b6001600160a01b03811661275557604051631e4fbdf760e01b81525f600482015260240161101c565b61275e81613726565b50565b5f6060845f0361279b57505060408051808201909152601081526f24b73b30b634b227b832b930ba34b7b760811b60208201525f90612a52565b6127a3612586565b6127d357505060408051808201909152600c81526b4d696e74496e61637469766560a01b60208201525f90612a52565b5f848152601e602052604090205460ff16612845575f848152601b6020526040902054158061280f57505f848152601b60205260409020544211155b156128455750506040805180820190915260118152704d696e7447726f7570496e61637469766560781b60208201525f90612a52565b83156128fd575f848152601d602090815260408083206001600160a01b0387168452909152812054900361289f57505060408051808201909152600c81526b4e6f74496e50726573616c6560a01b60208201525f90612a52565b5f848152601d602090815260408083206001600160a01b03871684529091529020548511156128f857505060408051808201909152601081526f457863656564734d696e7451756f746160801b60208201525f90612a52565b612970565b6010546001600160a01b0384165f908152601c6020908152604080832088845290915290205461292d90876143ec565b111561297057505060408051808201909152601d81527f457863656564735075626c69634d61784d696e7450657257616c6c657400000060208201525f90612a52565b5f84815260196020908152604080832054601a909252909120546129959087906143ec565b11156129d4575050604080518082019091526019815278457863656564734d61784d696e7447726f7570537570706c7960381b60208201525f90612a52565b7f00000000000000000000000000000000000000000000000000000000000003e7856129fe611286565b612a0891906143ec565b1115612a3e57505060408051808201909152601081526f457863656564734d6178537570706c7960801b60208201525f90612a52565b505060408051602081019091525f81526001905b935093915050565b604051638988eea960e01b81526001600160a01b038083166004830152831660248201523060448201525f60648201819052906060906c447e69651d841bd8d104bed49390638988eea990608401602060405180830381865afa158015612ac3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612ae791906145e2565b612b1757505060408051808201909152600c81526b155b985d5d1a1bdc9a5e995960a21b60208201525f90612e05565b855f03612b4e57505060408051808201909152601081526f24b73b30b634b227b832b930ba34b7b760811b60208201525f90612e05565b612b56612586565b612b8657505060408051808201909152600c81526b4d696e74496e61637469766560a01b60208201525f90612e05565b5f858152601e602052604090205460ff16612bf8575f858152601b60205260409020541580612bc257505f858152601b60205260409020544211155b15612bf85750506040805180820190915260118152704d696e7447726f7570496e61637469766560781b60208201525f90612e05565b8415612cb0575f858152601d602090815260408083206001600160a01b03881684529091528120549003612c5257505060408051808201909152600c81526b4e6f74496e50726573616c6560a01b60208201525f90612e05565b5f858152601d602090815260408083206001600160a01b0388168452909152902054861115612cab57505060408051808201909152601081526f457863656564734d696e7451756f746160801b60208201525f90612e05565b612d23565b6010546001600160a01b0385165f908152601c60209081526040808320898452909152902054612ce090886143ec565b1115612d2357505060408051808201909152601981527f457863656564735075626c69634d617850657257616c6c65740000000000000060208201525f90612e05565b5f85815260196020908152604080832054601a90925290912054612d489088906143ec565b1115612d87575050604080518082019091526019815278457863656564734d61784d696e7447726f7570537570706c7960381b60208201525f90612e05565b7f00000000000000000000000000000000000000000000000000000000000003e786612db1611286565b612dbb91906143ec565b1115612df157505060408051808201909152601081526f457863656564734d6178537570706c7960801b60208201525f90612e05565b505060408051602081019091525f81526001905b94509492505050565b612e16612ed2565b601280548215156101000261ff00199091161790556040517f4d1d0d52375c9625f1fd48b3844cf51f7dabb49be8f98732c607fe86c43fd2dc906110a990831515815260200190565b5f6001600160e01b03198216632b435fdb60e21b1480612e8f57506001600160e01b0319821663503e914d60e11b145b80610dc95750610dc982613a1f565b5f6001600160e01b0319821663152a902d60e11b1480610dc957506301ffc9a760e01b6001600160e01b0319831614610dc9565b600b546001600160a01b0316331461197f5760405163118cdaa760e01b815233600482015260240161101c565b6127106001600160601b038216811015612f3e57604051636f483d0960e01b81526001600160601b03831660048201526024810182905260440161101c565b6001600160a01b038316612f6757604051635b6cc80560e11b81525f600482015260240161101c565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600955565b5f81600111158015612fb357505f5482105b8015610dc95750505f90815260046020526040902054600160e01b161590565b5f835f0361302457604051637efdc7b760e01b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161101c565b61302c612586565b61304957604051634c7203e360e01b815260040160405180910390fd5b5f838152601e602052604090205460ff166130a6575f838152601b6020526040902054158061308557505f838152601b60205260409020544211155b156130a6576040516360a62d3960e11b81526004810184905260240161101c565b82156131ab575f838152601d602090815260408083206001600160a01b038916845290915281205490036130ff576040516351ddd35360e01b81526001600160a01b03861660048201526024810184905260440161101c565b5f838152601d602090815260408083206001600160a01b038916845290915290205484111561316f575f838152601d602090815260408083206001600160a01b03891684529091529081902054905163039135a560e11b815261101c918691600401918252602082015260400190565b5f838152601d602090815260408083206001600160a01b0389168452909152812080548692906131a0908490614535565b909155506132349050565b6010546001600160a01b0386165f908152601c602090815260408083208784529091529020546131db90866143ec565b1115613234576001600160a01b0385165f908152601c60209081526040808320868452909152902054601054859161321291614535565b604051635603493b60e11b81526004810192909252602482015260440161101c565b5f83815260196020908152604080832054601a909252909120546132599086906143ec565b11156132a6575f838152601a6020908152604080832054601990925290912054859161328491614535565b60405163463df51d60e11b81526004810192909252602482015260440161101c565b7f00000000000000000000000000000000000000000000000000000000000003e7846132d0611286565b6132da91906143ec565b111561333557836132e9611286565b613313907f00000000000000000000000000000000000000000000000000000000000003e7614535565b60405163954d722f60e01b81526004810192909252602482015260440161101c565b5f805f806133438789611292565b935093509350935083341015613375576040516333b08cdf60e21b81526004810185905234602482015260440161101c565b5f61338082846143ec565b6001600160a01b038b165f908152601c602090815260408083208c8452909152812080549293508b929091906133b79084906143ec565b90915550506001600160a01b037f00000000000000000000000010317fa93da2a2e6d7b8e29d2bc2e6b95f2ecc84165f90815260176020526040812080548392906134039084906143ec565b9091555061341390508285614535565b6014546001600160a01b03165f908152601760205260408120805490919061343c9084906143ec565b90915550505f888152601a6020526040812080548b929061345e9084906143ec565b9091555061346e9050878a613a06565b509293505050505b949350505050565b5f6134898234614535565b90508015611e4e576040515f90339083908381818185875af1925050503d805f81146134d0576040519150601f19603f3d011682016040523d82523d5f602084013e6134d5565b606091505b505090508061162a57335f90815260176020526040812080548492906134fc9084906143ec565b9091555050505050565b6011545f90815b81811015613549578360118281548110613529576135296143c4565b905f5260205f20015403613541575060019392505050565b60010161350d565b505f9392505050565b5f81815260186020908152604080832083905560198252808320839055601a90915281208190556011805460018101825591527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c680155565b5f81806001116135fa575f548110156135fa575f8181526004602052604081205490600160e01b821690036135f8575b805f036116b557505f19015f818152600460205260409020546135da565b505b604051636f96cda160e11b815260040160405180910390fd5b5f5b8181101561363957613631858561362c84876143ec565b613a6c565b600101613615565b5050505050565b5f5b818110156136395761365e858561365984876143ec565b613ac2565b600101613642565b6127106001600160601b0382168110156136ac5760405163dfd1fc1b60e01b8152600481018590526001600160601b03831660248201526044810182905260640161101c565b6001600160a01b0383166136dc57604051634b4f842960e11b8152600481018590525f602482015260440161101c565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600a90529190942093519051909116600160a01b029116179055565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6002600c540361379a57604051633ee5aeb560e01b815260040160405180910390fd5b6002600c55565b6001600160a01b0381165f81815260176020526040808220805490839055905190929083908381818185875af1925050503d805f81146137fc576040519150601f19603f3d011682016040523d82523d5f602084013e613801565b606091505b505090508061385357604051637efdc7b760e01b815260206004820152601860248201527f5769746864726177205472616e73666572204661696c65640000000000000000604482015260640161101c565b50919050565b61197f612ed2565b6001600160a01b0381161561275e57803b8015611e4e576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b1580156138c5575f80fd5b505af19250505080156138d6575060015b15611e4e575050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906139139033908990889088906004016145fd565b6020604051808303815f875af192505050801561394d575060408051601f3d908101601f1916820190925261394a91810190614639565b60015b6139a9573d80801561397a576040519150601f19603f3d011682016040523d82523d5f602084013e61397f565b606091505b5080515f036139a1576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613476565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806139dc5750819003601f19909101908152919050565b611e4e828260405180602001604052805f815250613b09565b5f6301ffc9a760e01b6001600160e01b031983161480613a4f57506380ac58cd60e01b6001600160e01b03198316145b80610dc95750506001600160e01b031916635b5e139f60e01b1490565b6001600160a01b038381161590831615818015613a865750805b15613aa457604051635cbd944160e01b815260040160405180910390fd5b8115613ab0575b613639565b80613aab576136393386868634613b6b565b6001600160a01b038381161590831615818015613adc5750805b15613afa57604051635cbd944160e01b815260040160405180910390fd5b81613aab5780613aab57613639565b613b138383613c0f565b6001600160a01b0383163b1561162a575f548281035b613b3b5f8683806001019450866138df565b613b58576040516368d2bf6b60e11b815260040160405180910390fd5b818110613b2957815f5414613639575f80fd5b5f613b74610fb9565b90506001600160a01b038116156114a6576001600160a01b0381163303613b9b5750613639565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea906084015f6040518083038186803b158015613bf1575f80fd5b505afa158015613c03573d5f803e3d5ffd5b50505050505050505050565b5f805490829003613c335760405163b562e8dd60e01b815260040160405180910390fd5b613c3f5f848385613613565b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114613ceb5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101613cb5565b50815f03613d0b57604051622e076360e81b815260040160405180910390fd5b5f90815561162a9150848385613640565b80356001600160a01b0381168114613d32575f80fd5b919050565b5f8060408385031215613d48575f80fd5b82359150613d5860208401613d1c565b90509250929050565b6001600160e01b03198116811461275e575f80fd5b5f60208284031215613d86575f80fd5b81356116b581613d61565b80356001600160601b0381168114613d32575f80fd5b5f8060408385031215613db8575f80fd5b613dc183613d1c565b9150613d5860208401613d91565b5f5b83811015613de9578181015183820152602001613dd1565b50505f910152565b5f8151808452613e08816020860160208601613dcf565b601f01601f19169290920160200192915050565b602081525f6116b56020830184613df1565b5f60208284031215613e3e575f80fd5b5035919050565b5f8060408385031215613e56575f80fd5b613e5f83613d1c565b946020939093013593505050565b5f8060408385031215613e7e575f80fd5b50508035926020909101359150565b5f805f60608486031215613e9f575f80fd5b613ea884613d1c565b9250613eb660208501613d1c565b9150604084013590509250925092565b5f60208284031215613ed6575f80fd5b6116b582613d1c565b5f805f60608486031215613ef1575f80fd5b8335925060208401359150613f0860408501613d1c565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613f4e57613f4e613f11565b604052919050565b5f67ffffffffffffffff831115613f6f57613f6f613f11565b613f82601f8401601f1916602001613f25565b9050828152838383011115613f95575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215613fbb575f80fd5b813567ffffffffffffffff811115613fd1575f80fd5b8201601f81018413613fe1575f80fd5b61347684823560208401613f56565b5f67ffffffffffffffff82111561400957614009613f11565b5060051b60200190565b5f82601f830112614022575f80fd5b8135602061403761403283613ff0565b613f25565b8083825260208201915060208460051b870101935086841115614058575f80fd5b602086015b8481101561407b5761406e81613d1c565b835291830191830161405d565b509695505050505050565b5f82601f830112614095575f80fd5b813560206140a561403283613ff0565b8083825260208201915060208460051b8701019350868411156140c6575f80fd5b602086015b8481101561407b57803583529183019183016140cb565b5f805f606084860312156140f4575f80fd5b833567ffffffffffffffff8082111561410b575f80fd5b61411787838801614013565b9450602086013593506040860135915080821115614133575f80fd5b5061414086828701614086565b9150509250925092565b5f805f6060848603121561415c575f80fd5b8335925061416c60208501613d1c565b9150613f0860408501613d91565b602080825282518282018190525f9190848201906040850190845b818110156141b157835183529284019291840191600101614195565b50909695505050505050565b801515811461275e575f80fd5b5f602082840312156141da575f80fd5b81356116b5816141bd565b5f80604083850312156141f6575f80fd5b6141ff83613d1c565b9150602083013561420f816141bd565b809150509250929050565b5f806040838503121561422b575f80fd5b8235613e5f816141bd565b5f805f8060808587031215614249575f80fd5b61425285613d1c565b935061426060208601613d1c565b925060408501359150606085013567ffffffffffffffff811115614282575f80fd5b8501601f81018713614292575f80fd5b6142a187823560208401613f56565b91505092959194509250565b5f80604083850312156142be575f80fd5b823567ffffffffffffffff808211156142d5575f80fd5b6142e186838701614013565b935060208501359150808211156142f6575f80fd5b5061430385828601614086565b9150509250929050565b5f806040838503121561431e575f80fd5b61432783613d1c565b9150613d5860208401613d1c565b8215158152604060208201525f6134766040830184613df1565b5f805f8060808587031215614362575f80fd5b843593506020850135925061437960408601613d1c565b915061438760608601613d1c565b905092959194509250565b600181811c908216806143a657607f821691505b60208210810361385357634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610dc957610dc96143d8565b8082028115828204841417610dc957610dc96143d8565b5f8261443057634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561162a57805f5260205f20601f840160051c8101602085101561445a5750805b601f840160051c820191505b81811015613639575f8155600101614466565b815167ffffffffffffffff81111561449357614493613f11565b6144a7816144a18454614392565b84614435565b602080601f8311600181146144da575f84156144c35750858301515b5f19600386901b1c1916600185901b1785556114a6565b5f85815260208120601f198616915b82811015614508578886015182559484019460019091019084016144e9565b508582101561452557878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610dc957610dc96143d8565b5f80845461455581614392565b6001828116801561456d5760018114614582576145ae565b60ff19841687528215158302870194506145ae565b885f526020805f205f5b858110156145a55781548a82015290840190820161458c565b50505082870194505b5050505083516145c2818360208801613dcf565b01949350505050565b5f602082840312156145db575f80fd5b5051919050565b5f602082840312156145f2575f80fd5b81516116b5816141bd565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061462f90830184613df1565b9695505050505050565b5f60208284031215614649575f80fd5b81516116b581613d6156fea2646970667358221220ca10348d863fb190314cd97833a4c176d8fe2389be3d359c8df853f92ead3e2b64736f6c63430008180033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

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