POL Price: $0.666843 (-6.61%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Token Holdings

Multichain Info

Transaction Hash
Method
Block
From
To
Mint Public651544232024-12-06 13:11:4011 mins ago1733490700IN
SeaDrop
1 POL0.0036888330.39703869
Mint Public651538792024-12-06 12:52:1831 mins ago1733489538IN
SeaDrop
1 POL0.0036444630.03144794
Mint Public651537962024-12-06 12:49:2234 mins ago1733489362IN
SeaDrop
0 POL0.0087425130.00280822
Mint Public651533922024-12-06 12:35:0448 mins ago1733488504IN
SeaDrop
0 POL0.0024883330.00773803
Mint Public651533772024-12-06 12:34:2449 mins ago1733488464IN
SeaDrop
0 POL0.060888230.00647329
Mint Public651530032024-12-06 12:21:071 hr ago1733487667IN
SeaDrop
0 POL0.0085541329.35631746
Mint Public651528232024-12-06 12:14:431 hr ago1733487283IN
SeaDrop
0 POL0.0041092730.0495611
Mint Public651520582024-12-06 11:47:281 hr ago1733485648IN
SeaDrop
1 POL0.0037429730.84321255
Mint Public651515022024-12-06 11:27:241 hr ago1733484444IN
SeaDrop
0 POL0.0027296532.91789354
Mint Public651514822024-12-06 11:26:411 hr ago1733484401IN
SeaDrop
0 POL0.0225629930.49638667
Mint Public651514702024-12-06 11:26:151 hr ago1733484375IN
SeaDrop
3 POL0.0038295830.58257803
Mint Public651514492024-12-06 11:25:311 hr ago1733484331IN
SeaDrop
6 POL0.0040006130.53441754
Mint Public651510352024-12-06 11:10:452 hrs ago1733483445IN
SeaDrop
2 POL0.0043539736.04642757
Mint Public651505152024-12-06 10:52:212 hrs ago1733482341IN
SeaDrop
1 POL0.0043371536.49117732
Mint Public651504262024-12-06 10:49:112 hrs ago1733482151IN
SeaDrop
0 POL0.0026467331.91798794
Mint Public651504052024-12-06 10:48:262 hrs ago1733482106IN
SeaDrop
0 POL0.0241782732.67960933
Mint Public651500722024-12-06 10:36:382 hrs ago1733481398IN
SeaDrop
0 POL0.0070012934.25206153
Mint Public651500522024-12-06 10:35:562 hrs ago1733481356IN
SeaDrop
50 POL0.0034905334.3033054
Mint Public651499482024-12-06 10:32:102 hrs ago1733481130IN
SeaDrop
50 POL0.0033737233.15533461
Mint Public651499212024-12-06 10:31:142 hrs ago1733481074IN
SeaDrop
50 POL0.0041680635.06851707
Mint Public651475522024-12-06 9:06:354 hrs ago1733475995IN
SeaDrop
0 POL0.0055813930.15745463
Mint Public651462212024-12-06 8:19:095 hrs ago1733473149IN
SeaDrop
0 POL0.010703550
Mint Public651459302024-12-06 8:08:515 hrs ago1733472531IN
SeaDrop
0 POL0.1519848330.82487729
Mint Public651453452024-12-06 7:47:375 hrs ago1733471257IN
SeaDrop
0 POL0.0627224730.88100869
Mint Public651441152024-12-06 7:03:456 hrs ago1733468625IN
SeaDrop
0 POL0.0049252331.55584965
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
651544232024-12-06 13:11:4011 mins ago1733490700
SeaDrop
0.9 POL
651544232024-12-06 13:11:4011 mins ago1733490700
SeaDrop
0.1 POL
651538792024-12-06 12:52:1831 mins ago1733489538
SeaDrop
0.9 POL
651538792024-12-06 12:52:1831 mins ago1733489538
SeaDrop
0.1 POL
651520582024-12-06 11:47:281 hr ago1733485648
SeaDrop
0.9 POL
651520582024-12-06 11:47:281 hr ago1733485648
SeaDrop
0.1 POL
651514702024-12-06 11:26:151 hr ago1733484375
SeaDrop
2.7 POL
651514702024-12-06 11:26:151 hr ago1733484375
SeaDrop
0.3 POL
651514492024-12-06 11:25:311 hr ago1733484331
SeaDrop
5.4 POL
651514492024-12-06 11:25:311 hr ago1733484331
SeaDrop
0.6 POL
651510352024-12-06 11:10:452 hrs ago1733483445
SeaDrop
1.8 POL
651510352024-12-06 11:10:452 hrs ago1733483445
SeaDrop
0.2 POL
651505152024-12-06 10:52:212 hrs ago1733482341
SeaDrop
0.9 POL
651505152024-12-06 10:52:212 hrs ago1733482341
SeaDrop
0.1 POL
651500522024-12-06 10:35:562 hrs ago1733481356
SeaDrop
45 POL
651500522024-12-06 10:35:562 hrs ago1733481356
SeaDrop
5 POL
651499482024-12-06 10:32:102 hrs ago1733481130
SeaDrop
45 POL
651499482024-12-06 10:32:102 hrs ago1733481130
SeaDrop
5 POL
651499212024-12-06 10:31:142 hrs ago1733481074
SeaDrop
45 POL
651499212024-12-06 10:31:142 hrs ago1733481074
SeaDrop
5 POL
651431842024-12-06 6:30:196 hrs ago1733466619
SeaDrop
0.9 POL
651431842024-12-06 6:30:196 hrs ago1733466619
SeaDrop
0.1 POL
651425662024-12-06 6:07:557 hrs ago1733465275
SeaDrop
0.9 POL
651425662024-12-06 6:07:557 hrs ago1733465275
SeaDrop
0.1 POL
651389422024-12-06 3:56:339 hrs ago1733457393
SeaDrop
0.9 POL
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SeaDrop

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

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

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

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

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

import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";

import { ReentrancyGuard } from "solmate/utils/ReentrancyGuard.sol";

import {
    IERC721
} from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol";

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

import {
    ECDSA
} from "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

import {
    MerkleProof
} from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol";

/**
 * @title  SeaDrop
 * @author James Wenzel (emo.eth)
 * @author Ryan Ghods (ralxz.eth)
 * @author Stephan Min (stephanm.eth)
 * @notice SeaDrop is a contract to help facilitate ERC721 token drops
 *         with functionality for public, allow list, server-side signed,
 *         and token-gated drops.
 */
contract SeaDrop is ISeaDrop, ReentrancyGuard {
    using ECDSA for bytes32;

    /// @notice Track the public drops.
    mapping(address => PublicDrop) private _publicDrops;

    /// @notice Track the creator payout addresses.
    mapping(address => address) private _creatorPayoutAddresses;

    /// @notice Track the allow list merkle roots.
    mapping(address => bytes32) private _allowListMerkleRoots;

    /// @notice Track the allowed fee recipients.
    mapping(address => mapping(address => bool)) private _allowedFeeRecipients;

    /// @notice Track the enumerated allowed fee recipients.
    mapping(address => address[]) private _enumeratedFeeRecipients;

    /// @notice Track the parameters for allowed signers for server-side drops.
    mapping(address => mapping(address => SignedMintValidationParams))
        private _signedMintValidationParams;

    /// @notice Track the signers for each server-side drop.
    mapping(address => address[]) private _enumeratedSigners;

    /// @notice Track the used signature digests.
    mapping(bytes32 => bool) private _usedDigests;

    /// @notice Track the allowed payers.
    mapping(address => mapping(address => bool)) private _allowedPayers;

    /// @notice Track the enumerated allowed payers.
    mapping(address => address[]) private _enumeratedPayers;

    /// @notice Track the token gated drop stages.
    mapping(address => mapping(address => TokenGatedDropStage))
        private _tokenGatedDrops;

    /// @notice Track the tokens for token gated drops.
    mapping(address => address[]) private _enumeratedTokenGatedTokens;

    /// @notice Track the redeemed token IDs for token gated drop stages.
    mapping(address => mapping(address => mapping(uint256 => bool)))
        private _tokenGatedRedeemed;

    /// @notice Internal constants for EIP-712: Typed structured
    ///         data hashing and signing
    bytes32 internal constant _SIGNED_MINT_TYPEHASH =
        // prettier-ignore
        keccak256(
             "SignedMint("
                "address nftContract,"
                "address minter,"
                "address feeRecipient,"
                "MintParams mintParams,"
                "uint256 salt"
            ")"
            "MintParams("
                "uint256 mintPrice,"
                "uint256 maxTotalMintableByWallet,"
                "uint256 startTime,"
                "uint256 endTime,"
                "uint256 dropStageIndex,"
                "uint256 maxTokenSupplyForStage,"
                "uint256 feeBps,"
                "bool restrictFeeRecipients"
            ")"
        );
    bytes32 internal constant _MINT_PARAMS_TYPEHASH =
        // prettier-ignore
        keccak256(
            "MintParams("
                "uint256 mintPrice,"
                "uint256 maxTotalMintableByWallet,"
                "uint256 startTime,"
                "uint256 endTime,"
                "uint256 dropStageIndex,"
                "uint256 maxTokenSupplyForStage,"
                "uint256 feeBps,"
                "bool restrictFeeRecipients"
            ")"
        );
    bytes32 internal constant _EIP_712_DOMAIN_TYPEHASH =
        // prettier-ignore
        keccak256(
            "EIP712Domain("
                "string name,"
                "string version,"
                "uint256 chainId,"
                "address verifyingContract"
            ")"
        );
    bytes32 internal constant _NAME_HASH = keccak256("SeaDrop");
    bytes32 internal constant _VERSION_HASH = keccak256("1.0");
    uint256 internal immutable _CHAIN_ID = block.chainid;
    bytes32 internal immutable _DOMAIN_SEPARATOR;

    /// @notice Constant for an unlimited `maxTokenSupplyForStage`.
    ///         Used in `mintPublic` where no `maxTokenSupplyForStage`
    ///         is stored in the `PublicDrop` struct.
    uint256 internal constant _UNLIMITED_MAX_TOKEN_SUPPLY_FOR_STAGE =
        type(uint256).max;

    /// @notice Constant for a public mint's `dropStageIndex`.
    ///         Used in `mintPublic` where no `dropStageIndex`
    ///         is stored in the `PublicDrop` struct.
    uint256 internal constant _PUBLIC_DROP_STAGE_INDEX = 0;

    /**
     * @notice Ensure only tokens implementing INonFungibleSeaDropToken can
     *         call the update methods.
     */
    modifier onlyINonFungibleSeaDropToken() virtual {
        if (
            !IERC165(msg.sender).supportsInterface(
                type(INonFungibleSeaDropToken).interfaceId
            )
        ) {
            revert OnlyINonFungibleSeaDropToken(msg.sender);
        }
        _;
    }

    /**
     * @notice Constructor for the contract deployment.
     */
    constructor() {
        // Derive the domain separator.
        _DOMAIN_SEPARATOR = _deriveDomainSeparator();
    }

    /**
     * @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 override {
        // Get the public drop data.
        PublicDrop memory publicDrop = _publicDrops[nftContract];

        // Ensure that the drop has started.
        _checkActive(publicDrop.startTime, publicDrop.endTime);

        // Put the mint price on the stack.
        uint256 mintPrice = publicDrop.mintPrice;

        // Validate payment is correct for number minted.
        _checkCorrectPayment(quantity, mintPrice);

        // Get the minter address.
        address minter = minterIfNotPayer != address(0)
            ? minterIfNotPayer
            : msg.sender;

        // Ensure the payer is allowed if not the minter.
        if (minter != msg.sender) {
            if (!_allowedPayers[nftContract][msg.sender]) {
                revert PayerNotAllowed();
            }
        }

        // Check that the minter is allowed to mint the desired quantity.
        _checkMintQuantity(
            nftContract,
            minter,
            quantity,
            publicDrop.maxTotalMintableByWallet,
            _UNLIMITED_MAX_TOKEN_SUPPLY_FOR_STAGE
        );

        // Check that the fee recipient is allowed if restricted.
        _checkFeeRecipientIsAllowed(
            nftContract,
            feeRecipient,
            publicDrop.restrictFeeRecipients
        );

        // Mint the token(s), split the payout, emit an event.
        _mintAndPay(
            nftContract,
            minter,
            quantity,
            mintPrice,
            _PUBLIC_DROP_STAGE_INDEX,
            publicDrop.feeBps,
            feeRecipient
        );
    }

    /**
     * @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 override {
        // Check that the drop stage is active.
        _checkActive(mintParams.startTime, mintParams.endTime);

        // Put the mint price on the stack.
        uint256 mintPrice = mintParams.mintPrice;

        // Validate payment is correct for number minted.
        _checkCorrectPayment(quantity, mintPrice);

        // Get the minter address.
        address minter = minterIfNotPayer != address(0)
            ? minterIfNotPayer
            : msg.sender;

        // Ensure the payer is allowed if not the minter.
        if (minter != msg.sender) {
            if (!_allowedPayers[nftContract][msg.sender]) {
                revert PayerNotAllowed();
            }
        }

        // Check that the minter is allowed to mint the desired quantity.
        _checkMintQuantity(
            nftContract,
            minter,
            quantity,
            mintParams.maxTotalMintableByWallet,
            mintParams.maxTokenSupplyForStage
        );

        // Check that the fee recipient is allowed if restricted.
        _checkFeeRecipientIsAllowed(
            nftContract,
            feeRecipient,
            mintParams.restrictFeeRecipients
        );

        // Verify the proof.
        if (
            !MerkleProof.verify(
                proof,
                _allowListMerkleRoots[nftContract],
                keccak256(abi.encode(minter, mintParams))
            )
        ) {
            revert InvalidProof();
        }

        // Mint the token(s), split the payout, emit an event.
        _mintAndPay(
            nftContract,
            minter,
            quantity,
            mintPrice,
            mintParams.dropStageIndex,
            mintParams.feeBps,
            feeRecipient
        );
    }

    /**
     * @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 salt 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 override {
        // Check that the drop stage is active.
        _checkActive(mintParams.startTime, mintParams.endTime);

        // Validate payment is correct for number minted.
        _checkCorrectPayment(quantity, mintParams.mintPrice);

        // Get the minter address.
        address minter = minterIfNotPayer != address(0)
            ? minterIfNotPayer
            : msg.sender;

        // Ensure the payer is allowed if not the minter.
        if (minter != msg.sender) {
            if (!_allowedPayers[nftContract][msg.sender]) {
                revert PayerNotAllowed();
            }
        }

        // Check that the minter is allowed to mint the desired quantity.
        _checkMintQuantity(
            nftContract,
            minter,
            quantity,
            mintParams.maxTotalMintableByWallet,
            mintParams.maxTokenSupplyForStage
        );

        // Check that the fee recipient is allowed if restricted.
        _checkFeeRecipientIsAllowed(
            nftContract,
            feeRecipient,
            mintParams.restrictFeeRecipients
        );

        // Validate the signature in a block scope to avoid "stack too deep".
        {
            // Get the digest to verify the EIP-712 signature.
            bytes32 digest = _getDigest(
                nftContract,
                minter,
                feeRecipient,
                mintParams,
                salt
            );

            // Ensure the digest has not already been used.
            if (_usedDigests[digest]) {
                revert SignatureAlreadyUsed();
            }

            // Mark the digest as used.
            _usedDigests[digest] = true;

            // Use the recover method to see what address was used to create
            // the signature on this data.
            // Note that if the digest doesn't exactly match what was signed we'll
            // get a random recovered address.
            address recoveredAddress = digest.recover(signature);
            _validateSignerAndParams(nftContract, mintParams, recoveredAddress);
        }

        // Mint the token(s), split the payout, emit an event.
        _mintAndPay(
            nftContract,
            minter,
            quantity,
            mintParams.mintPrice,
            mintParams.dropStageIndex,
            mintParams.feeBps,
            feeRecipient
        );
    }

    /**
     * @notice Enforce stored parameters for signed mints to mitigate
     *         the effects of a malicious signer.
     */
    function _validateSignerAndParams(
        address nftContract,
        MintParams memory mintParams,
        address signer
    ) internal view {
        SignedMintValidationParams
            memory signedMintValidationParams = _signedMintValidationParams[
                nftContract
            ][signer];

        // Check that SignedMintValidationParams have been initialized; if not,
        // this is an invalid signer.
        if (signedMintValidationParams.maxMaxTotalMintableByWallet == 0) {
            revert InvalidSignature(signer);
        }

        // Validate individual params.
        if (mintParams.mintPrice < signedMintValidationParams.minMintPrice) {
            revert InvalidSignedMintPrice(
                mintParams.mintPrice,
                signedMintValidationParams.minMintPrice
            );
        }
        if (
            mintParams.maxTotalMintableByWallet >
            signedMintValidationParams.maxMaxTotalMintableByWallet
        ) {
            revert InvalidSignedMaxTotalMintableByWallet(
                mintParams.maxTotalMintableByWallet,
                signedMintValidationParams.maxMaxTotalMintableByWallet
            );
        }
        if (mintParams.startTime < signedMintValidationParams.minStartTime) {
            revert InvalidSignedStartTime(
                mintParams.startTime,
                signedMintValidationParams.minStartTime
            );
        }
        if (mintParams.endTime > signedMintValidationParams.maxEndTime) {
            revert InvalidSignedEndTime(
                mintParams.endTime,
                signedMintValidationParams.maxEndTime
            );
        }
        if (
            mintParams.maxTokenSupplyForStage >
            signedMintValidationParams.maxMaxTokenSupplyForStage
        ) {
            revert InvalidSignedMaxTokenSupplyForStage(
                mintParams.maxTokenSupplyForStage,
                signedMintValidationParams.maxMaxTokenSupplyForStage
            );
        }
        if (mintParams.feeBps > signedMintValidationParams.maxFeeBps) {
            revert InvalidSignedFeeBps(
                mintParams.feeBps,
                signedMintValidationParams.maxFeeBps
            );
        }
        if (mintParams.feeBps < signedMintValidationParams.minFeeBps) {
            revert InvalidSignedFeeBps(
                mintParams.feeBps,
                signedMintValidationParams.minFeeBps
            );
        }
        if (!mintParams.restrictFeeRecipients) {
            revert SignedMintsMustRestrictFeeRecipients();
        }
    }

    /**
     * @notice Mint as an allowed token holder.
     *         This will mark the token ids 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 override {
        // Get the minter address.
        address minter = minterIfNotPayer != address(0)
            ? minterIfNotPayer
            : msg.sender;

        // Ensure the payer is allowed if not the minter.
        if (minter != msg.sender) {
            if (!_allowedPayers[nftContract][msg.sender]) {
                revert PayerNotAllowed();
            }
        }

        // Put the allowedNftToken on the stack for more efficient access.
        address allowedNftToken = mintParams.allowedNftToken;

        // Set the dropStage to a variable.
        TokenGatedDropStage memory dropStage = _tokenGatedDrops[nftContract][
            allowedNftToken
        ];

        // Validate that the dropStage is active.
        _checkActive(dropStage.startTime, dropStage.endTime);

        // Check that the fee recipient is allowed if restricted.
        _checkFeeRecipientIsAllowed(
            nftContract,
            feeRecipient,
            dropStage.restrictFeeRecipients
        );

        // Put the mint quantity on the stack for more efficient access.
        uint256 mintQuantity = mintParams.allowedNftTokenIds.length;

        // Validate payment is correct for number minted.
        _checkCorrectPayment(mintQuantity, dropStage.mintPrice);

        // Check that the minter is allowed to mint the desired quantity.
        _checkMintQuantity(
            nftContract,
            minter,
            mintQuantity,
            dropStage.maxTotalMintableByWallet,
            dropStage.maxTokenSupplyForStage
        );

        // Iterate through each allowedNftTokenId
        // to ensure it is not already redeemed.
        for (uint256 i = 0; i < mintQuantity; ) {
            // Put the tokenId on the stack.
            uint256 tokenId = mintParams.allowedNftTokenIds[i];

            // Check that the minter is the owner of the allowedNftTokenId.
            if (IERC721(allowedNftToken).ownerOf(tokenId) != minter) {
                revert TokenGatedNotTokenOwner(
                    nftContract,
                    allowedNftToken,
                    tokenId
                );
            }

            // Cache the storage pointer for cheaper access.
            mapping(uint256 => bool)
                storage redeemedTokenIds = _tokenGatedRedeemed[nftContract][
                    allowedNftToken
                ];

            // Check that the token id has not already been redeemed.
            if (redeemedTokenIds[tokenId]) {
                revert TokenGatedTokenIdAlreadyRedeemed(
                    nftContract,
                    allowedNftToken,
                    tokenId
                );
            }

            // Mark the token id as redeemed.
            redeemedTokenIds[tokenId] = true;

            unchecked {
                ++i;
            }
        }

        // Mint the token(s), split the payout, emit an event.
        _mintAndPay(
            nftContract,
            minter,
            mintQuantity,
            dropStage.mintPrice,
            dropStage.dropStageIndex,
            dropStage.feeBps,
            feeRecipient
        );
    }

    /**
     * @notice Check that the drop stage is active.
     *
     * @param startTime The drop stage start time.
     * @param endTime   The drop stage end time.
     */
    function _checkActive(uint256 startTime, uint256 endTime) internal view {
        if (block.timestamp < startTime || block.timestamp > endTime) {
            // Revert if the drop stage is not active.
            revert NotActive(block.timestamp, startTime, endTime);
        }
    }

    /**
     * @notice Check that the fee recipient is allowed.
     *
     * @param nftContract           The nft contract.
     * @param feeRecipient          The fee recipient.
     * @param restrictFeeRecipients If the fee recipients are restricted.
     */
    function _checkFeeRecipientIsAllowed(
        address nftContract,
        address feeRecipient,
        bool restrictFeeRecipients
    ) internal view {
        // Ensure the fee recipient is not the zero address.
        if (feeRecipient == address(0)) {
            revert FeeRecipientCannotBeZeroAddress();
        }

        // Revert if the fee recipient is restricted and not allowed.
        if (restrictFeeRecipients)
            if (!_allowedFeeRecipients[nftContract][feeRecipient]) {
                revert FeeRecipientNotAllowed();
            }
    }

    /**
     * @notice Check that the wallet is allowed to mint the desired quantity.
     *
     * @param nftContract              The nft contract.
     * @param minter                   The mint recipient.
     * @param quantity                 The number of tokens to mint.
     * @param maxTotalMintableByWallet The max allowed mints per wallet.
     * @param maxTokenSupplyForStage   The max token supply for the drop stage.
     */
    function _checkMintQuantity(
        address nftContract,
        address minter,
        uint256 quantity,
        uint256 maxTotalMintableByWallet,
        uint256 maxTokenSupplyForStage
    ) internal view {
        // Mint quantity of zero is not valid.
        if (quantity == 0) {
            revert MintQuantityCannotBeZero();
        }

        // Get the mint stats.
        (
            uint256 minterNumMinted,
            uint256 currentTotalSupply,
            uint256 maxSupply
        ) = INonFungibleSeaDropToken(nftContract).getMintStats(minter);

        // Ensure mint quantity doesn't exceed maxTotalMintableByWallet.
        if (quantity + minterNumMinted > maxTotalMintableByWallet) {
            revert MintQuantityExceedsMaxMintedPerWallet(
                quantity + minterNumMinted,
                maxTotalMintableByWallet
            );
        }

        // Ensure mint quantity doesn't exceed maxSupply.
        if (quantity + currentTotalSupply > maxSupply) {
            revert MintQuantityExceedsMaxSupply(
                quantity + currentTotalSupply,
                maxSupply
            );
        }

        // Ensure mint quantity doesn't exceed maxTokenSupplyForStage.
        if (quantity + currentTotalSupply > maxTokenSupplyForStage) {
            revert MintQuantityExceedsMaxTokenSupplyForStage(
                quantity + currentTotalSupply,
                maxTokenSupplyForStage
            );
        }
    }

    /**
     * @notice Revert if the payment is not the quantity times the mint price.
     *
     * @param quantity  The number of tokens to mint.
     * @param mintPrice The mint price per token.
     */
    function _checkCorrectPayment(uint256 quantity, uint256 mintPrice)
        internal
        view
    {
        // Revert if the tx's value doesn't match the total cost.
        if (msg.value != quantity * mintPrice) {
            revert IncorrectPayment(msg.value, quantity * mintPrice);
        }
    }

    /**
     * @notice Split the payment payout for the creator and fee recipient.
     *
     * @param nftContract  The nft contract.
     * @param feeRecipient The fee recipient.
     * @param feeBps       The fee basis points.
     */
    function _splitPayout(
        address nftContract,
        address feeRecipient,
        uint256 feeBps
    ) internal {
        // Revert if the fee basis points is greater than 10_000.
        if (feeBps > 10_000) {
            revert InvalidFeeBps(feeBps);
        }

        // Get the creator payout address.
        address creatorPayoutAddress = _creatorPayoutAddresses[nftContract];

        // Ensure the creator payout address is not the zero address.
        if (creatorPayoutAddress == address(0)) {
            revert CreatorPayoutAddressCannotBeZeroAddress();
        }

        // msg.value has already been validated by this point, so can use it directly.

        // If the fee is zero, just transfer to the creator and return.
        if (feeBps == 0) {
            SafeTransferLib.safeTransferETH(creatorPayoutAddress, msg.value);
            return;
        }

        // Get the fee amount.
        // Note that the fee amount is rounded down in favor of the creator.
        uint256 feeAmount = (msg.value * feeBps) / 10_000;

        // Get the creator payout amount. Fee amount is <= msg.value per above.
        uint256 payoutAmount;
        unchecked {
            payoutAmount = msg.value - feeAmount;
        }

        // Transfer the fee amount to the fee recipient.
        if (feeAmount > 0) {
            SafeTransferLib.safeTransferETH(feeRecipient, feeAmount);
        }

        // Transfer the creator payout amount to the creator.
        SafeTransferLib.safeTransferETH(creatorPayoutAddress, payoutAmount);
    }

    /**
     * @notice Mints a number of tokens, splits the payment,
     *         and emits an event.
     *
     * @param nftContract    The nft contract.
     * @param minter         The mint recipient.
     * @param quantity       The number of tokens to mint.
     * @param mintPrice      The mint price per token.
     * @param dropStageIndex The drop stage index.
     * @param feeBps         The fee basis points.
     * @param feeRecipient   The fee recipient.
     */
    function _mintAndPay(
        address nftContract,
        address minter,
        uint256 quantity,
        uint256 mintPrice,
        uint256 dropStageIndex,
        uint256 feeBps,
        address feeRecipient
    ) internal nonReentrant {
        // Mint the token(s).
        INonFungibleSeaDropToken(nftContract).mintSeaDrop(minter, quantity);

        if (mintPrice != 0) {
            // Split the payment between the creator and fee recipient.
            _splitPayout(nftContract, feeRecipient, feeBps);
        }

        // Emit an event for the mint.
        emit SeaDropMint(
            nftContract,
            minter,
            feeRecipient,
            msg.sender,
            quantity,
            mintPrice,
            feeBps,
            dropStageIndex
        );
    }

    /**
     * @dev Internal view function to get the EIP-712 domain separator. If the
     *      chainId matches the chainId set on deployment, the cached domain
     *      separator will be returned; otherwise, it will be derived from
     *      scratch.
     *
     * @return The domain separator.
     */
    function _domainSeparator() internal view returns (bytes32) {
        // prettier-ignore
        return block.chainid == _CHAIN_ID
            ? _DOMAIN_SEPARATOR
            : _deriveDomainSeparator();
    }

    /**
     * @dev Internal view function to derive the EIP-712 domain separator.
     *
     * @return The derived domain separator.
     */
    function _deriveDomainSeparator() internal view returns (bytes32) {
        // prettier-ignore
        return keccak256(
            abi.encode(
                _EIP_712_DOMAIN_TYPEHASH,
                _NAME_HASH,
                _VERSION_HASH,
                block.chainid,
                address(this)
            )
        );
    }

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

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

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

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

    /**
     * @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)
    {
        return _enumeratedFeeRecipients[nftContract];
    }

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

    /**
     * @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)
    {
        return _signedMintValidationParams[nftContract][signer];
    }

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

    /**
     * @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)
    {
        return _allowedPayers[nftContract][payer];
    }

    /**
     * @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)
    {
        return _enumeratedTokenGatedTokens[nftContract];
    }

    /**
     * @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)
    {
        return _tokenGatedDrops[nftContract][allowedNftToken];
    }

    /**
     * @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) {
        return
            _tokenGatedRedeemed[nftContract][allowedNftToken][
                allowedNftTokenId
            ];
    }

    /**
     * @notice Emits an event to notify update of the drop URI.
     *
     * @param dropURI The new drop URI.
     */
    function updateDropURI(string calldata dropURI)
        external
        onlyINonFungibleSeaDropToken
    {
        // Emit an event with the update.
        emit DropURIUpdated(msg.sender, dropURI);
    }

    /**
     * @notice Updates the public drop for the nft contract and emits an event.
     *
     * @param publicDrop The public drop data.
     */
    function updatePublicDrop(PublicDrop calldata publicDrop)
        external
        override
        onlyINonFungibleSeaDropToken
    {
        // Revert if the fee basis points is greater than 10_000.
        if (publicDrop.feeBps > 10_000) {
            revert InvalidFeeBps(publicDrop.feeBps);
        }

        // Set the public drop data.
        _publicDrops[msg.sender] = publicDrop;

        // Emit an event with the update.
        emit PublicDropUpdated(msg.sender, publicDrop);
    }

    /**
     * @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
        override
        onlyINonFungibleSeaDropToken
    {
        // Track the previous root.
        bytes32 prevRoot = _allowListMerkleRoots[msg.sender];

        // Update the merkle root.
        _allowListMerkleRoots[msg.sender] = allowListData.merkleRoot;

        // Emit an event with the update.
        emit AllowListUpdated(
            msg.sender,
            prevRoot,
            allowListData.merkleRoot,
            allowListData.publicKeyURIs,
            allowListData.allowListURI
        );
    }

    /**
     * @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 override onlyINonFungibleSeaDropToken {
        // Ensure the allowedNftToken is not the zero address.
        if (allowedNftToken == address(0)) {
            revert TokenGatedDropAllowedNftTokenCannotBeZeroAddress();
        }

        // Ensure the allowedNftToken cannot be the drop token itself.
        if (allowedNftToken == msg.sender) {
            revert TokenGatedDropAllowedNftTokenCannotBeDropToken();
        }

        // Revert if the fee basis points is greater than 10_000.
        if (dropStage.feeBps > 10_000) {
            revert InvalidFeeBps(dropStage.feeBps);
        }

        // Use maxTotalMintableByWallet != 0 as a signal that this update should
        // add or update the drop stage, otherwise we will be removing.
        bool addOrUpdateDropStage = dropStage.maxTotalMintableByWallet != 0;

        // Get pointers to the token gated drop data and enumerated addresses.
        TokenGatedDropStage storage existingDropStageData = _tokenGatedDrops[
            msg.sender
        ][allowedNftToken];
        address[] storage enumeratedTokens = _enumeratedTokenGatedTokens[
            msg.sender
        ];

        // Stage struct packs to a single slot, so load it
        // as a uint256; if it is 0, it is empty.
        bool dropStageDoesNotExist;
        assembly {
            dropStageDoesNotExist := iszero(sload(existingDropStageData.slot))
        }

        if (addOrUpdateDropStage) {
            _tokenGatedDrops[msg.sender][allowedNftToken] = dropStage;
            // Add to enumeration if it does not exist already.
            if (dropStageDoesNotExist) {
                enumeratedTokens.push(allowedNftToken);
            }
        } else {
            // Check we are not deleting a drop stage that does not exist.
            if (dropStageDoesNotExist) {
                revert TokenGatedDropStageNotPresent();
            }
            // Clear storage slot and remove from enumeration.
            delete _tokenGatedDrops[msg.sender][allowedNftToken];
            _removeFromEnumeration(allowedNftToken, enumeratedTokens);
        }

        // Emit an event with the update.
        emit TokenGatedDropStageUpdated(msg.sender, allowedNftToken, dropStage);
    }

    /**
     * @notice Updates the creator payout address and emits an event.
     *
     * @param _payoutAddress The creator payout address.
     */
    function updateCreatorPayoutAddress(address _payoutAddress)
        external
        onlyINonFungibleSeaDropToken
    {
        if (_payoutAddress == address(0)) {
            revert CreatorPayoutAddressCannotBeZeroAddress();
        }
        // Set the creator payout address.
        _creatorPayoutAddresses[msg.sender] = _payoutAddress;

        // Emit an event with the update.
        emit CreatorPayoutAddressUpdated(msg.sender, _payoutAddress);
    }

    /**
     * @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
        onlyINonFungibleSeaDropToken
    {
        if (feeRecipient == address(0)) {
            revert FeeRecipientCannotBeZeroAddress();
        }

        // Track the enumerated storage.
        address[] storage enumeratedStorage = _enumeratedFeeRecipients[
            msg.sender
        ];
        mapping(address => bool)
            storage feeRecipientsMap = _allowedFeeRecipients[msg.sender];

        if (allowed) {
            if (feeRecipientsMap[feeRecipient]) {
                revert DuplicateFeeRecipient();
            }
            feeRecipientsMap[feeRecipient] = true;
            enumeratedStorage.push(feeRecipient);
        } else {
            if (!feeRecipientsMap[feeRecipient]) {
                revert FeeRecipientNotPresent();
            }
            delete _allowedFeeRecipients[msg.sender][feeRecipient];
            _removeFromEnumeration(feeRecipient, enumeratedStorage);
        }

        // Emit an event with the update.
        emit AllowedFeeRecipientUpdated(msg.sender, feeRecipient, allowed);
    }

    /**
     * @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 onlyINonFungibleSeaDropToken {
        if (signer == address(0)) {
            revert SignerCannotBeZeroAddress();
        }

        if (signedMintValidationParams.minFeeBps > 10_000) {
            revert InvalidFeeBps(signedMintValidationParams.minFeeBps);
        }
        if (signedMintValidationParams.maxFeeBps > 10_000) {
            revert InvalidFeeBps(signedMintValidationParams.maxFeeBps);
        }

        // Track the enumerated storage.
        address[] storage enumeratedStorage = _enumeratedSigners[msg.sender];
        mapping(address => SignedMintValidationParams)
            storage signedMintValidationParamsMap = _signedMintValidationParams[
                msg.sender
            ];

        SignedMintValidationParams
            storage existingSignedMintValidationParams = signedMintValidationParamsMap[
                signer
            ];

        bool signedMintValidationParamsDoNotExist;
        assembly {
            signedMintValidationParamsDoNotExist := iszero(
                sload(existingSignedMintValidationParams.slot)
            )
        }
        // Use maxMaxTotalMintableByWallet as sentry for add/update or delete.
        bool addOrUpdate = signedMintValidationParams
            .maxMaxTotalMintableByWallet > 0;

        if (addOrUpdate) {
            signedMintValidationParamsMap[signer] = signedMintValidationParams;
            if (signedMintValidationParamsDoNotExist) {
                enumeratedStorage.push(signer);
            }
        } else {
            if (
                existingSignedMintValidationParams
                    .maxMaxTotalMintableByWallet == 0
            ) {
                revert SignerNotPresent();
            }
            delete _signedMintValidationParams[msg.sender][signer];
            _removeFromEnumeration(signer, enumeratedStorage);
        }

        // Emit an event with the update.
        emit SignedMintValidationParamsUpdated(
            msg.sender,
            signer,
            signedMintValidationParams
        );
    }

    /**
     * @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
        onlyINonFungibleSeaDropToken
    {
        if (payer == address(0)) {
            revert PayerCannotBeZeroAddress();
        }

        // Track the enumerated storage.
        address[] storage enumeratedStorage = _enumeratedPayers[msg.sender];
        mapping(address => bool) storage payersMap = _allowedPayers[msg.sender];

        if (allowed) {
            if (payersMap[payer]) {
                revert DuplicatePayer();
            }
            payersMap[payer] = true;
            enumeratedStorage.push(payer);
        } else {
            if (!payersMap[payer]) {
                revert PayerNotPresent();
            }
            delete _allowedPayers[msg.sender][payer];
            _removeFromEnumeration(payer, enumeratedStorage);
        }

        // Emit an event with the update.
        emit PayerUpdated(msg.sender, payer, allowed);
    }

    /**
     * @notice Remove an address from a supplied enumeration.
     *
     * @param toRemove    The address to remove.
     * @param enumeration The enumerated addresses to parse.
     */
    function _removeFromEnumeration(
        address toRemove,
        address[] storage enumeration
    ) internal {
        // Cache the length.
        uint256 enumerationLength = enumeration.length;
        for (uint256 i = 0; i < enumerationLength; ) {
            // Check if the enumerated element is the one we are deleting.
            if (enumeration[i] == toRemove) {
                // Swap with the last element.
                enumeration[i] = enumeration[enumerationLength - 1];
                // Delete the (now duplicated) last element.
                enumeration.pop();
                // Exit the loop.
                break;
            }
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @notice Verify an EIP-712 signature by recreating the data structure
     *         that we signed on the client side, and then using that to recover
     *         the address that signed the signature for this data.
     *
     * @param nftContract  The nft contract.
     * @param minter       The mint recipient.
     * @param feeRecipient The fee recipient.
     * @param mintParams   The mint params.
     * @param salt         The salt for the signed mint.
     */
    function _getDigest(
        address nftContract,
        address minter,
        address feeRecipient,
        MintParams memory mintParams,
        uint256 salt
    ) internal view returns (bytes32 digest) {
        bytes32 mintParamsHashStruct = keccak256(
            abi.encode(
                _MINT_PARAMS_TYPEHASH,
                mintParams.mintPrice,
                mintParams.maxTotalMintableByWallet,
                mintParams.startTime,
                mintParams.endTime,
                mintParams.dropStageIndex,
                mintParams.maxTokenSupplyForStage,
                mintParams.feeBps,
                mintParams.restrictFeeRecipients
            )
        );
        digest = keccak256(
            bytes.concat(
                bytes2(0x1901),
                _domainSeparator(),
                keccak256(
                    abi.encode(
                        _SIGNED_MINT_TYPEHASH,
                        nftContract,
                        minter,
                        feeRecipient,
                        mintParamsHashStruct,
                        salt
                    )
                )
            )
        );
    }
}

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

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

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

interface ISeaDrop is SeaDropErrorsAndEvents {
    /**
     * @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 3 of 15 : INonFungibleSeaDropToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

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

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

interface INonFungibleSeaDropToken is ISeaDropTokenContractMetadata, IERC165 {
    /**
     * @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 4 of 15 : SeaDropStructs.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 5 of 15 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 6 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @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 ReentrancyGuard {
    uint256 private locked = 1;

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

        locked = 2;

        _;

        locked = 1;
    }
}

File 7 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 9 of 15 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 10 of 15 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 11 of 15 : SeaDropErrorsAndEvents.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

interface SeaDropErrorsAndEvents {
    /**
     * @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 12 of 15 : ISeaDropTokenContractMetadata.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface ISeaDropTokenContractMetadata {
    /**
     * @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 13 of 15 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 14 of 15 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 15 of 15 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Settings
{
  "remappings": [
    "ERC721A/=lib/ERC721A/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "murky/=lib/murky/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "seadrop/=src/",
    "solmate/=lib/solmate/src/",
    "utility-contracts/=lib/utility-contracts/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CreatorPayoutAddressCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"DuplicateFeeRecipient","type":"error"},{"inputs":[],"name":"DuplicatePayer","type":"error"},{"inputs":[],"name":"FeeRecipientCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"FeeRecipientNotAllowed","type":"error"},{"inputs":[],"name":"FeeRecipientNotPresent","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"want","type":"uint256"}],"name":"IncorrectPayment","type":"error"},{"inputs":[{"internalType":"uint256","name":"feeBps","type":"uint256"}],"name":"InvalidFeeBps","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[{"internalType":"address","name":"recoveredSigner","type":"address"}],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"InvalidSignedEndTime","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"minimumOrMaximum","type":"uint256"}],"name":"InvalidSignedFeeBps","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"InvalidSignedMaxTokenSupplyForStage","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"InvalidSignedMaxTotalMintableByWallet","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"InvalidSignedMintPrice","type":"error"},{"inputs":[{"internalType":"uint256","name":"got","type":"uint256"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"InvalidSignedStartTime","type":"error"},{"inputs":[],"name":"MintQuantityCannotBeZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"allowed","type":"uint256"}],"name":"MintQuantityExceedsMaxMintedPerWallet","type":"error"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"MintQuantityExceedsMaxSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"maxTokenSupplyForStage","type":"uint256"}],"name":"MintQuantityExceedsMaxTokenSupplyForStage","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"NotActive","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"OnlyINonFungibleSeaDropToken","type":"error"},{"inputs":[],"name":"PayerCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"PayerNotAllowed","type":"error"},{"inputs":[],"name":"PayerNotPresent","type":"error"},{"inputs":[],"name":"SignatureAlreadyUsed","type":"error"},{"inputs":[],"name":"SignedMintsMustRestrictFeeRecipients","type":"error"},{"inputs":[],"name":"SignerCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"SignerNotPresent","type":"error"},{"inputs":[],"name":"TokenGatedDropAllowedNftTokenCannotBeDropToken","type":"error"},{"inputs":[],"name":"TokenGatedDropAllowedNftTokenCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"TokenGatedDropStageNotPresent","type":"error"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"},{"internalType":"uint256","name":"allowedNftTokenId","type":"uint256"}],"name":"TokenGatedNotTokenOwner","type":"error"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"},{"internalType":"uint256","name":"allowedNftTokenId","type":"uint256"}],"name":"TokenGatedTokenIdAlreadyRedeemed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"bytes32","name":"previousMerkleRoot","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"},{"indexed":false,"internalType":"string[]","name":"publicKeyURI","type":"string[]"},{"indexed":false,"internalType":"string","name":"allowListURI","type":"string"}],"name":"AllowListUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"address","name":"feeRecipient","type":"address"},{"indexed":true,"internalType":"bool","name":"allowed","type":"bool"}],"name":"AllowedFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"address","name":"newPayoutAddress","type":"address"}],"name":"CreatorPayoutAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":false,"internalType":"string","name":"newDropURI","type":"string"}],"name":"DropURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":true,"internalType":"bool","name":"allowed","type":"bool"}],"name":"PayerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","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"}],"indexed":false,"internalType":"struct PublicDrop","name":"publicDrop","type":"tuple"}],"name":"PublicDropUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"address","name":"feeRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantityMinted","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unitMintPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeBps","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dropStageIndex","type":"uint256"}],"name":"SeaDropMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"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"}],"indexed":false,"internalType":"struct SignedMintValidationParams","name":"signedMintValidationParams","type":"tuple"}],"name":"SignedMintValidationParamsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftContract","type":"address"},{"indexed":true,"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"}],"indexed":false,"internalType":"struct TokenGatedDropStage","name":"dropStage","type":"tuple"}],"name":"TokenGatedDropStageUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getAllowListMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getAllowedFeeRecipients","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"},{"internalType":"uint256","name":"allowedNftTokenId","type":"uint256"}],"name":"getAllowedNftTokenIdIsRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getCreatorPayoutAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"getFeeRecipientIsAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"payer","type":"address"}],"name":"getPayerIsAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getPayers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getPublicDrop","outputs":[{"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":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"name":"getSignedMintValidationParams","outputs":[{"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":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getSigners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"}],"name":"getTokenGatedAllowedTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"}],"name":"getTokenGatedDrop","outputs":[{"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":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"address","name":"minterIfNotPayer","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"components":[{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"maxTotalMintableByWallet","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"dropStageIndex","type":"uint256"},{"internalType":"uint256","name":"maxTokenSupplyForStage","type":"uint256"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct MintParams","name":"mintParams","type":"tuple"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintAllowList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"address","name":"minterIfNotPayer","type":"address"},{"components":[{"internalType":"address","name":"allowedNftToken","type":"address"},{"internalType":"uint256[]","name":"allowedNftTokenIds","type":"uint256[]"}],"internalType":"struct TokenGatedMintParams","name":"mintParams","type":"tuple"}],"name":"mintAllowedTokenHolder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"address","name":"minterIfNotPayer","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nftContract","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"address","name":"minterIfNotPayer","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"components":[{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"maxTotalMintableByWallet","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"dropStageIndex","type":"uint256"},{"internalType":"uint256","name":"maxTokenSupplyForStage","type":"uint256"},{"internalType":"uint256","name":"feeBps","type":"uint256"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct MintParams","name":"mintParams","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintSigned","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"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":"feeRecipient","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updateAllowedFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_payoutAddress","type":"address"}],"name":"updateCreatorPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"dropURI","type":"string"}],"name":"updateDropURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"payer","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updatePayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"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":"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"}]

60c060405260016000554660805234801561001957600080fd5b506100c2604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f752a02269614d51d9b7bd0a2f05cf03e553ce6be8b487650a6a2a4990208d804918101919091527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b360608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60a05260805160a051615259620000eb60003960006139350152600061386001526152596000f3fe60806040526004361061018b5760003560e01c80637c35b982116100d657806399eb900f1161007f578063e583141d11610059578063e583141d14610884578063ebb4a55f146108da578063fd9ab22a146108fa57600080fd5b806399eb900f146106a2578063b957d0cb146106b5578063bc6a629c146106d557600080fd5b806381bf9af3116100b057806381bf9af31461043057806388aa3d37146106255780638e7d1e431461068257600080fd5b80637c35b982146103d05780637e3ba6af146103f05780637f2a5cca1461041057600080fd5b806332bf11f5116101385780634d380178116101125780634d380178146103255780635cb3c4d31461034557806368632274146103b057600080fd5b806332bf11f5146102ae5780634300a4e6146102ff5780634b61cd6f1461031257600080fd5b8063161ac21f11610169578063161ac21f146102085780632db526eb1461021b578063322e75d11461024857600080fd5b806301308e65146101905780630b0e8a6e146101b257806312738db8146101e8575b600080fd5b34801561019c57600080fd5b506101b06101ab366004613ce8565b61091a565b005b3480156101be57600080fd5b506101d26101cd366004613d22565b610aaf565b6040516101df9190613d5b565b60405180910390f35b3480156101f457600080fd5b506101b0610203366004613e01565b610c41565b6101b0610216366004613e1e565b610dda565b34801561022757600080fd5b5061023b610236366004613e01565b610ff9565b6040516101df9190613e6f565b34801561025457600080fd5b5061029e610263366004613d22565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60405190151581526020016101df565b3480156102ba57600080fd5b506102f16102c9366004613e01565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6040519081526020016101df565b6101b061030d366004613edc565b611089565b6101b0610320366004613fe9565b611266565b34801561033157600080fd5b506101b061034036600461408c565b611471565b34801561035157600080fd5b5061038b610360366004613e01565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600260205260409020541690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101df565b3480156103bc57600080fd5b5061023b6103cb366004613e01565b6117cf565b3480156103dc57600080fd5b5061023b6103eb366004613e01565b61185d565b3480156103fc57600080fd5b5061023b61040b366004613e01565b6118eb565b34801561041c57600080fd5b506101b061042b36600461410a565b611979565b34801561043c57600080fd5b506105a561044b366004613d22565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091525073ffffffffffffffffffffffffffffffffffffffff9182166000908152600660209081526040808320939094168252918252829020825160e081018452905469ffffffffffffffffffff811682526a0100000000000000000000810462ffffff16928201929092526d0100000000000000000000000000820464ffffffffff90811693820193909352720100000000000000000000000000000000000082048316606082015277010000000000000000000000000000000000000000000000820490921660808301527c0100000000000000000000000000000000000000000000000000000000810461ffff90811660a08401527e010000000000000000000000000000000000000000000000000000000000009091041660c082015290565b6040516101df9190600060e08201905069ffffffffffffffffffff835116825262ffffff6020840151166020830152604083015164ffffffffff8082166040850152806060860151166060850152806080860151166080850152505060a083015161ffff80821660a08501528060c08601511660c0850152505092915050565b34801561063157600080fd5b5061029e610640366004614138565b73ffffffffffffffffffffffffffffffffffffffff9283166000908152600d602090815260408083209490951682529283528381209181529152205460ff1690565b34801561068e57600080fd5b506101b061069d36600461410a565b611cae565b6101b06106b0366004614179565b611fe3565b3480156106c157600080fd5b506101b06106d03660046141f3565b6124a3565b3480156106e157600080fd5b506108126106f0366004613e01565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091525073ffffffffffffffffffffffffffffffffffffffff16600090815260016020908152604091829020825160c081018452905469ffffffffffffffffffff8116825265ffffffffffff6a0100000000000000000000820481169383019390935270010000000000000000000000000000000081049092169281019290925261ffff7601000000000000000000000000000000000000000000008204811660608401527801000000000000000000000000000000000000000000000000820416608083015260ff7a01000000000000000000000000000000000000000000000000000090910416151560a082015290565b6040516101df9190600060c08201905069ffffffffffffffffffff8351168252602083015165ffffffffffff80821660208501528060408601511660408501525050606083015161ffff8082166060850152806080860151166080850152505060a0830151151560a083015292915050565b34801561089057600080fd5b5061029e61089f366004613d22565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260096020908152604080832093909416825291909152205460ff1690565b3480156108e657600080fd5b506101b06108f5366004614235565b6125c7565b34801561090657600080fd5b506101b0610915366004614270565b61270e565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b291906142a7565b6109ef576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b612710610a0260a08301608084016142df565b61ffff161115610a5557610a1c60a08201608083016142df565b6040517f3329f93200000000000000000000000000000000000000000000000000000000815261ffff90911660048201526024016109e6565b3360009081526001602052604090208190610a70828261434f565b505060405133907f3e30d8e1f739ea4795c481b21c23f905e938b80339305f3508e43c558e5dead390610aa4908490614551565b60405180910390a250565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101919091525073ffffffffffffffffffffffffffffffffffffffff8083166000908152600b60209081526040808320938516835292815290829020825161010081018452905469ffffffffffffffffffff8116825261ffff6a0100000000000000000000820481169383019390935265ffffffffffff6c01000000000000000000000000820481169483019490945272010000000000000000000000000000000000008104909316606082015260ff780100000000000000000000000000000000000000000000000084048116608083015263ffffffff79010000000000000000000000000000000000000000000000000085041660a08301527d010000000000000000000000000000000000000000000000000000000000840490921660c08201527f010000000000000000000000000000000000000000000000000000000000000090920416151560e08201525b92915050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd991906142a7565b610d11576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8116610d5e576040517f3f00976900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917f0c69f21751e800ea5960436c9a94370c7adbf54c733a20a025293fbbe8f1625291a350565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604091829020825160c081018452905469ffffffffffffffffffff8116825265ffffffffffff6a01000000000000000000008204811693830184905270010000000000000000000000000000000082041693820184905261ffff7601000000000000000000000000000000000000000000008204811660608401527801000000000000000000000000000000000000000000000000820416608083015260ff7a01000000000000000000000000000000000000000000000000000090910416151560a082015291610ece9190612a86565b805169ffffffffffffffffffff16610ee68382612ade565b600073ffffffffffffffffffffffffffffffffffffffff8516610f095733610f0b565b845b905073ffffffffffffffffffffffffffffffffffffffff81163314610f945773ffffffffffffffffffffffffffffffffffffffff8716600090815260096020908152604080832033845290915290205460ff16610f94576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc9878286866060015161ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612b34565b610fd887878560a00151612d15565b610ff0878286856000886080015161ffff168c612dd9565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815260409182902080548351818402810184019094528084526060939283018282801561107d57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611052575b50505050509050919050565b61109b83604001358460600135612a86565b82356110a78582612ade565b600073ffffffffffffffffffffffffffffffffffffffff87166110ca57336110cc565b865b905073ffffffffffffffffffffffffffffffffffffffff811633146111555773ffffffffffffffffffffffffffffffffffffffff8916600090815260096020908152604080832033845290915290205460ff16611155576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61116a89828888602001358960a00135612b34565b6111858989611180610100890160e08a016145eb565b612d15565b61120e848480806020026020016040519081016040528093929190818152602001838360200280828437600092018290525073ffffffffffffffffffffffffffffffffffffffff8f168152600360209081526040918290205491519194506111f393508792508b9101614608565b60405160208183030381529060405280519060200120612f62565b611244576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61125b8982888589608001358a60c001358e612dd9565b505050505050505050565b61127884604001358560600135612a86565b611283858535612ade565b600073ffffffffffffffffffffffffffffffffffffffff87166112a657336112a8565b865b905073ffffffffffffffffffffffffffffffffffffffff811633146113315773ffffffffffffffffffffffffffffffffffffffff8916600090815260096020908152604080832033845290915290205460ff16611331576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61134689828888602001358960a00135612b34565b61135c8989611180610100890160e08a016145eb565b60006113798a838b611373368b90038b018b61468c565b89612f78565b60008181526008602052604090205490915060ff16156113c5576040517f900bb2c900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260086020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558051601f870183900483028101830190915285815261143b918790879081908401838280828437600092019190915250869392505061313c9050565b90506114568b611450368a90038a018a61468c565b83613160565b5061125b9050898288883560808a013560c08b01358e612dd9565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150991906142a7565b611541576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff821661158e576040517fcfb6108a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127106115a160c0830160a084016142df565b61ffff1611156115bb57610a1c60c0820160a083016142df565b6127106115ce60e0830160c084016142df565b61ffff1611156115e857610a1c60e0820160c083016142df565b3360009081526007602090815260408083206006835281842073ffffffffffffffffffffffffffffffffffffffff871685528084528285208054929591949093921592829161163b918901908901614758565b62ffffff1611905080156116d85773ffffffffffffffffffffffffffffffffffffffff87166000908152602085905260409020869061167a8282614795565b505081156116d35784546001810186556000868152602090200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89161790555b611761565b82546a0100000000000000000000900462ffffff16600003611726576040517fb40637e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8b16845290915281205561176187866135b3565b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fcaeb4009c05208df426d15ff50b608287b05d21dee1f790552ea451a540a7be0886040516117be91906149de565b60405180910390a350505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526007602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa1580156119ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1191906142a7565b611a49576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216611a96576040517fd34468bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600a6020908152604080832060099092529091208215611ba25773ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff1615611b16576040517fd48fd2e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416600081815260208381526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558554908101865585835291200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055611c61565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff16611c01576040517f4cc1171300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff88168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611c6184836135b3565b6040518315159073ffffffffffffffffffffffffffffffffffffffff86169033907f55a5cfa4bc68ffb9d833b75bf93f6d9c9aadc558dbfa587a9b5bb0ea7d5c38a390600090a450505050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015611d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4691906142a7565b611d7e576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216611dcb576040517f5136e8d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260056020908152604080832060049092529091208215611ed75773ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff1615611e4b576040517f798701ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416600081815260208381526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558554908101865585835291200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055611f96565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff16611f36576040517f0998fbbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff88168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611f9684836135b3565b6040518315159073ffffffffffffffffffffffffffffffffffffffff86169033907f6486c31f9d664e241acf94ec2541d328f6b9e97257ae16a1d887f296f879719f90600090a450505050565b600073ffffffffffffffffffffffffffffffffffffffff83166120065733612008565b825b905073ffffffffffffffffffffffffffffffffffffffff811633146120915773ffffffffffffffffffffffffffffffffffffffff8516600090815260096020908152604080832033845290915290205460ff16612091576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006120a06020840184613e01565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600b60209081526040808320938516835292815290829020825161010081018452905469ffffffffffffffffffff8116825261ffff6a0100000000000000000000820481169383019390935265ffffffffffff6c010000000000000000000000008204811694830185905272010000000000000000000000000000000000008204166060830181905260ff780100000000000000000000000000000000000000000000000083048116608085015263ffffffff79010000000000000000000000000000000000000000000000000084041660a08501527d010000000000000000000000000000000000000000000000000000000000830490941660c08401527f0100000000000000000000000000000000000000000000000000000000000000909104909216151560e08201529293506121f79190612a86565b61220687878360e00151612d15565b60006122156020860186614a8e565b9050905061223381836000015169ffffffffffffffffffff16612ade565b612252888583856020015161ffff168660a0015163ffffffff16612b34565b60005b8181101561246a57600061226c6020880188614a8e565b8381811061227c5761227c614af6565b9050602002013590508573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016122d791815260200190565b602060405180830381865afa1580156122f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123189190614b25565b73ffffffffffffffffffffffffffffffffffffffff161461238c576040517fda8c7bc700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808c16600483015286166024820152604481018290526064016109e6565b73ffffffffffffffffffffffffffffffffffffffff808b166000908152600d602090815260408083209389168352928152828220848352908190529190205460ff161561242c576040517fa93f299b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808d16600483015287166024820152604481018390526064016109e6565b60009182526020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915501612255565b50612499888583856000015169ffffffffffffffffffff16866080015160ff168760c0015161ffff168d612dd9565b5050505050505050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015612517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253b91906142a7565b612573576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b3373ffffffffffffffffffffffffffffffffffffffff167fa0295608d25b3033c2e2c41cbac8746c2d08767bcfde6d47fae1ed7ba1d3215083836040516125bb929190614b8b565b60405180910390a25050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa15801561263b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265f91906142a7565b612697576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b33600081815260036020908152604090912080548435918290559290918391907fefcd7e019bc8b47d27881fd59e2619280ca5894f285950f10ab049870652efa5906126e590870187614a8e565b6126f26040890189614ba7565b6040516127029493929190614c0c565b60405180910390a45050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015612782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a691906142a7565b6127de576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff821661282b576040517f67156a2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff83160361287a576040517f17817dd800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61271061288d60e0830160c084016142df565b61ffff1611156128a757610a1c60e0820160c083016142df565b60006128b960408301602084016142df565b336000818152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff891684528252808320938352600c9091529020815461ffff939093161580159450919290919015906129a657336000908152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152902085906129488282614d34565b505080156129a15781546001810183556000838152602090200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b612a19565b80156129de576040517f2b60a32f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152812055612a1986836135b3565b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc695f93ae16034280e4fc93181b6afca9af23027ac1f1842a2287ba25cdc447687604051612a769190614ff6565b60405180910390a3505050505050565b81421080612a9357508042115b15612ada576040517f13da22f200000000000000000000000000000000000000000000000000000000815242600482015260248101839052604481018290526064016109e6565b5050565b612ae881836150e7565b3414612ada5734612af982846150e7565b6040517f0d35e921000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109e6565b82600003612b6e576040517f198441cb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f840e15d400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152600091829182919089169063840e15d490602401606060405180830381865afa158015612be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c0691906150fe565b9194509250905084612c18848861512c565b1115612c6557612c28838761512c565b6040517fedc012730000000000000000000000000000000000000000000000000000000081526004810191909152602481018690526044016109e6565b80612c70838861512c565b1115612cbd57612c80828761512c565b6040517fe12d23140000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016109e6565b83612cc8838861512c565b111561249957612cd8828761512c565b6040517fb98dabea0000000000000000000000000000000000000000000000000000000081526004810191909152602481018590526044016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216612d62576040517f5136e8d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015612dd45773ffffffffffffffffffffffffffffffffffffffff80841660009081526004602090815260408083209386168352929052205460ff16612dd4576040517ff477d26f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600054600114612e45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064016109e6565b60026000556040517f64869dad00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790528816906364869dad90604401600060405180830381600087803b158015612eba57600080fd5b505af1158015612ece573d6000803e3d6000fd5b5050505083600014612ee557612ee5878284613726565b6040805133815260208101879052908101859052606081018390526080810184905273ffffffffffffffffffffffffffffffffffffffff80831691888216918a16907fe90cf9cc0a552cf52ea6ff74ece0f1c8ae8cc9ad630d3181f55ac43ca076b7d69060a00160405180910390a4505060016000555050505050565b600082612f6f8584613817565b14949350505050565b6000807f632d30b7600fe596b016656d5dc3bc1e2c318bf422c8844e42871665322c484b846000015185602001518660400151876060015188608001518960a001518a60c001518b60e0015160405160200161301899989796959493929190988952602089019790975260408801959095526060870193909352608086019190915260a085015260c084015260e083015215156101008201526101200190565b60405160208183030381529060405280519060200120905061190160f01b61303e61385c565b604080517f8927086ec138a7aa6009c4966fc394504ae49ab0c06ae815b48e32e85c8279c7602082015273ffffffffffffffffffffffffffffffffffffffff808c1692820192909252818a166060820152908816608082015260a0810184905260c0810186905260e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905280516020918201207fffff00000000000000000000000000000000000000000000000000000000000090941690820152602281019190915260428101919091526062016040516020818303038152906040528051906020012091505095945050505050565b600080600061314b8585613957565b915091506131588161399c565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526006602090815260408083209385168352928152828220835160e081018552905469ffffffffffffffffffff8116825262ffffff6a010000000000000000000082041692820183905264ffffffffff6d010000000000000000000000000082048116958301959095527201000000000000000000000000000000000000810485166060830152770100000000000000000000000000000000000000000000008104909416608082015261ffff7c01000000000000000000000000000000000000000000000000000000008504811660a08301527e0100000000000000000000000000000000000000000000000000000000000090940490931660c084015290036132cb576040517fd855c4f400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016109e6565b8051835169ffffffffffffffffffff909116111561332e57825181516040517fa0c3ed0a000000000000000000000000000000000000000000000000000000008152600481019290925269ffffffffffffffffffff1660248201526044016109e6565b806020015162ffffff168360200151111561338d57602080840151908201516040517f4f430578000000000000000000000000000000000000000000000000000000008152600481019290925262ffffff1660248201526044016109e6565b806040015164ffffffffff16836040015110156133f257826040015181604001516040517f333d33d00000000000000000000000000000000000000000000000000000000081526004016109e692919091825264ffffffffff16602082015260400190565b806060015164ffffffffff168360600151111561345557606080840151908201516040517f6e1d357d000000000000000000000000000000000000000000000000000000008152600481019290925264ffffffffff1660248201526044016109e6565b806080015164ffffffffff168360a0015111156134b85760a083015160808201516040517f6d029c50000000000000000000000000000000000000000000000000000000008152600481019290925264ffffffffff1660248201526044016109e6565b8060c0015161ffff168360c0015111156135155760c080840151908201516040517f79fc44ed000000000000000000000000000000000000000000000000000000008152600481019290925261ffff1660248201526044016109e6565b8060a0015161ffff168360c0015110156135725760c083015160a08201516040517f79fc44ed000000000000000000000000000000000000000000000000000000008152600481019290925261ffff1660248201526044016109e6565b8260e001516135ad576040517fdb8b2fad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b805460005b818110156135ad578373ffffffffffffffffffffffffffffffffffffffff168382815481106135e9576135e9614af6565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff160361371e578261361c60018461513f565b8154811061362c5761362c614af6565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683828154811061366957613669614af6565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828054806136c1576136c1615152565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190556135ad565b6001016135b8565b612710811115613765576040517f3329f932000000000000000000000000000000000000000000000000000000008152600481018290526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526002602052604090205416806137c4576040517f3f00976900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816000036137d6576135ad8134613b52565b60006127106137e584346150e7565b6137ef9190615181565b9050348190038115613805576138058583613b52565b61380f8382613b52565b505050505050565b600081815b8451811015613158576138488286838151811061383b5761383b614af6565b6020026020010151613bc7565b915080613854816151bc565b91505061381c565b60007f000000000000000000000000000000000000000000000000000000000000000046146139325761392d604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f752a02269614d51d9b7bd0a2f05cf03e553ce6be8b487650a6a2a4990208d804918101919091527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b360608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b600080825160410361398d5760208301516040840151606085015160001a61398187828585613bf9565b94509450505050613995565b506000905060025b9250929050565b60008160048111156139b0576139b06151f4565b036139b85750565b60018160048111156139cc576139cc6151f4565b03613a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109e6565b6002816004811115613a4757613a476151f4565b03613aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109e6565b6003816004811115613ac257613ac26151f4565b03613b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016109e6565b50565b600080600080600085875af1905080612dd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c45440000000000000000000000000060448201526064016109e6565b6000818310613be3576000828152602084905260409020613bf2565b60008381526020839052604090205b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613c305750600090506003613cdf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613c84573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116613cd857600060019250925050613cdf565b9150600090505b94509492505050565b600060c08284031215613cfa57600080fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff81168114613b4f57600080fd5b60008060408385031215613d3557600080fd5b8235613d4081613d00565b91506020830135613d5081613d00565b809150509250929050565b60006101008201905069ffffffffffffffffffff835116825261ffff6020840151166020830152604083015165ffffffffffff808216604085015280606086015116606085015250506080830151613db8608084018260ff169052565b5060a0830151613dd060a084018263ffffffff169052565b5060c0830151613de660c084018261ffff169052565b5060e0830151613dfa60e084018215159052565b5092915050565b600060208284031215613e1357600080fd5b8135613bf281613d00565b60008060008060808587031215613e3457600080fd5b8435613e3f81613d00565b93506020850135613e4f81613d00565b92506040850135613e5f81613d00565b9396929550929360600135925050565b6020808252825182820181905260009190848201906040850190845b81811015613ebd57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101613e8b565b50909695505050505050565b60006101008284031215613cfa57600080fd5b60008060008060008060006101a0888a031215613ef857600080fd5b8735613f0381613d00565b96506020880135613f1381613d00565b95506040880135613f2381613d00565b945060608801359350613f398960808a01613ec9565b925061018088013567ffffffffffffffff80821115613f5757600080fd5b818a0191508a601f830112613f6b57600080fd5b813581811115613f7a57600080fd5b8b60208260051b8501011115613f8f57600080fd5b60208301945080935050505092959891949750929550565b60008083601f840112613fb957600080fd5b50813567ffffffffffffffff811115613fd157600080fd5b60208301915083602082850101111561399557600080fd5b6000806000806000806000806101c0898b03121561400657600080fd5b883561401181613d00565b9750602089013561402181613d00565b9650604089013561403181613d00565b9550606089013594506140478a60808b01613ec9565b935061018089013592506101a089013567ffffffffffffffff81111561406c57600080fd5b6140788b828c01613fa7565b999c989b5096995094979396929594505050565b6000808284036101008112156140a157600080fd5b83356140ac81613d00565b925060e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156140de57600080fd5b506020830190509250929050565b8015158114613b4f57600080fd5b8035614105816140ec565b919050565b6000806040838503121561411d57600080fd5b823561412881613d00565b91506020830135613d50816140ec565b60008060006060848603121561414d57600080fd5b833561415881613d00565b9250602084013561416881613d00565b929592945050506040919091013590565b6000806000806080858703121561418f57600080fd5b843561419a81613d00565b935060208501356141aa81613d00565b925060408501356141ba81613d00565b9150606085013567ffffffffffffffff8111156141d657600080fd5b8501604081880312156141e857600080fd5b939692955090935050565b6000806020838503121561420657600080fd5b823567ffffffffffffffff81111561421d57600080fd5b61422985828601613fa7565b90969095509350505050565b60006020828403121561424757600080fd5b813567ffffffffffffffff81111561425e57600080fd5b820160608185031215613bf257600080fd5b600080610120838503121561428457600080fd5b823561428f81613d00565b915061429e8460208501613ec9565b90509250929050565b6000602082840312156142b957600080fd5b8151613bf2816140ec565b61ffff81168114613b4f57600080fd5b8035614105816142c4565b6000602082840312156142f157600080fd5b8135613bf2816142c4565b69ffffffffffffffffffff81168114613b4f57600080fd5b65ffffffffffff81168114613b4f57600080fd5b60008135610c3b81614314565b60008135610c3b816142c4565b60008135610c3b816140ec565b813561435a816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff821617825550602082013561439d81614314565b81546fffffffffffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffff821617835560408401356143ec81614314565b75ffffffffffff000000000000000000000000000000008160801b16905080837fffffffffffffffffffff000000000000000000000000ffffffffffffffffffff8416171784556060850135614441816142c4565b77ffff000000000000000000000000000000000000000000008160b01b16847fffffffffffffffff0000000000000000000000000000ffffffffffffffffffff8516178317178555505050506144e761449c60808401614335565b82547fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b79ffff00000000000000000000000000000000000000000000000016178255565b612ada6144f660a08401614342565b8280547fffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffff1691151560d01b7aff000000000000000000000000000000000000000000000000000016919091179055565b803561410581614314565b60c081018235614560816142fc565b69ffffffffffffffffffff168252602083013561457c81614314565b65ffffffffffff908116602084015260408401359061459a82614314565b16604083015260608301356145ae816142c4565b61ffff90811660608401526080840135906145c8826142c4565b16608083015260a08301356145dc816140ec565b80151560a08401525092915050565b6000602082840312156145fd57600080fd5b8135613bf2816140ec565b60006101208201905073ffffffffffffffffffffffffffffffffffffffff8416825282356020830152602083013560408301526040830135606083015260608301356080830152608083013560a083015260a083013560c083015260c083013560e083015260e083013561467b816140ec565b801515610100840152509392505050565b60006101008083850312156146a057600080fd5b6040519081019067ffffffffffffffff821181831017156146ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b81604052833581526020840135602082015260408401356040820152606084013560608201526080840135608082015260a084013560a082015260c084013560c082015261473a60e085016140fa565b60e0820152949350505050565b62ffffff81168114613b4f57600080fd5b60006020828403121561476a57600080fd5b8135613bf281614747565b64ffffffffff81168114613b4f57600080fd5b60008135610c3b81614775565b81356147a0816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff82161782555060208201356147e381614747565b81546cffffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffff8216178355604084013561482f81614775565b71ffffffffff000000000000000000000000008160681b16837fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff841617178455505050606082013561488081614775565b81547fffffffffffffffffff0000000000ffffffffffffffffffffffffffffffffffff16609082901b76ffffffffff00000000000000000000000000000000000016178255506149226148d560808401614788565b82547fffffffff0000000000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b7bffffffffff000000000000000000000000000000000000000000000016178255565b61498061493160a08401614335565b82547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09190911b7dffff0000000000000000000000000000000000000000000000000000000016178255565b612ada61498f60c08401614335565b82547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f09190911b7fffff00000000000000000000000000000000000000000000000000000000000016178255565b60e0810182356149ed816142fc565b69ffffffffffffffffffff1682526020830135614a0981614747565b62ffffff1660208301526040830135614a2181614775565b64ffffffffff9081166040840152606084013590614a3e82614775565b1660608301526080830135614a5281614775565b64ffffffffff166080830152614a6a60a084016142d4565b61ffff1660a0830152614a7f60c084016142d4565b61ffff811660c0840152613dfa565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614ac357600080fd5b83018035915067ffffffffffffffff821115614ade57600080fd5b6020019150600581901b360382131561399557600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215614b3757600080fd5b8151613bf281613d00565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000614b9f602083018486614b42565b949350505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614bdc57600080fd5b83018035915067ffffffffffffffff821115614bf757600080fd5b60200191503681900382131561399557600080fd5b6040808252810184905260006060600586901b8301810190830187835b88811015614cd8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18b3603018112614c8a57600080fd5b8a01602081810191359067ffffffffffffffff821115614ca957600080fd5b813603831315614cb857600080fd5b614cc3878385614b42565b96509485019493909301925050600101614c29565b5050508281036020840152614cee818587614b42565b979650505050505050565b60ff81168114613b4f57600080fd5b60008135610c3b81614cf9565b63ffffffff81168114613b4f57600080fd5b60008135610c3b81614d15565b8135614d3f816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff8216178255506020820135614d82816142c4565b81546bffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff82161783556040840135614dcd81614314565b71ffffffffffff0000000000000000000000008160601b16837fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff841617178455505050614e68614e1f60608401614328565b82547fffffffffffffffff000000000000ffffffffffffffffffffffffffffffffffff1660909190911b77ffffffffffff00000000000000000000000000000000000016178255565b614ec1614e7760808401614d08565b82547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b78ff00000000000000000000000000000000000000000000000016178255565b614f1e614ed060a08401614d27565b82547fffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7cffffffff0000000000000000000000000000000000000000000000000016178255565b614f7d614f2d60c08401614335565b82547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e89190911b7effff000000000000000000000000000000000000000000000000000000000016178255565b612ada614f8c60e08401614342565b8280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1691151560f81b7fff0000000000000000000000000000000000000000000000000000000000000016919091179055565b803561410581614cf9565b803561410581614d15565b61010081018235615006816142fc565b69ffffffffffffffffffff1682526020830135615022816142c4565b61ffff166020830152604083013561503981614314565b65ffffffffffff16604083015261505260608401614546565b65ffffffffffff16606083015261506b60808401614fe0565b60ff16608083015261507f60a08401614feb565b63ffffffff1660a083015261509660c084016142d4565b61ffff1660c08301526150ab60e084016140fa565b80151560e0840152613dfa565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610c3b57610c3b6150b8565b60008060006060848603121561511357600080fd5b8351925060208401519150604084015190509250925092565b80820180821115610c3b57610c3b6150b8565b81810381811115610c3b57610c3b6150b8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000826151b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036151ed576151ed6150b8565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122059417cee21f6f3ebb52e2dca8de151d4233988c1f09fc2244b377210ed4a1c1364736f6c63430008110033

Deployed Bytecode

0x60806040526004361061018b5760003560e01c80637c35b982116100d657806399eb900f1161007f578063e583141d11610059578063e583141d14610884578063ebb4a55f146108da578063fd9ab22a146108fa57600080fd5b806399eb900f146106a2578063b957d0cb146106b5578063bc6a629c146106d557600080fd5b806381bf9af3116100b057806381bf9af31461043057806388aa3d37146106255780638e7d1e431461068257600080fd5b80637c35b982146103d05780637e3ba6af146103f05780637f2a5cca1461041057600080fd5b806332bf11f5116101385780634d380178116101125780634d380178146103255780635cb3c4d31461034557806368632274146103b057600080fd5b806332bf11f5146102ae5780634300a4e6146102ff5780634b61cd6f1461031257600080fd5b8063161ac21f11610169578063161ac21f146102085780632db526eb1461021b578063322e75d11461024857600080fd5b806301308e65146101905780630b0e8a6e146101b257806312738db8146101e8575b600080fd5b34801561019c57600080fd5b506101b06101ab366004613ce8565b61091a565b005b3480156101be57600080fd5b506101d26101cd366004613d22565b610aaf565b6040516101df9190613d5b565b60405180910390f35b3480156101f457600080fd5b506101b0610203366004613e01565b610c41565b6101b0610216366004613e1e565b610dda565b34801561022757600080fd5b5061023b610236366004613e01565b610ff9565b6040516101df9190613e6f565b34801561025457600080fd5b5061029e610263366004613d22565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260046020908152604080832093909416825291909152205460ff1690565b60405190151581526020016101df565b3480156102ba57600080fd5b506102f16102c9366004613e01565b73ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b6040519081526020016101df565b6101b061030d366004613edc565b611089565b6101b0610320366004613fe9565b611266565b34801561033157600080fd5b506101b061034036600461408c565b611471565b34801561035157600080fd5b5061038b610360366004613e01565b73ffffffffffffffffffffffffffffffffffffffff9081166000908152600260205260409020541690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101df565b3480156103bc57600080fd5b5061023b6103cb366004613e01565b6117cf565b3480156103dc57600080fd5b5061023b6103eb366004613e01565b61185d565b3480156103fc57600080fd5b5061023b61040b366004613e01565b6118eb565b34801561041c57600080fd5b506101b061042b36600461410a565b611979565b34801561043c57600080fd5b506105a561044b366004613d22565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091525073ffffffffffffffffffffffffffffffffffffffff9182166000908152600660209081526040808320939094168252918252829020825160e081018452905469ffffffffffffffffffff811682526a0100000000000000000000810462ffffff16928201929092526d0100000000000000000000000000820464ffffffffff90811693820193909352720100000000000000000000000000000000000082048316606082015277010000000000000000000000000000000000000000000000820490921660808301527c0100000000000000000000000000000000000000000000000000000000810461ffff90811660a08401527e010000000000000000000000000000000000000000000000000000000000009091041660c082015290565b6040516101df9190600060e08201905069ffffffffffffffffffff835116825262ffffff6020840151166020830152604083015164ffffffffff8082166040850152806060860151166060850152806080860151166080850152505060a083015161ffff80821660a08501528060c08601511660c0850152505092915050565b34801561063157600080fd5b5061029e610640366004614138565b73ffffffffffffffffffffffffffffffffffffffff9283166000908152600d602090815260408083209490951682529283528381209181529152205460ff1690565b34801561068e57600080fd5b506101b061069d36600461410a565b611cae565b6101b06106b0366004614179565b611fe3565b3480156106c157600080fd5b506101b06106d03660046141f3565b6124a3565b3480156106e157600080fd5b506108126106f0366004613e01565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091525073ffffffffffffffffffffffffffffffffffffffff16600090815260016020908152604091829020825160c081018452905469ffffffffffffffffffff8116825265ffffffffffff6a0100000000000000000000820481169383019390935270010000000000000000000000000000000081049092169281019290925261ffff7601000000000000000000000000000000000000000000008204811660608401527801000000000000000000000000000000000000000000000000820416608083015260ff7a01000000000000000000000000000000000000000000000000000090910416151560a082015290565b6040516101df9190600060c08201905069ffffffffffffffffffff8351168252602083015165ffffffffffff80821660208501528060408601511660408501525050606083015161ffff8082166060850152806080860151166080850152505060a0830151151560a083015292915050565b34801561089057600080fd5b5061029e61089f366004613d22565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260096020908152604080832093909416825291909152205460ff1690565b3480156108e657600080fd5b506101b06108f5366004614235565b6125c7565b34801561090657600080fd5b506101b0610915366004614270565b61270e565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b291906142a7565b6109ef576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b612710610a0260a08301608084016142df565b61ffff161115610a5557610a1c60a08201608083016142df565b6040517f3329f93200000000000000000000000000000000000000000000000000000000815261ffff90911660048201526024016109e6565b3360009081526001602052604090208190610a70828261434f565b505060405133907f3e30d8e1f739ea4795c481b21c23f905e938b80339305f3508e43c558e5dead390610aa4908490614551565b60405180910390a250565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101919091525073ffffffffffffffffffffffffffffffffffffffff8083166000908152600b60209081526040808320938516835292815290829020825161010081018452905469ffffffffffffffffffff8116825261ffff6a0100000000000000000000820481169383019390935265ffffffffffff6c01000000000000000000000000820481169483019490945272010000000000000000000000000000000000008104909316606082015260ff780100000000000000000000000000000000000000000000000084048116608083015263ffffffff79010000000000000000000000000000000000000000000000000085041660a08301527d010000000000000000000000000000000000000000000000000000000000840490921660c08201527f010000000000000000000000000000000000000000000000000000000000000090920416151560e08201525b92915050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015610cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd991906142a7565b610d11576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8116610d5e576040517f3f00976900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917f0c69f21751e800ea5960436c9a94370c7adbf54c733a20a025293fbbe8f1625291a350565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604091829020825160c081018452905469ffffffffffffffffffff8116825265ffffffffffff6a01000000000000000000008204811693830184905270010000000000000000000000000000000082041693820184905261ffff7601000000000000000000000000000000000000000000008204811660608401527801000000000000000000000000000000000000000000000000820416608083015260ff7a01000000000000000000000000000000000000000000000000000090910416151560a082015291610ece9190612a86565b805169ffffffffffffffffffff16610ee68382612ade565b600073ffffffffffffffffffffffffffffffffffffffff8516610f095733610f0b565b845b905073ffffffffffffffffffffffffffffffffffffffff81163314610f945773ffffffffffffffffffffffffffffffffffffffff8716600090815260096020908152604080832033845290915290205460ff16610f94576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc9878286866060015161ffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff612b34565b610fd887878560a00151612d15565b610ff0878286856000886080015161ffff168c612dd9565b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600c602090815260409182902080548351818402810184019094528084526060939283018282801561107d57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611052575b50505050509050919050565b61109b83604001358460600135612a86565b82356110a78582612ade565b600073ffffffffffffffffffffffffffffffffffffffff87166110ca57336110cc565b865b905073ffffffffffffffffffffffffffffffffffffffff811633146111555773ffffffffffffffffffffffffffffffffffffffff8916600090815260096020908152604080832033845290915290205460ff16611155576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61116a89828888602001358960a00135612b34565b6111858989611180610100890160e08a016145eb565b612d15565b61120e848480806020026020016040519081016040528093929190818152602001838360200280828437600092018290525073ffffffffffffffffffffffffffffffffffffffff8f168152600360209081526040918290205491519194506111f393508792508b9101614608565b60405160208183030381529060405280519060200120612f62565b611244576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61125b8982888589608001358a60c001358e612dd9565b505050505050505050565b61127884604001358560600135612a86565b611283858535612ade565b600073ffffffffffffffffffffffffffffffffffffffff87166112a657336112a8565b865b905073ffffffffffffffffffffffffffffffffffffffff811633146113315773ffffffffffffffffffffffffffffffffffffffff8916600090815260096020908152604080832033845290915290205460ff16611331576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61134689828888602001358960a00135612b34565b61135c8989611180610100890160e08a016145eb565b60006113798a838b611373368b90038b018b61468c565b89612f78565b60008181526008602052604090205490915060ff16156113c5576040517f900bb2c900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260086020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558051601f870183900483028101830190915285815261143b918790879081908401838280828437600092019190915250869392505061313c9050565b90506114568b611450368a90038a018a61468c565b83613160565b5061125b9050898288883560808a013560c08b01358e612dd9565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa1580156114e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150991906142a7565b611541576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff821661158e576040517fcfb6108a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127106115a160c0830160a084016142df565b61ffff1611156115bb57610a1c60c0820160a083016142df565b6127106115ce60e0830160c084016142df565b61ffff1611156115e857610a1c60e0820160c083016142df565b3360009081526007602090815260408083206006835281842073ffffffffffffffffffffffffffffffffffffffff871685528084528285208054929591949093921592829161163b918901908901614758565b62ffffff1611905080156116d85773ffffffffffffffffffffffffffffffffffffffff87166000908152602085905260409020869061167a8282614795565b505081156116d35784546001810186556000868152602090200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89161790555b611761565b82546a0100000000000000000000900462ffffff16600003611726576040517fb40637e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8b16845290915281205561176187866135b3565b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fcaeb4009c05208df426d15ff50b608287b05d21dee1f790552ea451a540a7be0886040516117be91906149de565b60405180910390a350505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526007602090815260409182902080548351818402810184019094528084526060939283018282801561107d5760200282019190600052602060002090815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116110525750505050509050919050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa1580156119ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1191906142a7565b611a49576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216611a96576040517fd34468bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600a6020908152604080832060099092529091208215611ba25773ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff1615611b16576040517fd48fd2e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416600081815260208381526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558554908101865585835291200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055611c61565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff16611c01576040517f4cc1171300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff88168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611c6184836135b3565b6040518315159073ffffffffffffffffffffffffffffffffffffffff86169033907f55a5cfa4bc68ffb9d833b75bf93f6d9c9aadc558dbfa587a9b5bb0ea7d5c38a390600090a450505050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015611d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4691906142a7565b611d7e576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216611dcb576040517f5136e8d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260056020908152604080832060049092529091208215611ed75773ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff1615611e4b576040517f798701ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8416600081815260208381526040822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558554908101865585835291200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055611f96565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020829052604090205460ff16611f36576040517f0998fbbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff88168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611f9684836135b3565b6040518315159073ffffffffffffffffffffffffffffffffffffffff86169033907f6486c31f9d664e241acf94ec2541d328f6b9e97257ae16a1d887f296f879719f90600090a450505050565b600073ffffffffffffffffffffffffffffffffffffffff83166120065733612008565b825b905073ffffffffffffffffffffffffffffffffffffffff811633146120915773ffffffffffffffffffffffffffffffffffffffff8516600090815260096020908152604080832033845290915290205460ff16612091576040517f1fe7da0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006120a06020840184613e01565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152600b60209081526040808320938516835292815290829020825161010081018452905469ffffffffffffffffffff8116825261ffff6a0100000000000000000000820481169383019390935265ffffffffffff6c010000000000000000000000008204811694830185905272010000000000000000000000000000000000008204166060830181905260ff780100000000000000000000000000000000000000000000000083048116608085015263ffffffff79010000000000000000000000000000000000000000000000000084041660a08501527d010000000000000000000000000000000000000000000000000000000000830490941660c08401527f0100000000000000000000000000000000000000000000000000000000000000909104909216151560e08201529293506121f79190612a86565b61220687878360e00151612d15565b60006122156020860186614a8e565b9050905061223381836000015169ffffffffffffffffffff16612ade565b612252888583856020015161ffff168660a0015163ffffffff16612b34565b60005b8181101561246a57600061226c6020880188614a8e565b8381811061227c5761227c614af6565b9050602002013590508573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016122d791815260200190565b602060405180830381865afa1580156122f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123189190614b25565b73ffffffffffffffffffffffffffffffffffffffff161461238c576040517fda8c7bc700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808c16600483015286166024820152604481018290526064016109e6565b73ffffffffffffffffffffffffffffffffffffffff808b166000908152600d602090815260408083209389168352928152828220848352908190529190205460ff161561242c576040517fa93f299b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808d16600483015287166024820152604481018390526064016109e6565b60009182526020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915501612255565b50612499888583856000015169ffffffffffffffffffff16866080015160ff168760c0015161ffff168d612dd9565b5050505050505050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015612517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253b91906142a7565b612573576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b3373ffffffffffffffffffffffffffffffffffffffff167fa0295608d25b3033c2e2c41cbac8746c2d08767bcfde6d47fae1ed7ba1d3215083836040516125bb929190614b8b565b60405180910390a25050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa15801561263b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265f91906142a7565b612697576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b33600081815260036020908152604090912080548435918290559290918391907fefcd7e019bc8b47d27881fd59e2619280ca5894f285950f10ab049870652efa5906126e590870187614a8e565b6126f26040890189614ba7565b6040516127029493929190614c0c565b60405180910390a45050565b6040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f1890fe8e00000000000000000000000000000000000000000000000000000000600482015233906301ffc9a790602401602060405180830381865afa158015612782573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a691906142a7565b6127de576040517f32c5d8cf0000000000000000000000000000000000000000000000000000000081523360048201526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff821661282b576040517f67156a2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff83160361287a576040517f17817dd800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61271061288d60e0830160c084016142df565b61ffff1611156128a757610a1c60e0820160c083016142df565b60006128b960408301602084016142df565b336000818152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff891684528252808320938352600c9091529020815461ffff939093161580159450919290919015906129a657336000908152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152902085906129488282614d34565b505080156129a15781546001810183556000838152602090200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88161790555b612a19565b80156129de576040517f2b60a32f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152600b6020908152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152812055612a1986836135b3565b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc695f93ae16034280e4fc93181b6afca9af23027ac1f1842a2287ba25cdc447687604051612a769190614ff6565b60405180910390a3505050505050565b81421080612a9357508042115b15612ada576040517f13da22f200000000000000000000000000000000000000000000000000000000815242600482015260248101839052604481018290526064016109e6565b5050565b612ae881836150e7565b3414612ada5734612af982846150e7565b6040517f0d35e921000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109e6565b82600003612b6e576040517f198441cb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f840e15d400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152600091829182919089169063840e15d490602401606060405180830381865afa158015612be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c0691906150fe565b9194509250905084612c18848861512c565b1115612c6557612c28838761512c565b6040517fedc012730000000000000000000000000000000000000000000000000000000081526004810191909152602481018690526044016109e6565b80612c70838861512c565b1115612cbd57612c80828761512c565b6040517fe12d23140000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016109e6565b83612cc8838861512c565b111561249957612cd8828761512c565b6040517fb98dabea0000000000000000000000000000000000000000000000000000000081526004810191909152602481018590526044016109e6565b73ffffffffffffffffffffffffffffffffffffffff8216612d62576040517f5136e8d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015612dd45773ffffffffffffffffffffffffffffffffffffffff80841660009081526004602090815260408083209386168352929052205460ff16612dd4576040517ff477d26f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600054600114612e45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f5245454e5452414e43590000000000000000000000000000000000000000000060448201526064016109e6565b60026000556040517f64869dad00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790528816906364869dad90604401600060405180830381600087803b158015612eba57600080fd5b505af1158015612ece573d6000803e3d6000fd5b5050505083600014612ee557612ee5878284613726565b6040805133815260208101879052908101859052606081018390526080810184905273ffffffffffffffffffffffffffffffffffffffff80831691888216918a16907fe90cf9cc0a552cf52ea6ff74ece0f1c8ae8cc9ad630d3181f55ac43ca076b7d69060a00160405180910390a4505060016000555050505050565b600082612f6f8584613817565b14949350505050565b6000807f632d30b7600fe596b016656d5dc3bc1e2c318bf422c8844e42871665322c484b846000015185602001518660400151876060015188608001518960a001518a60c001518b60e0015160405160200161301899989796959493929190988952602089019790975260408801959095526060870193909352608086019190915260a085015260c084015260e083015215156101008201526101200190565b60405160208183030381529060405280519060200120905061190160f01b61303e61385c565b604080517f8927086ec138a7aa6009c4966fc394504ae49ab0c06ae815b48e32e85c8279c7602082015273ffffffffffffffffffffffffffffffffffffffff808c1692820192909252818a166060820152908816608082015260a0810184905260c0810186905260e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905280516020918201207fffff00000000000000000000000000000000000000000000000000000000000090941690820152602281019190915260428101919091526062016040516020818303038152906040528051906020012091505095945050505050565b600080600061314b8585613957565b915091506131588161399c565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526006602090815260408083209385168352928152828220835160e081018552905469ffffffffffffffffffff8116825262ffffff6a010000000000000000000082041692820183905264ffffffffff6d010000000000000000000000000082048116958301959095527201000000000000000000000000000000000000810485166060830152770100000000000000000000000000000000000000000000008104909416608082015261ffff7c01000000000000000000000000000000000000000000000000000000008504811660a08301527e0100000000000000000000000000000000000000000000000000000000000090940490931660c084015290036132cb576040517fd855c4f400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016109e6565b8051835169ffffffffffffffffffff909116111561332e57825181516040517fa0c3ed0a000000000000000000000000000000000000000000000000000000008152600481019290925269ffffffffffffffffffff1660248201526044016109e6565b806020015162ffffff168360200151111561338d57602080840151908201516040517f4f430578000000000000000000000000000000000000000000000000000000008152600481019290925262ffffff1660248201526044016109e6565b806040015164ffffffffff16836040015110156133f257826040015181604001516040517f333d33d00000000000000000000000000000000000000000000000000000000081526004016109e692919091825264ffffffffff16602082015260400190565b806060015164ffffffffff168360600151111561345557606080840151908201516040517f6e1d357d000000000000000000000000000000000000000000000000000000008152600481019290925264ffffffffff1660248201526044016109e6565b806080015164ffffffffff168360a0015111156134b85760a083015160808201516040517f6d029c50000000000000000000000000000000000000000000000000000000008152600481019290925264ffffffffff1660248201526044016109e6565b8060c0015161ffff168360c0015111156135155760c080840151908201516040517f79fc44ed000000000000000000000000000000000000000000000000000000008152600481019290925261ffff1660248201526044016109e6565b8060a0015161ffff168360c0015110156135725760c083015160a08201516040517f79fc44ed000000000000000000000000000000000000000000000000000000008152600481019290925261ffff1660248201526044016109e6565b8260e001516135ad576040517fdb8b2fad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b805460005b818110156135ad578373ffffffffffffffffffffffffffffffffffffffff168382815481106135e9576135e9614af6565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff160361371e578261361c60018461513f565b8154811061362c5761362c614af6565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683828154811061366957613669614af6565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828054806136c1576136c1615152565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690550190556135ad565b6001016135b8565b612710811115613765576040517f3329f932000000000000000000000000000000000000000000000000000000008152600481018290526024016109e6565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526002602052604090205416806137c4576040517f3f00976900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816000036137d6576135ad8134613b52565b60006127106137e584346150e7565b6137ef9190615181565b9050348190038115613805576138058583613b52565b61380f8382613b52565b505050505050565b600081815b8451811015613158576138488286838151811061383b5761383b614af6565b6020026020010151613bc7565b915080613854816151bc565b91505061381c565b60007f000000000000000000000000000000000000000000000000000000000000008946146139325761392d604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f752a02269614d51d9b7bd0a2f05cf03e553ce6be8b487650a6a2a4990208d804918101919091527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b360608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b905090565b507f5e47c461bd68dc4a7d97a65bc59b4b23e4f8d8f8c55b41b28ba2bcc25d62257390565b600080825160410361398d5760208301516040840151606085015160001a61398187828585613bf9565b94509450505050613995565b506000905060025b9250929050565b60008160048111156139b0576139b06151f4565b036139b85750565b60018160048111156139cc576139cc6151f4565b03613a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109e6565b6002816004811115613a4757613a476151f4565b03613aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109e6565b6003816004811115613ac257613ac26151f4565b03613b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016109e6565b50565b600080600080600085875af1905080612dd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c45440000000000000000000000000060448201526064016109e6565b6000818310613be3576000828152602084905260409020613bf2565b60008381526020839052604090205b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613c305750600090506003613cdf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613c84573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116613cd857600060019250925050613cdf565b9150600090505b94509492505050565b600060c08284031215613cfa57600080fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff81168114613b4f57600080fd5b60008060408385031215613d3557600080fd5b8235613d4081613d00565b91506020830135613d5081613d00565b809150509250929050565b60006101008201905069ffffffffffffffffffff835116825261ffff6020840151166020830152604083015165ffffffffffff808216604085015280606086015116606085015250506080830151613db8608084018260ff169052565b5060a0830151613dd060a084018263ffffffff169052565b5060c0830151613de660c084018261ffff169052565b5060e0830151613dfa60e084018215159052565b5092915050565b600060208284031215613e1357600080fd5b8135613bf281613d00565b60008060008060808587031215613e3457600080fd5b8435613e3f81613d00565b93506020850135613e4f81613d00565b92506040850135613e5f81613d00565b9396929550929360600135925050565b6020808252825182820181905260009190848201906040850190845b81811015613ebd57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101613e8b565b50909695505050505050565b60006101008284031215613cfa57600080fd5b60008060008060008060006101a0888a031215613ef857600080fd5b8735613f0381613d00565b96506020880135613f1381613d00565b95506040880135613f2381613d00565b945060608801359350613f398960808a01613ec9565b925061018088013567ffffffffffffffff80821115613f5757600080fd5b818a0191508a601f830112613f6b57600080fd5b813581811115613f7a57600080fd5b8b60208260051b8501011115613f8f57600080fd5b60208301945080935050505092959891949750929550565b60008083601f840112613fb957600080fd5b50813567ffffffffffffffff811115613fd157600080fd5b60208301915083602082850101111561399557600080fd5b6000806000806000806000806101c0898b03121561400657600080fd5b883561401181613d00565b9750602089013561402181613d00565b9650604089013561403181613d00565b9550606089013594506140478a60808b01613ec9565b935061018089013592506101a089013567ffffffffffffffff81111561406c57600080fd5b6140788b828c01613fa7565b999c989b5096995094979396929594505050565b6000808284036101008112156140a157600080fd5b83356140ac81613d00565b925060e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156140de57600080fd5b506020830190509250929050565b8015158114613b4f57600080fd5b8035614105816140ec565b919050565b6000806040838503121561411d57600080fd5b823561412881613d00565b91506020830135613d50816140ec565b60008060006060848603121561414d57600080fd5b833561415881613d00565b9250602084013561416881613d00565b929592945050506040919091013590565b6000806000806080858703121561418f57600080fd5b843561419a81613d00565b935060208501356141aa81613d00565b925060408501356141ba81613d00565b9150606085013567ffffffffffffffff8111156141d657600080fd5b8501604081880312156141e857600080fd5b939692955090935050565b6000806020838503121561420657600080fd5b823567ffffffffffffffff81111561421d57600080fd5b61422985828601613fa7565b90969095509350505050565b60006020828403121561424757600080fd5b813567ffffffffffffffff81111561425e57600080fd5b820160608185031215613bf257600080fd5b600080610120838503121561428457600080fd5b823561428f81613d00565b915061429e8460208501613ec9565b90509250929050565b6000602082840312156142b957600080fd5b8151613bf2816140ec565b61ffff81168114613b4f57600080fd5b8035614105816142c4565b6000602082840312156142f157600080fd5b8135613bf2816142c4565b69ffffffffffffffffffff81168114613b4f57600080fd5b65ffffffffffff81168114613b4f57600080fd5b60008135610c3b81614314565b60008135610c3b816142c4565b60008135610c3b816140ec565b813561435a816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff821617825550602082013561439d81614314565b81546fffffffffffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffff821617835560408401356143ec81614314565b75ffffffffffff000000000000000000000000000000008160801b16905080837fffffffffffffffffffff000000000000000000000000ffffffffffffffffffff8416171784556060850135614441816142c4565b77ffff000000000000000000000000000000000000000000008160b01b16847fffffffffffffffff0000000000000000000000000000ffffffffffffffffffff8516178317178555505050506144e761449c60808401614335565b82547fffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b79ffff00000000000000000000000000000000000000000000000016178255565b612ada6144f660a08401614342565b8280547fffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffff1691151560d01b7aff000000000000000000000000000000000000000000000000000016919091179055565b803561410581614314565b60c081018235614560816142fc565b69ffffffffffffffffffff168252602083013561457c81614314565b65ffffffffffff908116602084015260408401359061459a82614314565b16604083015260608301356145ae816142c4565b61ffff90811660608401526080840135906145c8826142c4565b16608083015260a08301356145dc816140ec565b80151560a08401525092915050565b6000602082840312156145fd57600080fd5b8135613bf2816140ec565b60006101208201905073ffffffffffffffffffffffffffffffffffffffff8416825282356020830152602083013560408301526040830135606083015260608301356080830152608083013560a083015260a083013560c083015260c083013560e083015260e083013561467b816140ec565b801515610100840152509392505050565b60006101008083850312156146a057600080fd5b6040519081019067ffffffffffffffff821181831017156146ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b81604052833581526020840135602082015260408401356040820152606084013560608201526080840135608082015260a084013560a082015260c084013560c082015261473a60e085016140fa565b60e0820152949350505050565b62ffffff81168114613b4f57600080fd5b60006020828403121561476a57600080fd5b8135613bf281614747565b64ffffffffff81168114613b4f57600080fd5b60008135610c3b81614775565b81356147a0816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff82161782555060208201356147e381614747565b81546cffffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffff8216178355604084013561482f81614775565b71ffffffffff000000000000000000000000008160681b16837fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff841617178455505050606082013561488081614775565b81547fffffffffffffffffff0000000000ffffffffffffffffffffffffffffffffffff16609082901b76ffffffffff00000000000000000000000000000000000016178255506149226148d560808401614788565b82547fffffffff0000000000ffffffffffffffffffffffffffffffffffffffffffffff1660b89190911b7bffffffffff000000000000000000000000000000000000000000000016178255565b61498061493160a08401614335565b82547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09190911b7dffff0000000000000000000000000000000000000000000000000000000016178255565b612ada61498f60c08401614335565b82547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f09190911b7fffff00000000000000000000000000000000000000000000000000000000000016178255565b60e0810182356149ed816142fc565b69ffffffffffffffffffff1682526020830135614a0981614747565b62ffffff1660208301526040830135614a2181614775565b64ffffffffff9081166040840152606084013590614a3e82614775565b1660608301526080830135614a5281614775565b64ffffffffff166080830152614a6a60a084016142d4565b61ffff1660a0830152614a7f60c084016142d4565b61ffff811660c0840152613dfa565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614ac357600080fd5b83018035915067ffffffffffffffff821115614ade57600080fd5b6020019150600581901b360382131561399557600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215614b3757600080fd5b8151613bf281613d00565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b602081526000614b9f602083018486614b42565b949350505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614bdc57600080fd5b83018035915067ffffffffffffffff821115614bf757600080fd5b60200191503681900382131561399557600080fd5b6040808252810184905260006060600586901b8301810190830187835b88811015614cd8577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa086850301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18b3603018112614c8a57600080fd5b8a01602081810191359067ffffffffffffffff821115614ca957600080fd5b813603831315614cb857600080fd5b614cc3878385614b42565b96509485019493909301925050600101614c29565b5050508281036020840152614cee818587614b42565b979650505050505050565b60ff81168114613b4f57600080fd5b60008135610c3b81614cf9565b63ffffffff81168114613b4f57600080fd5b60008135610c3b81614d15565b8135614d3f816142fc565b81547fffffffffffffffffffffffffffffffffffffffffffff000000000000000000001669ffffffffffffffffffff8216178255506020820135614d82816142c4565b81546bffff000000000000000000008260501b169150817fffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff82161783556040840135614dcd81614314565b71ffffffffffff0000000000000000000000008160601b16837fffffffffffffffffffffffffffff0000000000000000ffffffffffffffffffff841617178455505050614e68614e1f60608401614328565b82547fffffffffffffffff000000000000ffffffffffffffffffffffffffffffffffff1660909190911b77ffffffffffff00000000000000000000000000000000000016178255565b614ec1614e7760808401614d08565b82547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b78ff00000000000000000000000000000000000000000000000016178255565b614f1e614ed060a08401614d27565b82547fffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffff1660c89190911b7cffffffff0000000000000000000000000000000000000000000000000016178255565b614f7d614f2d60c08401614335565b82547fff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e89190911b7effff000000000000000000000000000000000000000000000000000000000016178255565b612ada614f8c60e08401614342565b8280547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1691151560f81b7fff0000000000000000000000000000000000000000000000000000000000000016919091179055565b803561410581614cf9565b803561410581614d15565b61010081018235615006816142fc565b69ffffffffffffffffffff1682526020830135615022816142c4565b61ffff166020830152604083013561503981614314565b65ffffffffffff16604083015261505260608401614546565b65ffffffffffff16606083015261506b60808401614fe0565b60ff16608083015261507f60a08401614feb565b63ffffffff1660a083015261509660c084016142d4565b61ffff1660c08301526150ab60e084016140fa565b80151560e0840152613dfa565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610c3b57610c3b6150b8565b60008060006060848603121561511357600080fd5b8351925060208401519150604084015190509250925092565b80820180821115610c3b57610c3b6150b8565b81810381811115610c3b57610c3b6150b8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000826151b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036151ed576151ed6150b8565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122059417cee21f6f3ebb52e2dca8de151d4233988c1f09fc2244b377210ed4a1c1364736f6c63430008110033

Block Transaction Gas Used Reward
view all blocks produced

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

OVERVIEW

SeaDrop is a contract for conducting primary NFT drops on EVM-compatible blockchains.

Loading...
Loading

Validator Index Block Amount
View All Withdrawals

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

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