ETH Price: $3,297.05 (-3.36%)
Gas: 20 Gwei

Contract

0x2A77Ac6b6c7E4E3fF06CCA52537360EE2C13992E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Capsule Card...182216932023-09-26 18:19:35280 days ago1695752375IN
0x2A77Ac6b...E2C13992E
0 ETH0.0005239521.85405729
0x60808060161120032022-12-04 14:20:59577 days ago1670163659IN
 Create: CapsuleChests
0 ETH0.0533342712.88008117

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CapsuleChests

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 29 : CapsuleChests.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    ERC721PartnerSeaDropUpgradeable
} from "../ERC721PartnerSeaDropUpgradeable.sol";
// import {ERC721AStorage} from '../ERC721AStorage.sol';
import { ERC721AStorage } from "../../lib/ERC721A/contracts/ERC721AStorage.sol";

/*
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOl,.....'ckXMMMMMMMMWx'.lXMMMMMMMMKc.......';dXMMMW0l,....'cOWMNo..cXMMMMMMNl..lNMMk,.;0MMMMMMMMNo.........,
MMMMMMMMMMWWWWWMMMMMMMMMMMMMMMMMMMMMMMMWOc'..';:;,..'dNMMMMMMM0;..'xWMMMMMMMK:...,,,'...:0WWk,..';:,.,xNMNl..:XMMMMMMXc..cXMWx..,OMMMMMMMMNl...',,,,,:
MMMMMMWX00000000KNMMMMMMMMMMMMMMMMMMMMNd...ckXNWWX0dxXWMMMMMMK:....'kWMMMMMMK:..lXNNXO;..cXK;..cKNWNKKWMMNl..:XMMMMMMXc..cXMWx..'OMMMMMMMMNl..:0NNNNNN
MMMMNKOkxdooooddkk0XWMMMMMMMMMMMMMMMMWx..'xNMMMMMMMMMMMMMMMMXc..;:..,OWMMMMMK:..lXNNXO;..cXXl..'okKNWMMMMNl..:XMMMMMMXc..cXMWx..'OMMMMMMMMNl..,dkOkOXM
MMMNOkxo::;;;;;;cdxkOXWMMMMMMMMMMMMMMNl..:XMMMMMMMMMMMMMMMMXl..;0Xl..:0MMMMMK:...,,,,...:0WMXx:'...;lkXMMNl..:XMMMMMMXc..cXMMx..,OMMMMMMMMNl.......'kW
MMW0kklcc::;;;;;,;coxxOXMMMMMMMMMMMMMNl..:KMMMMMMMMMMMMMMMNd...lkOo'..cKMMMMK:..,ccclldONMMMMMWKOdc'..:0WNl..:XMMMMMMXc..cXMMx..'OMMMMMMMMNl..,dkkkOXM
MMNOkd:cc:;;;;;;,,,,:odxONMMMMMMMMMMMMO,..cKWMMMMMMWKKWMMWx'...........lXMMMK;..oNMMMMMMMMMMWNWMMMWO,..oNWd..,OWMMMMWO;..oWMMx..'OMMMMMMMMNl..:XMMMMMM
MMWOkkc;;;;;;;;,,,,'',lO0KXNMMMMMMMMMMWO:..'lxO00Odc''dNWk'..lkkkkkkd,..oNMMK:..oNMMMMMMMMWKl;cxO0Oo'..xWMKc..,ok00ko,..:KMMMx...okOOOOOKWNl..,dkkOOOO
MMMNOkxl:;;;;;,,,,,;lxkxdxxkOXWMMMMMMMMMXkc,.......';o0W0;..oNMMMMMMWk,.'xWMK:..oWMMMMMMMMW0o;.......:kNMMMXx:'......':dXMMMMk..........lNNo..........
MMMMNKOkxl;;;,,,,:okkl;,;;:oxkOXWMMMMMMMMMWX0kxxxkOKNMMWXOk0NMMMMMMMMWKkk0WMW0kkKWMMMMMMMMMMWN0kxxxkKNMMMMMMMNKOkxxxOKNMMMMMMXOkkkkkkkkkKWWKkkkkkkkkkO
MMMMMMNKOkdl;,,;oOkl,''''''';oxk0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMN0kxdcckOo;'''''''''',:dxk0NMMMMMMMMMMMMMMMMMMMN0kOXMMMMMMMWKkk0WMMMMMMWNKOxxxxOKNWMMMMMW0kkKWMMMMMMN0kOXMMMMNKkxxxk0NWMMW0kkkkkkkkk0WMMMMMMMM
MMMMMMMMMMN0kOK0c'''''''''''',,;lxO0XWMMMMMMMMMMMMMMMMM0;..dWMMMMMMNl..:KMMMMN0o;........;o0WMMMK:..oNMMMMMMK;..dWMNk:.......cKMMK:.........cKMMMMMMMM
MMMMMMMMMMMMNNXkdc,'''''''',,,;;:lk00NMMMMMMMMMMMMMMMMM0,..dWMMMMMMNl..:KMMMXl...:dO00Od:...oXMMK:..oNMMMMMM0;..dWWk'..lO0OxdOWMMK:..;xkOkOk0WMMMMMMMM
MMMMMMMMMMMMMMN0kxo:,'''''',;;;:ccx00NMMMMMMMMMMMMMMMMM0,..oXNNNNNNKc..:KMXOl..;kNMMMMMMNk,..lXMK:..oNMMMMMM0;..dWWx...oKNWMMMMMMK:..cKNNNNWMMMMMMMMMM
MMMMMMMMMMMMMMMMN0kxdc,'''',:c::clO0KWMMMMMMMMMMMMMMMMM0,...,,,,,,,,...:KMk:'..xWMMMMMMMMWx..'OMK:..oNMMMMMM0;..dWMXd,..';lx0NMMMK:...,,,,cKMMMMMMMMMM
MMMMMMMMMMMMMMMMMMN0kxdc,'',,;;:okO0NWMMMMMMMMMMMMMMMMM0,..,cllllllc'..:KMk;..'kMMMMMMMMMMk'..kMK:..lNMMMMMM0;..dWMMWXOdc,...:OWMK:..'cllldXMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMN0kxdolclodxkOKNMMMMMMMMMMMMMMMMMMM0,..dWMMMMMMNl..:KMKd;..cXMMMMMMMMXc..;KMXc..cXMMMMMMO,..xWMMMMMMWNO:..;0MK:..lNMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMNKOOOOOO00KNWMMMMMMMMMMMMMMMMMMMM0,..dWMMMMMMNl..:KMWWO;..;xKNWWNKx;..;OWMWx'..l0NWWXk:..:KMWKdd0XNWKl..,0MK:..cKNNNNNNWMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMWWWWWWMMMMMMMMMMMMMMMMMMMMMMMM0,..dWMMMMMMNl..:KMMMWKo,...,:;,...,dKWMMMNk:...,;;,..'lKWMNd'..,;;,..,kWMK:...,,,,,,c0MMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM0:.'xWMMMMMMNo..cXMMMMMWKd;......:dKWMMMMMMMXd;.....'ckNMMMMNkc'....,o0WMMXc.........;OMMMMMMMM
*/

library CapsuleChestsStorage {
    struct Layout {
        /// @notice The Capsule Cards address that can burn chests to unpack
        ///         into cards.
        address capsuleCards;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("seaDrop.contracts.storage.capsuleChests");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

/*
 * @notice This contract uses ERC721PartnerSeaDrop,
 *         an ERC721A token contract that is compatible with SeaDrop.
 *         The set Capsule Cards contract is the only one that can call
 *         the burn function to unpack a chest into individual cards.
 */
contract CapsuleChests is ERC721PartnerSeaDropUpgradeable {
    using CapsuleChestsStorage for CapsuleChestsStorage.Layout;

    /**
     * @notice A token can only be burned by the set Capsule Cards address.
     */
    error BurnIncorrectSender();

    /**
     * @notice Initialize the token contract with its name, symbol,
     *         administrator, and allowed SeaDrop addresses.
     */
    function initialize(
        string memory name,
        string memory symbol,
        address administrator,
        address[] memory allowedSeaDrop
    ) external initializer initializerERC721A {
        ERC721PartnerSeaDropUpgradeable.__ERC721PartnerSeaDrop_init(
            name,
            symbol,
            administrator,
            allowedSeaDrop
        );
    }

    function newFunc() public pure returns (string memory) {
        return "upgrade";
    }

    function setCapsuleCardsAddress(address newCapsuleCardsAddress)
        external
        onlyOwner
    {
        CapsuleChestsStorage.layout().capsuleCards = newCapsuleCardsAddress;
    }

    function getCapsuleCardsAddress() public view returns (address) {
        return CapsuleChestsStorage.layout().capsuleCards;
    }

    /**
     * @notice Destroys `tokenId`, only callable by the set Capsule Cards
     *         address.
     *
     * @param tokenId The token id to burn.
     */
    function burn(uint256 tokenId) external {
        if (msg.sender != CapsuleChestsStorage.layout().capsuleCards) {
            revert BurnIncorrectSender();
        }

        _burn(tokenId);
    }

    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return ERC721AStorage.layout()._currentIndex - _startTokenId();
        }
    }
}

File 2 of 29 : ERC721PartnerSeaDropUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

import { ISeaDropUpgradeable } from "./interfaces/ISeaDropUpgradeable.sol";

import {
    AllowListData,
    PublicDrop,
    TokenGatedDropStage,
    SignedMintValidationParams
} from "./lib/SeaDropStructsUpgradeable.sol";

import {
    TwoStepAdministeredUpgradeable
} from "../lib/utility-contracts/src/TwoStepAdministeredUpgradeable.sol";
import {
    TwoStepAdministeredStorage
} from "../lib/utility-contracts/src/TwoStepAdministeredStorage.sol";

/**
 * @title  ERC721PartnerSeaDrop
 * @author James Wenzel (emo.eth)
 * @author Ryan Ghods (ralxz.eth)
 * @author Stephan Min (stephanm.eth)
 * @notice ERC721PartnerSeaDrop is a token contract that contains methods
 *         to properly interact with SeaDrop, with additional administrative
 *         functionality tailored for business requirements around partnered
 *         mints with off-chain agreements in place between two parties.
 *
 *         The "Owner" should control mint specifics such as price and start.
 *         The "Administrator" should control fee parameters.
 *
 *         Otherwise, for ease of administration, either Owner or Administrator
 *         should be able to configure mint parameters. They have the ability
 *         to override each other's actions in many circumstances, which is
 *         why the establishment of off-chain trust is important.
 *
 *         Note: An Administrator is not required to interface with SeaDrop.
 */
contract ERC721PartnerSeaDropUpgradeable is
    ERC721SeaDropUpgradeable,
    TwoStepAdministeredUpgradeable
{
    using TwoStepAdministeredStorage for TwoStepAdministeredStorage.Layout;

    /// @notice To prevent Owner from overriding fees, Administrator must
    ///         first initialize with fee.
    error AdministratorMustInitializeWithFee();

    /**
     * @notice Deploy the token contract with its name, symbol,
     *         administrator, and allowed SeaDrop addresses.
     */
    function __ERC721PartnerSeaDrop_init(
        string memory name,
        string memory symbol,
        address administrator,
        address[] memory allowedSeaDrop
    ) internal onlyInitializing {
        __ERC721A_init_unchained(name, symbol);
        __ConstructorInitializable_init_unchained();
        __TwoStepOwnable_init_unchained();
        __ERC721ContractMetadata_init_unchained(name, symbol);
        __ReentrancyGuard_init_unchained();
        __ERC721SeaDrop_init_unchained(name, symbol, allowedSeaDrop);
        __TwoStepAdministered_init_unchained(administrator);
        __ERC721PartnerSeaDrop_init_unchained(
            name,
            symbol,
            administrator,
            allowedSeaDrop
        );
    }

    function __ERC721PartnerSeaDrop_init_unchained(
        string memory,
        string memory,
        address,
        address[] memory
    ) internal onlyInitializing {}

    /**
     * @notice Mint tokens, restricted to the SeaDrop contract.
     *
     * @param minter   The address to mint to.
     * @param quantity The number of tokens to mint.
     */
    function mintSeaDrop(address minter, uint256 quantity)
        external
        payable
        virtual
        override
        onlyAllowedSeaDrop(msg.sender)
    {
        // Extra safety check to ensure the max supply is not exceeded.
        if (_totalMinted() + quantity > maxSupply()) {
            revert MintQuantityExceedsMaxSupply(
                _totalMinted() + quantity,
                maxSupply()
            );
        }

        // Mint the quantity of tokens to the minter.
        _mint(minter, quantity);
    }

    /**
     * @notice Update the allowed SeaDrop contracts.
     *         Only the owner or administrator can use this function.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function updateAllowedSeaDrop(address[] calldata allowedSeaDrop)
        external
        override
        onlyOwnerOrAdministrator
    {
        _updateAllowedSeaDrop(allowedSeaDrop);
    }

    /**
     * @notice Update the public drop data for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator can only update `feeBps`.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param publicDrop  The public drop data.
     */
    function updatePublicDrop(
        address seaDropImpl,
        PublicDrop calldata publicDrop
    )
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Track the previous public drop data.
        PublicDrop memory retrieved = ISeaDropUpgradeable(seaDropImpl)
            .getPublicDrop(address(this));

        // Track the newly supplied drop data.
        PublicDrop memory supplied = publicDrop;

        // Only the administrator (OpenSea) can set feeBps.
        if (msg.sender != TwoStepAdministeredStorage.layout().administrator) {
            // Administrator must first set fee.
            if (retrieved.maxTotalMintableByWallet == 0) {
                revert AdministratorMustInitializeWithFee();
            }
            supplied.feeBps = retrieved.feeBps;
            supplied.restrictFeeRecipients = true;
        } else {
            // Administrator can only initialize
            // (maxTotalMintableByWallet > 0) and set
            // feeBps/restrictFeeRecipients.
            uint16 maxTotalMintableByWallet = retrieved
                .maxTotalMintableByWallet;
            retrieved.maxTotalMintableByWallet = maxTotalMintableByWallet > 0
                ? maxTotalMintableByWallet
                : 1;
            retrieved.feeBps = supplied.feeBps;
            retrieved.restrictFeeRecipients = true;
            supplied = retrieved;
        }

        // Update the public drop data on SeaDrop.
        ISeaDropUpgradeable(seaDropImpl).updatePublicDrop(supplied);
    }

    /**
     * @notice Update the allow list data for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param allowListData The allow list data.
     */
    function updateAllowList(
        address seaDropImpl,
        AllowListData calldata allowListData
    )
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Update the allow list on SeaDrop.
        ISeaDropUpgradeable(seaDropImpl).updateAllowList(allowListData);
    }

    /**
     * @notice Update the token gated drop stage data for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator must first set `feeBps`.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing
     *         simultaneous token gated drop promotions for each other,
     *         they can be minted by the same actor until
     *         `maxTokenSupplyForStage` is reached. Please ensure the
     *         `allowedNftToken` is not running an active drop during the
     *         `dropStage` time period.
     *
     * @param seaDropImpl     The allowed SeaDrop contract.
     * @param allowedNftToken The allowed nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address seaDropImpl,
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    )
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Track the previous drop stage data.
        TokenGatedDropStage memory retrieved = ISeaDropUpgradeable(seaDropImpl)
            .getTokenGatedDrop(address(this), allowedNftToken);

        // Track the newly supplied drop data.
        TokenGatedDropStage memory supplied = dropStage;

        // Only the administrator (OpenSea) can set feeBps on Partner
        // contracts.
        if (msg.sender != TwoStepAdministeredStorage.layout().administrator) {
            // Administrator must first set fee.
            if (retrieved.maxTotalMintableByWallet == 0) {
                revert AdministratorMustInitializeWithFee();
            }
            supplied.feeBps = retrieved.feeBps;
            supplied.restrictFeeRecipients = true;
        } else {
            // Administrator can only initialize
            // (maxTotalMintableByWallet > 0) and set
            // feeBps/restrictFeeRecipients.
            uint16 maxTotalMintableByWallet = retrieved
                .maxTotalMintableByWallet;
            retrieved.maxTotalMintableByWallet = maxTotalMintableByWallet > 0
                ? maxTotalMintableByWallet
                : 1;
            retrieved.feeBps = supplied.feeBps;
            retrieved.restrictFeeRecipients = true;
            supplied = retrieved;
        }

        // Update the token gated drop stage.

        ISeaDropUpgradeable(seaDropImpl).updateTokenGatedDrop(
            allowedNftToken,
            supplied
        );
    }

    /**
     * @notice Update the drop URI for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param dropURI     The new drop URI.
     */
    function updateDropURI(address seaDropImpl, string calldata dropURI)
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Update the drop URI.

        ISeaDropUpgradeable(seaDropImpl).updateDropURI(dropURI);
    }

    /**
     * @notice Update the allowed fee recipient for this nft contract
     *         on SeaDrop.
     *         Only the administrator can set the allowed fee recipient.
     *
     * @param seaDropImpl  The allowed SeaDrop contract.
     * @param feeRecipient The new fee recipient.
     * @param allowed      If the fee recipient is allowed.
     */
    function updateAllowedFeeRecipient(
        address seaDropImpl,
        address feeRecipient,
        bool allowed
    ) external override onlyAdministrator onlyAllowedSeaDrop(seaDropImpl) {
        // Update the allowed fee recipient.

        ISeaDropUpgradeable(seaDropImpl).updateAllowedFeeRecipient(
            feeRecipient,
            allowed
        );
    }

    /**
     * @notice Update the server-side signers for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl                The allowed SeaDrop contract.
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters to
     *                                   enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address seaDropImpl,
        address signer,
        SignedMintValidationParams memory signedMintValidationParams
    )
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Track the previous signed mint validation params.

        SignedMintValidationParams memory retrieved = ISeaDropUpgradeable(
            seaDropImpl
        ).getSignedMintValidationParams(address(this), signer);

        // Track the newly supplied params.

        SignedMintValidationParams memory supplied = signedMintValidationParams;

        // Only the administrator (OpenSea) can set feeBps on Partner
        // contracts.

        if (msg.sender != TwoStepAdministeredStorage.layout().administrator) {
            // Administrator must first set fee.

            if (retrieved.maxMaxTotalMintableByWallet == 0) {
                revert AdministratorMustInitializeWithFee();
            }
            supplied.minFeeBps = retrieved.minFeeBps;
            supplied.maxFeeBps = retrieved.maxFeeBps;
        } else {
            // Administrator can only initialize
            // (maxTotalMintableByWallet > 0) and set
            // feeBps/restrictFeeRecipients.
            uint24 maxMaxTotalMintableByWallet = retrieved
                .maxMaxTotalMintableByWallet;
            retrieved
                .maxMaxTotalMintableByWallet = maxMaxTotalMintableByWallet > 0
                ? maxMaxTotalMintableByWallet
                : 1;
            retrieved.minFeeBps = supplied.minFeeBps;
            retrieved.maxFeeBps = supplied.maxFeeBps;
            supplied = retrieved;
        }

        // Update the signed mint validation params.
        ISeaDropUpgradeable(seaDropImpl).updateSignedMintValidationParams(
            signer,
            supplied
        );
    }

    /**
     * @notice Update the allowed payers for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param payer       The payer to update.
     * @param allowed     Whether the payer is allowed.
     */
    function updatePayer(
        address seaDropImpl,
        address payer,
        bool allowed
    )
        external
        virtual
        override
        onlyOwnerOrAdministrator
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Update the payer.
        ISeaDropUpgradeable(seaDropImpl).updatePayer(payer, allowed);
    }
}

File 3 of 29 : ERC721AStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library ERC721AStorage {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    struct Layout {
        // =============================================================
        //                            STORAGE
        // =============================================================

        // The next token ID to be minted.
        uint256 _currentIndex;
        // The number of tokens burned.
        uint256 _burnCounter;
        // Token name
        string _name;
        // Token symbol
        string _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) _packedOwnerships;
        // Mapping owner address to address data.
        //
        // Bits Layout:
        // - [0..63]    `balance`
        // - [64..127]  `numberMinted`
        // - [128..191] `numberBurned`
        // - [192..255] `aux`
        mapping(address => uint256) _packedAddressData;
        // Mapping from token ID to approved address.
        mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals;
        // Mapping from owner to operator approvals
        mapping(address => mapping(address => bool)) _operatorApprovals;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 4 of 29 : ERC721SeaDropUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    ERC721ContractMetadataUpgradeable,
    ISeaDropTokenContractMetadataUpgradeable
} from "./ERC721ContractMetadataUpgradeable.sol";

import {
    INonFungibleSeaDropTokenUpgradeable
} from "./interfaces/INonFungibleSeaDropTokenUpgradeable.sol";

import { ISeaDropUpgradeable } from "./interfaces/ISeaDropUpgradeable.sol";

import {
    AllowListData,
    PublicDrop,
    TokenGatedDropStage,
    SignedMintValidationParams
} from "./lib/SeaDropStructsUpgradeable.sol";

import {
    ERC721AUpgradeable
} from "../lib/ERC721A/contracts/ERC721AUpgradeable.sol";

import {
    ReentrancyGuardUpgradeable
} from "../lib/solmate/src/utils/ReentrancyGuardUpgradeable.sol";

import {
    IERC165Upgradeable
} from "../lib/openzeppelin-contracts/contracts/utils/introspection/IERC165Upgradeable.sol";

import {
    DefaultOperatorFilterer721Upgradeable
} from "../lib/operator-filter-registry/src/example/upgradeable/DefaultOperatorFilterer721Upgradeable.sol";
import { ERC721SeaDropStorage } from "./ERC721SeaDropStorage.sol";
import {
    ERC721ContractMetadataStorage
} from "./ERC721ContractMetadataStorage.sol";

/**
 * @title  ERC721SeaDrop
 * @author James Wenzel (emo.eth)
 * @author Ryan Ghods (ralxz.eth)
 * @author Stephan Min (stephanm.eth)
 * @notice ERC721SeaDrop is a token contract that contains methods
 *         to properly interact with SeaDrop.
 */
contract ERC721SeaDropUpgradeable is
    ERC721ContractMetadataUpgradeable,
    INonFungibleSeaDropTokenUpgradeable,
    ReentrancyGuardUpgradeable,
    DefaultOperatorFilterer721Upgradeable
{
    using ERC721SeaDropStorage for ERC721SeaDropStorage.Layout;
    using ERC721ContractMetadataStorage for ERC721ContractMetadataStorage.Layout;

    /// @notice Revert with an error if mint exceeds the max supply.
    error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);

    /**
     * @notice Modifier to restrict access exclusively to
     *         allowed SeaDrop contracts.
     */
    modifier onlyAllowedSeaDrop(address seaDrop) {
        if (ERC721SeaDropStorage.layout()._allowedSeaDrop[seaDrop] != true) {
            revert OnlyAllowedSeaDrop();
        }

        _;
    }

    /**
     * @notice Deploy the token contract with its name, symbol,
     *         and allowed SeaDrop addresses.
     */
    function __ERC721SeaDrop_init(
        string memory name,
        string memory symbol,
        address[] memory allowedSeaDrop
    ) internal onlyInitializing {
        __ERC721A_init_unchained(name, symbol);
        __ConstructorInitializable_init_unchained();
        __TwoStepOwnable_init_unchained();
        __ERC721ContractMetadata_init_unchained(name, symbol);
        __ReentrancyGuard_init_unchained();
        __DefaultOperatorFilterer721_init();
        __ERC721SeaDrop_init_unchained(name, symbol, allowedSeaDrop);
    }

    function __ERC721SeaDrop_init_unchained(
        string memory,
        string memory,
        address[] memory allowedSeaDrop
    ) internal onlyInitializing {
        // Put the length on the stack for more efficient access.

        uint256 allowedSeaDropLength = allowedSeaDrop.length;

        // Set the mapping for allowed SeaDrop contracts.

        for (uint256 i = 0; i < allowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                allowedSeaDrop[i]
            ] = true;

            unchecked {
                ++i;
            }
        }

        // Set the enumeration.

        ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop = allowedSeaDrop;
    }

    /**
     * @notice Update the allowed SeaDrop contracts.
     *         Only the owner or administrator can use this function.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function updateAllowedSeaDrop(address[] calldata allowedSeaDrop)
        external
        virtual
        override
        onlyOwner
    {
        _updateAllowedSeaDrop(allowedSeaDrop);
    }

    /**
     * @notice Internal function to update the allowed SeaDrop contracts.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function _updateAllowedSeaDrop(address[] calldata allowedSeaDrop) internal {
        // Put the length on the stack for more efficient access.

        uint256 enumeratedAllowedSeaDropLength = ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop
            .length;

        uint256 allowedSeaDropLength = allowedSeaDrop.length;

        // Reset the old mapping.

        for (uint256 i = 0; i < enumeratedAllowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                ERC721SeaDropStorage.layout()._enumeratedAllowedSeaDrop[i]
            ] = false;

            unchecked {
                ++i;
            }
        }

        // Set the new mapping for allowed SeaDrop contracts.

        for (uint256 i = 0; i < allowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                allowedSeaDrop[i]
            ] = true;

            unchecked {
                ++i;
            }
        }

        // Set the enumeration.

        ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop = allowedSeaDrop;

        // Emit an event for the update.

        emit AllowedSeaDropUpdated(allowedSeaDrop);
    }

    /**
     * @dev Overrides the `_startTokenId` function from ERC721A
     *      to start at token id `1`.
     *
     *      This is to avoid future possible problems since `0` is usually
     *      used to signal values that have not been set or have been removed.
     */
    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    /**
     * @notice Mint tokens, restricted to the SeaDrop contract.
     *
     * @dev    NOTE: If a token registers itself with multiple SeaDrop
     *         contracts, the implementation of this function should guard
     *         against reentrancy. If the implementing token uses
     *         _safeMint(), or a feeRecipient with a malicious receive() hook
     *         is specified, the token or fee recipients may be able to execute
     *         another mint in the same transaction via a separate SeaDrop
     *         contract.
     *         This is dangerous if an implementing token does not correctly
     *         update the minterNumMinted and currentTotalSupply values before
     *         transferring minted tokens, as SeaDrop references these values
     *         to enforce token limits on a per-wallet and per-stage basis.
     *
     *         ERC721A tracks these values automatically, but this note and
     *         nonReentrant modifier are left here to encourage best-practices
     *         when referencing this contract.
     *
     * @param minter   The address to mint to.
     * @param quantity The number of tokens to mint.
     */
    function mintSeaDrop(address minter, uint256 quantity)
        external
        payable
        virtual
        override
        onlyAllowedSeaDrop(msg.sender)
        nonReentrant
    {
        // Extra safety check to ensure the max supply is not exceeded.

        if (_totalMinted() + quantity > maxSupply()) {
            revert MintQuantityExceedsMaxSupply(
                _totalMinted() + quantity,
                maxSupply()
            );
        }

        // Mint the quantity of tokens to the minter.

        _safeMint(minter, quantity);
    }

    /**
     * @notice Update the public drop data for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param publicDrop  The public drop data.
     */
    function updatePublicDrop(
        address seaDropImpl,
        PublicDrop calldata publicDrop
    ) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the public drop data on SeaDrop.

        ISeaDropUpgradeable(seaDropImpl).updatePublicDrop(publicDrop);
    }

    /**
     * @notice Update the allow list data for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param allowListData The allow list data.
     */
    function updateAllowList(
        address seaDropImpl,
        AllowListData calldata allowListData
    ) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the allow list on SeaDrop.

        ISeaDropUpgradeable(seaDropImpl).updateAllowList(allowListData);
    }

    /**
     * @notice Update the token gated drop stage data for this nft contract
     *         on SeaDrop.
     *         Only the owner can use this function.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing
     *         simultaneous token gated drop promotions for each other,
     *         they can be minted by the same actor until
     *         `maxTokenSupplyForStage` is reached. Please ensure the
     *         `allowedNftToken` is not running an active drop during the
     *         `dropStage` time period.
     *
     * @param seaDropImpl     The allowed SeaDrop contract.
     * @param allowedNftToken The allowed nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address seaDropImpl,
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the token gated drop stage.

        ISeaDropUpgradeable(seaDropImpl).updateTokenGatedDrop(
            allowedNftToken,
            dropStage
        );
    }

    /**
     * @notice Update the drop URI for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param dropURI     The new drop URI.
     */
    function updateDropURI(address seaDropImpl, string calldata dropURI)
        external
        virtual
        override
        onlyOwner
        onlyAllowedSeaDrop(seaDropImpl)
    {
        // Update the drop URI.

        ISeaDropUpgradeable(seaDropImpl).updateDropURI(dropURI);
    }

    /**
     * @notice Update the creator payout address for this nft contract on SeaDrop.
     *         Only the owner can set the creator payout address.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param payoutAddress The new payout address.
     */
    function updateCreatorPayoutAddress(
        address seaDropImpl,
        address payoutAddress
    ) external onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the creator payout address.

        ISeaDropUpgradeable(seaDropImpl).updateCreatorPayoutAddress(
            payoutAddress
        );
    }

    /**
     * @notice Update the allowed fee recipient for this nft contract
     *         on SeaDrop.
     *         Only the owner can set the allowed fee recipient.
     *
     * @param seaDropImpl  The allowed SeaDrop contract.
     * @param feeRecipient The new fee recipient.
     * @param allowed      If the fee recipient is allowed.
     */
    function updateAllowedFeeRecipient(
        address seaDropImpl,
        address feeRecipient,
        bool allowed
    ) external virtual onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the allowed fee recipient.

        ISeaDropUpgradeable(seaDropImpl).updateAllowedFeeRecipient(
            feeRecipient,
            allowed
        );
    }

    /**
     * @notice Update the server-side signers for this nft contract
     *         on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl                The allowed SeaDrop contract.
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters to
     *                                   enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address seaDropImpl,
        address signer,
        SignedMintValidationParams memory signedMintValidationParams
    ) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the signer.

        ISeaDropUpgradeable(seaDropImpl).updateSignedMintValidationParams(
            signer,
            signedMintValidationParams
        );
    }

    /**
     * @notice Update the allowed payers for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param payer       The payer to update.
     * @param allowed     Whether the payer is allowed.
     */
    function updatePayer(
        address seaDropImpl,
        address payer,
        bool allowed
    ) external virtual override onlyOwner onlyAllowedSeaDrop(seaDropImpl) {
        // Update the payer.

        ISeaDropUpgradeable(seaDropImpl).updatePayer(payer, allowed);
    }

    /**
     * @notice Returns a set of mint stats for the address.
     *         This assists SeaDrop in enforcing maxSupply,
     *         maxTotalMintableByWallet, and maxTokenSupplyForStage checks.
     *
     * @dev    NOTE: Implementing contracts should always update these numbers
     *         before transferring any tokens with _safeMint() to mitigate
     *         consequences of malicious onERC721Received() hooks.
     *
     * @param minter The minter address.
     */
    function getMintStats(address minter)
        external
        view
        override
        returns (
            uint256 minterNumMinted,
            uint256 currentTotalSupply,
            uint256 maxSupply
        )
    {
        minterNumMinted = _numberMinted(minter);

        currentTotalSupply = _totalMinted();

        maxSupply = ERC721ContractMetadataStorage.layout()._maxSupply;
    }

    /**
     * @notice Returns whether the interface is supported.
     *
     * @param interfaceId The interface id to check against.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(IERC165Upgradeable, ERC721AUpgradeable)
        returns (bool)
    {
        return
            interfaceId ==
            type(INonFungibleSeaDropTokenUpgradeable).interfaceId ||
            interfaceId ==
            type(ISeaDropTokenContractMetadataUpgradeable).interfaceId ||
            // ERC721A returns supportsInterface true for
            // ERC165, ERC721, ERC721Metadata
            super.supportsInterface(interfaceId);
    }

    /**
     * @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}.
     * - The operator (msg.sender) must be allowed.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        super.transferFrom(from, to, tokenId);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override {
        super.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.
     * - The operator (msg.sender) must be allowed.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override {
        super.safeTransferFrom(from, to, tokenId, data);
    }

    function operatorInitialize() public reinitializer(2) onlyOwner {
        __DefaultOperatorFilterer721_init();
    }
}

File 5 of 29 : ISeaDropUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    AllowListData,
    MintParams,
    PublicDrop,
    TokenGatedDropStage,
    TokenGatedMintParams,
    SignedMintValidationParams
} from "../lib/SeaDropStructsUpgradeable.sol";

import {
    SeaDropErrorsAndEventsUpgradeable
} from "../lib/SeaDropErrorsAndEventsUpgradeable.sol";

interface ISeaDropUpgradeable is SeaDropErrorsAndEventsUpgradeable {
    /**
     * @notice Mint a public drop.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     */
    function mintPublic(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity
    ) external payable;

    /**
     * @notice Mint from an allow list.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     * @param mintParams       The mint parameters.
     * @param proof            The proof for the leaf of the allow list.
     */
    function mintAllowList(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity,
        MintParams calldata mintParams,
        bytes32[] calldata proof
    ) external payable;

    /**
     * @notice Mint with a server-side signature.
     *         Note that a signature can only be used once.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     * @param mintParams       The mint parameters.
     * @param salt             The sale for the signed mint.
     * @param signature        The server-side signature, must be an allowed
     *                         signer.
     */
    function mintSigned(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity,
        MintParams calldata mintParams,
        uint256 salt,
        bytes calldata signature
    ) external payable;

    /**
     * @notice Mint as an allowed token holder.
     *         This will mark the token id as redeemed and will revert if the
     *         same token id is attempted to be redeemed twice.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param mintParams       The token gated mint params.
     */
    function mintAllowedTokenHolder(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        TokenGatedMintParams calldata mintParams
    ) external payable;

    /**
     * @notice Returns the public drop data for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getPublicDrop(address nftContract)
        external
        view
        returns (PublicDrop memory);

    /**
     * @notice Returns the creator payout address for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getCreatorPayoutAddress(address nftContract)
        external
        view
        returns (address);

    /**
     * @notice Returns the allow list merkle root for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getAllowListMerkleRoot(address nftContract)
        external
        view
        returns (bytes32);

    /**
     * @notice Returns if the specified fee recipient is allowed
     *         for the nft contract.
     *
     * @param nftContract  The nft contract.
     * @param feeRecipient The fee recipient.
     */
    function getFeeRecipientIsAllowed(address nftContract, address feeRecipient)
        external
        view
        returns (bool);

    /**
     * @notice Returns an enumeration of allowed fee recipients for an
     *         nft contract when fee recipients are enforced
     *
     * @param nftContract The nft contract.
     */
    function getAllowedFeeRecipients(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the server-side signers for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getSigners(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the struct of SignedMintValidationParams for a signer.
     *
     * @param nftContract The nft contract.
     * @param signer      The signer.
     */
    function getSignedMintValidationParams(address nftContract, address signer)
        external
        view
        returns (SignedMintValidationParams memory);

    /**
     * @notice Returns the payers for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getPayers(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns if the specified payer is allowed
     *         for the nft contract.
     *
     * @param nftContract The nft contract.
     * @param payer       The payer.
     */
    function getPayerIsAllowed(address nftContract, address payer)
        external
        view
        returns (bool);

    /**
     * @notice Returns the allowed token gated drop tokens for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getTokenGatedAllowedTokens(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the token gated drop data for the nft contract
     *         and token gated nft.
     *
     * @param nftContract     The nft contract.
     * @param allowedNftToken The token gated nft token.
     */
    function getTokenGatedDrop(address nftContract, address allowedNftToken)
        external
        view
        returns (TokenGatedDropStage memory);

    /**
     * @notice Returns whether the token id for a token gated drop has been
     *         redeemed.
     *
     * @param nftContract       The nft contract.
     * @param allowedNftToken   The token gated nft token.
     * @param allowedNftTokenId The token gated nft token id to check.
     */
    function getAllowedNftTokenIdIsRedeemed(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    ) external view returns (bool);

    /**
     * The following methods assume msg.sender is an nft contract
     * and its ERC165 interface id matches INonFungibleSeaDropToken.
     */

    /**
     * @notice Emits an event to notify update of the drop URI.
     *
     * @param dropURI The new drop URI.
     */
    function updateDropURI(string calldata dropURI) external;

    /**
     * @notice Updates the public drop data for the nft contract
     *         and emits an event.
     *
     * @param publicDrop The public drop data.
     */
    function updatePublicDrop(PublicDrop calldata publicDrop) external;

    /**
     * @notice Updates the allow list merkle root for the nft contract
     *         and emits an event.
     *
     *         Note: Be sure only authorized users can call this from
     *         token contracts that implement INonFungibleSeaDropToken.
     *
     * @param allowListData The allow list data.
     */
    function updateAllowList(AllowListData calldata allowListData) external;

    /**
     * @notice Updates the token gated drop stage for the nft contract
     *         and emits an event.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing simultaneous
     *         token gated drop promotions for each other, they can be
     *         minted by the same actor until `maxTokenSupplyForStage`
     *         is reached. Please ensure the `allowedNftToken` is not
     *         running an active drop during the `dropStage` time period.
     *
     * @param allowedNftToken The token gated nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external;

    /**
     * @notice Updates the creator payout address and emits an event.
     *
     * @param payoutAddress The creator payout address.
     */
    function updateCreatorPayoutAddress(address payoutAddress) external;

    /**
     * @notice Updates the allowed fee recipient and emits an event.
     *
     * @param feeRecipient The fee recipient.
     * @param allowed      If the fee recipient is allowed.
     */
    function updateAllowedFeeRecipient(address feeRecipient, bool allowed)
        external;

    /**
     * @notice Updates the allowed server-side signers and emits an event.
     *
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters
     *                                   to enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address signer,
        SignedMintValidationParams calldata signedMintValidationParams
    ) external;

    /**
     * @notice Updates the allowed payer and emits an event.
     *
     * @param payer   The payer to add or remove.
     * @param allowed Whether to add or remove the payer.
     */
    function updatePayer(address payer, bool allowed) external;
}

File 6 of 29 : SeaDropStructsUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/**
 * @notice A struct defining public drop data.
 *         Designed to fit efficiently in one storage slot.
 * 
 * @param mintPrice                The mint price per token. (Up to 1.2m
 *                                 of native token, e.g. ETH, MATIC)
 * @param startTime                The start time, ensure this is not zero.
 * @param endTIme                  The end time, ensure this is not zero.
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed. (The limit for this field is
 *                                 2^16 - 1)
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct PublicDrop {
    uint80 mintPrice; // 80/256 bits
    uint48 startTime; // 128/256 bits
    uint48 endTime; // 176/256 bits
    uint16 maxTotalMintableByWallet; // 224/256 bits
    uint16 feeBps; // 240/256 bits
    bool restrictFeeRecipients; // 248/256 bits
}

/**
 * @notice A struct defining token gated drop stage data.
 *         Designed to fit efficiently in one storage slot.
 * 
 * @param mintPrice                The mint price per token. (Up to 1.2m 
 *                                 of native token, e.g.: ETH, MATIC)
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed. (The limit for this field is
 *                                 2^16 - 1)
 * @param startTime                The start time, ensure this is not zero.
 * @param endTime                  The end time, ensure this is not zero.
 * @param dropStageIndex           The drop stage index to emit with the event
 *                                 for analytical purposes. This should be 
 *                                 non-zero since the public mint emits
 *                                 with index zero.
 * @param maxTokenSupplyForStage   The limit of token supply this stage can
 *                                 mint within. (The limit for this field is
 *                                 2^16 - 1)
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct TokenGatedDropStage {
    uint80 mintPrice; // 80/256 bits
    uint16 maxTotalMintableByWallet; // 96/256 bits
    uint48 startTime; // 144/256 bits
    uint48 endTime; // 192/256 bits
    uint8 dropStageIndex; // non-zero. 200/256 bits
    uint32 maxTokenSupplyForStage; // 232/256 bits
    uint16 feeBps; // 248/256 bits
    bool restrictFeeRecipients; // 256/256 bits
}

/**
 * @notice A struct defining mint params for an allow list.
 *         An allow list leaf will be composed of `msg.sender` and
 *         the following params.
 * 
 *         Note: Since feeBps is encoded in the leaf, backend should ensure
 *         that feeBps is acceptable before generating a proof.
 * 
 * @param mintPrice                The mint price per token.
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed.
 * @param startTime                The start time, ensure this is not zero.
 * @param endTime                  The end time, ensure this is not zero.
 * @param dropStageIndex           The drop stage index to emit with the event
 *                                 for analytical purposes. This should be
 *                                 non-zero since the public mint emits with
 *                                 index zero.
 * @param maxTokenSupplyForStage   The limit of token supply this stage can
 *                                 mint within.
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct MintParams {
    uint256 mintPrice; 
    uint256 maxTotalMintableByWallet;
    uint256 startTime;
    uint256 endTime;
    uint256 dropStageIndex; // non-zero
    uint256 maxTokenSupplyForStage;
    uint256 feeBps;
    bool restrictFeeRecipients;
}

/**
 * @notice A struct defining token gated mint params.
 * 
 * @param allowedNftToken    The allowed nft token contract address.
 * @param allowedNftTokenIds The token ids to redeem.
 */
struct TokenGatedMintParams {
    address allowedNftToken;
    uint256[] allowedNftTokenIds;
}

/**
 * @notice A struct defining allow list data (for minting an allow list).
 * 
 * @param merkleRoot    The merkle root for the allow list.
 * @param publicKeyURIs If the allowListURI is encrypted, a list of URIs
 *                      pointing to the public keys. Empty if unencrypted.
 * @param allowListURI  The URI for the allow list.
 */
struct AllowListData {
    bytes32 merkleRoot;
    string[] publicKeyURIs;
    string allowListURI;
}

/**
 * @notice A struct defining minimum and maximum parameters to validate for 
 *         signed mints, to minimize negative effects of a compromised signer.
 *
 * @param minMintPrice                The minimum mint price allowed.
 * @param maxMaxTotalMintableByWallet The maximum total number of mints allowed
 *                                    by a wallet.
 * @param minStartTime                The minimum start time allowed.
 * @param maxEndTime                  The maximum end time allowed.
 * @param maxMaxTokenSupplyForStage   The maximum token supply allowed.
 * @param minFeeBps                   The minimum fee allowed.
 * @param maxFeeBps                   The maximum fee allowed.
 */
struct SignedMintValidationParams {
    uint80 minMintPrice; // 80/256 bits
    uint24 maxMaxTotalMintableByWallet; // 104/256 bits
    uint40 minStartTime; // 144/256 bits
    uint40 maxEndTime; // 184/256 bits
    uint40 maxMaxTokenSupplyForStage; // 224/256 bits
    uint16 minFeeBps; // 240/256 bits
    uint16 maxFeeBps; // 256/256 bits
}

File 7 of 29 : TwoStepAdministeredStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


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

library TwoStepAdministeredStorage {

  struct Layout {

    address administrator;
    address potentialAdministrator;
  
  }
  
  bytes32 internal constant STORAGE_SLOT = keccak256('openzepplin.contracts.storage.TwoStepAdministered');

  function layout() internal pure returns (Layout storage l) {
    bytes32 slot = STORAGE_SLOT;
    assembly {
      l.slot := slot
    }
  }
}

File 8 of 29 : TwoStepAdministeredUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import { TwoStepOwnableUpgradeable } from "./TwoStepOwnableUpgradeable.sol";
import { TwoStepAdministeredStorage } from "./TwoStepAdministeredStorage.sol";
import "../../openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

contract TwoStepAdministeredUpgradeable is Initializable, TwoStepOwnableUpgradeable {
    using TwoStepAdministeredStorage for TwoStepAdministeredStorage.Layout;
    event AdministratorUpdated(
        address indexed previousAdministrator,
        address indexed newAdministrator
    );
    event PotentialAdministratorUpdated(address newPotentialAdministrator);

    error OnlyAdministrator();
    error OnlyOwnerOrAdministrator();
    error NotNextAdministrator();
    error NewAdministratorIsZeroAddress();

    modifier onlyAdministrator() virtual {
        if (msg.sender != TwoStepAdministeredStorage.layout().administrator) {
            revert OnlyAdministrator();
        }

        _;
    }

    modifier onlyOwnerOrAdministrator() virtual {
        if (msg.sender != owner()) {
            if (msg.sender != TwoStepAdministeredStorage.layout().administrator) {
                revert OnlyOwnerOrAdministrator();
            }
        }
        _;
    }

    function __TwoStepAdministered_init(address _administrator) internal onlyInitializing {
        __ConstructorInitializable_init_unchained();
        __TwoStepOwnable_init_unchained();
        __TwoStepAdministered_init_unchained(_administrator);
    }

    function __TwoStepAdministered_init_unchained(address _administrator) internal onlyInitializing {
        _initialize(_administrator);
    }

    function _initialize(address _administrator) private onlyConstructor {
        TwoStepAdministeredStorage.layout().administrator = _administrator;
        emit AdministratorUpdated(address(0), _administrator);
    }

    function transferAdministration(address newAdministrator)
        public
        virtual
        onlyAdministrator
    {
        if (newAdministrator == address(0)) {
            revert NewAdministratorIsZeroAddress();
        }
        TwoStepAdministeredStorage.layout().potentialAdministrator = newAdministrator;
        emit PotentialAdministratorUpdated(newAdministrator);
    }

    function _transferAdministration(address newAdministrator)
        internal
        virtual
    {
        TwoStepAdministeredStorage.layout().administrator = newAdministrator;

        emit AdministratorUpdated(msg.sender, newAdministrator);
    }

    ///@notice Acept administration of smart contract, after the current administrator has initiated the process with transferAdministration
    function acceptAdministration() public virtual {
        address _potentialAdministrator = TwoStepAdministeredStorage.layout().potentialAdministrator;
        if (msg.sender != _potentialAdministrator) {
            revert NotNextAdministrator();
        }
        _transferAdministration(_potentialAdministrator);
        delete TwoStepAdministeredStorage.layout().potentialAdministrator;
    }

    ///@notice cancel administration transfer
    function cancelAdministrationTransfer() public virtual onlyAdministrator {
        delete TwoStepAdministeredStorage.layout().potentialAdministrator;
        emit PotentialAdministratorUpdated(address(0));
    }

    function renounceAdministration() public virtual onlyAdministrator {
        delete TwoStepAdministeredStorage.layout().administrator;
        emit AdministratorUpdated(msg.sender, address(0));
    }
    // generated getter for ${varDecl.name}
    function administrator() public view returns(address) {
        return TwoStepAdministeredStorage.layout().administrator;
    }

    // generated getter for ${varDecl.name}
    function potentialAdministrator() public view returns(address) {
        return TwoStepAdministeredStorage.layout().potentialAdministrator;
    }

}

File 9 of 29 : ERC721ContractMetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    ISeaDropTokenContractMetadataUpgradeable
} from "./interfaces/ISeaDropTokenContractMetadataUpgradeable.sol";

import {
    ERC721AUpgradeable
} from "../lib/ERC721A/contracts/ERC721AUpgradeable.sol";

import {
    TwoStepOwnableUpgradeable
} from "../lib/utility-contracts/src/TwoStepOwnableUpgradeable.sol";
import {
    ERC721ContractMetadataStorage
} from "./ERC721ContractMetadataStorage.sol";

/**
 * @title  ERC721ContractMetadata
 * @author James Wenzel (emo.eth)
 * @author Ryan Ghods (ralxz.eth)
 * @author Stephan Min (stephanm.eth)
 * @notice ERC721ContractMetadata is a token contract that extends ERC721A
 *         with additional metadata and ownership capabilities.
 */
contract ERC721ContractMetadataUpgradeable is
    ERC721AUpgradeable,
    TwoStepOwnableUpgradeable,
    ISeaDropTokenContractMetadataUpgradeable
{
    using ERC721ContractMetadataStorage for ERC721ContractMetadataStorage.Layout;

    /// @notice Throw if the max supply exceeds uint64, a limit
    //          due to the storage of bit-packed variables in ERC721A.
    error CannotExceedMaxSupplyOfUint64(uint256 newMaxSupply);

    /**
     * @notice Deploy the token contract with its name and symbol.
     */
    function __ERC721ContractMetadata_init(
        string memory name,
        string memory symbol
    ) internal onlyInitializing {
        __ERC721A_init_unchained(name, symbol);
        __ConstructorInitializable_init_unchained();
        __TwoStepOwnable_init_unchained();
        __ERC721ContractMetadata_init_unchained(name, symbol);
    }

    function __ERC721ContractMetadata_init_unchained(
        string memory,
        string memory
    ) internal onlyInitializing {}

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

    /**
     * @notice Returns the contract URI for contract metadata.
     */
    function contractURI() external view override returns (string memory) {
        return ERC721ContractMetadataStorage.layout()._contractURI;
    }

    /**
     * @notice Sets the contract URI for contract metadata.
     *
     * @param newContractURI The new contract URI.
     */
    function setContractURI(string calldata newContractURI)
        external
        override
        onlyOwner
    {
        // Set the new contract URI.
        ERC721ContractMetadataStorage.layout()._contractURI = newContractURI;

        // Emit an event with the update.
        emit ContractURIUpdated(newContractURI);
    }

    /**
     * @notice Emit an event notifying metadata updates for
     *         a range of token ids.
     *
     * @param startTokenId The start token id.
     * @param endTokenId   The end token id.
     */
    function emitBatchTokenURIUpdated(uint256 startTokenId, uint256 endTokenId)
        external
        onlyOwner
    {
        // Emit an event with the update.

        emit TokenURIUpdated(startTokenId, endTokenId);
    }

    /**
     * @notice Returns the max token supply.
     */
    function maxSupply() public view returns (uint256) {
        return ERC721ContractMetadataStorage.layout()._maxSupply;
    }

    /**
     * @notice Returns the provenance hash.
     *         The provenance hash is used for random reveals, which
     *         is a hash of the ordered metadata to show it is unmodified
     *         after mint has started.
     */
    function provenanceHash() external view override returns (bytes32) {
        return ERC721ContractMetadataStorage.layout()._provenanceHash;
    }

    /**
     * @notice Sets the provenance hash and emits an event.
     *         The provenance hash is used for random reveals, which
     *         is a hash of the ordered metadata to show it is unmodified
     *         after mint has started.
     *         This function will revert after the first item has been minted.
     *
     * @param newProvenanceHash The new provenance hash to set.
     */
    function setProvenanceHash(bytes32 newProvenanceHash) external onlyOwner {
        // Revert if any items have been minted.

        if (_totalMinted() > 0) {
            revert ProvenanceHashCannotBeSetAfterMintStarted();
        }

        // Keep track of the old provenance hash for emitting with the event.

        bytes32 oldProvenanceHash = ERC721ContractMetadataStorage
            .layout()
            ._provenanceHash;

        // Set the new provenance hash.

        ERC721ContractMetadataStorage
            .layout()
            ._provenanceHash = newProvenanceHash;

        // Emit an event with the update.

        emit ProvenanceHashUpdated(oldProvenanceHash, newProvenanceHash);
    }

    /**
     * @notice Sets the max token supply and emits an event.
     *
     * @param newMaxSupply The new max supply to set.
     */
    function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
        // Ensure the max supply does not exceed the maximum value of uint64.
        if (newMaxSupply > 2**64 - 1) {
            revert CannotExceedMaxSupplyOfUint64(newMaxSupply);
        }

        // Set the new max supply.
        ERC721ContractMetadataStorage.layout()._maxSupply = newMaxSupply;

        // Emit an event with the update.
        emit MaxSupplyUpdated(newMaxSupply);
    }

    /**
     * @notice Sets the base URI for the token metadata and emits an event.
     *
     * @param newBaseURI The new base URI to set.
     */
    function setBaseURI(string calldata newBaseURI)
        external
        override
        onlyOwner
    {
        // Set the new base URI.
        ERC721ContractMetadataStorage.layout()._tokenBaseURI = newBaseURI;

        // Emit an event with the update.
        emit BaseURIUpdated(newBaseURI);
    }

    /**
     * @notice Returns the base URI for the contract, which ERC721A uses
     *         to return tokenURI.
     */
    function _baseURI() internal view virtual override returns (string memory) {
        return ERC721ContractMetadataStorage.layout()._tokenBaseURI;
    }
}

File 10 of 29 : INonFungibleSeaDropTokenUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    ISeaDropTokenContractMetadataUpgradeable
} from "../interfaces/ISeaDropTokenContractMetadataUpgradeable.sol";

import {
    AllowListData,
    PublicDrop,
    TokenGatedDropStage,
    SignedMintValidationParams
} from "../lib/SeaDropStructsUpgradeable.sol";

import {
    IERC165Upgradeable
} from "../../lib/openzeppelin-contracts/contracts/utils/introspection/IERC165Upgradeable.sol";

interface INonFungibleSeaDropTokenUpgradeable is
    ISeaDropTokenContractMetadataUpgradeable,
    IERC165Upgradeable
{
    /**
     * @dev Revert with an error if a contract is not an allowed
     *      SeaDrop address.
     */
    error OnlyAllowedSeaDrop();

    /**
     * @dev Emit an event when allowed SeaDrop contracts are updated.
     */
    event AllowedSeaDropUpdated(address[] allowedSeaDrop);

    /**
     * @notice Update the allowed SeaDrop contracts.
     *         Only the owner or administrator can use this function.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function updateAllowedSeaDrop(address[] calldata allowedSeaDrop) external;

    /**
     * @notice Mint tokens, restricted to the SeaDrop contract.
     *
     * @dev    NOTE: If a token registers itself with multiple SeaDrop
     *         contracts, the implementation of this function should guard
     *         against reentrancy. If the implementing token uses
     *         _safeMint(), or a feeRecipient with a malicious receive() hook
     *         is specified, the token or fee recipients may be able to execute
     *         another mint in the same transaction via a separate SeaDrop
     *         contract.
     *         This is dangerous if an implementing token does not correctly
     *         update the minterNumMinted and currentTotalSupply values before
     *         transferring minted tokens, as SeaDrop references these values
     *         to enforce token limits on a per-wallet and per-stage basis.
     *
     * @param minter   The address to mint to.
     * @param quantity The number of tokens to mint.
     */
    function mintSeaDrop(address minter, uint256 quantity) external payable;

    /**
     * @notice Returns a set of mint stats for the address.
     *         This assists SeaDrop in enforcing maxSupply,
     *         maxTotalMintableByWallet, and maxTokenSupplyForStage checks.
     *
     * @dev    NOTE: Implementing contracts should always update these numbers
     *         before transferring any tokens with _safeMint() to mitigate
     *         consequences of malicious onERC721Received() hooks.
     *
     * @param minter The minter address.
     */
    function getMintStats(address minter)
        external
        view
        returns (
            uint256 minterNumMinted,
            uint256 currentTotalSupply,
            uint256 maxSupply
        );

    /**
     * @notice Update the public drop data for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator can only update `feeBps`.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param publicDrop  The public drop data.
     */
    function updatePublicDrop(
        address seaDropImpl,
        PublicDrop calldata publicDrop
    ) external;

    /**
     * @notice Update the allow list data for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param allowListData The allow list data.
     */
    function updateAllowList(
        address seaDropImpl,
        AllowListData calldata allowListData
    ) external;

    /**
     * @notice Update the token gated drop stage data for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator, when present, must first set `feeBps`.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing
     *         simultaneous token gated drop promotions for each other,
     *         they can be minted by the same actor until
     *         `maxTokenSupplyForStage` is reached. Please ensure the
     *         `allowedNftToken` is not running an active drop during the
     *         `dropStage` time period.
     *
     *
     * @param seaDropImpl     The allowed SeaDrop contract.
     * @param allowedNftToken The allowed nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address seaDropImpl,
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external;

    /**
     * @notice Update the drop URI for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param dropURI     The new drop URI.
     */
    function updateDropURI(address seaDropImpl, string calldata dropURI)
        external;

    /**
     * @notice Update the creator payout address for this nft contract on SeaDrop.
     *         Only the owner can set the creator payout address.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param payoutAddress The new payout address.
     */
    function updateCreatorPayoutAddress(
        address seaDropImpl,
        address payoutAddress
    ) external;

    /**
     * @notice Update the allowed fee recipient for this nft contract
     *         on SeaDrop.
     *         Only the administrator can set the allowed fee recipient.
     *
     * @param seaDropImpl  The allowed SeaDrop contract.
     * @param feeRecipient The new fee recipient.
     */
    function updateAllowedFeeRecipient(
        address seaDropImpl,
        address feeRecipient,
        bool allowed
    ) external;

    /**
     * @notice Update the server-side signers for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl                The allowed SeaDrop contract.
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters
     *                                   to enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address seaDropImpl,
        address signer,
        SignedMintValidationParams memory signedMintValidationParams
    ) external;

    /**
     * @notice Update the allowed payers for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param payer       The payer to update.
     * @param allowed     Whether the payer is allowed.
     */
    function updatePayer(
        address seaDropImpl,
        address payer,
        bool allowed
    ) external;
}

File 11 of 29 : ERC721SeaDropStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { ERC721SeaDropUpgradeable } from "./ERC721SeaDropUpgradeable.sol";
import {
    ERC721ContractMetadataUpgradeable
} from "./ERC721ContractMetadataUpgradeable.sol";

library ERC721SeaDropStorage {
    struct Layout {
        /// @notice Track the allowed SeaDrop addresses.
        mapping(address => bool) _allowedSeaDrop;
        /// @notice Track the enumerated allowed SeaDrop addresses.
        address[] _enumeratedAllowedSeaDrop;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("openzepplin.contracts.storage.ERC721SeaDrop");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 12 of 29 : ERC721ContractMetadataStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

library ERC721ContractMetadataStorage {
    struct Layout {
        /// @notice Track the max supply.
        uint256 _maxSupply;
        /// @notice Track the base URI for token metadata.
        string _tokenBaseURI;
        /// @notice Track the contract URI for contract metadata.
        string _contractURI;
        /// @notice Track the provenance hash for guaranteeing metadata order
        ///         for random reveals.
        bytes32 _provenanceHash;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("openzepplin.contracts.storage.ERC721ContractMetadata");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 13 of 29 : ERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AUpgradeable.sol';
import {ERC721AStorage} from './ERC721AStorage.sol';
import './ERC721A__Initializable.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721ReceiverUpgradeable {
    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 ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable {
    using ERC721AStorage for ERC721AStorage.Layout;

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

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

    function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        __ERC721A_init_unchained(name_, symbol_);
    }

    function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        ERC721AStorage.layout()._name = name_;
        ERC721AStorage.layout()._symbol = symbol_;
        ERC721AStorage.layout()._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 ERC721AStorage.layout()._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 ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._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 ERC721AStorage.layout()._currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return ERC721AStorage.layout()._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 ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return
            (ERC721AStorage.layout()._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
            (ERC721AStorage.layout()._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(ERC721AStorage.layout()._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 = ERC721AStorage.layout()._packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        ERC721AStorage.layout()._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 ERC721AStorage.layout()._name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return ERC721AStorage.layout()._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(ERC721AStorage.layout()._packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (ERC721AStorage.layout()._packedOwnerships[index] == 0) {
            ERC721AStorage.layout()._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 < ERC721AStorage.layout()._currentIndex) {
                    uint256 packed = ERC721AStorage.layout()._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 = ERC721AStorage.layout()._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 virtual override {
        address owner = ownerOf(tokenId);

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

        ERC721AStorage.layout()._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 ERC721AStorage.layout()._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 {
        ERC721AStorage.layout()._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 ERC721AStorage.layout()._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 < ERC721AStorage.layout()._currentIndex && // If within bounds,
            ERC721AStorage.layout()._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)
    {
        ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._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 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.
            --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`.
            ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            ERC721AStorage.layout()._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 (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._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 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 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__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data)
        returns (bytes4 retval) {
            return retval == ERC721A__IERC721ReceiverUpgradeable(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 = ERC721AStorage.layout()._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`.
            ERC721AStorage.layout()._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`.
            ERC721AStorage.layout()._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();

            ERC721AStorage.layout()._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 = ERC721AStorage.layout()._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`.
            ERC721AStorage.layout()._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`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

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

            ERC721AStorage.layout()._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 = ERC721AStorage.layout()._currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (ERC721AStorage.layout()._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;`.
            ERC721AStorage.layout()._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`.
            ERC721AStorage.layout()._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 (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        ERC721AStorage.layout()._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 {
            ERC721AStorage.layout()._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 = ERC721AStorage.layout()._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);
        ERC721AStorage.layout()._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 29 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import { ReentrancyGuardStorage } from "./ReentrancyGuardStorage.sol";
import "../../../openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuardUpgradeable is Initializable {
    using ReentrancyGuardStorage for ReentrancyGuardStorage.Layout;
    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        ReentrancyGuardStorage.layout().locked = 1;
    }

    modifier nonReentrant() virtual {
        require(ReentrancyGuardStorage.layout().locked == 1, "REENTRANCY");

        ReentrancyGuardStorage.layout().locked = 2;

        _;

        ReentrancyGuardStorage.layout().locked = 1;
    }
}

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

pragma solidity ^0.8.0;

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

File 16 of 29 : DefaultOperatorFilterer721Upgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

abstract contract DefaultOperatorFilterer721Upgradeable is OperatorFilterer721Upgradeable {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    function __DefaultOperatorFilterer721_init() public onlyInitializing {
        OperatorFilterer721Upgradeable.__OperatorFilterer721_init(DEFAULT_SUBSCRIPTION, true);
    }
}

File 17 of 29 : ISeaDropTokenContractMetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface ISeaDropTokenContractMetadataUpgradeable {
    /**
     * @dev Emit an event when the max token supply is updated.
     */
    event MaxSupplyUpdated(uint256 newMaxSupply);

    /**
     * @dev Emit an event with the previous and new provenance hash after
     *      being updated.
     */
    event ProvenanceHashUpdated(bytes32 previousHash, bytes32 newHash);

    /**
     * @dev Emit an event when the URI for the collection-level metadata
     *      is updated.
     */
    event ContractURIUpdated(string newContractURI);

    /**
     * @dev Emit an event for partial reveals/updates.
     *      Batch update implementation should be left to contract.
     *
     * @param startTokenId The start token id.
     * @param endTokenId   The end token id.
     */
    event TokenURIUpdated(
        uint256 indexed startTokenId,
        uint256 indexed endTokenId
    );

    /**
     * @dev Emit an event for full token metadata reveals/updates.
     *
     * @param baseURI The base URI.
     */
    event BaseURIUpdated(string baseURI);

    /**
     * @notice Returns the contract URI.
     */
    function contractURI() external view returns (string memory);

    /**
     * @notice Sets the contract URI for contract metadata.
     *
     * @param newContractURI The new contract URI.
     */
    function setContractURI(string calldata newContractURI) external;

    /**
     * @notice Returns the base URI for token metadata.
     */
    function baseURI() external view returns (string memory);

    /**
     * @notice Sets the base URI for the token metadata and emits an event.
     *
     * @param tokenURI The new base URI to set.
     */
    function setBaseURI(string calldata tokenURI) external;

    /**
     * @notice Returns the max token supply.
     */
    function maxSupply() external view returns (uint256);

    /**
     * @notice Sets the max supply and emits an event.
     *
     * @param newMaxSupply The new max supply to set.
     */
    function setMaxSupply(uint256 newMaxSupply) external;

    /**
     * @notice Returns the provenance hash.
     *         The provenance hash is used for random reveals, which
     *         is a hash of the ordered metadata to show it is unmodified
     *         after mint has started.
     */
    function provenanceHash() external view returns (bytes32);

    /**
     * @notice Sets the provenance hash and emits an event.
     *         The provenance hash is used for random reveals, which
     *         is a hash of the ordered metadata to show it is unmodified
     *         after mint has started.
     *         This function will revert after the first item has been minted.
     *
     * @param newProvenanceHash The new provenance hash to set.
     */
    function setProvenanceHash(bytes32 newProvenanceHash) external;

    /**
     * @dev Revert with an error when attempting to set the provenance
     *      hash after the mint has started.
     */
    error ProvenanceHashCannotBeSetAfterMintStarted();
}

File 18 of 29 : TwoStepOwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import { ConstructorInitializableUpgradeable } from "./ConstructorInitializableUpgradeable.sol";
import { TwoStepOwnableStorage } from "./TwoStepOwnableStorage.sol";
import "../../openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

/**
@notice A two-step extension of Ownable, where the new owner must claim ownership of the contract after owner initiates transfer
Owner can cancel the transfer at any point before the new owner claims ownership.
Helpful in guarding against transferring ownership to an address that is unable to act as the Owner.
*/
abstract contract TwoStepOwnableUpgradeable is Initializable, ConstructorInitializableUpgradeable {
    using TwoStepOwnableStorage for TwoStepOwnableStorage.Layout;

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

    event PotentialOwnerUpdated(address newPotentialAdministrator);

    error NewOwnerIsZeroAddress();
    error NotNextOwner();
    error OnlyOwner();

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    function __TwoStepOwnable_init() internal onlyInitializing {
        __ConstructorInitializable_init_unchained();
        __TwoStepOwnable_init_unchained();
    }

    function __TwoStepOwnable_init_unchained() internal onlyInitializing {
        _initialize();
    }

    function _initialize() private onlyConstructor {
        _transferOwnership(msg.sender);
    }

    ///@notice Initiate ownership transfer to newPotentialOwner. Note: new owner will have to manually acceptOwnership
    ///@param newPotentialOwner address of potential new owner
    function transferOwnership(address newPotentialOwner)
        public
        virtual
        onlyOwner
    {
        if (newPotentialOwner == address(0)) {
            revert NewOwnerIsZeroAddress();
        }
        TwoStepOwnableStorage.layout().potentialOwner = newPotentialOwner;
        emit PotentialOwnerUpdated(newPotentialOwner);
    }

    ///@notice Claim ownership of smart contract, after the current owner has initiated the process with transferOwnership
    function acceptOwnership() public virtual {
        address _potentialOwner = TwoStepOwnableStorage.layout().potentialOwner;
        if (msg.sender != _potentialOwner) {
            revert NotNextOwner();
        }
        delete TwoStepOwnableStorage.layout().potentialOwner;
        emit PotentialOwnerUpdated(address(0));
        _transferOwnership(_potentialOwner);
    }

    ///@notice cancel ownership transfer
    function cancelOwnershipTransfer() public virtual onlyOwner {
        delete TwoStepOwnableStorage.layout().potentialOwner;
        emit PotentialOwnerUpdated(address(0));
    }

    function owner() public view virtual returns (address) {
        return TwoStepOwnableStorage.layout()._owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (TwoStepOwnableStorage.layout()._owner != msg.sender) {
            revert OnlyOwner();
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = TwoStepOwnableStorage.layout()._owner;
        TwoStepOwnableStorage.layout()._owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 19 of 29 : ERC721A__Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable diamond facet contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */

import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol';

abstract contract ERC721A__Initializable {
    using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializerERC721A() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(
            ERC721A__InitializableStorage.layout()._initializing
                ? _isConstructor()
                : !ERC721A__InitializableStorage.layout()._initialized,
            'ERC721A__Initializable: contract is already initialized'
        );

        bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing;
        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = true;
            ERC721A__InitializableStorage.layout()._initialized = true;
        }

        _;

        if (isTopLevelCall) {
            ERC721A__InitializableStorage.layout()._initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializingERC721A() {
        require(
            ERC721A__InitializableStorage.layout()._initializing,
            'ERC721A__Initializable: contract is not initializing'
        );
        _;
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        // extcodesize checks the size of the code stored in an address, and
        // address returns the current address. Since the code is still not
        // deployed when running a constructor, any checks on its code size will
        // yield zero, making it an effective way to detect if a contract is
        // under construction or not.
        address self = address(this);
        uint256 cs;
        assembly {
            cs := extcodesize(self)
        }
        return cs == 0;
    }
}

File 20 of 29 : IERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721AUpgradeable {
    /**
     * 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;

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

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

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

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

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

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

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

File 21 of 29 : ERC721A__InitializableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base storage for the  initialization function for upgradeable diamond facet contracts
 **/

library ERC721A__InitializableStorage {
    struct Layout {
        /*
         * Indicates that the contract has been initialized.
         */
        bool _initialized;
        /*
         * Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet');

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

File 22 of 29 : TwoStepOwnableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


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

library TwoStepOwnableStorage {

  struct Layout {
    address _owner;

    address potentialOwner;
  
  }
  
  bytes32 internal constant STORAGE_SLOT = keccak256('openzepplin.contracts.storage.TwoStepOwnable');

  function layout() internal pure returns (Layout storage l) {
    bytes32 slot = STORAGE_SLOT;
    assembly {
      l.slot := slot
    }
  }
}

File 23 of 29 : ConstructorInitializableUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import "../../openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

/**
 * @author emo.eth
 * @notice Abstract smart contract that provides an onlyUninitialized modifier which only allows calling when
 *         from within a constructor of some sort, whether directly instantiating an inherting contract,
 *         or when delegatecalling from a proxy
 */
abstract contract ConstructorInitializableUpgradeable is Initializable {
    function __ConstructorInitializable_init() internal onlyInitializing {
        __ConstructorInitializable_init_unchained();
    }

    function __ConstructorInitializable_init_unchained() internal onlyInitializing {
    }
    error AlreadyInitialized();

    modifier onlyConstructor() {
        if (address(this).code.length != 0) {
            revert AlreadyInitialized();
        }
        _;
    }
}

File 24 of 29 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 25 of 29 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

File 26 of 29 : SeaDropErrorsAndEventsUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { PublicDrop, TokenGatedDropStage, SignedMintValidationParams } from "./SeaDropStructsUpgradeable.sol";

interface SeaDropErrorsAndEventsUpgradeable {
    /**
     * @dev Revert with an error if the drop stage is not active.
     */
    error NotActive(
        uint256 currentTimestamp,
        uint256 startTimestamp,
        uint256 endTimestamp
    );

    /**
     * @dev Revert with an error if the mint quantity is zero.
     */
    error MintQuantityCannotBeZero();

    /**
     * @dev Revert with an error if the mint quantity exceeds the max allowed
     *      to be minted per wallet.
     */
    error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);

    /**
     * @dev Revert with an error if the mint quantity exceeds the max token
     *      supply.
     */
    error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);

    /**
     * @dev Revert with an error if the mint quantity exceeds the max token
     *      supply for the stage.
     *      Note: The `maxTokenSupplyForStage` for public mint is
     *      always `type(uint).max`.
     */
    error MintQuantityExceedsMaxTokenSupplyForStage(
        uint256 total, 
        uint256 maxTokenSupplyForStage
    );
    
    /**
     * @dev Revert if the fee recipient is the zero address.
     */
    error FeeRecipientCannotBeZeroAddress();

    /**
     * @dev Revert if the fee recipient is not already included.
     */
    error FeeRecipientNotPresent();

    /**
     * @dev Revert if the fee basis points is greater than 10_000.
     */
     error InvalidFeeBps(uint256 feeBps);

    /**
     * @dev Revert if the fee recipient is already included.
     */
    error DuplicateFeeRecipient();

    /**
     * @dev Revert if the fee recipient is restricted and not allowed.
     */
    error FeeRecipientNotAllowed();

    /**
     * @dev Revert if the creator payout address is the zero address.
     */
    error CreatorPayoutAddressCannotBeZeroAddress();

    /**
     * @dev Revert with an error if the received payment is incorrect.
     */
    error IncorrectPayment(uint256 got, uint256 want);

    /**
     * @dev Revert with an error if the allow list proof is invalid.
     */
    error InvalidProof();

    /**
     * @dev Revert if a supplied signer address is the zero address.
     */
    error SignerCannotBeZeroAddress();

    /**
     * @dev Revert with an error if signer's signature is invalid.
     */
    error InvalidSignature(address recoveredSigner);

    /**
     * @dev Revert with an error if a signer is not included in
     *      the enumeration when removing.
     */
    error SignerNotPresent();

    /**
     * @dev Revert with an error if a payer is not included in
     *      the enumeration when removing.
     */
    error PayerNotPresent();

    /**
     * @dev Revert with an error if a payer is already included in mapping
     *      when adding.
     *      Note: only applies when adding a single payer, as duplicates in
     *      enumeration can be removed with updatePayer.
     */
    error DuplicatePayer();

    /**
     * @dev Revert with an error if the payer is not allowed. The minter must
     *      pay for their own mint.
     */
    error PayerNotAllowed();

    /**
     * @dev Revert if a supplied payer address is the zero address.
     */
    error PayerCannotBeZeroAddress();

    /**
     * @dev Revert with an error if the sender does not
     *      match the INonFungibleSeaDropToken interface.
     */
    error OnlyINonFungibleSeaDropToken(address sender);

    /**
     * @dev Revert with an error if the sender of a token gated supplied
     *      drop stage redeem is not the owner of the token.
     */
    error TokenGatedNotTokenOwner(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    );

    /**
     * @dev Revert with an error if the token id has already been used to
     *      redeem a token gated drop stage.
     */
    error TokenGatedTokenIdAlreadyRedeemed(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    );

    /**
     * @dev Revert with an error if an empty TokenGatedDropStage is provided
     *      for an already-empty TokenGatedDropStage.
     */
     error TokenGatedDropStageNotPresent();

    /**
     * @dev Revert with an error if an allowedNftToken is set to
     *      the zero address.
     */
     error TokenGatedDropAllowedNftTokenCannotBeZeroAddress();

    /**
     * @dev Revert with an error if an allowedNftToken is set to
     *      the drop token itself.
     */
     error TokenGatedDropAllowedNftTokenCannotBeDropToken();


    /**
     * @dev Revert with an error if supplied signed mint price is less than
     *      the minimum specified.
     */
    error InvalidSignedMintPrice(uint256 got, uint256 minimum);

    /**
     * @dev Revert with an error if supplied signed maxTotalMintableByWallet
     *      is greater than the maximum specified.
     */
    error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);

    /**
     * @dev Revert with an error if supplied signed start time is less than
     *      the minimum specified.
     */
    error InvalidSignedStartTime(uint256 got, uint256 minimum);
    
    /**
     * @dev Revert with an error if supplied signed end time is greater than
     *      the maximum specified.
     */
    error InvalidSignedEndTime(uint256 got, uint256 maximum);

    /**
     * @dev Revert with an error if supplied signed maxTokenSupplyForStage
     *      is greater than the maximum specified.
     */
     error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);
    
     /**
     * @dev Revert with an error if supplied signed feeBps is greater than
     *      the maximum specified, or less than the minimum.
     */
    error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);

    /**
     * @dev Revert with an error if signed mint did not specify to restrict
     *      fee recipients.
     */
    error SignedMintsMustRestrictFeeRecipients();

    /**
     * @dev Revert with an error if a signature for a signed mint has already
     *      been used.
     */
    error SignatureAlreadyUsed();

    /**
     * @dev An event with details of a SeaDrop mint, for analytical purposes.
     * 
     * @param nftContract    The nft contract.
     * @param minter         The mint recipient.
     * @param feeRecipient   The fee recipient.
     * @param payer          The address who payed for the tx.
     * @param quantityMinted The number of tokens minted.
     * @param unitMintPrice  The amount paid for each token.
     * @param feeBps         The fee out of 10_000 basis points collected.
     * @param dropStageIndex The drop stage index. Items minted
     *                       through mintPublic() have
     *                       dropStageIndex of 0.
     */
    event SeaDropMint(
        address indexed nftContract,
        address indexed minter,
        address indexed feeRecipient,
        address payer,
        uint256 quantityMinted,
        uint256 unitMintPrice,
        uint256 feeBps,
        uint256 dropStageIndex
    );

    /**
     * @dev An event with updated public drop data for an nft contract.
     */
    event PublicDropUpdated(
        address indexed nftContract,
        PublicDrop publicDrop
    );

    /**
     * @dev An event with updated token gated drop stage data
     *      for an nft contract.
     */
    event TokenGatedDropStageUpdated(
        address indexed nftContract,
        address indexed allowedNftToken,
        TokenGatedDropStage dropStage
    );

    /**
     * @dev An event with updated allow list data for an nft contract.
     * 
     * @param nftContract        The nft contract.
     * @param previousMerkleRoot The previous allow list merkle root.
     * @param newMerkleRoot      The new allow list merkle root.
     * @param publicKeyURI       If the allow list is encrypted, the public key
     *                           URIs that can decrypt the list.
     *                           Empty if unencrypted.
     * @param allowListURI       The URI for the allow list.
     */
    event AllowListUpdated(
        address indexed nftContract,
        bytes32 indexed previousMerkleRoot,
        bytes32 indexed newMerkleRoot,
        string[] publicKeyURI,
        string allowListURI
    );

    /**
     * @dev An event with updated drop URI for an nft contract.
     */
    event DropURIUpdated(address indexed nftContract, string newDropURI);

    /**
     * @dev An event with the updated creator payout address for an nft
     *      contract.
     */
    event CreatorPayoutAddressUpdated(
        address indexed nftContract,
        address indexed newPayoutAddress
    );

    /**
     * @dev An event with the updated allowed fee recipient for an nft
     *      contract.
     */
    event AllowedFeeRecipientUpdated(
        address indexed nftContract,
        address indexed feeRecipient,
        bool indexed allowed
    );

    /**
     * @dev An event with the updated validation parameters for server-side
     *      signers.
     */
    event SignedMintValidationParamsUpdated(
        address indexed nftContract,
        address indexed signer,
        SignedMintValidationParams signedMintValidationParams
    );   

    /**
     * @dev An event with the updated payer for an nft contract.
     */
    event PayerUpdated(
        address indexed nftContract,
        address indexed payer,
        bool indexed allowed
    );
}

File 27 of 29 : ReentrancyGuardStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


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

library ReentrancyGuardStorage {

  struct Layout {
    uint256 locked;
  
  }
  
  bytes32 internal constant STORAGE_SLOT = keccak256('openzepplin.contracts.storage.ReentrancyGuard');

  function layout() internal pure returns (Layout storage l) {
    bytes32 slot = STORAGE_SLOT;
    assembly {
      l.slot := slot
    }
  }
}

File 28 of 29 : OperatorFilterer721Upgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "../../IOperatorFilterRegistry.sol";
import {Initializable} from "../../../../openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";

abstract contract OperatorFilterer721Upgradeable is Initializable {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant operatorFilterRegistry =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    function __OperatorFilterer721_init(address subscriptionOrRegistrantToCopy, bool subscribe)
        public
        onlyInitializing
    {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(operatorFilterRegistry).code.length > 0) {
            if (!operatorFilterRegistry.isRegistered(address(this))) {
                if (subscribe) {
                    operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    if (subscriptionOrRegistrantToCopy != address(0)) {
                        operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                    } else {
                        operatorFilterRegistry.register(address(this));
                    }
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            // Allow spending tokens from addresses with balance
            // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
            // from an EOA.
            if (from == msg.sender) {
                _;
                return;
            }
            if (
                !(
                    operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)
                        && operatorFilterRegistry.isOperatorAllowed(address(this), from)
                )
            ) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }
}

File 29 of 29 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"AdministratorMustInitializeWithFee","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BurnIncorrectSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"CannotExceedMaxSupplyOfUint64","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"MintQuantityExceedsMaxSupply","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NewAdministratorIsZeroAddress","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NotNextAdministrator","type":"error"},{"inputs":[],"name":"NotNextOwner","type":"error"},{"inputs":[],"name":"OnlyAdministrator","type":"error"},{"inputs":[],"name":"OnlyAllowedSeaDrop","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"OnlyOwnerOrAdministrator","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ProvenanceHashCannotBeSetAfterMintStarted","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":"previousAdministrator","type":"address"},{"indexed":true,"internalType":"address","name":"newAdministrator","type":"address"}],"name":"AdministratorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"AllowedSeaDropUpdated","type":"event"},{"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":"string","name":"baseURI","type":"string"}],"name":"BaseURIUpdated","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":"string","name":"newContractURI","type":"string"}],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"MaxSupplyUpdated","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":"address","name":"newPotentialAdministrator","type":"address"}],"name":"PotentialAdministratorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPotentialAdministrator","type":"address"}],"name":"PotentialOwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"previousHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"newHash","type":"bytes32"}],"name":"ProvenanceHashUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"endTokenId","type":"uint256"}],"name":"TokenURIUpdated","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"},{"inputs":[],"name":"__DefaultOperatorFilterer721_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"subscriptionOrRegistrantToCopy","type":"address"},{"internalType":"bool","name":"subscribe","type":"bool"}],"name":"__OperatorFilterer721_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptAdministration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"administrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelAdministrationTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"endTokenId","type":"uint256"}],"name":"emitBatchTokenURIUpdated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCapsuleCardsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"getMintStats","outputs":[{"internalType":"uint256","name":"minterNumMinted","type":"uint256"},{"internalType":"uint256","name":"currentTotalSupply","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"administrator","type":"address"},{"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintSeaDrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newFunc","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"operatorInitialize","outputs":[],"stateMutability":"nonpayable","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":"potentialAdministrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceAdministration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newCapsuleCardsAddress","type":"address"}],"name":"setCapsuleCardsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newProvenanceHash","type":"bytes32"}],"name":"setProvenanceHash","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":[{"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":"newAdministrator","type":"address"}],"name":"transferAdministration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPotentialOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string[]","name":"publicKeyURIs","type":"string[]"},{"internalType":"string","name":"allowListURI","type":"string"}],"internalType":"struct AllowListData","name":"allowListData","type":"tuple"}],"name":"updateAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updateAllowedFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"updateAllowedSeaDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"payoutAddress","type":"address"}],"name":"updateCreatorPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"string","name":"dropURI","type":"string"}],"name":"updateDropURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updatePayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"components":[{"internalType":"uint80","name":"mintPrice","type":"uint80"},{"internalType":"uint48","name":"startTime","type":"uint48"},{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint16","name":"maxTotalMintableByWallet","type":"uint16"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct PublicDrop","name":"publicDrop","type":"tuple"}],"name":"updatePublicDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint80","name":"minMintPrice","type":"uint80"},{"internalType":"uint24","name":"maxMaxTotalMintableByWallet","type":"uint24"},{"internalType":"uint40","name":"minStartTime","type":"uint40"},{"internalType":"uint40","name":"maxEndTime","type":"uint40"},{"internalType":"uint40","name":"maxMaxTokenSupplyForStage","type":"uint40"},{"internalType":"uint16","name":"minFeeBps","type":"uint16"},{"internalType":"uint16","name":"maxFeeBps","type":"uint16"}],"internalType":"struct SignedMintValidationParams","name":"signedMintValidationParams","type":"tuple"}],"name":"updateSignedMintValidationParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"},{"components":[{"internalType":"uint80","name":"mintPrice","type":"uint80"},{"internalType":"uint16","name":"maxTotalMintableByWallet","type":"uint16"},{"internalType":"uint48","name":"startTime","type":"uint48"},{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint8","name":"dropStageIndex","type":"uint8"},{"internalType":"uint32","name":"maxTokenSupplyForStage","type":"uint32"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct TokenGatedDropStage","name":"dropStage","type":"tuple"}],"name":"updateTokenGatedDrop","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60808060405234610016576149f1908161001c8239f35b600080fdfe60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a71461043757806306fdde031461042e578063081812fc14610425578063095ea7b31461041c578063099b6bfa14610413578063134f707c1461040a57806315922b281461040157806318160ddd146103f85780631b73593c146103ef57806323452b9c146103e657806323b872dd146103dd5780633680620d146103d45780633eb51368146103cb57806342842e0e146103c257806342966c68146103b957806348a4c101146103b0578063511aa644146103a757806355f804b31461039e578063572bedd51461039557806360c308b61461038c5780636352211e1461038357806364869dad1461037a57806366251b69146103715780636c0360eb146103685780636f8b44b01461035f57806370a0823114610356578063715018a61461034d57806379ba5097146103445780637a05bc821461033b5780637bc2be7614610332578063840e15d41461032957806388ebd6b0146103205780638da5cb5b146103175780638dfb7f331461030e578063913ee93d14610305578063938e3d7b146102fc57806395d89b41146102f35780639794ed40146102ea578063a22cb465146102e1578063b61b3d03146102d8578063b88d4fde146102cf578063c6ab67a3146102c6578063c780b63d146102bd578063c87b56dd146102b4578063cb743ba8146102ab578063d5abeb01146102a2578063d5e7feb814610299578063e8a3d48514610290578063e985e9c514610287578063f0025d961461027e578063f2fde38b14610275578063f53d0a8e1461026c5763fbc46ada1461026457600080fd5b61000e613050565b5061000e612ffe565b5061000e612f58565b5061000e612ec1565b5061000e612e95565b5061000e612dde565b5061000e612da7565b5061000e612d7b565b5061000e612cc7565b5061000e612bf9565b5061000e612b90565b5061000e612b52565b5061000e612987565b5061000e6127a8565b5061000e612743565b5061000e6126c5565b5061000e61260e565b5061000e6124cb565b5061000e612425565b5061000e612317565b5061000e6122e0565b5061000e612297565b5061000e61222b565b5061000e612024565b5061000e611f54565b5061000e611eb7565b5061000e611e4b565b5061000e611def565b5061000e611d6e565b5061000e611d3d565b5061000e611caa565b5061000e611b3b565b5061000e611b0b565b5061000e61197a565b5061000e611913565b5061000e6117a3565b5061000e61169a565b5061000e61149c565b5061000e6112ff565b5061000e611183565b5061000e610fd6565b5061000e610ddb565b5061000e610c7a565b5061000e610bd5565b5061000e61093e565b5061000e61090e565b5061000e6108c7565b5061000e610861565b5061000e6107c2565b5061000e6106d7565b5061000e610652565b5061000e61055a565b5061000e610452565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561047281610440565b63ffffffff60e01b16630c487f4760e11b81149081156104e2575b811561049f575b506040519015158152f35b6301ffc9a760e01b8114915081156104d1575b81156104c0575b5038610494565b635b5e139f60e01b149050386104b9565b6380ac58cd60e01b811491506104b2565b631be3172760e11b8114915061048d565b600091031261000e57565b60005b8381106105115750506000910152565b8181015183820152602001610501565b9060209161053a815180928185528580860191016104fe565b601f01601f1916010190565b906020610557928181520190610521565b90565b503461000e5760008060031936011261064f57604051908060008051602061489c8339815191529081549061058e826131df565b8086529260019280841690811561062257506001146105c8575b6105c4866105b8818803826115e1565b60405191829182610546565b0390f35b815292507f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb35b82841061060a5750505081016020016105b8826105c4386105a8565b805460208587018101919091529093019281016105ee565b90508695506105c4969350602092506105b894915060ff191682840152151560051b8201019293386105a8565b80fd5b503461000e57602036600319011261000e57600435610670816133b9565b156106b4576000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052602060018060a01b0360406000205416604051908152f35b6040516333d1c03960e21b8152600490fd5b6001600160a01b0381160361000e57565b503461000e57604036600319011261000e576004356106f5816106c6565b6024356001600160a01b038061070a8361332b565b1690813303610784575b60008381527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c466020526040812080546001600160a01b0319166001600160a01b0387161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60ff6107aa3361079385613134565b9060018060a01b0316600052602052604060002090565b5416610714576040516367d9dca160e11b8152600490fd5b503461000e57602036600319011261000e576004356107df6134ad565b60008051602061481c833981519152546000190161084f5760407f7c22004198bf87da0f0dab623c72e66ca1200f4454aa3b9ca30f436275428b7c917fb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031c90808254925582519182526020820152a1005b60405163e03264af60e01b8152600490fd5b503461000e57602036600319011261000e5760043561087f816106c6565b6108876134ad565b7fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e80546001600160a01b0319166001600160a01b03909216919091179055005b503461000e57604036600319011261000e576108e16134ad565b6024356004357fa367e77d52123b7db91661964f869e6d260e9050507402788a87ca8ad38687e7600080a3005b503461000e57600036600319011261000e57602060001960008051602061481c8339815191525401604051908152f35b503461000e5760e036600319011261000e576004803561095d816106c6565b60c036602319011261000e5760008051602061497c833981519152546001600160a01b03919082163303610bab575b600160ff6109998361316d565b5416151503610b9a57604051632f1a98a760e21b81523081850190815292909116929160c090829081906020010381865afa908115610b8d575b600091610b5f575b506109e536613826565b60008051602061491c83398151915254909190610a12906001600160a01b03165b6001600160a01b031690565b3314610b145761ffff610a2a606083015161ffff1690565b1615610b035760800151610a489061ffff165b61ffff166080830152565b600160a08201525b823b1561000e57610ad092600092836040518096819582946301308e6560e01b8452830191909160a08060c083019469ffffffffffffffffffff815116845265ffffffffffff806020830151166020860152604082015116604085015261ffff806060830151166060860152608082015116608085015201511515910152565b03925af18015610af6575b610ae157005b80610aee610af49261158b565b806104f3565b005b610afe6134a0565b610adb565b604051634f4ca83d60e11b81528390fd5b90610a3d6080610b4c92610b4360608601610b31815161ffff1690565b61ffff811615610b585761ffff169052565b015161ffff1690565b600160a0820152610a50565b5060019052565b610b80915060c03d8111610b86575b610b7881836115e1565b81019061376a565b386109db565b503d610b6e565b610b956134a0565b6109d3565b6040516315e26ff360e01b81528390fd5b8160008051602061491c833981519152541633031561098c576040516359d9793760e01b81528390fd5b503461000e5760008060031936011261064f57610bf06134ad565b7ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b6001600160601b0360a01b81541690557f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da6020604051838152a180f35b606090600319011261000e57600435610c66816106c6565b90602435610c73816106c6565b9060443590565b503461000e57610c8936610c4e565b9190610c948361332b565b6001600160a01b0383811692828216849003610dca57610cb386613fc2565b9092610cd26001600160a01b03881633908114908414171590565b1590565b610d99575b8216958615610d8757610d0093610cf392610d7d575b506131a6565b80546000190190556131a6565b80546001019055600160e11b4260a01b84178117610d1d866132fc565b55811615610d3c575b506000805160206148bc833981519152600080a4005b60018401610d49816132fc565b5415610d56575b50610d26565b60008051602061481c833981519152548114610d5057610d75906132fc565b553880610d50565b6000905538610ced565b604051633a954ecd60e21b8152600490fd5b610db3610cce610dac336107938b613134565b5460ff1690565b15610cd757604051632ce44b5f60e11b8152600490fd5b60405162a1148160e81b8152600490fd5b503461000e5760031960403682011261000e5760048035610dfb816106c6565b6001600160401b039060243582811161000e578084019160608236039687011261000e5760008051602061497c833981519152546001600160a01b039081163303610f60575b6001918260ff610e508361316d565b5416151503610f4f571694853b1561000e576040519663ebb4a55f60e01b885260209081838a01526084890190863560248b01526024860135906022190181121561000e578501602481019793013592831161000e578260051b90813603881361000e5791838a9897969593606060448b97959701525260a4808901948901019680946000915b848310610f0f575050505050505083610ad060009694610efd839560448a9601906138bf565b848303602319016064860152906136e4565b919395999280610f3987999a9b610f338e849a969860a319908403018952876138bf565b906136e4565b9b019301930190928b9998979694929593610ed7565b6040516315e26ff360e01b81528790fd5b8060008051602061491c8339815191525416330315610e41576040516359d9793760e01b81528690fd5b8015150361000e57565b60c43590610fa182610f8a565b565b6101243590610fa182610f8a565b604090600319011261000e57600435610fc9816106c6565b9060243561055781610f8a565b503461000e57610fe536610fb1565b906000918291610ffb60ff845460081c16613420565b6daaeb6d7670e522a718067333cd4e91823b61101657505050f35b60405163c3c5a54760e01b815230600482015260208160248188885af1908115611176575b8591611148575b501561104d57505050f35b156110bf57813b156110bb57604051633e9f1edf60e11b81523060048201526001600160a01b0391909116602482015291908290604490829084905af180156110ae575b61109b575b505b80f35b80610aee6110a89261158b565b38611096565b6110b66134a0565b611091565b5050fd5b6001600160a01b0381161561111657813b156110bb5760405163a0af290360e01b81523060048201526001600160a01b03909116602482015291908290818381604481015b03925af180156110ae5761109b575080f35b508091503b1561114457604051632210724360e11b8152306004820152908290829081838160248101611104565b5080fd5b611169915060203d811161116f575b61116181836115e1565b81019061348b565b38611042565b503d611157565b61117e6134a0565b61103b565b503461000e5761119236610c4e565b9160405161119f816115c6565b6000938482526111ae8161332b565b6001600160a01b0390848216818316819003610dca576111cd84613fc2565b90939092906111eb6001600160a01b03891633908114908614171590565b6112d5575b8816928315610d875785948a916112cd575b505061120d876131a6565b805460001901905561121e886131a6565b80546001019055600160e11b4260a01b8417811761123b866132fc565b5581161561128c575b506000805160206148bc8339815191528880a4833b611261578480f35b61126e93610cce9361406a565b61127a57388080808480f35b6040516368d2bf6b60e11b8152600490fd5b60018401611299816132fc565b54156112a6575b50611244565b60008051602061481c8339815191525481146112a0576112c5906132fc565b5538806112a0565b558838611202565b6112e8610cce610dac336107938c613134565b156111f057604051632ce44b5f60e11b8152600490fd5b503461000e57602036600319011261000e577fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e54600435906001600160a01b039081163303611458576000906113548361332b565b9081169061136184613fc2565b61144f575b50611370826131a6565b80546fffffffffffffffffffffffffffffffff0190554260a01b8217600360e01b1761139b856132fc565b55600160e11b81161561140e575b506000805160206148bc8339815191528280a4610af46113ea7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c415460010190565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4155565b6001840161141b816132fc565b5415611428575b506113a9565b60008051602061481c83398151915254811461142257611447906132fc565b553880611422565b83905538611366565b60405163ea885d8360e01b8152600490fd5b606090600319011261000e57600435611482816106c6565b9060243561148f816106c6565b9060443561055781610f8a565b503461000e576114ab3661146a565b60008051602061491c8339815191525460009391906001600160a01b03908116330361155f57600160ff6114de8561316d565b541615150361154d57849216803b1561154957604051638e7d1e4360e01b81526001600160a01b03909416600485015290151560248401528290818381604481015b03925af1801561153c575b611533575080f35b6110989061158b565b6115446134a0565b61152b565b8280fd5b6040516315e26ff360e01b8152600490fd5b6040516001620aed3360e41b03198152600490fd5b50634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161159e57604052565b6115a6611574565b604052565b60e081019081106001600160401b0382111761159e57604052565b602081019081106001600160401b0382111761159e57604052565b90601f801991011681019081106001600160401b0382111761159e57604052565b69ffffffffffffffffffff81160361000e57565b60443590610fa182611602565b62ffffff81160361000e57565b64ffffffffff81160361000e57565b60843590610fa182611630565b60a43590610fa182611630565b60c43590610fa182611630565b61ffff81160361000e57565b60e43590610fa182611666565b6101043590610fa182611666565b60643590610fa182611666565b503461000e5761012036600319011261000e576004356116b9816106c6565b602435906116c6826106c6565b60e036604319011261000e57610af491604051916116e3836115ab565b6044356116ef81611602565b83526064356116fd81611623565b602084015261170a61163f565b604084015261171761164c565b6060840152611724611659565b6080840152611731611672565b60a084015261173e61167f565b60c0840152613b2a565b9181601f8401121561000e578235916001600160401b03831161000e576020838186019501011161000e57565b602060031982011261000e57600435906001600160401b03821161000e5761179f91600401611748565b9091565b503461000e576117b236611775565b6117ba6134ad565b6001600160401b038111611906575b6000805160206148fc833981519152916117ec826117e785546131df565b61354d565b600092601f831160011461185857827f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad9460009161184d575b508360011b906000198560031b1c19161790555b61184860405192839283613705565b0390a1005b905082013538611825565b6000805160206148fc833981519152600052601f198316937fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c0790805b8681106118ee5750847f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad96106118d4575b5050600183811b019055611839565b830135600019600386901b60f8161c1916905538806118c5565b90916020600181928588013581550193019101611894565b61190e611574565b6117c9565b503461000e57600036600319011261000e576105c4604051604081018181106001600160401b0382111761196d575b60405260078152667570677261646560c81b6020820152604051918291602083526020830190610521565b611975611574565b611942565b503461000e57602036600319011261000e576004356001600160401b0380821161000e573660238301121561000e57816004013590811161000e576024820191602436918360051b01011161000e5760008051602061497c833981519152546001600160a01b039081163303611adc575b506000805160206148dc83398151915280549060005b828110611a855750505060005b818110611a51575081611a42827fbbd3b69c138de4d317d0bc4290282c4e1cbd1e58b579a5b4f114b598c237454d94613f03565b61184860405192839283613f74565b80611a7f611a72611a6d611a686001958789613e7b565b613e99565b61316d565b805460ff19166001179055565b01611a0e565b6001908254811015611acf575b600083905260008051602061483c833981519152810154611ac990611abf906001600160a01b031661316d565b805460ff19169055565b01611a01565b611ad7613e64565b611a92565b60008051602061491c83398151915254163303611af957386119eb565b6040516359d9793760e01b8152600490fd5b503461000e57602036600319011261000e5760206001600160a01b03611b3260043561332b565b16604051908152f35b50604036600319011261000e57600435611b54816106c6565b60016024358160ff611b653361316d565b541615150361154d5760008051602061481c83398151915254926000198401611b8e8382613716565b9060008051602061495c83398151915254809211611c5d5750508115611c4b57611bb7816131a6565b80546801000000000000000184020190556001600160a01b0316904260a01b83821460e11b178217611be8856132fc565b55830191600093816000805160206148bc83398151915291808588858180a4015b848103611c3c5750505015611c2b5760008051602061481c8339815191525580f35b604051622e076360e81b8152600490fd5b8083918588858180a401611c09565b60405163b562e8dd60e01b8152600490fd5b90611c6a84604493613716565b906040519163384b48c560e21b835260048301526024820152fd5b604090600319011261000e57600435611c9d816106c6565b90602435610557816106c6565b503461000e57611cb936611c85565b90611cc26134ad565b60009160018060a01b03809216918284527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f3602052600160ff60408620541615150361154d578391833b156115495760249083604051958694859363024e71b760e31b85521660048401525af1801561153c57611533575080f35b503461000e57600036600319011261000e576105c4611d5a613219565b604051918291602083526020830190610521565b503461000e57602036600319011261000e57600435611d8b6134ad565b6001600160401b038111611dd7576020817f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c9260008051602061495c83398151915255604051908152a1005b6024906040519063b43e913760e01b82526004820152fd5b503461000e57602036600319011261000e57600435611e0d816106c6565b6001600160a01b03811615611e39576001600160401b03611e2f6020926131a6565b5416604051908152f35b6040516323d3ad8160e21b8152600490fd5b503461000e5760008060031936011261064f57611e666134ad565b60008051602061497c83398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e5760008060031936011261064f577ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b8054906001600160a01b0382169033829003611f4257611098926001600160601b0360a01b1690557f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da6020604051858152a16134e0565b604051636b7584e760e11b8152600490fd5b503461000e576000604036600319011261064f57600435611f74816106c6565b6024356001600160401b03811161154957611f93903690600401611748565b60008051602061497c833981519152549192916001600160a01b039081163303611ff9575b600160ff611fc58561316d565b541615150361154d57849216803b1561154957611520938360405180968195829463b957d0cb60e01b845260048401613705565b8060008051602061491c8339815191525416330315611fb8576040516359d9793760e01b8152600490fd5b503461000e5761014036600319011261000e576004803590612045826106c6565b60243591612052836106c6565b610100908160431936011261000e5760008051602061497c833981519152546001600160a01b03919082163303612201575b600160ff6120918361316d565b54161515036121f05760408051630587453760e11b8152308682019081526001600160a01b03881660208201529390921692849183918291010381855afa9283156121e3575b6000936121b4575b50506120ea366139f5565b60008051602061491c8339815191525490929061210f906001600160a01b0316610a06565b331461217e5761ffff612127602083015161ffff1690565b161561216d5760c09081015161ffff1690830152600160e08301525b803b1561000e57610ad0936000809460405196879586948593637ecd591560e11b85528401613a90565b604051634f4ca83d60e11b81528490fd5b909161219c60c06121a792610b4360208601610b31815161ffff1690565b61ffff1660c0830152565b600160e082015290612143565b6121d4929350803d106121dc575b6121cc81836115e1565b81019061391f565b9038806120df565b503d6121c2565b6121eb6134a0565b6120d7565b6040516315e26ff360e01b81528490fd5b8160008051602061491c8339815191525416330315612084576040516359d9793760e01b81528490fd5b503461000e57602036600319011261000e57606061225360043561224e816106c6565b6131a6565b5460001960008051602061481c833981519152540160008051602061495c83398151915254906001600160401b036040519360401c16835260208301526040820152f35b503461000e57600036600319011261000e577fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e5760008051602061497c833981519152546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261064f5761234360ff825460081c1661233e81613420565b613420565b6daaeb6d7670e522a718067333cd4e803b61235c575080f35b60405163c3c5a54760e01b815230600482015260208160248186865af1908115612418575b83916123fa575b5015612392575080f35b803b1561114457604051633e9f1edf60e11b8152306004820152733cc6cdda760b79bafa08df41ecfa224f810dceb660248201529082908290604490829084905af180156123ed575b156110965780610aee6110989261158b565b6123f56134a0565b6123db565b612412915060203d811161116f5761116181836115e1565b38612388565b6124206134a0565b612381565b503461000e57602036600319011261000e57600435612443816106c6565b60008051602061491c833981519152546001600160a01b0391908216330361155f571680156124b95760008051602061485c83398151915280546001600160a01b031916821790556040519081527fffa60f32d5278b35b1a3350ca92518fb5fe53e54ad07ac6355a17f54c5296b1f90602090a1005b604051633536be7f60e21b8152600490fd5b503461000e576124da36611775565b6124e26134ad565b6001600160401b038111612601575b60008051602061493c833981519152916125148261250f85546131df565b6135bb565b600092601f831160011461256e57827f905d981207a7d0b6c62cc46ab0be2a076d0298e4a86d0ab79882dbd01ac373789460009161184d57508360011b906000198560031b1c191617905561184860405192839283613705565b60008051602061493c833981519152600052601f198316937fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de790805b8681106125e95750847f905d981207a7d0b6c62cc46ab0be2a076d0298e4a86d0ab79882dbd01ac3737896106118d4575050600183811b019055611839565b909160206001819285880135815501930191016125aa565b612609611574565b6124f1565b503461000e5760008060031936011261064f57604051908060008051602061487c83398151915290815490612642826131df565b80865292600192808416908115610622575060011461266b576105c4866105b8818803826115e1565b815292507f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c5b8284106126ad5750505081016020016105b8826105c4386105a8565b80546020858701810191909152909301928101612691565b503461000e5760008060031936011261064f5760008051602061491c833981519152546001600160a01b0316330361155f5760008051602061485c8339815191526001600160601b0360a01b81541690557fffa60f32d5278b35b1a3350ca92518fb5fe53e54ad07ac6355a17f54c5296b1f6020604051838152a180f35b503461000e5761275236610fb1565b906127608161079333613134565b9115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e5760008060031936011261064f576127f960ff6101028354828160081c16158061291a575b6127db90614113565b61ffff1916178084556127ec6134ad565b60081c1661233e81613420565b6daaeb6d7670e522a718067333cd4e803b612850575b5061282061ff001960005416600055565b604051600281527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a180f35b60405163c3c5a54760e01b815230600482015260208160248186865af190811561290d575b83916128ef575b5061280f57803b1561114457604051633e9f1edf60e11b8152306004820152733cc6cdda760b79bafa08df41ecfa224f810dceb660248201529082908290604490829084905af180156128e2575b1561280f5780610aee6128dc9261158b565b3861280f565b6128ea6134a0565b6128ca565b612907915060203d811161116f5761116181836115e1565b3861287c565b6129156134a0565b612875565b506002818416106127d2565b6020906001600160401b038111612943575b601f01601f19160190565b61294b611574565b612938565b92919261295c82612926565b9161296a60405193846115e1565b82948184528183011161000e578281602093846000960137010152565b503461000e57608036600319011261000e57600480356129a6816106c6565b602435906129b3826106c6565b6044356064356001600160401b03811161000e573660238201121561000e576129e59036906024818801359101612950565b906129ef8161332b565b6001600160a01b03848116828216819003612b4257612a0d84613fc2565b939092612a296001600160a01b03891633908114908714171590565b612b19575b8816928315612b08578594612afe575b50612a48876131a6565b8054600019019055612a59886131a6565b80546001019055600160e11b4260a01b84178117612a76866132fc565b55811615612abd575b506000805160206148bc833981519152600080a4833b612a9b57005b612aa893610cce9361406a565b612aae57005b6040516368d2bf6b60e11b8152fd5b60018401612aca816132fc565b5415612ad7575b50612a7f565b60008051602061481c833981519152548114612ad157612af6906132fc565b553880612ad1565b6000905538612a3e565b604051633a954ecd60e21b81528a90fd5b612b2c610cce610dac336107938c613134565b15612a2e57604051632ce44b5f60e11b81528a90fd5b60405162a1148160e81b81528890fd5b503461000e57600036600319011261000e5760207fb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031c54604051908152f35b503461000e5760008060031936011261064f5760008051602061491c83398151915280546001600160a01b038116330361155f576001600160a01b031916905580337f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228280a380f35b503461000e57602036600319011261000e57600435612c17816133b9565b15612cb557612c24613219565b805160009015612c9b575060405160a08101604052608081019260008452925b6000190192600a906030828206018553049283612c44576105c49350612c8992612c8f6105b8936080601f1994858101920301815260405195869360208501906132e5565b906132e5565b039081018352826115e1565b6040516105c493509150612cae826115c6565b81526105b8565b604051630a14c4b560e41b8152600490fd5b503461000e57612cd63661146a565b60008051602061497c8339815191525460009391906001600160a01b039081163303612d50575b600160ff612d0a8561316d565b541615150361154d57849216803b1561154957604051633f952e6560e11b81526001600160a01b0390941660048501529015156024840152829081838160448101611520565b8060008051602061491c8339815191525416330315612cfd576040516359d9793760e01b8152600490fd5b503461000e57600036600319011261000e57602060008051602061495c83398151915254604051908152f35b503461000e57600036600319011261000e5760008051602061485c833981519152546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261064f57604051908060008051602061493c83398151915290815490612e12826131df565b808652926001928084169081156106225750600114612e3b576105c4866105b8818803826115e1565b815292507fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de75b828410612e7d5750505081016020016105b8826105c4386105a8565b80546020858701810191909152909301928101612e61565b503461000e57602060ff612eb5610793612eae36611c85565b9190613134565b54166040519015158152f35b503461000e5760008060031936011261064f5760008051602061485c83398151915280546001600160a01b0381169033829003612f46576001600160601b0360a01b9160008051602061491c8339815191528184825416179055337f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228680a316905580f35b6040516353bb059b60e01b8152600490fd5b503461000e57602036600319011261000e57600435612f76816106c6565b612f7e6134ad565b6001600160a01b03168015612fec577ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b80546001600160a01b031916821790556040519081527f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da90602090a1005b604051633a247dd760e11b8152600490fd5b503461000e57600036600319011261000e5760008051602061491c833981519152546040516001600160a01b039091168152602090f35b9080601f8301121561000e5781602061055793359101612950565b503461000e57608036600319011261000e576001600160401b0360043581811161000e57613082903690600401613035565b60243582811161000e5761309a903690600401613035565b604435906130a7826106c6565b6064359284841161000e573660238501121561000e578360040135948511613127575b8460051b93604051946020966130e2888301886115e1565b86526024878701918301019136831161000e57602401905b82821061310e57505050610af49450614176565b878091833561311c816106c6565b8152019101906130fa565b61312f611574565b6130ca565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020526040902090565b6001600160a01b031660009081527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f36020526040902090565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902090565b90600182811c9216801561320f575b60208310146131f957565b634e487b7160e01b600052602260045260246000fd5b91607f16916131ee565b604051906000826000805160206148fc83398151915291825461323b816131df565b808452936001918083169081156132c15750600114613263575b5050610fa1925003836115e1565b600090815291507fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c075b8483106132a65750610fa193505081016020013880613255565b81935090816020925483858a0101520191019091859261328c565b91505060209250610fa194915060ff191682840152151560051b8201013880613255565b906132f8602092828151948592016104fe565b0190565b6000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604060002090565b808060011115613348575b604051636f96cda160e11b8152600490fd5b60008051602061481c83398151915254811015613336576000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260406000205490600160e01b8216613336575b81156133a3575090565b6000190190506133b2816132fc565b5490613399565b80600111159081613407575b816133ce575090565b90506000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052600160e01b604060002054161590565b60008051602061481c83398151915254811091506133c5565b1561342757565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b5190610fa182610f8a565b9081602091031261000e575161055781610f8a565b506040513d6000823e3d90fd5b60008051602061497c833981519152546001600160a01b031633036134ce57565b604051635fc483c560e01b8152600490fd5b60008051602061497c83398151915280546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b818110613541575050565b60008155600101613536565b90601f821161355a575050565b610fa1916000805160206148fc8339815191526000527fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c07906020601f840160051c830193106135b1575b601f0160051c0190613536565b90915081906135a4565b90601f82116135c8575050565b610fa19160008051602061493c8339815191526000527fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de7906020601f840160051c830193106135b157601f0160051c0190613536565b90601f821161362b575050565b610fa19160008051602061489c8339815191526000527f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb3906020601f840160051c830193106135b157601f0160051c0190613536565b90601f821161368e575050565b610fa19160008051602061487c8339815191526000527f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c906020601f840160051c830193106135b157601f0160051c0190613536565b908060209392818452848401376000828201840152601f01601f1916010190565b9160206105579381815201916136e4565b9190820180921161372357565b634e487b7160e01b600052601160045260246000fd5b5190610fa182611602565b65ffffffffffff81160361000e57565b5190610fa182613744565b5190610fa182611666565b908160c091031261000e576137f760a06040519260c084018481106001600160401b038211176137ff575b60405280516137a381611602565b845260208101516137b381613744565b602085015260408101516137c681613744565b604085015260608101516137d981611666565b606085015260808101516137ec81611666565b608085015201613480565b60a082015290565b613807611574565b613795565b60843590610fa182613744565b60a43590610fa182613744565b60c090602319011261000e576040519060c082018281106001600160401b038211176138b2575b6040528160243561385d81611602565b815260443561386b81613744565b602082015260643561387c81613744565b604082015260843561388d81611666565b606082015260a43561389e81611666565b608082015260a06138ad610f94565b910152565b6138ba611574565b61384d565b9035601e198236030181121561000e5701602081359101916001600160401b03821161000e57813603831361000e57565b60ff81160361000e57565b5190610fa1826138f0565b63ffffffff81160361000e57565b5190610fa182613906565b8091610100928391031261000e5760e06139c6916040519384018481106001600160401b038211176139ce575b60405261395881613739565b84526139666020820161375f565b602085015261397760408201613754565b604085015261398860608201613754565b6060850152613999608082016138fb565b60808501526139aa60a08201613914565b60a08501526139bb60c0820161375f565b60c085015201613480565b60e082015290565b6139d6611574565b61394c565b60c43590610fa1826138f0565b60e43590610fa182613906565b906101008092604319011261000e576040519182018281106001600160401b03821117613a83575b60405281613a29611616565b8152613a3361168d565b6020820152613a4061380c565b6040820152613a4d613819565b6060820152613a5a6139db565b6080820152613a676139e8565b60a0820152613a7461167f565b60c082015260e06138ad610fa3565b613a8b611574565b613a1d565b61010060e0610fa193959461012084019660018060a01b0316845269ffffffffffffffffffff815116602085015261ffff602082015116604085015265ffffffffffff6040820151166060850152613af76060820151608086019065ffffffffffff169052565b608081015160ff1660a085015260a081015163ffffffff1660c085015260c081015161ffff168483015201511515910152565b60008051602061497c833981519152546001600160a01b03919082163303613cfd575b600160ff613b5a8361316d565b541615150361154d576040516381bf9af360e01b81523060048201526001600160a01b03841660248201529116929060e081604481875afa908115613cf0575b600091613cc2575b5060008051602061491c833981519152548290613bc7906001600160a01b0316610a06565b3314613c77575062ffffff613be2602083015162ffffff1690565b1615613c655761219c60c082610b43613c0360a0613c0e96015161ffff1690565b61ffff1660a0870152565b823b1561000e57613c3992600092836040518096819582946309a7002f60e31b845260048401613de0565b03925af18015613c58575b613c4b5750565b80610aee610fa19261158b565b613c606134a0565b613c44565b604051634f4ca83d60e11b8152600490fd5b81925060c061219c91613cab6020613cbd9501613c97815162ffffff1690565b62ffffff811615610b585762ffffff169052565b610b43613c0360a083015161ffff1690565b613c0e565b613ce3915060e03d8111613ce9575b613cdb81836115e1565b810190613d33565b38613ba2565b503d613cd1565b613cf86134a0565b613b9a565b8160008051602061491c8339815191525416330315613b4d576040516359d9793760e01b8152600490fd5b5190610fa182611630565b908160e091031261000e57613dcb60c06040519260e084018481106001600160401b03821117613dd3575b6040528051613d6c81611602565b84526020810151613d7c81611623565b6020850152613d8d60408201613d28565b6040850152613d9e60608201613d28565b6060850152613daf60808201613d28565b6080850152613dc060a0820161375f565b60a08501520161375f565b60c082015290565b613ddb611574565b613d5e565b60e060c0610fa193959461010084019660018060a01b0316845269ffffffffffffffffffff815116602085015262ffffff602082015116604085015264ffffffffff80604083015116606086015280606083015116608086015260808201511660a0850152613e5960a08201518386019061ffff169052565b015161ffff16910152565b50634e487b7160e01b600052603260045260246000fd5b9190811015613e8c575b60051b0190565b613e94613e64565b613e85565b35610557816106c6565b680100000000000000008111613ef6575b6000805160206148dc83398151915290815490808355818110613ed657505050565b610fa19260005260008051602061483c8339815191529182019101613536565b613efe611574565b613eb4565b6001600160401b038211613f67575b613f1b82613ea3565b6000805160206148dc83398151915260005260005b828110613f3c57505050565b6001906020833593613f4d856106c6565b01928160008051602061483c833981519152015501613f30565b613f6f611574565b613f12565b90916040602092828482018583525201929160005b828110613f97575050505090565b9091929382806001928735613fab816106c6565b848060a01b03168152019501910192919092613f89565b6000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604060002090815490565b9081602091031261000e575161055781610440565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261055792910190610521565b3d15614065573d9061404b82612926565b9161405960405193846115e1565b82523d6000602084013e565b606090565b92602091614093936000604051809681958294630a85bd0160e11b9a8b85523360048601614009565b03926001600160a01b03165af1600091816140e3575b506140d5576140b661403a565b805190816140d0576040516368d2bf6b60e11b8152600490fd5b602001fd5b6001600160e01b0319161490565b61410591925060203d811161410c575b6140fd81836115e1565b810190613ff4565b90386140a9565b503d6140f3565b1561411a57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b91926000549360ff8560081c16159485809661430f575b80156142f8575b61419d90614113565b60ff198116600117600055856142e6575b5060008051602061499c833981519152549260ff8460081c1693846000146142dd5750303b155b15614272576141ea931594856142515761431c565b614234575b6141f557565b61420561ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b60008051602061499c833981519152805461ff00191690556141ef565b60008051602061499c833981519152805461ffff191661010117905561431c565b60405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608490fd5b60ff16156141d5565b61ffff191661010117600055386141ae565b50303b158015614194575060ff8116600114614194565b50600160ff82161061418d565b92919261433060ff60005460081c16613420565b60ff60008051602061499c8339815191525460081c16156144c35780516001600160401b0381116144b6575b60008051602061489c8339815191529161437f8261437a85546131df565b61361e565b60209081601f8411600114614415575092826143c1936143fd969361440299989660009261440a575b50508160011b916000199060031b1c1916179055614525565b6143d8600160008051602061481c83398151915255565b6143e061466f565b6143e86146fc565b6143f061466f565b6143f8614638565b61471c565b614680565b610fa161466f565b0151905038806143a8565b60008051602061489c8339815191526000529190601f1984167f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb3936000905b82821061449e575050936143fd969361440299989693600193836143c19810614485575b505050811b019055614525565b015160001960f88460031b161c19169055388080614478565b80600186978294978701518155019601940190614454565b6144be611574565b61435c565b60405162461bcd60e51b815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604482015273206973206e6f7420696e697469616c697a696e6760601b6064820152608490fd5b9081516001600160401b03811161462b575b60008051602061487c8339815191529061455a8161455584546131df565b613681565b602080601f831160011461459657508192939460009261458b575b50508160011b916000199060031b1c1916179055565b015190503880614575565b90601f198316956145d660008051602061487c8339815191526000527f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c90565b926000905b888210614613575050836001959697106145fa575b505050811b019055565b015160001960f88460031b161c191690553880806145f0565b806001859682949686015181550195019301906145db565b614633611574565b614537565b61464960ff60005460081c16613420565b60017fd59f8a8c0d1463371c77782499276e5cbe466fd192ada543ceaea0a36604c1f255565b610fa160ff60005460081c16613420565b61469160ff60005460081c16613420565b303b6146eb5760008051602061491c83398151915280546001600160a01b0319166001600160a01b0392909216918217905560007f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228180a3565b60405162dc149f60e41b8152600490fd5b61470d60ff60005460081c16613420565b303b6146eb57610fa1336134e0565b600061472e60ff825460081c16613420565b8151815b8181106147b15750508151916001600160401b0383116147a4575b61475683613ea3565b6020809101916000805160206148dc83398151915281525b83811061477b5750505050565b82516001600160a01b031660008051602061483c8339815191528201559181019160010161476e565b6147ac611574565b61474d565b835181101561480e575b600581901b84016020908101516001600160a01b031684527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f3905260408320805460ff1916600190811790915501614732565b614816613e64565b6147bb56fe2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40b31d597aa596daba4fc1f9b7f2b079faea756475727b03e1452757e7f4209d05b3623c06c2ed11908644eb46053665cc2b67a32ab7b445094be7495b2530a9d42569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c432569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c42ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3eff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4b847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031ab3623c06c2ed11908644eb46053665cc2b67a32ab7b445094be7495b2530a9d3b847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031bb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a40319f73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4aee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220caeee936923a6019a38cfad56e236586a1ee42df9535712f12856754c9a6dedf64736f6c63430008110033

Deployed Bytecode

0x60806040526004361015610013575b600080fd5b60003560e01c806301ffc9a71461043757806306fdde031461042e578063081812fc14610425578063095ea7b31461041c578063099b6bfa14610413578063134f707c1461040a57806315922b281461040157806318160ddd146103f85780631b73593c146103ef57806323452b9c146103e657806323b872dd146103dd5780633680620d146103d45780633eb51368146103cb57806342842e0e146103c257806342966c68146103b957806348a4c101146103b0578063511aa644146103a757806355f804b31461039e578063572bedd51461039557806360c308b61461038c5780636352211e1461038357806364869dad1461037a57806366251b69146103715780636c0360eb146103685780636f8b44b01461035f57806370a0823114610356578063715018a61461034d57806379ba5097146103445780637a05bc821461033b5780637bc2be7614610332578063840e15d41461032957806388ebd6b0146103205780638da5cb5b146103175780638dfb7f331461030e578063913ee93d14610305578063938e3d7b146102fc57806395d89b41146102f35780639794ed40146102ea578063a22cb465146102e1578063b61b3d03146102d8578063b88d4fde146102cf578063c6ab67a3146102c6578063c780b63d146102bd578063c87b56dd146102b4578063cb743ba8146102ab578063d5abeb01146102a2578063d5e7feb814610299578063e8a3d48514610290578063e985e9c514610287578063f0025d961461027e578063f2fde38b14610275578063f53d0a8e1461026c5763fbc46ada1461026457600080fd5b61000e613050565b5061000e612ffe565b5061000e612f58565b5061000e612ec1565b5061000e612e95565b5061000e612dde565b5061000e612da7565b5061000e612d7b565b5061000e612cc7565b5061000e612bf9565b5061000e612b90565b5061000e612b52565b5061000e612987565b5061000e6127a8565b5061000e612743565b5061000e6126c5565b5061000e61260e565b5061000e6124cb565b5061000e612425565b5061000e612317565b5061000e6122e0565b5061000e612297565b5061000e61222b565b5061000e612024565b5061000e611f54565b5061000e611eb7565b5061000e611e4b565b5061000e611def565b5061000e611d6e565b5061000e611d3d565b5061000e611caa565b5061000e611b3b565b5061000e611b0b565b5061000e61197a565b5061000e611913565b5061000e6117a3565b5061000e61169a565b5061000e61149c565b5061000e6112ff565b5061000e611183565b5061000e610fd6565b5061000e610ddb565b5061000e610c7a565b5061000e610bd5565b5061000e61093e565b5061000e61090e565b5061000e6108c7565b5061000e610861565b5061000e6107c2565b5061000e6106d7565b5061000e610652565b5061000e61055a565b5061000e610452565b6001600160e01b031981160361000e57565b503461000e57602036600319011261000e57602060043561047281610440565b63ffffffff60e01b16630c487f4760e11b81149081156104e2575b811561049f575b506040519015158152f35b6301ffc9a760e01b8114915081156104d1575b81156104c0575b5038610494565b635b5e139f60e01b149050386104b9565b6380ac58cd60e01b811491506104b2565b631be3172760e11b8114915061048d565b600091031261000e57565b60005b8381106105115750506000910152565b8181015183820152602001610501565b9060209161053a815180928185528580860191016104fe565b601f01601f1916010190565b906020610557928181520190610521565b90565b503461000e5760008060031936011261064f57604051908060008051602061489c8339815191529081549061058e826131df565b8086529260019280841690811561062257506001146105c8575b6105c4866105b8818803826115e1565b60405191829182610546565b0390f35b815292507f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb35b82841061060a5750505081016020016105b8826105c4386105a8565b805460208587018101919091529093019281016105ee565b90508695506105c4969350602092506105b894915060ff191682840152151560051b8201019293386105a8565b80fd5b503461000e57602036600319011261000e57600435610670816133b9565b156106b4576000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052602060018060a01b0360406000205416604051908152f35b6040516333d1c03960e21b8152600490fd5b6001600160a01b0381160361000e57565b503461000e57604036600319011261000e576004356106f5816106c6565b6024356001600160a01b038061070a8361332b565b1690813303610784575b60008381527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c466020526040812080546001600160a01b0319166001600160a01b0387161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b60ff6107aa3361079385613134565b9060018060a01b0316600052602052604060002090565b5416610714576040516367d9dca160e11b8152600490fd5b503461000e57602036600319011261000e576004356107df6134ad565b60008051602061481c833981519152546000190161084f5760407f7c22004198bf87da0f0dab623c72e66ca1200f4454aa3b9ca30f436275428b7c917fb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031c90808254925582519182526020820152a1005b60405163e03264af60e01b8152600490fd5b503461000e57602036600319011261000e5760043561087f816106c6565b6108876134ad565b7fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e80546001600160a01b0319166001600160a01b03909216919091179055005b503461000e57604036600319011261000e576108e16134ad565b6024356004357fa367e77d52123b7db91661964f869e6d260e9050507402788a87ca8ad38687e7600080a3005b503461000e57600036600319011261000e57602060001960008051602061481c8339815191525401604051908152f35b503461000e5760e036600319011261000e576004803561095d816106c6565b60c036602319011261000e5760008051602061497c833981519152546001600160a01b03919082163303610bab575b600160ff6109998361316d565b5416151503610b9a57604051632f1a98a760e21b81523081850190815292909116929160c090829081906020010381865afa908115610b8d575b600091610b5f575b506109e536613826565b60008051602061491c83398151915254909190610a12906001600160a01b03165b6001600160a01b031690565b3314610b145761ffff610a2a606083015161ffff1690565b1615610b035760800151610a489061ffff165b61ffff166080830152565b600160a08201525b823b1561000e57610ad092600092836040518096819582946301308e6560e01b8452830191909160a08060c083019469ffffffffffffffffffff815116845265ffffffffffff806020830151166020860152604082015116604085015261ffff806060830151166060860152608082015116608085015201511515910152565b03925af18015610af6575b610ae157005b80610aee610af49261158b565b806104f3565b005b610afe6134a0565b610adb565b604051634f4ca83d60e11b81528390fd5b90610a3d6080610b4c92610b4360608601610b31815161ffff1690565b61ffff811615610b585761ffff169052565b015161ffff1690565b600160a0820152610a50565b5060019052565b610b80915060c03d8111610b86575b610b7881836115e1565b81019061376a565b386109db565b503d610b6e565b610b956134a0565b6109d3565b6040516315e26ff360e01b81528390fd5b8160008051602061491c833981519152541633031561098c576040516359d9793760e01b81528390fd5b503461000e5760008060031936011261064f57610bf06134ad565b7ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b6001600160601b0360a01b81541690557f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da6020604051838152a180f35b606090600319011261000e57600435610c66816106c6565b90602435610c73816106c6565b9060443590565b503461000e57610c8936610c4e565b9190610c948361332b565b6001600160a01b0383811692828216849003610dca57610cb386613fc2565b9092610cd26001600160a01b03881633908114908414171590565b1590565b610d99575b8216958615610d8757610d0093610cf392610d7d575b506131a6565b80546000190190556131a6565b80546001019055600160e11b4260a01b84178117610d1d866132fc565b55811615610d3c575b506000805160206148bc833981519152600080a4005b60018401610d49816132fc565b5415610d56575b50610d26565b60008051602061481c833981519152548114610d5057610d75906132fc565b553880610d50565b6000905538610ced565b604051633a954ecd60e21b8152600490fd5b610db3610cce610dac336107938b613134565b5460ff1690565b15610cd757604051632ce44b5f60e11b8152600490fd5b60405162a1148160e81b8152600490fd5b503461000e5760031960403682011261000e5760048035610dfb816106c6565b6001600160401b039060243582811161000e578084019160608236039687011261000e5760008051602061497c833981519152546001600160a01b039081163303610f60575b6001918260ff610e508361316d565b5416151503610f4f571694853b1561000e576040519663ebb4a55f60e01b885260209081838a01526084890190863560248b01526024860135906022190181121561000e578501602481019793013592831161000e578260051b90813603881361000e5791838a9897969593606060448b97959701525260a4808901948901019680946000915b848310610f0f575050505050505083610ad060009694610efd839560448a9601906138bf565b848303602319016064860152906136e4565b919395999280610f3987999a9b610f338e849a969860a319908403018952876138bf565b906136e4565b9b019301930190928b9998979694929593610ed7565b6040516315e26ff360e01b81528790fd5b8060008051602061491c8339815191525416330315610e41576040516359d9793760e01b81528690fd5b8015150361000e57565b60c43590610fa182610f8a565b565b6101243590610fa182610f8a565b604090600319011261000e57600435610fc9816106c6565b9060243561055781610f8a565b503461000e57610fe536610fb1565b906000918291610ffb60ff845460081c16613420565b6daaeb6d7670e522a718067333cd4e91823b61101657505050f35b60405163c3c5a54760e01b815230600482015260208160248188885af1908115611176575b8591611148575b501561104d57505050f35b156110bf57813b156110bb57604051633e9f1edf60e11b81523060048201526001600160a01b0391909116602482015291908290604490829084905af180156110ae575b61109b575b505b80f35b80610aee6110a89261158b565b38611096565b6110b66134a0565b611091565b5050fd5b6001600160a01b0381161561111657813b156110bb5760405163a0af290360e01b81523060048201526001600160a01b03909116602482015291908290818381604481015b03925af180156110ae5761109b575080f35b508091503b1561114457604051632210724360e11b8152306004820152908290829081838160248101611104565b5080fd5b611169915060203d811161116f575b61116181836115e1565b81019061348b565b38611042565b503d611157565b61117e6134a0565b61103b565b503461000e5761119236610c4e565b9160405161119f816115c6565b6000938482526111ae8161332b565b6001600160a01b0390848216818316819003610dca576111cd84613fc2565b90939092906111eb6001600160a01b03891633908114908614171590565b6112d5575b8816928315610d875785948a916112cd575b505061120d876131a6565b805460001901905561121e886131a6565b80546001019055600160e11b4260a01b8417811761123b866132fc565b5581161561128c575b506000805160206148bc8339815191528880a4833b611261578480f35b61126e93610cce9361406a565b61127a57388080808480f35b6040516368d2bf6b60e11b8152600490fd5b60018401611299816132fc565b54156112a6575b50611244565b60008051602061481c8339815191525481146112a0576112c5906132fc565b5538806112a0565b558838611202565b6112e8610cce610dac336107938c613134565b156111f057604051632ce44b5f60e11b8152600490fd5b503461000e57602036600319011261000e577fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e54600435906001600160a01b039081163303611458576000906113548361332b565b9081169061136184613fc2565b61144f575b50611370826131a6565b80546fffffffffffffffffffffffffffffffff0190554260a01b8217600360e01b1761139b856132fc565b55600160e11b81161561140e575b506000805160206148bc8339815191528280a4610af46113ea7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c415460010190565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4155565b6001840161141b816132fc565b5415611428575b506113a9565b60008051602061481c83398151915254811461142257611447906132fc565b553880611422565b83905538611366565b60405163ea885d8360e01b8152600490fd5b606090600319011261000e57600435611482816106c6565b9060243561148f816106c6565b9060443561055781610f8a565b503461000e576114ab3661146a565b60008051602061491c8339815191525460009391906001600160a01b03908116330361155f57600160ff6114de8561316d565b541615150361154d57849216803b1561154957604051638e7d1e4360e01b81526001600160a01b03909416600485015290151560248401528290818381604481015b03925af1801561153c575b611533575080f35b6110989061158b565b6115446134a0565b61152b565b8280fd5b6040516315e26ff360e01b8152600490fd5b6040516001620aed3360e41b03198152600490fd5b50634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161159e57604052565b6115a6611574565b604052565b60e081019081106001600160401b0382111761159e57604052565b602081019081106001600160401b0382111761159e57604052565b90601f801991011681019081106001600160401b0382111761159e57604052565b69ffffffffffffffffffff81160361000e57565b60443590610fa182611602565b62ffffff81160361000e57565b64ffffffffff81160361000e57565b60843590610fa182611630565b60a43590610fa182611630565b60c43590610fa182611630565b61ffff81160361000e57565b60e43590610fa182611666565b6101043590610fa182611666565b60643590610fa182611666565b503461000e5761012036600319011261000e576004356116b9816106c6565b602435906116c6826106c6565b60e036604319011261000e57610af491604051916116e3836115ab565b6044356116ef81611602565b83526064356116fd81611623565b602084015261170a61163f565b604084015261171761164c565b6060840152611724611659565b6080840152611731611672565b60a084015261173e61167f565b60c0840152613b2a565b9181601f8401121561000e578235916001600160401b03831161000e576020838186019501011161000e57565b602060031982011261000e57600435906001600160401b03821161000e5761179f91600401611748565b9091565b503461000e576117b236611775565b6117ba6134ad565b6001600160401b038111611906575b6000805160206148fc833981519152916117ec826117e785546131df565b61354d565b600092601f831160011461185857827f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad9460009161184d575b508360011b906000198560031b1c19161790555b61184860405192839283613705565b0390a1005b905082013538611825565b6000805160206148fc833981519152600052601f198316937fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c0790805b8681106118ee5750847f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad96106118d4575b5050600183811b019055611839565b830135600019600386901b60f8161c1916905538806118c5565b90916020600181928588013581550193019101611894565b61190e611574565b6117c9565b503461000e57600036600319011261000e576105c4604051604081018181106001600160401b0382111761196d575b60405260078152667570677261646560c81b6020820152604051918291602083526020830190610521565b611975611574565b611942565b503461000e57602036600319011261000e576004356001600160401b0380821161000e573660238301121561000e57816004013590811161000e576024820191602436918360051b01011161000e5760008051602061497c833981519152546001600160a01b039081163303611adc575b506000805160206148dc83398151915280549060005b828110611a855750505060005b818110611a51575081611a42827fbbd3b69c138de4d317d0bc4290282c4e1cbd1e58b579a5b4f114b598c237454d94613f03565b61184860405192839283613f74565b80611a7f611a72611a6d611a686001958789613e7b565b613e99565b61316d565b805460ff19166001179055565b01611a0e565b6001908254811015611acf575b600083905260008051602061483c833981519152810154611ac990611abf906001600160a01b031661316d565b805460ff19169055565b01611a01565b611ad7613e64565b611a92565b60008051602061491c83398151915254163303611af957386119eb565b6040516359d9793760e01b8152600490fd5b503461000e57602036600319011261000e5760206001600160a01b03611b3260043561332b565b16604051908152f35b50604036600319011261000e57600435611b54816106c6565b60016024358160ff611b653361316d565b541615150361154d5760008051602061481c83398151915254926000198401611b8e8382613716565b9060008051602061495c83398151915254809211611c5d5750508115611c4b57611bb7816131a6565b80546801000000000000000184020190556001600160a01b0316904260a01b83821460e11b178217611be8856132fc565b55830191600093816000805160206148bc83398151915291808588858180a4015b848103611c3c5750505015611c2b5760008051602061481c8339815191525580f35b604051622e076360e81b8152600490fd5b8083918588858180a401611c09565b60405163b562e8dd60e01b8152600490fd5b90611c6a84604493613716565b906040519163384b48c560e21b835260048301526024820152fd5b604090600319011261000e57600435611c9d816106c6565b90602435610557816106c6565b503461000e57611cb936611c85565b90611cc26134ad565b60009160018060a01b03809216918284527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f3602052600160ff60408620541615150361154d578391833b156115495760249083604051958694859363024e71b760e31b85521660048401525af1801561153c57611533575080f35b503461000e57600036600319011261000e576105c4611d5a613219565b604051918291602083526020830190610521565b503461000e57602036600319011261000e57600435611d8b6134ad565b6001600160401b038111611dd7576020817f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c9260008051602061495c83398151915255604051908152a1005b6024906040519063b43e913760e01b82526004820152fd5b503461000e57602036600319011261000e57600435611e0d816106c6565b6001600160a01b03811615611e39576001600160401b03611e2f6020926131a6565b5416604051908152f35b6040516323d3ad8160e21b8152600490fd5b503461000e5760008060031936011261064f57611e666134ad565b60008051602061497c83398151915280546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461000e5760008060031936011261064f577ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b8054906001600160a01b0382169033829003611f4257611098926001600160601b0360a01b1690557f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da6020604051858152a16134e0565b604051636b7584e760e11b8152600490fd5b503461000e576000604036600319011261064f57600435611f74816106c6565b6024356001600160401b03811161154957611f93903690600401611748565b60008051602061497c833981519152549192916001600160a01b039081163303611ff9575b600160ff611fc58561316d565b541615150361154d57849216803b1561154957611520938360405180968195829463b957d0cb60e01b845260048401613705565b8060008051602061491c8339815191525416330315611fb8576040516359d9793760e01b8152600490fd5b503461000e5761014036600319011261000e576004803590612045826106c6565b60243591612052836106c6565b610100908160431936011261000e5760008051602061497c833981519152546001600160a01b03919082163303612201575b600160ff6120918361316d565b54161515036121f05760408051630587453760e11b8152308682019081526001600160a01b03881660208201529390921692849183918291010381855afa9283156121e3575b6000936121b4575b50506120ea366139f5565b60008051602061491c8339815191525490929061210f906001600160a01b0316610a06565b331461217e5761ffff612127602083015161ffff1690565b161561216d5760c09081015161ffff1690830152600160e08301525b803b1561000e57610ad0936000809460405196879586948593637ecd591560e11b85528401613a90565b604051634f4ca83d60e11b81528490fd5b909161219c60c06121a792610b4360208601610b31815161ffff1690565b61ffff1660c0830152565b600160e082015290612143565b6121d4929350803d106121dc575b6121cc81836115e1565b81019061391f565b9038806120df565b503d6121c2565b6121eb6134a0565b6120d7565b6040516315e26ff360e01b81528490fd5b8160008051602061491c8339815191525416330315612084576040516359d9793760e01b81528490fd5b503461000e57602036600319011261000e57606061225360043561224e816106c6565b6131a6565b5460001960008051602061481c833981519152540160008051602061495c83398151915254906001600160401b036040519360401c16835260208301526040820152f35b503461000e57600036600319011261000e577fd6b54d0b82ab99b6a12a8a681e529fa7e86f6bd68babfc1fc625262f19c43d7e546040516001600160a01b039091168152602090f35b503461000e57600036600319011261000e5760008051602061497c833981519152546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261064f5761234360ff825460081c1661233e81613420565b613420565b6daaeb6d7670e522a718067333cd4e803b61235c575080f35b60405163c3c5a54760e01b815230600482015260208160248186865af1908115612418575b83916123fa575b5015612392575080f35b803b1561114457604051633e9f1edf60e11b8152306004820152733cc6cdda760b79bafa08df41ecfa224f810dceb660248201529082908290604490829084905af180156123ed575b156110965780610aee6110989261158b565b6123f56134a0565b6123db565b612412915060203d811161116f5761116181836115e1565b38612388565b6124206134a0565b612381565b503461000e57602036600319011261000e57600435612443816106c6565b60008051602061491c833981519152546001600160a01b0391908216330361155f571680156124b95760008051602061485c83398151915280546001600160a01b031916821790556040519081527fffa60f32d5278b35b1a3350ca92518fb5fe53e54ad07ac6355a17f54c5296b1f90602090a1005b604051633536be7f60e21b8152600490fd5b503461000e576124da36611775565b6124e26134ad565b6001600160401b038111612601575b60008051602061493c833981519152916125148261250f85546131df565b6135bb565b600092601f831160011461256e57827f905d981207a7d0b6c62cc46ab0be2a076d0298e4a86d0ab79882dbd01ac373789460009161184d57508360011b906000198560031b1c191617905561184860405192839283613705565b60008051602061493c833981519152600052601f198316937fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de790805b8681106125e95750847f905d981207a7d0b6c62cc46ab0be2a076d0298e4a86d0ab79882dbd01ac3737896106118d4575050600183811b019055611839565b909160206001819285880135815501930191016125aa565b612609611574565b6124f1565b503461000e5760008060031936011261064f57604051908060008051602061487c83398151915290815490612642826131df565b80865292600192808416908115610622575060011461266b576105c4866105b8818803826115e1565b815292507f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c5b8284106126ad5750505081016020016105b8826105c4386105a8565b80546020858701810191909152909301928101612691565b503461000e5760008060031936011261064f5760008051602061491c833981519152546001600160a01b0316330361155f5760008051602061485c8339815191526001600160601b0360a01b81541690557fffa60f32d5278b35b1a3350ca92518fb5fe53e54ad07ac6355a17f54c5296b1f6020604051838152a180f35b503461000e5761275236610fb1565b906127608161079333613134565b9115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b503461000e5760008060031936011261064f576127f960ff6101028354828160081c16158061291a575b6127db90614113565b61ffff1916178084556127ec6134ad565b60081c1661233e81613420565b6daaeb6d7670e522a718067333cd4e803b612850575b5061282061ff001960005416600055565b604051600281527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a180f35b60405163c3c5a54760e01b815230600482015260208160248186865af190811561290d575b83916128ef575b5061280f57803b1561114457604051633e9f1edf60e11b8152306004820152733cc6cdda760b79bafa08df41ecfa224f810dceb660248201529082908290604490829084905af180156128e2575b1561280f5780610aee6128dc9261158b565b3861280f565b6128ea6134a0565b6128ca565b612907915060203d811161116f5761116181836115e1565b3861287c565b6129156134a0565b612875565b506002818416106127d2565b6020906001600160401b038111612943575b601f01601f19160190565b61294b611574565b612938565b92919261295c82612926565b9161296a60405193846115e1565b82948184528183011161000e578281602093846000960137010152565b503461000e57608036600319011261000e57600480356129a6816106c6565b602435906129b3826106c6565b6044356064356001600160401b03811161000e573660238201121561000e576129e59036906024818801359101612950565b906129ef8161332b565b6001600160a01b03848116828216819003612b4257612a0d84613fc2565b939092612a296001600160a01b03891633908114908714171590565b612b19575b8816928315612b08578594612afe575b50612a48876131a6565b8054600019019055612a59886131a6565b80546001019055600160e11b4260a01b84178117612a76866132fc565b55811615612abd575b506000805160206148bc833981519152600080a4833b612a9b57005b612aa893610cce9361406a565b612aae57005b6040516368d2bf6b60e11b8152fd5b60018401612aca816132fc565b5415612ad7575b50612a7f565b60008051602061481c833981519152548114612ad157612af6906132fc565b553880612ad1565b6000905538612a3e565b604051633a954ecd60e21b81528a90fd5b612b2c610cce610dac336107938c613134565b15612a2e57604051632ce44b5f60e11b81528a90fd5b60405162a1148160e81b81528890fd5b503461000e57600036600319011261000e5760207fb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031c54604051908152f35b503461000e5760008060031936011261064f5760008051602061491c83398151915280546001600160a01b038116330361155f576001600160a01b031916905580337f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228280a380f35b503461000e57602036600319011261000e57600435612c17816133b9565b15612cb557612c24613219565b805160009015612c9b575060405160a08101604052608081019260008452925b6000190192600a906030828206018553049283612c44576105c49350612c8992612c8f6105b8936080601f1994858101920301815260405195869360208501906132e5565b906132e5565b039081018352826115e1565b6040516105c493509150612cae826115c6565b81526105b8565b604051630a14c4b560e41b8152600490fd5b503461000e57612cd63661146a565b60008051602061497c8339815191525460009391906001600160a01b039081163303612d50575b600160ff612d0a8561316d565b541615150361154d57849216803b1561154957604051633f952e6560e11b81526001600160a01b0390941660048501529015156024840152829081838160448101611520565b8060008051602061491c8339815191525416330315612cfd576040516359d9793760e01b8152600490fd5b503461000e57600036600319011261000e57602060008051602061495c83398151915254604051908152f35b503461000e57600036600319011261000e5760008051602061485c833981519152546040516001600160a01b039091168152602090f35b503461000e5760008060031936011261064f57604051908060008051602061493c83398151915290815490612e12826131df565b808652926001928084169081156106225750600114612e3b576105c4866105b8818803826115e1565b815292507fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de75b828410612e7d5750505081016020016105b8826105c4386105a8565b80546020858701810191909152909301928101612e61565b503461000e57602060ff612eb5610793612eae36611c85565b9190613134565b54166040519015158152f35b503461000e5760008060031936011261064f5760008051602061485c83398151915280546001600160a01b0381169033829003612f46576001600160601b0360a01b9160008051602061491c8339815191528184825416179055337f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228680a316905580f35b6040516353bb059b60e01b8152600490fd5b503461000e57602036600319011261000e57600435612f76816106c6565b612f7e6134ad565b6001600160a01b03168015612fec577ff73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4b80546001600160a01b031916821790556040519081527f11a3cf439fb225bfe74225716b6774765670ec1060e3796802e62139d69974da90602090a1005b604051633a247dd760e11b8152600490fd5b503461000e57600036600319011261000e5760008051602061491c833981519152546040516001600160a01b039091168152602090f35b9080601f8301121561000e5781602061055793359101612950565b503461000e57608036600319011261000e576001600160401b0360043581811161000e57613082903690600401613035565b60243582811161000e5761309a903690600401613035565b604435906130a7826106c6565b6064359284841161000e573660238501121561000e578360040135948511613127575b8460051b93604051946020966130e2888301886115e1565b86526024878701918301019136831161000e57602401905b82821061310e57505050610af49450614176565b878091833561311c816106c6565b8152019101906130fa565b61312f611574565b6130ca565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020526040902090565b6001600160a01b031660009081527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f36020526040902090565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902090565b90600182811c9216801561320f575b60208310146131f957565b634e487b7160e01b600052602260045260246000fd5b91607f16916131ee565b604051906000826000805160206148fc83398151915291825461323b816131df565b808452936001918083169081156132c15750600114613263575b5050610fa1925003836115e1565b600090815291507fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c075b8483106132a65750610fa193505081016020013880613255565b81935090816020925483858a0101520191019091859261328c565b91505060209250610fa194915060ff191682840152151560051b8201013880613255565b906132f8602092828151948592016104fe565b0190565b6000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604060002090565b808060011115613348575b604051636f96cda160e11b8152600490fd5b60008051602061481c83398151915254811015613336576000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260406000205490600160e01b8216613336575b81156133a3575090565b6000190190506133b2816132fc565b5490613399565b80600111159081613407575b816133ce575090565b90506000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052600160e01b604060002054161590565b60008051602061481c83398151915254811091506133c5565b1561342757565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b5190610fa182610f8a565b9081602091031261000e575161055781610f8a565b506040513d6000823e3d90fd5b60008051602061497c833981519152546001600160a01b031633036134ce57565b604051635fc483c560e01b8152600490fd5b60008051602061497c83398151915280546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b818110613541575050565b60008155600101613536565b90601f821161355a575050565b610fa1916000805160206148fc8339815191526000527fb419b910869863e04cf46157fa5c0d24c4d117703f8c345db068832fc4478c07906020601f840160051c830193106135b1575b601f0160051c0190613536565b90915081906135a4565b90601f82116135c8575050565b610fa19160008051602061493c8339815191526000527fd836579d48f9d8e7a31da50dbf64267a6df016a8579c60a6e9b83420fa1b0de7906020601f840160051c830193106135b157601f0160051c0190613536565b90601f821161362b575050565b610fa19160008051602061489c8339815191526000527f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb3906020601f840160051c830193106135b157601f0160051c0190613536565b90601f821161368e575050565b610fa19160008051602061487c8339815191526000527f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c906020601f840160051c830193106135b157601f0160051c0190613536565b908060209392818452848401376000828201840152601f01601f1916010190565b9160206105579381815201916136e4565b9190820180921161372357565b634e487b7160e01b600052601160045260246000fd5b5190610fa182611602565b65ffffffffffff81160361000e57565b5190610fa182613744565b5190610fa182611666565b908160c091031261000e576137f760a06040519260c084018481106001600160401b038211176137ff575b60405280516137a381611602565b845260208101516137b381613744565b602085015260408101516137c681613744565b604085015260608101516137d981611666565b606085015260808101516137ec81611666565b608085015201613480565b60a082015290565b613807611574565b613795565b60843590610fa182613744565b60a43590610fa182613744565b60c090602319011261000e576040519060c082018281106001600160401b038211176138b2575b6040528160243561385d81611602565b815260443561386b81613744565b602082015260643561387c81613744565b604082015260843561388d81611666565b606082015260a43561389e81611666565b608082015260a06138ad610f94565b910152565b6138ba611574565b61384d565b9035601e198236030181121561000e5701602081359101916001600160401b03821161000e57813603831361000e57565b60ff81160361000e57565b5190610fa1826138f0565b63ffffffff81160361000e57565b5190610fa182613906565b8091610100928391031261000e5760e06139c6916040519384018481106001600160401b038211176139ce575b60405261395881613739565b84526139666020820161375f565b602085015261397760408201613754565b604085015261398860608201613754565b6060850152613999608082016138fb565b60808501526139aa60a08201613914565b60a08501526139bb60c0820161375f565b60c085015201613480565b60e082015290565b6139d6611574565b61394c565b60c43590610fa1826138f0565b60e43590610fa182613906565b906101008092604319011261000e576040519182018281106001600160401b03821117613a83575b60405281613a29611616565b8152613a3361168d565b6020820152613a4061380c565b6040820152613a4d613819565b6060820152613a5a6139db565b6080820152613a676139e8565b60a0820152613a7461167f565b60c082015260e06138ad610fa3565b613a8b611574565b613a1d565b61010060e0610fa193959461012084019660018060a01b0316845269ffffffffffffffffffff815116602085015261ffff602082015116604085015265ffffffffffff6040820151166060850152613af76060820151608086019065ffffffffffff169052565b608081015160ff1660a085015260a081015163ffffffff1660c085015260c081015161ffff168483015201511515910152565b60008051602061497c833981519152546001600160a01b03919082163303613cfd575b600160ff613b5a8361316d565b541615150361154d576040516381bf9af360e01b81523060048201526001600160a01b03841660248201529116929060e081604481875afa908115613cf0575b600091613cc2575b5060008051602061491c833981519152548290613bc7906001600160a01b0316610a06565b3314613c77575062ffffff613be2602083015162ffffff1690565b1615613c655761219c60c082610b43613c0360a0613c0e96015161ffff1690565b61ffff1660a0870152565b823b1561000e57613c3992600092836040518096819582946309a7002f60e31b845260048401613de0565b03925af18015613c58575b613c4b5750565b80610aee610fa19261158b565b613c606134a0565b613c44565b604051634f4ca83d60e11b8152600490fd5b81925060c061219c91613cab6020613cbd9501613c97815162ffffff1690565b62ffffff811615610b585762ffffff169052565b610b43613c0360a083015161ffff1690565b613c0e565b613ce3915060e03d8111613ce9575b613cdb81836115e1565b810190613d33565b38613ba2565b503d613cd1565b613cf86134a0565b613b9a565b8160008051602061491c8339815191525416330315613b4d576040516359d9793760e01b8152600490fd5b5190610fa182611630565b908160e091031261000e57613dcb60c06040519260e084018481106001600160401b03821117613dd3575b6040528051613d6c81611602565b84526020810151613d7c81611623565b6020850152613d8d60408201613d28565b6040850152613d9e60608201613d28565b6060850152613daf60808201613d28565b6080850152613dc060a0820161375f565b60a08501520161375f565b60c082015290565b613ddb611574565b613d5e565b60e060c0610fa193959461010084019660018060a01b0316845269ffffffffffffffffffff815116602085015262ffffff602082015116604085015264ffffffffff80604083015116606086015280606083015116608086015260808201511660a0850152613e5960a08201518386019061ffff169052565b015161ffff16910152565b50634e487b7160e01b600052603260045260246000fd5b9190811015613e8c575b60051b0190565b613e94613e64565b613e85565b35610557816106c6565b680100000000000000008111613ef6575b6000805160206148dc83398151915290815490808355818110613ed657505050565b610fa19260005260008051602061483c8339815191529182019101613536565b613efe611574565b613eb4565b6001600160401b038211613f67575b613f1b82613ea3565b6000805160206148dc83398151915260005260005b828110613f3c57505050565b6001906020833593613f4d856106c6565b01928160008051602061483c833981519152015501613f30565b613f6f611574565b613f12565b90916040602092828482018583525201929160005b828110613f97575050505090565b9091929382806001928735613fab816106c6565b848060a01b03168152019501910192919092613f89565b6000527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604060002090815490565b9081602091031261000e575161055781610440565b6001600160a01b03918216815291166020820152604081019190915260806060820181905261055792910190610521565b3d15614065573d9061404b82612926565b9161405960405193846115e1565b82523d6000602084013e565b606090565b92602091614093936000604051809681958294630a85bd0160e11b9a8b85523360048601614009565b03926001600160a01b03165af1600091816140e3575b506140d5576140b661403a565b805190816140d0576040516368d2bf6b60e11b8152600490fd5b602001fd5b6001600160e01b0319161490565b61410591925060203d811161410c575b6140fd81836115e1565b810190613ff4565b90386140a9565b503d6140f3565b1561411a57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b91926000549360ff8560081c16159485809661430f575b80156142f8575b61419d90614113565b60ff198116600117600055856142e6575b5060008051602061499c833981519152549260ff8460081c1693846000146142dd5750303b155b15614272576141ea931594856142515761431c565b614234575b6141f557565b61420561ff001960005416600055565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1565b60008051602061499c833981519152805461ff00191690556141ef565b60008051602061499c833981519152805461ffff191661010117905561431c565b60405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608490fd5b60ff16156141d5565b61ffff191661010117600055386141ae565b50303b158015614194575060ff8116600114614194565b50600160ff82161061418d565b92919261433060ff60005460081c16613420565b60ff60008051602061499c8339815191525460081c16156144c35780516001600160401b0381116144b6575b60008051602061489c8339815191529161437f8261437a85546131df565b61361e565b60209081601f8411600114614415575092826143c1936143fd969361440299989660009261440a575b50508160011b916000199060031b1c1916179055614525565b6143d8600160008051602061481c83398151915255565b6143e061466f565b6143e86146fc565b6143f061466f565b6143f8614638565b61471c565b614680565b610fa161466f565b0151905038806143a8565b60008051602061489c8339815191526000529190601f1984167f933ecf8acb7824b680a8d16f3ff3db8864228d986aa4c2ebab1eeb2703b4beb3936000905b82821061449e575050936143fd969361440299989693600193836143c19810614485575b505050811b019055614525565b015160001960f88460031b161c19169055388080614478565b80600186978294978701518155019601940190614454565b6144be611574565b61435c565b60405162461bcd60e51b815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604482015273206973206e6f7420696e697469616c697a696e6760601b6064820152608490fd5b9081516001600160401b03811161462b575b60008051602061487c8339815191529061455a8161455584546131df565b613681565b602080601f831160011461459657508192939460009261458b575b50508160011b916000199060031b1c1916179055565b015190503880614575565b90601f198316956145d660008051602061487c8339815191526000527f617167b76dcc8247761fd21f427ad8ec3be6b3be203aed34e3aac08b4d31817c90565b926000905b888210614613575050836001959697106145fa575b505050811b019055565b015160001960f88460031b161c191690553880806145f0565b806001859682949686015181550195019301906145db565b614633611574565b614537565b61464960ff60005460081c16613420565b60017fd59f8a8c0d1463371c77782499276e5cbe466fd192ada543ceaea0a36604c1f255565b610fa160ff60005460081c16613420565b61469160ff60005460081c16613420565b303b6146eb5760008051602061491c83398151915280546001600160a01b0319166001600160a01b0392909216918217905560007f222c8e95a03c7aa95fc5d110485e0d38e767f07ab1ec878a6eac644ef1d831228180a3565b60405162dc149f60e41b8152600490fd5b61470d60ff60005460081c16613420565b303b6146eb57610fa1336134e0565b600061472e60ff825460081c16613420565b8151815b8181106147b15750508151916001600160401b0383116147a4575b61475683613ea3565b6020809101916000805160206148dc83398151915281525b83811061477b5750505050565b82516001600160a01b031660008051602061483c8339815191528201559181019160010161476e565b6147ac611574565b61474d565b835181101561480e575b600581901b84016020908101516001600160a01b031684527ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f3905260408320805460ff1916600190811790915501614732565b614816613e64565b6147bb56fe2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40b31d597aa596daba4fc1f9b7f2b079faea756475727b03e1452757e7f4209d05b3623c06c2ed11908644eb46053665cc2b67a32ab7b445094be7495b2530a9d42569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c432569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c42ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3eff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4b847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031ab3623c06c2ed11908644eb46053665cc2b67a32ab7b445094be7495b2530a9d3b847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a4031bb847c145db4703dd7415562b7f4e3aaa5b8cbca80b6c5135ed89cd14e7a40319f73863e3917595a7e67829ed60f0c51bf14c7a0d0de47c7b02a00abd48488e4aee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220caeee936923a6019a38cfad56e236586a1ee42df9535712f12856754c9a6dedf64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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