ETH Price: $3,433.14 (+1.91%)
Gas: 41 Gwei

Contract

0x95864937cC8c90878C3254CF418632F8154D3B7d
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Approval For...193157122024-02-27 1:48:594 days ago1708998539IN
0x95864937...8154D3B7d
0 ETH0.0023886536.52038962
Set Approval For...192989062024-02-24 17:22:476 days ago1708795367IN
0x95864937...8154D3B7d
0 ETH0.0020975832.0290977
Set Approval For...192082062024-02-11 23:52:4719 days ago1707695567IN
0x95864937...8154D3B7d
0 ETH0.0012567519.20702149
Set Approval For...191663072024-02-06 2:45:1125 days ago1707187511IN
0x95864937...8154D3B7d
0 ETH0.0020888531.93681708
Safe Transfer Fr...190894362024-01-26 7:57:2335 days ago1706255843IN
0x95864937...8154D3B7d
0 ETH0.0013619418.76448589
Set Approval For...190789922024-01-24 20:51:2337 days ago1706129483IN
0x95864937...8154D3B7d
0 ETH0.0008173812.49712965
Set Approval For...190367722024-01-18 22:37:1143 days ago1705617431IN
0x95864937...8154D3B7d
0 ETH0.0021379832.67484099
Set Approval For...190244102024-01-17 5:06:3544 days ago1705467995IN
0x95864937...8154D3B7d
0 ETH0.0013392830.79248511
Safe Transfer Fr...189690922024-01-09 11:25:1152 days ago1704799511IN
0x95864937...8154D3B7d
0 ETH0.0006786414.32683698
Set Approval For...189259672024-01-03 9:33:2358 days ago1704274403IN
0x95864937...8154D3B7d
0 ETH0.0010637916.25808607
Set Approval For...188115912023-12-18 8:08:3574 days ago1702886915IN
0x95864937...8154D3B7d
0 ETH0.0022328334.13805864
Set Approval For...188085852023-12-17 22:02:3575 days ago1702850555IN
0x95864937...8154D3B7d
0 ETH0.0023640636.13004998
Set Approval For...188077682023-12-17 19:17:5975 days ago1702840679IN
0x95864937...8154D3B7d
0 ETH0.0014313432.90906863
Set Approval For...188026202023-12-17 1:55:5976 days ago1702778159IN
0x95864937...8154D3B7d
0 ETH0.002273834.75067568
Set Approval For...187957572023-12-16 2:46:1177 days ago1702694771IN
0x95864937...8154D3B7d
0 ETH0.0025861239.53953762
Set Approval For...187557192023-12-10 12:09:5982 days ago1702210199IN
0x95864937...8154D3B7d
0 ETH0.0014727522.48820266
Set Approval For...187120352023-12-04 9:14:1188 days ago1701681251IN
0x95864937...8154D3B7d
0 ETH0.002346235.82540792
Set Approval For...186680212023-11-28 5:24:1194 days ago1701149051IN
0x95864937...8154D3B7d
0 ETH0.0019789130.25591097
Safe Transfer Fr...186226472023-11-21 20:53:35101 days ago1700600015IN
0x95864937...8154D3B7d
0 ETH0.0040271744.41620647
Set Approval For...186021522023-11-19 0:01:35104 days ago1700352095IN
0x95864937...8154D3B7d
0 ETH0.0014715822.49924348
Safe Transfer Fr...185516672023-11-11 22:27:59111 days ago1699741679IN
0x95864937...8154D3B7d
0 ETH0.0037339441.23856202
Set Approval For...184173472023-10-24 3:09:47130 days ago1698116987IN
0x95864937...8154D3B7d
0 ETH0.0036115755.21782214
Safe Transfer Fr...183859302023-10-19 17:40:47134 days ago1697737247IN
0x95864937...8154D3B7d
0 ETH0.000757628.35706285
Set Approval For...183773492023-10-18 12:50:59135 days ago1697633459IN
0x95864937...8154D3B7d
0 ETH0.000545818.34502878
Set Approval For...182933752023-10-06 18:53:59147 days ago1696618439IN
0x95864937...8154D3B7d
0 ETH0.000536978.20981983
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
173310582023-05-24 19:14:59282 days ago1684955699
0x95864937...8154D3B7d
3.159375 ETH
173169062023-05-22 19:27:23284 days ago1684783643
0x95864937...8154D3B7d
0.25 ETH
173168952023-05-22 19:25:11284 days ago1684783511
0x95864937...8154D3B7d
0.25 ETH
173168952023-05-22 19:25:11284 days ago1684783511
0x95864937...8154D3B7d
0.25 ETH
173168952023-05-22 19:25:11284 days ago1684783511
0x95864937...8154D3B7d
0.25 ETH
173168942023-05-22 19:24:59284 days ago1684783499
0x95864937...8154D3B7d
0.25 ETH
173168932023-05-22 19:24:47284 days ago1684783487
0x95864937...8154D3B7d
0.25 ETH
173168932023-05-22 19:24:47284 days ago1684783487
0x95864937...8154D3B7d
0.25 ETH
173168932023-05-22 19:24:47284 days ago1684783487
0x95864937...8154D3B7d
0.25 ETH
173168922023-05-22 19:24:35284 days ago1684783475
0x95864937...8154D3B7d
0.25 ETH
173168922023-05-22 19:24:35284 days ago1684783475
0x95864937...8154D3B7d
0.25 ETH
173168902023-05-22 19:24:11284 days ago1684783451
0x95864937...8154D3B7d
0.25 ETH
173168892023-05-22 19:23:59284 days ago1684783439
0x95864937...8154D3B7d
0.25 ETH
173168892023-05-22 19:23:59284 days ago1684783439
0x95864937...8154D3B7d
0.25 ETH
173168882023-05-22 19:23:47284 days ago1684783427
0x95864937...8154D3B7d
0.25 ETH
173168862023-05-22 19:23:23284 days ago1684783403
0x95864937...8154D3B7d
0.25 ETH
173168842023-05-22 19:22:59284 days ago1684783379
0x95864937...8154D3B7d
0.25 ETH
173168812023-05-22 19:22:23284 days ago1684783343
0x95864937...8154D3B7d
0.25 ETH
173168772023-05-22 19:21:35284 days ago1684783295
0x95864937...8154D3B7d
0.25 ETH
173168732023-05-22 19:20:47284 days ago1684783247
0x95864937...8154D3B7d
0.25 ETH
173168712023-05-22 19:20:23284 days ago1684783223
0x95864937...8154D3B7d
0.25 ETH
173168512023-05-22 19:16:23284 days ago1684782983
0x95864937...8154D3B7d
0.25 ETH
173168432023-05-22 19:14:47284 days ago1684782887
0x95864937...8154D3B7d
0.25 ETH
173168272023-05-22 19:11:35284 days ago1684782695
0x95864937...8154D3B7d
0.25 ETH
173168192023-05-22 19:09:59284 days ago1684782599
0x95864937...8154D3B7d
0.25 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GmStudioQuadrature

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 21 of 30 : Quadrature.sol
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2022 gmDAO
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@divergencetech/ethier/contracts/erc721/ERC721ACommon.sol";
import "@divergencetech/ethier/contracts/crypto/SignatureChecker.sol";
import "@divergencetech/ethier-0-39/contracts/factories/PaymentSplitterDeployer.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "../../utils/ERC2981SinglePercentual.sol";
import "../../utils/IDelegationRegistry.sol";

//                                           __                    __ __
//                                          |  \                  |  \  \
//   ______  ______ ____           _______ _| β–“β–“_   __    __  ____| β–“β–“\β–“β–“ ______
//  /      \|      \    \         /       \   β–“β–“ \ |  \  |  \/      β–“β–“  \/      \
// |  β–“β–“β–“β–“β–“β–“\ β–“β–“β–“β–“β–“β–“\β–“β–“β–“β–“\       |  β–“β–“β–“β–“β–“β–“β–“\β–“β–“β–“β–“β–“β–“ | β–“β–“  | β–“β–“  β–“β–“β–“β–“β–“β–“β–“ β–“β–“  β–“β–“β–“β–“β–“β–“\
// | β–“β–“  | β–“β–“ β–“β–“ | β–“β–“ | β–“β–“        \β–“β–“    \  | β–“β–“ __| β–“β–“  | β–“β–“ β–“β–“  | β–“β–“ β–“β–“ β–“β–“  | β–“β–“
// | β–“β–“__| β–“β–“ β–“β–“ | β–“β–“ | β–“β–“__      _\β–“β–“β–“β–“β–“β–“\ | β–“β–“|  \ β–“β–“__/ β–“β–“ β–“β–“__| β–“β–“ β–“β–“ β–“β–“__/ β–“β–“
//  \β–“β–“    β–“β–“ β–“β–“ | β–“β–“ | β–“β–“  \    |       β–“β–“  \β–“β–“  β–“β–“\β–“β–“    β–“β–“\β–“β–“    β–“β–“ β–“β–“\β–“β–“    β–“β–“
//  _\β–“β–“β–“β–“β–“β–“β–“\β–“β–“  \β–“β–“  \β–“β–“\β–“β–“     \β–“β–“β–“β–“β–“β–“β–“    \β–“β–“β–“β–“  \β–“β–“β–“β–“β–“β–“  \β–“β–“β–“β–“β–“β–“β–“\β–“β–“ \β–“β–“β–“β–“β–“β–“
// |  \__| β–“β–“
//  \β–“β–“    β–“β–“
//   \β–“β–“β–“β–“β–“β–“
//
contract GmStudioQuadrature is
    ERC721ACommon,
    ReentrancyGuard,
    DefaultOperatorFilterer,
    ERC2981SinglePercentual
{
    using EnumerableSet for EnumerableSet.AddressSet;
    using SignatureChecker for EnumerableSet.AddressSet;
    using Address for address payable;

    /// @notice Timestamps to enable/disable minting interfaces
    struct AuctionConfig {
        uint64 startTimestamp;
        uint64 endTimestamp;
    }

    // @notice The address of the gm.dao token.
    IERC721 public gmToken;

    IDelegationRegistry public delegateCash =
        IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B);

    /// @notice The price for early-access mints by the curation panel
    uint256 public constant MINT_PRICE_CURATION_PANEL = 0.25 ether;

    uint256 public constant GM_TOKEN_DISCOUNT_AMOUNT = 0.25 ether;

    /// @notice Start price of auction
    uint256 public constant MINT_START_PRICE = 4 ether;

    /// @notice End price of auction
    uint256 public constant MINT_END_PRICE = 0.25 ether;

    /// @notice Total maximum amount of tokens
    uint32 public constant MAX_NUM_TOKENS = 300;

    /// @notice Number of mints for reserved the studio/artist.
    uint32 internal constant NUM_RESERVED_MINTS = 6;

    /// @notice Splits payments between the Studio and the artist.
    address payable public immutable paymentSplitter;

    /// @notice Splits payments between the Studio and the artist.
    address payable public immutable paymentSplitterRoyalties;

    /// @notice Locks the mintReserve function
    bool internal reserveMinted;

    /// @notice The number of tokens minted with a possible rebate.
    uint256 internal numRebateMints;

    /// @notice The number of tokens minted with a possible rebate + gm token discount.
    uint256 internal numGMRebateMints;

    /// @notice The final sale price, if sold out.
    uint256 public finalSalePrice;

    /// @notice A map of user -> prices paid for mints. Allows us to calculate rebates.
    mapping(address => uint256[]) internal mintPrices;

    /// @notice A map of gm token id -> mint price. Allows us to calculate rebates with gm discounts.
    mapping(uint256 => uint256) public gmTokenIdToMintPrice;

    /// @notice A map of (minter address -> token IDs). Allows us to restrict rebate claims to the minter,
    /// rather than the token owner, if it is delegated.
    mapping(address => uint256[]) public gmMinterAddressToTokenIds;

    /// @notice The auction configuration
    AuctionConfig public auctionConfig;

    /// @notice tokenURI() base path.
    /// @dev Without trailing slash
    string internal _baseTokenURI;

    /// @notice Stores the number of tokens minted from a signature during the
    /// early access stage.
    /// @dev Used in `mintEarlyAccess`
    mapping(bytes32 => uint256) public numCurationPanelMintsFrom;

    /// @notice Signature signers for the early access stage.
    EnumerableSet.AddressSet private _signersCurationPanelReserve;

    bool public isClosed = false;

    constructor(
        address newOwner,
        string memory baseTokenURI,
        AuctionConfig memory config,
        address[] memory payees,
        uint256[] memory shares,
        uint256[] memory sharesRoyalties,
        address signersCurationPanelReserve,
        IERC721 _gmToken
    ) ERC721ACommon("Quadrature by Darien Brito", "QUAD") {
        _signersCurationPanelReserve.add(signersCurationPanelReserve);
        _baseTokenURI = baseTokenURI;
        auctionConfig = config;
        gmToken = _gmToken;

        paymentSplitter = payable(
            PaymentSplitterDeployer.instance().deploy(payees, shares)
        );

        paymentSplitterRoyalties = payable(
            PaymentSplitterDeployer.instance().deploy(payees, sharesRoyalties)
        );

        _setRoyaltyPercentage(750);
        _setRoyaltyReceiver(paymentSplitterRoyalties);

        transferOwnership(newOwner);
    }

    // -------------------------------------------------------------------------
    //
    //  Minting
    //
    // -------------------------------------------------------------------------

    /// @notice Toggle minting relevant flags.
    function setAuctionConfig(AuctionConfig calldata config)
        external
        onlyOwner
    {
        auctionConfig = config;
    }

    /// @notice Sets the delegateCash contract.
    /// @dev mostly used for testing.
    function setDelegationContract(IDelegationRegistry _delegateCash)
        external
        onlyOwner
    {
        delegateCash = _delegateCash;
    }

    /// @notice Changes the closed flag on the sale.
    function setSaleClosed(bool closed) external onlyOwner {
        isClosed = closed;
    }

    /// @notice Reverts if the sale is closed.
    modifier whenNotClosed() {
        if (isClosed) {
            revert SaleClosed();
        }
        _;
    }

    modifier beforeAuctionStarted() {
        if (block.timestamp >= auctionConfig.startTimestamp) {
            revert MintDisabled();
        }
        _;
    }

    /// @dev Reverts if the auction has not started.
    modifier whenAuctionStarted() {
        if (block.timestamp < auctionConfig.startTimestamp) {
            revert MintDisabled();
        }
        _;
    }

    modifier whenAuctionFinished() {
        if (block.timestamp < auctionConfig.endTimestamp) {
            revert AuctionRunning();
        }
        _;
    }

    /// @dev Reverts if called by a contract.
    modifier onlyEOA() {
        /* solhint-disable-next-line avoid-tx-origin */
        if (tx.origin != msg.sender) {
            revert OnlyEOA();
        }
        _;
    }

    /**
     * @notice Returns the current price of the token.
     * @dev This is a linear interpolation between the start and end price.
     */
    function getCurrentPrice() public view returns (uint256) {
        if (finalSalePrice != 0) {
            return finalSalePrice;
        }

        uint256 maxDelta = MINT_START_PRICE - MINT_END_PRICE;
        uint256 timeDifference = auctionConfig.endTimestamp -
            auctionConfig.startTimestamp;

        if (block.timestamp <= auctionConfig.startTimestamp) {
            return MINT_START_PRICE;
        }

        uint256 timeElapsed = block.timestamp - auctionConfig.startTimestamp;
        uint256 delta = (maxDelta * timeElapsed) / timeDifference;
        if (delta > maxDelta) {
            return MINT_END_PRICE;
        }
        return MINT_START_PRICE - delta;
    }

    /// @notice Mints tokens for the sender.
    function mintPublic()
        external
        payable
        whenAuctionStarted
        whenNotClosed
        onlyEOA
    {
        uint256 price = getCurrentPrice();

        // Ensure value is correct. We use < so that we don't fail slight overpayments
        // based on price changing every block. This extra payment will be tracked
        // and claimed along side the rebate.
        if (msg.value < price) revert InvalidPayment();

        // If this is the last mint, set the final sale price.
        if (totalSupply() + 1 == MAX_NUM_TOKENS) {
            finalSalePrice = price;
        }

        // If price is at the resting price, we can send the value directly to
        // the payment splitter.
        if (price == MINT_END_PRICE) {
            paymentSplitter.sendValue(msg.value);
            _processMint(msg.sender, 1);
            return;
        }

        // Otherwise, there could be a rebate, so record the price paid.
        // Note: We record the actual sent amount, not current price.
        mintPrices[msg.sender].push(msg.value);
        numRebateMints++;
        _processMint(msg.sender, 1);
    }

    function mintWithGMToken(uint256 tokenId, address vault)
        external
        payable
        whenAuctionStarted
        whenNotClosed
        onlyEOA
    {
        if (!hasValidGMTokenOwnership(msg.sender, tokenId, vault)) {
            revert NotAuthorized();
        }
        // If price is > 0, then this token has already been used.
        if (gmTokenIdToMintPrice[tokenId] != 0) {
            revert NotAuthorized();
        }
        uint256 price = getCurrentPrice();
        if (msg.value < price) revert InvalidPayment();

        // If this is the last mint, set the final sale price.
        if (totalSupply() + 1 == MAX_NUM_TOKENS) {
            finalSalePrice = price;
        }

        // If price is at the resting price, we can send the value directly to
        // the payment splitter.
        if (price == MINT_END_PRICE) {
            paymentSplitter.sendValue(msg.value);
            _processMint(msg.sender, 1);
            return;
        }

        // We can save gas for token holders by only writing the price if it
        // might be needed for rebates. This technically means that the gm token
        // can be used multiple times, but if the price is at the resting price
        // then there is no discount anyway, so we don't really care.
        gmTokenIdToMintPrice[tokenId] = msg.value;
        gmMinterAddressToTokenIds[msg.sender].push(tokenId);
        numGMRebateMints++;
        _processMint(msg.sender, 1);
    }

    function hasValidGMTokenOwnership(
        address collector,
        uint256 tokenId,
        address vault
    ) internal view returns (bool) {
        address owner = gmToken.ownerOf(tokenId);
        if (owner == collector) {
            return true;
        }
        if (owner == vault) {
            // This cascades down to check delegations at the
            // contract and wallet level too.
            return
                delegateCash.checkDelegateForToken(
                    collector,
                    vault,
                    address(gmToken),
                    tokenId
                );
        }
        return false;
    }

    /// @notice Mints tokens to a given address using a signed message.
    /// @dev The minter might be different than the receiver.
    /// @param to Token receiver
    /// @param num Number of tokens to be minted.
    /// @param numMax Max number of tokens that can be minted to the receiver.
    /// @param nonce additional signature salt.
    /// @param signature to prove that the receiver is allowed to get mints.
    /// @dev The signed messages is generated by concatenating
    /// `address(this) || to || numMax || nonce`.
    function _mintSigned(
        address to,
        uint16 num,
        uint16 numMax,
        uint128 nonce,
        bytes calldata signature,
        EnumerableSet.AddressSet storage signers,
        mapping(bytes32 => uint256) storage numMintedFrom,
        uint256 price
    ) internal {
        // General checks
        if (num * price != msg.value) {
            revert InvalidPayment();
        }

        // Signature related checks
        bytes32 message = ECDSA.toEthSignedMessageHash(
            abi.encodePacked(address(this), to, numMax, nonce)
        );

        if (num + numMintedFrom[message] > numMax) {
            revert TooManyMintsRequested();
        }

        signers.requireValidSignature(message, signature);
        numMintedFrom[message] += num;

        paymentSplitter.sendValue(msg.value);
        _processMint(to, num);
    }

    /// @notice Mints tokens to a given address using a signed message during
    /// the curation panels early access before the actual auction starts.
    /// @dev The minter might be different than the receiver.
    /// @param to Token receiver
    /// @param num Number of tokens to be minted.
    /// @param numMax Max number of tokens that can be minted to the receiver.
    /// @param nonce additional signature salt.
    /// @param signature to prove that the receiver is allowed to get mints.
    function mintCurationPanel(
        address to,
        uint16 num,
        uint16 numMax,
        uint128 nonce,
        bytes calldata signature
    ) external payable beforeAuctionStarted whenNotClosed nonReentrant {
        _mintSigned(
            to,
            num,
            numMax,
            nonce,
            signature,
            _signersCurationPanelReserve,
            numCurationPanelMintsFrom,
            MINT_PRICE_CURATION_PANEL
        );
    }

    /// @notice Receiver of reserve mints.
    /// @dev `to` corresponds to the address of the receiver and `num` to the
    /// number of tokens to be minted.
    struct ReserveReceiver {
        address to;
        uint32 num;
    }

    /// @notice Mints the initial token reserve.
    /// @param receivers Array of token receivers
    /// @dev The minter might be different than the receiver.
    /// @dev Reverts if the number of minted tokens does not equal
    /// NUM_RESERVED_MINTS
    function mintReserve(ReserveReceiver[] calldata receivers)
        external
        onlyOwner
    {
        if (reserveMinted) revert MintDisabled();
        reserveMinted = true;

        uint256 numReceivers = receivers.length;
        uint256 minted = 0;
        for (uint256 idx = 0; idx < numReceivers; ++idx) {
            minted += receivers[idx].num;
            _processMint(receivers[idx].to, receivers[idx].num);
        }
        if (minted != NUM_RESERVED_MINTS) revert WrongNumberOfReserveMints();
    }

    /// @notice Mints new tokens for the recipient.
    function _processMint(address to, uint256 num) internal {
        if (totalSupply() + num > MAX_NUM_TOKENS) {
            revert InsufficientTokensRemaining();
        }

        _mint(to, num);
    }

    /// @notice Computes a pseudorandom seed for a mint batch.
    /// @dev Even though this process can be gamed in principle, it is extremly
    /// difficult to do so in practise. Therefore we can still rely on this to
    /// derive fair seeds.
    function _computeBatchSeed(address to) private view returns (uint24) {
        return
            uint24(
                bytes3(
                    keccak256(
                        abi.encodePacked(
                            block.timestamp,
                            block.difficulty,
                            blockhash(block.number - 1),
                            to
                        )
                    )
                )
            );
    }

    /// @dev Sets the extra data field during token transfers
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual override returns (uint24) {
        // if minting, compute a batch seed
        if (from == address(0)) {
            return _computeBatchSeed(to);
        }
        // else return the current value
        return previousExtraData;
    }

    // -------------------------------------------------------------------------
    //
    //  Signature validataion
    //
    // -------------------------------------------------------------------------

    /// @notice Removes and adds addresses to the set of allowed signers.
    /// @dev Removal is performed before addition.
    function changeSigners(
        address[] calldata delSigners,
        address[] calldata addSigners
    ) external onlyOwner {
        EnumerableSet.AddressSet
            storage _signers = _signersCurationPanelReserve;

        for (uint256 idx; idx < delSigners.length; ++idx) {
            _signers.remove(delSigners[idx]);
        }
        for (uint256 idx; idx < addSigners.length; ++idx) {
            _signers.add(addSigners[idx]);
        }
    }

    // -------------------------------------------------------------------------
    //
    //  Payment
    //
    // -------------------------------------------------------------------------

    /// @notice Returns the resting price of auction. The resting price is the
    /// final sale price if sold out, otherwise it is the mint end price.
    function _restingPrice() internal view returns (uint256) {
        return finalSalePrice > 0 ? finalSalePrice : MINT_END_PRICE;
    }

    /// @notice Returns the amount of discount for GM token minters.
    /// Discount is the smaller of delta between resting price and final price,
    /// up to the max discount amount.
    /// E.g. if resting price is 0.5 ETH and final price is 0.3 ETH, and discount is 0.1 ETH,
    /// then the user gets a 0.1 ETH discount.
    /// If the resting price is 0.3 ETH and the final price is 0.25 ETH, then the user
    /// gets a 0.05 ETH discount.
    function _discountAmount(uint256 restingPrice)
        internal
        pure
        returns (uint256)
    {
        uint256 restingDelta = restingPrice - MINT_END_PRICE;
        return Math.min(restingDelta, GM_TOKEN_DISCOUNT_AMOUNT);
    }

    /// @notice Returns the total rebate amount for gm and normal mints for the given collector.
    /// @param collector The address of the collector.
    function getTotalRebateAmount(address collector)
        public
        view
        whenAuctionFinished
        returns (uint256)
    {
        return getRebateAmount(collector) + getGMTokenRebateAmount(collector);
    }

    /// @notice Returns the amount of rebate available to the collector.
    /// @param collector The address of the collector.
    /// @dev The rebate is the difference between the price paid and the
    /// resting price.
    function getRebateAmount(address collector)
        public
        view
        whenAuctionFinished
        returns (uint256)
    {
        uint256[] memory amountsPaid = mintPrices[collector];

        // We reuse this storage slot to indicate that the rebate has been claimed.
        if (amountsPaid.length == 0) {
            return 0;
        }

        uint256 restingPrice = _restingPrice();
        uint256 totalRebate = 0;
        for (uint256 i = 0; i < amountsPaid.length; i++) {
            if (amountsPaid[i] > restingPrice) {
                totalRebate += amountsPaid[i] - restingPrice;
            }
        }
        return totalRebate;
    }

    /// @notice Returns the amount of rebate available to the collector for the gm token mints.
    /// @param collector The address of the collector.
    function getGMTokenRebateAmount(address collector)
        public
        view
        whenAuctionFinished
        returns (uint256)
    {
        uint256 restingPrice = _restingPrice();
        uint256 discountAmount = _discountAmount(restingPrice);
        uint256 totalRebate = 0;

        uint256[] storage tokenIds = gmMinterAddressToTokenIds[collector];

        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 amountPaid = gmTokenIdToMintPrice[tokenIds[i]];
            // Not minted or already claimed
            if (amountPaid == 0) {
                continue;
            }

            // Note that unlike for 'normal' mints, you can still be eligible
            // for a rebate if the amount paid == resting price (because it may
            // be above the final sale price)
            totalRebate += amountPaid - restingPrice + discountAmount;
        }

        return totalRebate;
    }

    /// @notice Claims the rebate for the sender, if available.
    function claimRebate() public whenAuctionFinished {
        uint256 totalRebate = getTotalRebateAmount(msg.sender);

        if (totalRebate == 0) {
            revert NoRebateAvailable();
        }

        // Delete the rebate amounts so they cannot be claimed again.
        delete (mintPrices[msg.sender]);

        // Delete gm token mints so they cannot be claimed again.
        delete gmMinterAddressToTokenIds[msg.sender];

        // External call, ensure rebate is marked as claimed before calling for reentrancy.
        payable(msg.sender).sendValue(totalRebate);
    }

    /// @notice Flushes the pending money to the payment splitter.
    /// @dev During the auction, we do not know the final price, so we
    /// buffer money in the contract to allow rebates to be claimed.
    /// Once the final price is known, we can forward that money to the splitter.
    /// Note that mints which are made at the known final price go directly to
    /// the splitter.
    function forwardPaymentToSplitter() public whenAuctionFinished {
        // Nothing to do if no mints have a rebate.
        if (numRebateMints == 0 && numGMRebateMints == 0) {
            return;
        }

        uint256 restingPrice = _restingPrice();
        uint256 totalNonTokenValue = numRebateMints * restingPrice;

        uint256 totalGMTokenValue = numGMRebateMints *
            (restingPrice - _discountAmount(restingPrice));

        // Set the pending rebates to 0, so that we can't flush twice.
        numRebateMints = 0;
        numGMRebateMints = 0;

        paymentSplitter.sendValue(totalNonTokenValue + totalGMTokenValue);
    }

    /// @notice Emergency withdraw funds from the contract.
    /// This will only be used in case of an emergency like a critical bug or misconfiguration.
    function emergencyWithdraw() external onlyOwner {
        address payable studioMultisig = payable(
            0x16485319Aa0aD7a4E68176FBaadA235c92ACae2E
        );
        studioMultisig.sendValue(address(this).balance);
    }

    // -------------------------------------------------------------------------
    //
    //  Metadata
    //
    // -------------------------------------------------------------------------

    /// @notice Change tokenURI() base path.
    /// @param uri The new base path (must not contain trailing slash)
    function setBaseTokenURI(string calldata uri) external onlyOwner {
        require(bytes(uri).length > 0, "Base token URI cannot be empty");
        require(
            bytes(uri)[bytes(uri).length - 1] != "/",
            "Base token URI must not contain trailing slash"
        );

        _baseTokenURI = uri;
    }

    /// @notice Returns the URI for token metadata.
    function tokenURI(uint256 tokenId)
        public
        view
        override
        tokenExists(tokenId)
        returns (string memory)
    {
        return
            string(
                abi.encodePacked(
                    _baseTokenURI,
                    "/",
                    Strings.toString(tokenId),
                    ".json"
                )
            );
    }

    /// @notice Returns the seed of a token.
    /// @dev The seed is computed from the seed of the batch in which the given
    /// token was minted.
    function tokenSeed(uint256 tokenId)
        public
        view
        tokenExists(tokenId)
        returns (bytes32)
    {
        uint24 batchSeed = _ownershipOf(tokenId).extraData;
        return keccak256(abi.encodePacked(address(this), batchSeed, tokenId));
    }

    // -------------------------------------------------------------------------
    //
    //  Operator filtering
    //
    // -------------------------------------------------------------------------

    function setApprovalForAll(address operator, bool approved)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.setApprovalForAll(operator, approved);
    }

    function approve(address operator, uint256 tokenId)
        public
        override
        onlyAllowedOperatorApproval(operator)
    {
        super.approve(operator, tokenId);
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }

    // -------------------------------------------------------------------------
    //
    //  Internals
    //
    // -------------------------------------------------------------------------

    /// @dev See {IERC165-supportsInterface}.
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721ACommon, ERC2981)
        returns (bool)
    {
        return
            ERC721ACommon.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId);
    }

    // -------------------------------------------------------------------------
    //
    //  Errors
    //
    // -------------------------------------------------------------------------

    error MintDisabled();
    error TooManyMintsRequested();
    error InsufficientTokensRemaining();
    error InvalidPayment();
    error OnlyEOA();
    error WrongNumberOfReserveMints();
    error AuctionRunning();
    error NoRebateAvailable();
    error NotAuthorized();
    error SaleClosed();
}

File 2 of 30 : IPaymentSplitterFactory.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

interface IPaymentSplitterFactory {
    /// @notice Deploys a minimal contract proxy to a PaymentSplitter.
    function deploy(address[] memory payees, uint256[] memory shares)
        external
        returns (address);

    /**
    @notice Deploys a minimal contract proxy to a PaymentSplitter, at a
    deterministic address.
    @dev Use predictDeploymentAddress() with the same salt to predit the address
    before calling deployDeterministic(). See OpenZeppelin's proxy/Clones.sol
    for details and caveats, primarily that this will revert if a salt is
    reused.
     */
    function deployDeterministic(
        bytes32 salt,
        address[] memory payees,
        uint256[] memory shares
    ) external returns (address);

    /**
    @notice Returns the address at which a new PaymentSplitter will be deployed
    if using the same salt as passed to this function.
     */
    function predictDeploymentAddress(bytes32 salt)
        external
        view
        returns (address);
}

File 3 of 30 : PaymentSplitterDeployer.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "./IPaymentSplitterFactory.sol";

/**
@notice Convenience library for using ethier's PaymentSplitterFactory for cheap
deployment of OpenZeppelin PaymentSplitters via minimal proxy contracts. A
single factory contract is deployed on supported chains, the respective
addresses of which are determined via the chainid() and returned by this
library's instance() function.
 */
library PaymentSplitterDeployer {
    /***
    @notice Returns the ethier PaymentSplitterFactory instance for the current
    chain.
     */
    function instance() internal view returns (IPaymentSplitterFactory) {
        address factory;

        assembly {
            switch chainid()
            case 1 {
                // mainnet
                factory := 0xf034d6a4b1a64f0e6038632d87746ca24b79d325
            }
            case 5 {
                // Görli
                factory := 0x7F4Ae949da2eD37E0a4b37e0b15B22Ad5c94DE65
            }
            case 1337 {
                // The geth SimulatedBackend iff used with the ethier
                // factorytest package.
                factory := 0xa516d2c64ED7Fe2004A93Bc123854B229F3Bb738
            }
        }

        require(
            factory != address(0),
            "PaymentSplitterFactory: not deployed on current chain"
        );
        return IPaymentSplitterFactory(factory);
    }
}

File 4 of 30 : SignatureChecker.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

/**
@title SignatureChecker
@notice Additional functions for EnumerableSet.Addresset that require a valid
ECDSA signature of a standardized message, signed by any member of the set.
 */
library SignatureChecker {
    using EnumerableSet for EnumerableSet.AddressSet;

    /**
    @notice Requires that the message has not been used previously and that the
    recovered signer is contained in the signers AddressSet.
    @dev Convenience wrapper for message generation + signature verification
    + marking message as used
    @param signers Set of addresses from which signatures are accepted.
    @param usedMessages Set of already-used messages.
    @param signature ECDSA signature of message.
     */
    function requireValidSignature(
        EnumerableSet.AddressSet storage signers,
        bytes memory data,
        bytes calldata signature,
        mapping(bytes32 => bool) storage usedMessages
    ) internal {
        bytes32 message = generateMessage(data);
        require(
            !usedMessages[message],
            "SignatureChecker: Message already used"
        );
        usedMessages[message] = true;
        requireValidSignature(signers, message, signature);
    }

    /**
    @notice Requires that the message has not been used previously and that the
    recovered signer is contained in the signers AddressSet.
    @dev Convenience wrapper for message generation + signature verification.
     */
    function requireValidSignature(
        EnumerableSet.AddressSet storage signers,
        bytes memory data,
        bytes calldata signature
    ) internal view {
        bytes32 message = generateMessage(data);
        requireValidSignature(signers, message, signature);
    }

    /**
    @notice Requires that the message has not been used previously and that the
    recovered signer is contained in the signers AddressSet.
    @dev Convenience wrapper for message generation from address +
    signature verification.
     */
    function requireValidSignature(
        EnumerableSet.AddressSet storage signers,
        address a,
        bytes calldata signature
    ) internal view {
        bytes32 message = generateMessage(abi.encodePacked(a));
        requireValidSignature(signers, message, signature);
    }

    /**
    @notice Common validator logic, checking if the recovered signer is
    contained in the signers AddressSet.
    */
    function validSignature(
        EnumerableSet.AddressSet storage signers,
        bytes32 message,
        bytes calldata signature
    ) internal view returns (bool) {
        return signers.contains(ECDSA.recover(message, signature));
    }

    /**
    @notice Requires that the recovered signer is contained in the signers
    AddressSet.
    @dev Convenience wrapper that reverts if the signature validation fails.
    */
    function requireValidSignature(
        EnumerableSet.AddressSet storage signers,
        bytes32 message,
        bytes calldata signature
    ) internal view {
        require(
            validSignature(signers, message, signature),
            "SignatureChecker: Invalid signature"
        );
    }

    /**
    @notice Generates a message for a given data input that will be signed
    off-chain using ECDSA.
    @dev For multiple data fields, a standard concatenation using 
    `abi.encodePacked` is commonly used to build data.
     */
    function generateMessage(bytes memory data)
        internal
        pure
        returns (bytes32)
    {
        return ECDSA.toEthSignedMessageHash(data);
    }
}

File 5 of 30 : ERC721ACommon.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "./ERC721APreApproval.sol";
import "../utils/OwnerPausable.sol";

/**
@notice An ERC721A contract with common functionality:
 - OpenSea gas-free listings
 - Pausable with toggling functions exposed to Owner only
 */
contract ERC721ACommon is ERC721APreApproval, OwnerPausable {
    constructor(string memory name, string memory symbol)
        ERC721A(name, symbol)
    {} // solhint-disable-line no-empty-blocks

    /// @notice Requires that the token exists.
    modifier tokenExists(uint256 tokenId) {
        require(ERC721A._exists(tokenId), "ERC721ACommon: Token doesn't exist");
        _;
    }

    /// @notice Requires that msg.sender owns or is approved for the token.
    modifier onlyApprovedOrOwner(uint256 tokenId) {
        require(
            _ownershipOf(tokenId).addr == _msgSender() ||
                getApproved(tokenId) == _msgSender(),
            "ERC721ACommon: Not approved nor owner"
        );
        _;
    }

    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        require(!paused(), "ERC721ACommon: paused");
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    /// @notice Overrides supportsInterface as required by inheritance.
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721A)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

File 6 of 30 : ERC721APreApproval.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/utils/Context.sol";
import "../thirdparty/opensea/OpenSeaGasFreeListing.sol";
import "erc721a/contracts/ERC721A.sol";

/// @notice Pre-approval of OpenSea proxies for gas-less listing
/// @dev This wrapper allows users to revoke the pre-approval of their
/// associated proxy and emits the corresponding events. This is necessary for
/// external tools to index approvals correctly and inform the user.
/// @dev The pre-approval is triggered on a per-wallet basis during the first
/// transfer transactions. It will only be enabled for wallets with an existing
/// proxy. Not having a proxy incurs a gas overhead.
/// @dev This wrapper optimizes for the following scenario:
/// - The majority of users already have a wyvern proxy
/// - Most of them want to transfer tokens via wyvern exchanges
abstract contract ERC721APreApproval is ERC721A, Context {
    /// @dev It is important that Active remains at first position, since this
    /// is the scenario that we are trying to optimize for.
    enum State {
        Active,
        Inactive
    }

    /// @notice The state of the pre-approval for a given owner
    mapping(address => State) private state;

    /// @dev Returns true if either standard `isApprovedForAll()` or if the
    /// `operator` is the OpenSea proxy for the `owner` provided the
    /// pre-approval is active.
    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        if (super.isApprovedForAll(owner, operator)) {
            return true;
        }

        return
            state[owner] == State.Active &&
            OpenSeaGasFreeListing.isApprovedForAll(owner, operator);
    }

    /// @dev Uses the standard `setApprovalForAll` or toggles the pre-approval
    /// state if `operator` is the OpenSea proxy for the sender.
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        address owner = _msgSender();
        if (operator == OpenSeaGasFreeListing.proxyFor(owner)) {
            state[owner] = approved ? State.Active : State.Inactive;
            emit ApprovalForAll(owner, operator, approved);
        } else {
            super.setApprovalForAll(operator, approved);
        }
    }

    /// @dev Checks if the receiver has an existing proxy. If not, the
    /// pre-approval is disabled.
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        super._beforeTokenTransfers(from, to, startTokenId, quantity);

        // Exclude burns and inactive pre-approvals
        if (to == address(0) || state[to] == State.Inactive) {
            return;
        }

        address operator = OpenSeaGasFreeListing.proxyFor(to);

        // Disable if `to` has no proxy
        if (operator == address(0)) {
            state[to] = State.Inactive;
            return;
        }

        // Avoid emitting unnecessary events.
        if (balanceOf(to) == 0) {
            emit ApprovalForAll(to, operator, true);
        }
    }
}

File 7 of 30 : OpenSeaGasFreeListing.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

// Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need
// to pass specific addresses depending on deployment network.
// https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/

import "./ProxyRegistry.sol";

/// @notice Library to achieve gas-free listings on OpenSea.
library OpenSeaGasFreeListing {
    /**
    @notice Returns whether the operator is an OpenSea proxy for the owner, thus
    allowing it to list without the token owner paying gas.
    @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
    this function returns true.
     */
    function isApprovedForAll(address owner, address operator)
        internal
        view
        returns (bool)
    {
        address proxy = proxyFor(owner);
        return proxy != address(0) && proxy == operator;
    }

    /**
    @notice Returns the OpenSea proxy address for the owner.
     */
    function proxyFor(address owner) internal view returns (address) {
        address registry;
        uint256 chainId;

        assembly {
            chainId := chainid()
            switch chainId
            // Production networks are placed higher to minimise the number of
            // checks performed and therefore reduce gas. By the same rationale,
            // mainnet comes before Polygon as it's more expensive.
            case 1 {
                // mainnet
                registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1
            }
            case 137 {
                // polygon
                registry := 0x58807baD0B376efc12F5AD86aAc70E78ed67deaE
            }
            case 4 {
                // rinkeby
                registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317
            }
            case 80001 {
                // mumbai
                registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c
            }
            case 1337 {
                // The geth SimulatedBackend iff used with the ethier
                // openseatest package. This is mocked as a Wyvern proxy as it's
                // more complex than the 0x ones.
                registry := 0xE1a2bbc877b29ADBC56D2659DBcb0ae14ee62071
            }
        }

        // Unlike Wyvern, the registry itself is the proxy for all owners on 0x
        // chains.
        if (registry == address(0) || chainId == 137 || chainId == 80001) {
            return registry;
        }

        return address(ProxyRegistry(registry).proxies(owner));
    }
}

File 8 of 30 : ProxyRegistry.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

/// @notice A minimal interface describing OpenSea's Wyvern proxy registry.
contract ProxyRegistry {
    mapping(address => OwnableDelegateProxy) public proxies;
}

/**
@dev This pattern of using an empty contract is cargo-culted directly from
OpenSea's example code. TODO: it's likely that the above mapping can be changed
to address => address without affecting anything, but further investigation is
needed (i.e. is there a subtle reason that OpenSea released it like this?).
 */
// solhint-disable-next-line no-empty-blocks
contract OwnableDelegateProxy {

}

File 9 of 30 : OwnerPausable.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

/// @notice A Pausable contract that can only be toggled by the Owner.
contract OwnerPausable is Ownable, Pausable {
    /// @notice Pauses the contract.
    function pause() public onlyOwner {
        Pausable._pause();
    }

    /// @notice Unpauses the contract.
    function unpause() public onlyOwner {
        Pausable._unpause();
    }
}

File 10 of 30 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

File 11 of 30 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 12 of 30 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 13 of 30 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

File 14 of 30 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 30 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 16 of 30 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 17 of 30 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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
    }

    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");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' 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) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        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.
            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 if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } 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;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 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 (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // 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 18 of 30 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 19 of 30 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 20 of 30 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @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 / b + (a % b == 0 ? 0 : 1);
    }
}

File 21 of 30 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 22 of 30 : ERC2981.sol
// SPDX-License-Identifier: MIT
// Copyright 2021 David Huber (@cxkoda)

pragma solidity >=0.8.0 <0.9.0;

import "./IERC2981.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @notice ERC2981 royalty info base contract
 * @dev Implements `supportsInterface`
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC165, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC2981).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

File 23 of 30 : ERC2981SinglePercentual.sol
// SPDX-License-Identifier: MIT
// Copyright 2021 David Huber (@cxkoda)

pragma solidity >=0.8.0 <0.9.0;

import "./ERC2981.sol";

/**
 * @notice ERC2981 royalty info implementation for a single beneficiary
 * receving a percentage of sales prices.
 * @author David Huber (@cxkoda)
 */
contract ERC2981SinglePercentual is ERC2981 {
    /**
     * @dev The royalty percentage (in units of 0.01%)
     */
    uint96 private _percentage;

    /**
     * @dev The address to receive the royalties
     */
    address private _receiver;

    /**
     * @dev See {IERC2981-royaltyInfo}.
     */
    function royaltyInfo(uint256, uint256 salePrice)
        external
        view
        override
        returns (address receiver, uint256 royaltyAmount)
    {
        royaltyAmount = (salePrice / 10000) * _percentage;
        receiver = _receiver;
    }

    /**
     * @dev Sets the royalty percentage (in units of 0.01%)
     */
    function _setRoyaltyPercentage(uint96 percentage_) internal {
        _percentage = percentage_;
    }

    /**
     * @dev Sets the address to receive the royalties
     */
    function _setRoyaltyReceiver(address receiver_) internal {
        _receiver = receiver_;
    }
}

File 24 of 30 : IDelegationRegistry.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.17;

/**
 * @title An immutable registry contract to be deployed as a standalone primitive
 * @dev See EIP-5639, new project launches can read previous cold wallet -> hot wallet delegations
 * from here and integrate those permissions into their flow
 */
interface IDelegationRegistry {
    /// @notice Delegation type
    enum DelegationType {
        NONE,
        ALL,
        CONTRACT,
        TOKEN
    }

    /// @notice Info about a single delegation, used for onchain enumeration
    struct DelegationInfo {
        DelegationType type_;
        address vault;
        address delegate;
        address contract_;
        uint256 tokenId;
    }

    /// @notice Info about a single contract-level delegation
    struct ContractDelegation {
        address contract_;
        address delegate;
    }

    /// @notice Info about a single token-level delegation
    struct TokenDelegation {
        address contract_;
        uint256 tokenId;
        address delegate;
    }

    /// @notice Emitted when a user delegates their entire wallet
    event DelegateForAll(address vault, address delegate, bool value);

    /// @notice Emitted when a user delegates a specific contract
    event DelegateForContract(
        address vault,
        address delegate,
        address contract_,
        bool value
    );

    /// @notice Emitted when a user delegates a specific token
    event DelegateForToken(
        address vault,
        address delegate,
        address contract_,
        uint256 tokenId,
        bool value
    );

    /// @notice Emitted when a user revokes all delegations
    event RevokeAllDelegates(address vault);

    /// @notice Emitted when a user revoes all delegations for a given delegate
    event RevokeDelegate(address vault, address delegate);

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

    /**
     * @notice Allow the delegate to act on your behalf for all contracts
     * @param delegate The hotwallet to act on your behalf
     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
     */
    function delegateForAll(address delegate, bool value) external;

    /**
     * @notice Allow the delegate to act on your behalf for a specific contract
     * @param delegate The hotwallet to act on your behalf
     * @param contract_ The address for the contract you're delegating
     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
     */
    function delegateForContract(
        address delegate,
        address contract_,
        bool value
    ) external;

    /**
     * @notice Allow the delegate to act on your behalf for a specific token
     * @param delegate The hotwallet to act on your behalf
     * @param contract_ The address for the contract you're delegating
     * @param tokenId The token id for the token you're delegating
     * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
     */
    function delegateForToken(
        address delegate,
        address contract_,
        uint256 tokenId,
        bool value
    ) external;

    /**
     * @notice Revoke all delegates
     */
    function revokeAllDelegates() external;

    /**
     * @notice Revoke a specific delegate for all their permissions
     * @param delegate The hotwallet to revoke
     */
    function revokeDelegate(address delegate) external;

    /**
     * @notice Remove yourself as a delegate for a specific vault
     * @param vault The vault which delegated to the msg.sender, and should be removed
     */
    function revokeSelf(address vault) external;

    /**
     * -----------  READ -----------
     */

    /**
     * @notice Returns all active delegations a given delegate is able to claim on behalf of
     * @param delegate The delegate that you would like to retrieve delegations for
     * @return info Array of DelegationInfo structs
     */
    function getDelegationsByDelegate(address delegate)
        external
        view
        returns (DelegationInfo[] memory);

    /**
     * @notice Returns an array of wallet-level delegates for a given vault
     * @param vault The cold wallet who issued the delegation
     * @return addresses Array of wallet-level delegates for a given vault
     */
    function getDelegatesForAll(address vault)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns an array of contract-level delegates for a given vault and contract
     * @param vault The cold wallet who issued the delegation
     * @param contract_ The address for the contract you're delegating
     * @return addresses Array of contract-level delegates for a given vault and contract
     */
    function getDelegatesForContract(address vault, address contract_)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns an array of contract-level delegates for a given vault's token
     * @param vault The cold wallet who issued the delegation
     * @param contract_ The address for the contract holding the token
     * @param tokenId The token id for the token you're delegating
     * @return addresses Array of contract-level delegates for a given vault's token
     */
    function getDelegatesForToken(
        address vault,
        address contract_,
        uint256 tokenId
    ) external view returns (address[] memory);

    /**
     * @notice Returns all contract-level delegations for a given vault
     * @param vault The cold wallet who issued the delegations
     * @return delegations Array of ContractDelegation structs
     */
    function getContractLevelDelegations(address vault)
        external
        view
        returns (ContractDelegation[] memory delegations);

    /**
     * @notice Returns all token-level delegations for a given vault
     * @param vault The cold wallet who issued the delegations
     * @return delegations Array of TokenDelegation structs
     */
    function getTokenLevelDelegations(address vault)
        external
        view
        returns (TokenDelegation[] memory delegations);

    /**
     * @notice Returns true if the address is delegated to act on the entire vault
     * @param delegate The hotwallet to act on your behalf
     * @param vault The cold wallet who issued the delegation
     */
    function checkDelegateForAll(address delegate, address vault)
        external
        view
        returns (bool);

    /**
     * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault
     * @param delegate The hotwallet to act on your behalf
     * @param contract_ The address for the contract you're delegating
     * @param vault The cold wallet who issued the delegation
     */
    function checkDelegateForContract(
        address delegate,
        address vault,
        address contract_
    ) external view returns (bool);

    /**
     * @notice Returns true if the address is delegated to act on your behalf for a specific token, the token's contract or an entire vault
     * @param delegate The hotwallet to act on your behalf
     * @param contract_ The address for the contract you're delegating
     * @param tokenId The token id for the token you're delegating
     * @param vault The cold wallet who issued the delegation
     */
    function checkDelegateForToken(
        address delegate,
        address vault,
        address contract_,
        uint256 tokenId
    ) external view returns (bool);
}

File 25 of 30 : IERC2981.sol
// SPDX-License-Identifier: None

pragma solidity >=0.8.0 <0.9.0;

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

/**
 * @dev Interface for the NFT Royalty Standard
 * @author Taken from https://eips.ethereum.org/EIPS/eip-2981
 */
interface IERC2981 is IERC165 {
    /**
     * @notice Called with the sale price to determine how much royalty
     * is owed and to whom.
     * @param tokenId - the NFT asset queried for royalty information
     * @param salePrice - the sale price of the NFT asset specified by _tokenId
     * @return receiver - address of who should be sent the royalty payment
     * @return royaltyAmount - the royalty payment amount for _salePrice
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 26 of 30 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return _tokenApprovals[tokenId].value;
    }

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

        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

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

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

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

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

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

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

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

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

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

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

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

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

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

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

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

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

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

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

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

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

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

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit),
            // but we allocate 0x80 bytes to keep the free memory pointer 32-byte word aliged.
            // We will need 1 32-byte word to store the length,
            // and 3 32-byte words to store a maximum of 78 digits. Total: 0x20 + 3 * 0x20 = 0x80.
            str := add(mload(0x40), 0x80)
            // Update the free memory pointer to allocate.
            mstore(0x40, str)

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

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

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

File 27 of 30 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

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

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

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

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

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

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

    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"string","name":"baseTokenURI","type":"string"},{"components":[{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"endTimestamp","type":"uint64"}],"internalType":"struct GmStudioQuadrature.AuctionConfig","name":"config","type":"tuple"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint256[]","name":"sharesRoyalties","type":"uint256[]"},{"internalType":"address","name":"signersCurationPanelReserve","type":"address"},{"internalType":"contract IERC721","name":"_gmToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"AuctionRunning","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InsufficientTokensRemaining","type":"error"},{"inputs":[],"name":"InvalidPayment","type":"error"},{"inputs":[],"name":"MintDisabled","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NoRebateAvailable","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"OnlyEOA","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SaleClosed","type":"error"},{"inputs":[],"name":"TooManyMintsRequested","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WrongNumberOfReserveMints","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"GM_TOKEN_DISCOUNT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_NUM_TOKENS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_END_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE_CURATION_PANEL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_START_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auctionConfig","outputs":[{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"endTimestamp","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"delSigners","type":"address[]"},{"internalType":"address[]","name":"addSigners","type":"address[]"}],"name":"changeSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRebate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegateCash","outputs":[{"internalType":"contract IDelegationRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forwardPaymentToSplitter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collector","type":"address"}],"name":"getGMTokenRebateAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collector","type":"address"}],"name":"getRebateAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collector","type":"address"}],"name":"getTotalRebateAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"gmMinterAddressToTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gmToken","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"gmTokenIdToMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isClosed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"num","type":"uint16"},{"internalType":"uint16","name":"numMax","type":"uint16"},{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintCurationPanel","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"num","type":"uint32"}],"internalType":"struct GmStudioQuadrature.ReserveReceiver[]","name":"receivers","type":"tuple[]"}],"name":"mintReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"vault","type":"address"}],"name":"mintWithGMToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"numCurationPanelMintsFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitter","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitterRoyalties","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint64","name":"endTimestamp","type":"uint64"}],"internalType":"struct GmStudioQuadrature.AuctionConfig","name":"config","type":"tuple"}],"name":"setAuctionConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDelegationRegistry","name":"_delegateCash","type":"address"}],"name":"setDelegationContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"closed","type":"bool"}],"name":"setSaleClosed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600d80546001600160a01b0319166d76a84fef008cdabe6409d2fe638b1790556019805460ff191690553480156200003b57600080fd5b5060405162004d1138038062004d118339810160408190526200005e9162000944565b733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060400160405280601a81526020017f517561647261747572652062792044617269656e20427269746f000000000000815250604051806040016040528060048152602001631455505160e21b81525081818160029081620000db919062000ada565b506003620000ea828262000ada565b50506000805550620000fc3362000433565b50506009805460ff60a01b191690556001600a556daaeb6d7670e522a718067333cd4e3b1562000255578015620001a357604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200018457600080fd5b505af115801562000199573d6000803e3d6000fd5b5050505062000255565b6001600160a01b03821615620001f45760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000169565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200023b57600080fd5b505af115801562000250573d6000803e3d6000fd5b505050505b5050620002728260176200048560201b62001be61790919060201c565b50601562000281888262000ada565b508551601480546020808a01516001600160401b0390811668010000000000000000026001600160801b0319909316941693909317179055600c80546001600160a01b0384166001600160a01b0319909116179055620002ea9062001bfb620004a5821b17901c565b6001600160a01b0316634f62f4d186866040518363ffffffff1660e01b81526004016200031992919062000ba6565b6020604051808303816000875af115801562000339573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200035f919062000c2e565b6001600160a01b031660805262000381620004a5602090811b62001bfb17901c565b6001600160a01b0316634f62f4d186856040518363ffffffff1660e01b8152600401620003b092919062000ba6565b6020604051808303816000875af1158015620003d0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003f6919062000c2e565b6001600160a01b031660a08190526c01000000000000000000000000026102ee17600b556200042588620005a5565b505050505050505062000c55565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006200049c836001600160a01b03841662000676565b90505b92915050565b6000804660018114620004cb5760058114620004e857610539811462000505576200051d565b73f034d6a4b1a64f0e6038632d87746ca24b79d32591506200051d565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de6591506200051d565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b038116620005a05760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527f6f796564206f6e2063757272656e7420636861696e000000000000000000000060648201526084015b60405180910390fd5b919050565b6009546001600160a01b03163314620006015760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000597565b6001600160a01b038116620006685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000597565b620006738162000433565b50565b6000818152600183016020526040812054620006bf575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200049f565b5060006200049f565b6001600160a01b03811681146200067357600080fd5b8051620005a081620006c8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200072c576200072c620006eb565b604052919050565b600082601f8301126200074657600080fd5b81516001600160401b03811115620007625762000762620006eb565b602062000778601f8301601f1916820162000701565b82815285828487010111156200078d57600080fd5b60005b83811015620007ad57858101830151828201840152820162000790565b506000928101909101919091529392505050565b80516001600160401b0381168114620005a057600080fd5b600060408284031215620007ec57600080fd5b604080519081016001600160401b0381118282101715620008115762000811620006eb565b6040529050806200082283620007c1565b81526200083260208401620007c1565b60208201525092915050565b60006001600160401b038211156200085a576200085a620006eb565b5060051b60200190565b600082601f8301126200087657600080fd5b815160206200088f62000889836200083e565b62000701565b82815260059290921b84018101918181019086841115620008af57600080fd5b8286015b84811015620008d7578051620008c981620006c8565b8352918301918301620008b3565b509695505050505050565b600082601f830112620008f457600080fd5b815160206200090762000889836200083e565b82815260059290921b840181019181810190868411156200092757600080fd5b8286015b84811015620008d757805183529183019183016200092b565b600080600080600080600080610120898b0312156200096257600080fd5b6200096d89620006de565b60208a01519098506001600160401b03808211156200098b57600080fd5b620009998c838d0162000734565b9850620009aa8c60408d01620007d9565b975060808b0151915080821115620009c157600080fd5b620009cf8c838d0162000864565b965060a08b0151915080821115620009e657600080fd5b620009f48c838d01620008e2565b955060c08b015191508082111562000a0b57600080fd5b5062000a1a8b828c01620008e2565b93505062000a2b60e08a01620006de565b915062000a3c6101008a01620006de565b90509295985092959890939650565b600181811c9082168062000a6057607f821691505b60208210810362000a8157634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000ad557600081815260208120601f850160051c8101602086101562000ab05750805b601f850160051c820191505b8181101562000ad15782815560010162000abc565b5050505b505050565b81516001600160401b0381111562000af65762000af6620006eb565b62000b0e8162000b07845462000a4b565b8462000a87565b602080601f83116001811462000b46576000841562000b2d5750858301515b600019600386901b1c1916600185901b17855562000ad1565b600085815260208120601f198616915b8281101562000b775788860151825594840194600190910190840162000b56565b508582101562000b965787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604080825283519082018190526000906020906060840190828701845b8281101562000bea5781516001600160a01b03168452928401929084019060010162000bc3565b5050508381038285015284518082528583019183019060005b8181101562000c215783518352928401929184019160010162000c03565b5090979650505050505050565b60006020828403121562000c4157600080fd5b815162000c4e81620006c8565b9392505050565b60805160a05161407a62000c9760003960006108760152600081816109630152818161124a01528181611595015281816116c301526127ff015261407a6000f3fe6080604052600436106103345760003560e01c80638456cb59116101ab578063bf7983bf116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610985578063f3902319146107ae578063f49d3701146109a5578063f968a3c7146109c557600080fd5b8063e985e9c51461091c578063eb91d37e1461093c578063ed4a6b0c1461095157600080fd5b8063c87b56dd116100d1578063c87b56dd146108b2578063cda3948f146108d2578063d8816dc7146108e7578063db2e21bc1461090757600080fd5b8063bf7983bf14610848578063bf964b4e14610864578063c2b6b58c1461089857600080fd5b806399521d6f11610164578063b88d4fde1161013e578063b88d4fde146107ca578063bb406135146107ea578063bcc4b55114610835578063bf08aeb7146107ae57600080fd5b806399521d6f14610779578063a22cb4651461078e578063ab28480e146107ae57600080fd5b80638456cb59146106f35780638c1478a2146107085780638c874ebd1461071e5780638da5cb5b14610726578063948562951461074457806395d89b411461076457600080fd5b80633c5b79b7116102855780636352211e1161022357806370a08231116101fd57806370a0823114610673578063715018a614610693578063718e6adb146106a85780637ec9704f146106d357600080fd5b80636352211e146106205780636919cdc9146106405780637008873f1461066057600080fd5b806342842e0e1161025f57806342842e0e146105a1578063546d9e05146105c15780635c975abb146105e15780635f5168361461060057600080fd5b80633c5b79b71461054a5780633f4ba83a1461056a57806341f434341461057f57600080fd5b806318160ddd116102f257806330176e13116102cc57806330176e13146104bd578063332d4357146104dd578063350d435a146104fd57806335c429471461052a57600080fd5b806318160ddd1461044557806323b872dd1461045e5780632a55205a1461047e57600080fd5b8062b86a1e1461033957806301ffc9a71461037957806306fdde03146103a9578063081812fc146103cb578063095ea7b3146104035780630ae9f4ae14610425575b600080fd5b34801561034557600080fd5b506103666103543660046135e0565b60166020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561038557600080fd5b5061039961039436600461360f565b6109e5565b6040519015158152602001610370565b3480156103b557600080fd5b506103be610a05565b604051610370919061367c565b3480156103d757600080fd5b506103eb6103e63660046135e0565b610a97565b6040516001600160a01b039091168152602001610370565b34801561040f57600080fd5b5061042361041e3660046136a4565b610adb565b005b34801561043157600080fd5b506104236104403660046136d0565b610af4565b34801561045157600080fd5b5060015460005403610366565b34801561046a57600080fd5b50610423610479366004613744565b610c46565b34801561048a57600080fd5b5061049e610499366004613785565b610c6b565b604080516001600160a01b039093168352602083019190915201610370565b3480156104c957600080fd5b506104236104d83660046137e8565b610cb4565b3480156104e957600080fd5b506104236104f8366004613837565b610dcd565b34801561050957600080fd5b506103666105183660046135e0565b60126020526000908152604090205481565b34801561053657600080fd5b50610423610545366004613898565b610e0a565b34801561055657600080fd5b50610366610565366004613903565b610ed9565b34801561057657600080fd5b50610423610fd1565b34801561058b57600080fd5b506103eb6daaeb6d7670e522a718067333cd4e81565b3480156105ad57600080fd5b506104236105bc366004613744565b611005565b3480156105cd57600080fd5b506103666105dc366004613903565b61102a565b3480156105ed57600080fd5b50600954600160a01b900460ff16610399565b34801561060c57600080fd5b5061036661061b3660046135e0565b61107c565b34801561062c57600080fd5b506103eb61063b3660046135e0565b61110b565b34801561064c57600080fd5b50600c546103eb906001600160a01b031681565b61042361066e366004613920565b611116565b34801561067f57600080fd5b5061036661068e366004613903565b6112cc565b34801561069f57600080fd5b5061042361131a565b3480156106b457600080fd5b506106be61012c81565b60405163ffffffff9091168152602001610370565b3480156106df57600080fd5b506103666106ee366004613903565b61134e565b3480156106ff57600080fd5b50610423611484565b34801561071457600080fd5b5061036660105481565b6104236114b6565b34801561073257600080fd5b506009546001600160a01b03166103eb565b34801561075057600080fd5b50600d546103eb906001600160a01b031681565b34801561077057600080fd5b506103be61160a565b34801561078557600080fd5b50610423611619565b34801561079a57600080fd5b506104236107a9366004613950565b6116e9565b3480156107ba57600080fd5b506103666703782dace9d9000081565b3480156107d657600080fd5b506104236107e5366004613994565b6116fd565b3480156107f657600080fd5b50601454610815906001600160401b0380821691600160401b90041682565b604080516001600160401b03938416815292909116602083015201610370565b610423610843366004613a85565b61172a565b34801561085457600080fd5b50610366673782dace9d90000081565b34801561087057600080fd5b506103eb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108a457600080fd5b506019546103999060ff1681565b3480156108be57600080fd5b506103be6108cd3660046135e0565b6117f8565b3480156108de57600080fd5b50610423611853565b3480156108f357600080fd5b50610423610902366004613903565b6118ee565b34801561091357600080fd5b5061042361193a565b34801561092857600080fd5b50610399610937366004613b1a565b611983565b34801561094857600080fd5b50610366611a01565b34801561095d57600080fd5b506103eb7f000000000000000000000000000000000000000000000000000000000000000081565b34801561099157600080fd5b506104236109a0366004613903565b611ae6565b3480156109b157600080fd5b506103666109c03660046136a4565b611b7e565b3480156109d157600080fd5b506104236109e0366004613b48565b611baf565b60006109f082611ce2565b806109ff57506109ff82611ced565b92915050565b606060028054610a1490613b5a565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4090613b5a565b8015610a8d5780601f10610a6257610100808354040283529160200191610a8d565b820191906000526020600020905b815481529060010190602001808311610a7057829003601f168201915b5050505050905090565b6000610aa282611d22565b610abf576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610ae581611d49565b610aef8383611e02565b505050565b6009546001600160a01b03163314610b275760405162461bcd60e51b8152600401610b1e90613b8e565b60405180910390fd5b600d54600160a01b900460ff1615610b52576040516317efbd6b60e01b815260040160405180910390fd5b600d805460ff60a01b1916600160a01b179055806000805b82811015610c1e57848482818110610b8457610b84613bc3565b9050604002016020016020810190610b9c9190613bd9565b610bac9063ffffffff1683613c15565b9150610c0e858583818110610bc357610bc3613bc3565b610bd99260206040909202019081019150613903565b868684818110610beb57610beb613bc3565b9050604002016020016020810190610c039190613bd9565b63ffffffff16611ea2565b610c1781613c28565b9050610b6a565b5060068114610c40576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b0381163314610c6057610c6033611d49565b610c40848484611ee6565b600b5460009081906bffffffffffffffffffffffff16610c8d61271085613c57565b610c979190613c6b565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610cde5760405162461bcd60e51b8152600401610b1e90613b8e565b80610d2b5760405162461bcd60e51b815260206004820152601e60248201527f4261736520746f6b656e205552492063616e6e6f7420626520656d70747900006044820152606401610b1e565b8181610d38600182613c82565b818110610d4757610d47613bc3565b909101356001600160f81b031916602f60f81b039050610dc05760405162461bcd60e51b815260206004820152602e60248201527f4261736520746f6b656e20555249206d757374206e6f7420636f6e7461696e2060448201526d0e8e4c2d2d8d2dcce40e6d8c2e6d60931b6064820152608401610b1e565b6015610aef828483613cdb565b6009546001600160a01b03163314610df75760405162461bcd60e51b8152600401610b1e90613b8e565b6019805460ff1916911515919091179055565b6009546001600160a01b03163314610e345760405162461bcd60e51b8152600401610b1e90613b8e565b601760005b84811015610e8357610e72868683818110610e5657610e56613bc3565b9050602002016020810190610e6b9190613903565b83906120a4565b50610e7c81613c28565b9050610e39565b5060005b82811015610ed157610ec0848483818110610ea457610ea4613bc3565b9050602002016020810190610eb99190613903565b8390611be6565b50610eca81613c28565b9050610e87565b505050505050565b601454600090600160401b90046001600160401b0316421015610f0f5760405163ec25d02960e01b815260040160405180910390fd5b6000610f196120b9565b90506000610f26826120d8565b6001600160a01b038516600090815260136020526040812091925090815b8154811015610fc457600060126000848481548110610f6557610f65613bc3565b9060005260206000200154815260200190815260200160002054905080600003610f8f5750610fb2565b84610f9a8783613c82565b610fa49190613c15565b610fae9085613c15565b9350505b80610fbc81613c28565b915050610f44565b509093505050505b919050565b6009546001600160a01b03163314610ffb5760405162461bcd60e51b8152600401610b1e90613b8e565b611003612101565b565b826001600160a01b038116331461101f5761101f33611d49565b610c4084848461219e565b601454600090600160401b90046001600160401b03164210156110605760405163ec25d02960e01b815260040160405180910390fd5b61106982610ed9565b6110728361134e565b6109ff9190613c15565b60008161108881611d22565b6110a45760405162461bcd60e51b8152600401610b1e90613d9a565b60006110af846121b9565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b60006109ff82612230565b6014546001600160401b0316421015611142576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561116657604051634c013bd760e01b815260040160405180910390fd5b32331461118657604051639f8129d160e01b815260040160405180910390fd5b611191338383612297565b6111ae5760405163ea8e4eb560e01b815260040160405180910390fd5b600082815260126020526040902054156111db5760405163ea8e4eb560e01b815260040160405180910390fd5b60006111e5611a01565b9050803410156112085760405163078d696560e31b815260040160405180910390fd5b61012c6112186001546000540390565b611223906001613c15565b0361122e5760108190555b6703782dace9d90000810361127b576112706001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016346123e1565b610aef336001611ea2565b6000838152601260209081526040808320349055338352601382528220805460018101825590835290822001849055600f8054916112b883613c28565b9190505550610aef336001611ea2565b5050565b60006001600160a01b0382166112f5576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b031633146113445760405162461bcd60e51b8152600401610b1e90613b8e565b61100360006124fa565b601454600090600160401b90046001600160401b03164210156113845760405163ec25d02960e01b815260040160405180910390fd5b6001600160a01b0382166000908152601160209081526040808320805482518185028101850190935280835291929091908301828280156113e457602002820191906000526020600020905b8154815260200190600101908083116113d0575b5050505050905080516000036113fd5750600092915050565b60006114076120b9565b90506000805b835181101561147b578284828151811061142957611429613bc3565b60200260200101511115611469578284828151811061144a5761144a613bc3565b602002602001015161145c9190613c82565b6114669083613c15565b91505b8061147381613c28565b91505061140d565b50949350505050565b6009546001600160a01b031633146114ae5760405162461bcd60e51b8152600401610b1e90613b8e565b61100361254c565b6014546001600160401b03164210156114e2576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561150657604051634c013bd760e01b815260040160405180910390fd5b32331461152657604051639f8129d160e01b815260040160405180910390fd5b6000611530611a01565b9050803410156115535760405163078d696560e31b815260040160405180910390fd5b61012c6115636001546000540390565b61156e906001613c15565b036115795760108190555b6703782dace9d9000081036115c9576115bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016346123e1565b6115c6336001611ea2565b50565b3360009081526011602090815260408220805460018101825590835290822034910155600e8054916115fa83613c28565b91905055506115c6336001611ea2565b606060038054610a1490613b5a565b601454600160401b90046001600160401b031642101561164c5760405163ec25d02960e01b815260040160405180910390fd5b600e5415801561165c5750600f54155b61100357600061166a6120b9565b9050600081600e5461167c9190613c6b565b90506000611689836120d8565b6116939084613c82565b600f546116a09190613c6b565b6000600e819055600f559050610aef6116b98284613c15565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906123e1565b816116f381611d49565b610aef83836125d4565b836001600160a01b03811633146117175761171733611d49565b61172385858585612699565b5050505050565b6014546001600160401b03164210611755576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561177957604051634c013bd760e01b815260040160405180910390fd5b6002600a54036117cb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b1e565b6002600a556117eb868686868686601760166703782dace9d900006126dd565b50506001600a5550505050565b60608161180481611d22565b6118205760405162461bcd60e51b8152600401610b1e90613d9a565b601561182b8461283f565b60405160200161183c929190613ddc565b604051602081830303815290604052915050919050565b601454600160401b90046001600160401b03164210156118865760405163ec25d02960e01b815260040160405180910390fd5b60006118913361102a565b9050806000036118b457604051631b33a9b960e11b815260040160405180910390fd5b3360009081526011602052604081206118cc916135ae565b3360009081526013602052604081206118e4916135ae565b6115c633826123e1565b6009546001600160a01b031633146119185760405162461bcd60e51b8152600401610b1e90613b8e565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146119645760405162461bcd60e51b8152600401610b1e90613b8e565b7316485319aa0ad7a4e68176fbaada235c92acae2e6115c681476123e1565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff16156119bb575060016109ff565b6001600160a01b03831660009081526008602052604081205460ff1660018111156119e8576119e8613e82565b1480156119fa57506119fa8383612947565b9392505050565b6000601054600014611a14575060105490565b6000611a306703782dace9d90000673782dace9d900000613c82565b601454909150600090611a56906001600160401b0380821691600160401b900416613e98565b6014546001600160401b039182169250164211611a7d57673782dace9d9000009250505090565b601454600090611a96906001600160401b031642613c82565b9050600082611aa58386613c6b565b611aaf9190613c57565b905083811115611acb576703782dace9d9000094505050505090565b611add81673782dace9d900000613c82565b94505050505090565b6009546001600160a01b03163314611b105760405162461bcd60e51b8152600401610b1e90613b8e565b6001600160a01b038116611b755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b1e565b6115c6816124fa565b60136020528160005260406000208181548110611b9a57600080fd5b90600052602060002001600091509150505481565b6009546001600160a01b03163314611bd95760405162461bcd60e51b8152600401610b1e90613b8e565b806014610aef8282613ed1565b60006119fa836001600160a01b038416612985565b6000804660018114611c1d5760058114611c39576105398114611c5557611c6d565b73f034d6a4b1a64f0e6038632d87746ca24b79d3259150611c6d565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de659150611c6d565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b038116610fcc5760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610b1e565b60006109ff826129d4565b60006001600160e01b0319821663152a902d60e11b14806109ff57506301ffc9a760e01b6001600160e01b03198316146109ff565b60008054821080156109ff575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b156115c657604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dda9190613f2b565b6115c657604051633b79c77360e21b81526001600160a01b0382166004820152602401610b1e565b6000611e0d8261110b565b9050336001600160a01b03821614611e4657611e298133611983565b611e46576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61012c81611eb36001546000540390565b611ebd9190613c15565b1115611edc57604051639004693560e01b815260040160405180910390fd5b6112c88282612a22565b6000611ef182612230565b9050836001600160a01b0316816001600160a01b031614611f245760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611f7157611f548633611983565b611f7157604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611f9857604051633a954ecd60e21b815260040160405180910390fd5b611fa58686866001612b5b565b8015611fb057600082555b6001600160a01b0380871660009081526005602052604080822080546000190190559187168152208054600101905561200985611fee888287612bb9565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b8416900361205e5760018401600081815260046020526040812054900361205c57600054811461205c5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610ed1565b60006119fa836001600160a01b038416612bdc565b600080601054116120d157506703782dace9d9000090565b5060105490565b6000806120ed6703782dace9d9000084613c82565b90506119fa816703782dace9d90000612cd6565b600954600160a01b900460ff166121515760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b1e565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610aef838383604051806020016040528060008152506116fd565b6040805160808101825260008082526020820181905291810182905260608101919091526109ff6121e983612230565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008160005481101561227e5760008181526004602052604081205490600160e01b8216900361227c575b806000036119fa57506000190160008181526004602052604090205461225b565b505b604051636f96cda160e11b815260040160405180910390fd5b600c546040516331a9108f60e11b81526004810184905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156122e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123099190613f48565b9050846001600160a01b0316816001600160a01b03160361232e5760019150506119fa565b826001600160a01b0316816001600160a01b0316036123d657600d54600c54604051631574d39f60e31b81526001600160a01b038881166004830152868116602483015291821660448201526064810187905291169063aba69cf890608401602060405180830381865afa1580156123aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ce9190613f2b565b9150506119fa565b506000949350505050565b804710156124315760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b1e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461247e576040519150601f19603f3d011682016040523d82523d6000602084013e612483565b606091505b5050905080610aef5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b1e565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156125995760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b1e565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121813390565b336125de81612cec565b6001600160a01b0316836001600160a01b03160361268f5781612602576001612605565b60005b6001600160a01b0382166000908152600860205260409020805460ff19166001838181111561263657612636613e82565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051612682911515815260200190565b60405180910390a3505050565b610aef8383612e43565b6126a4848484610c46565b6001600160a01b0383163b15610c40576126c084848484612ed8565b610c40576040516368d2bf6b60e11b815260040160405180910390fd5b346126ec8261ffff8b16613c6b565b1461270a5760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528b901b1660348201526001600160f01b031960f089901b1660488201526fffffffffffffffffffffffffffffffff19608088901b16604a82015260009061277b90605a01604051602081830303815290604052612fc3565b60008181526020859052604090205490915061ffff808a169161279f918c16613c15565b11156127be5760405163342e754760e21b815260040160405180910390fd5b6127ca84828888612ffe565b6000818152602084905260408120805461ffff8c1692906127ec908490613c15565b9091555061282590506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016346123e1565b6128338a8a61ffff16611ea2565b50505050505050505050565b6060816000036128665750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612890578061287a81613c28565b91506128899050600a83613c57565b915061286a565b6000816001600160401b038111156128aa576128aa61397e565b6040519080825280601f01601f1916602001820160405280156128d4576020820181803683370190505b5090505b841561293f576128e9600183613c82565b91506128f6600a86613f65565b612901906030613c15565b60f81b81838151811061291657612916613bc3565b60200101906001600160f81b031916908160001a905350612938600a86613c57565b94506128d8565b949350505050565b60008061295384612cec565b90506001600160a01b0381161580159061293f5750826001600160a01b0316816001600160a01b031614949350505050565b60008181526001830160205260408120546129cc575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109ff565b5060006109ff565b60006301ffc9a760e01b6001600160e01b031983161480612a0557506380ac58cd60e01b6001600160e01b03198316145b806109ff5750506001600160e01b031916635b5e139f60e01b1490565b6000805490829003612a475760405163b562e8dd60e01b815260040160405180910390fd5b612a546000848385612b5b565b6001600160a01b03831660009081526005602052604081208054680100000000000000018502019055612aab908490612a8e908281612bb9565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612b3157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612af9565b5081600003612b5257604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff1615612bad5760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610b1e565b610c4084848484613062565b600060e882811c90612bcc868684613153565b62ffffff16901b95945050505050565b60008181526001830160205260408120548015612cc5576000612c00600183613c82565b8554909150600090612c1490600190613c82565b9050818114612c79576000866000018281548110612c3457612c34613bc3565b9060005260206000200154905080876000018481548110612c5757612c57613bc3565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612c8a57612c8a613f79565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109ff565b60009150506109ff565b5092915050565b6000818310612ce557816119fa565b5090919050565b600080468060018114612d215760898114612d3d5760048114612d5957620138818114612d75576105398114612d9157612da9565b73a5409ec958c83c3f309868babaca7c86dcb077c19250612da9565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250612da9565b73f57b2c51ded3a29e6891aba85459d600256cf3179250612da9565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250612da9565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b0382161580612dc05750806089145b80612dcd57508062013881145b15612dd9575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa158015612e1f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293f9190613f48565b336001600160a01b03831603612e6c5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612f0d903390899088908890600401613f8f565b6020604051808303816000875af1925050508015612f48575060408051601f3d908101601f19168201909252612f4591810190613fcc565b60015b612fa6573d808015612f76576040519150601f19603f3d011682016040523d82523d6000602084013e612f7b565b606091505b508051600003612f9e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000612fcf825161283f565b82604051602001612fe1929190613fe9565b604051602081830303815290604052805190602001209050919050565b61300a84848484613173565b610c405760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610b1e565b6001600160a01b03831615806130a4575060016001600160a01b03841660009081526008602052604090205460ff1660018111156130a2576130a2613e82565b145b610c405760006130b384612cec565b90506001600160a01b0381166130ec57506001600160a01b0383166000908152600860205260409020805460ff19166001179055610c40565b6130f5846112cc565b60000361172357806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c316001604051613144911515815260200190565b60405180910390a35050505050565b60006001600160a01b038416612ccf5761316c836131c8565b90506119fa565b60006131bf6131b88585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061322892505050565b869061324c565b95945050505050565b600042446131d7600143613c82565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b6000806000613237858561326e565b91509150613244816132dc565b509392505050565b6001600160a01b038116600090815260018301602052604081205415156119fa565b60008082516041036132a45760208301516040840151606085015160001a61329887828585613492565b945094505050506132d5565b82516040036132cd57602083015160408401516132c286838361357f565b9350935050506132d5565b506000905060025b9250929050565b60008160048111156132f0576132f0613e82565b036132f85750565b600181600481111561330c5761330c613e82565b036133595760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b1e565b600281600481111561336d5761336d613e82565b036133ba5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b1e565b60038160048111156133ce576133ce613e82565b036134265760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b1e565b600481600481111561343a5761343a613e82565b036115c65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b1e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156134c95750600090506003613576565b8460ff16601b141580156134e157508460ff16601c14155b156134f25750600090506004613576565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613546573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661356f57600060019250925050613576565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016135a087828885613492565b935093505050935093915050565b50805460008255906000526020600020908101906115c691905b808211156135dc57600081556001016135c8565b5090565b6000602082840312156135f257600080fd5b5035919050565b6001600160e01b0319811681146115c657600080fd5b60006020828403121561362157600080fd5b81356119fa816135f9565b60005b8381101561364757818101518382015260200161362f565b50506000910152565b6000815180845261366881602086016020860161362c565b601f01601f19169290920160200192915050565b6020815260006119fa6020830184613650565b6001600160a01b03811681146115c657600080fd5b600080604083850312156136b757600080fd5b82356136c28161368f565b946020939093013593505050565b600080602083850312156136e357600080fd5b82356001600160401b03808211156136fa57600080fd5b818501915085601f83011261370e57600080fd5b81358181111561371d57600080fd5b8660208260061b850101111561373257600080fd5b60209290920196919550909350505050565b60008060006060848603121561375957600080fd5b83356137648161368f565b925060208401356137748161368f565b929592945050506040919091013590565b6000806040838503121561379857600080fd5b50508035926020909101359150565b60008083601f8401126137b957600080fd5b5081356001600160401b038111156137d057600080fd5b6020830191508360208285010111156132d557600080fd5b600080602083850312156137fb57600080fd5b82356001600160401b0381111561381157600080fd5b61381d858286016137a7565b90969095509350505050565b80151581146115c657600080fd5b60006020828403121561384957600080fd5b81356119fa81613829565b60008083601f84011261386657600080fd5b5081356001600160401b0381111561387d57600080fd5b6020830191508360208260051b85010111156132d557600080fd5b600080600080604085870312156138ae57600080fd5b84356001600160401b03808211156138c557600080fd5b6138d188838901613854565b909650945060208701359150808211156138ea57600080fd5b506138f787828801613854565b95989497509550505050565b60006020828403121561391557600080fd5b81356119fa8161368f565b6000806040838503121561393357600080fd5b8235915060208301356139458161368f565b809150509250929050565b6000806040838503121561396357600080fd5b823561396e8161368f565b9150602083013561394581613829565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156139aa57600080fd5b84356139b58161368f565b935060208501356139c58161368f565b92506040850135915060608501356001600160401b03808211156139e857600080fd5b818701915087601f8301126139fc57600080fd5b813581811115613a0e57613a0e61397e565b604051601f8201601f19908116603f01168101908382118183101715613a3657613a3661397e565b816040528281528a6020848701011115613a4f57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff81168114610fcc57600080fd5b60008060008060008060a08789031215613a9e57600080fd5b8635613aa98161368f565b9550613ab760208801613a73565b9450613ac560408801613a73565b935060608701356001600160801b0381168114613ae157600080fd5b925060808701356001600160401b03811115613afc57600080fd5b613b0889828a016137a7565b979a9699509497509295939492505050565b60008060408385031215613b2d57600080fd5b8235613b388161368f565b915060208301356139458161368f565b60006040828403121561110557600080fd5b600181811c90821680613b6e57607f821691505b60208210810361110557634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613beb57600080fd5b813563ffffffff811681146119fa57600080fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156109ff576109ff613bff565b600060018201613c3a57613c3a613bff565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082613c6657613c66613c41565b500490565b80820281158282048414176109ff576109ff613bff565b818103818111156109ff576109ff613bff565b601f821115610aef57600081815260208120601f850160051c81016020861015613cbc5750805b601f850160051c820191505b81811015610ed157828155600101613cc8565b6001600160401b03831115613cf257613cf261397e565b613d0683613d008354613b5a565b83613c95565b6000601f841160018114613d3a5760008515613d225750838201355b600019600387901b1c1916600186901b178355611723565b600083815260209020601f19861690835b82811015613d6b5786850135825560209485019460019092019101613d4b565b5086821015613d885760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b6000808454613dea81613b5a565b60018281168015613e025760018114613e1757613e46565b60ff1984168752821515830287019450613e46565b8860005260208060002060005b85811015613e3d5781548a820152908401908201613e24565b50505082870194505b50602f60f81b845286519250613e628382860160208a0161362c565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b03828116828216039080821115612ccf57612ccf613bff565b600081356001600160401b03811681146109ff57600080fd5b6001600160401b03613ee283613eb8565b168154816001600160401b031982161783556fffffffffffffffff0000000000000000613f1160208601613eb8565b60401b16826001600160801b031983161717835550505050565b600060208284031215613f3d57600080fd5b81516119fa81613829565b600060208284031215613f5a57600080fd5b81516119fa8161368f565b600082613f7457613f74613c41565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613fc290830184613650565b9695505050505050565b600060208284031215613fde57600080fd5b81516119fa816135f9565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000835161402181601a85016020880161362c565b83519083019061403881601a84016020880161362c565b01601a0194935050505056fea26469706673582212206d320bd1e91ff7037ddbe01c8c3e5e65b0ffecc4d98162cdcafc5df4208fe20e64736f6c63430008110033000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000006468e070000000000000000000000000000000000000000000000000000000006468ee800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef00000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648000000000000000000000000000000000000000000000000000000000000003568747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f717561647261747572652f746f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd5952000000000000000000000000bbe65bb420b6005214e655ab385c3241a3f197d80000000000000000000000002726bba3e527584a1989c9fe392f21114307f72d0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000005500000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x6080604052600436106103345760003560e01c80638456cb59116101ab578063bf7983bf116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610985578063f3902319146107ae578063f49d3701146109a5578063f968a3c7146109c557600080fd5b8063e985e9c51461091c578063eb91d37e1461093c578063ed4a6b0c1461095157600080fd5b8063c87b56dd116100d1578063c87b56dd146108b2578063cda3948f146108d2578063d8816dc7146108e7578063db2e21bc1461090757600080fd5b8063bf7983bf14610848578063bf964b4e14610864578063c2b6b58c1461089857600080fd5b806399521d6f11610164578063b88d4fde1161013e578063b88d4fde146107ca578063bb406135146107ea578063bcc4b55114610835578063bf08aeb7146107ae57600080fd5b806399521d6f14610779578063a22cb4651461078e578063ab28480e146107ae57600080fd5b80638456cb59146106f35780638c1478a2146107085780638c874ebd1461071e5780638da5cb5b14610726578063948562951461074457806395d89b411461076457600080fd5b80633c5b79b7116102855780636352211e1161022357806370a08231116101fd57806370a0823114610673578063715018a614610693578063718e6adb146106a85780637ec9704f146106d357600080fd5b80636352211e146106205780636919cdc9146106405780637008873f1461066057600080fd5b806342842e0e1161025f57806342842e0e146105a1578063546d9e05146105c15780635c975abb146105e15780635f5168361461060057600080fd5b80633c5b79b71461054a5780633f4ba83a1461056a57806341f434341461057f57600080fd5b806318160ddd116102f257806330176e13116102cc57806330176e13146104bd578063332d4357146104dd578063350d435a146104fd57806335c429471461052a57600080fd5b806318160ddd1461044557806323b872dd1461045e5780632a55205a1461047e57600080fd5b8062b86a1e1461033957806301ffc9a71461037957806306fdde03146103a9578063081812fc146103cb578063095ea7b3146104035780630ae9f4ae14610425575b600080fd5b34801561034557600080fd5b506103666103543660046135e0565b60166020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561038557600080fd5b5061039961039436600461360f565b6109e5565b6040519015158152602001610370565b3480156103b557600080fd5b506103be610a05565b604051610370919061367c565b3480156103d757600080fd5b506103eb6103e63660046135e0565b610a97565b6040516001600160a01b039091168152602001610370565b34801561040f57600080fd5b5061042361041e3660046136a4565b610adb565b005b34801561043157600080fd5b506104236104403660046136d0565b610af4565b34801561045157600080fd5b5060015460005403610366565b34801561046a57600080fd5b50610423610479366004613744565b610c46565b34801561048a57600080fd5b5061049e610499366004613785565b610c6b565b604080516001600160a01b039093168352602083019190915201610370565b3480156104c957600080fd5b506104236104d83660046137e8565b610cb4565b3480156104e957600080fd5b506104236104f8366004613837565b610dcd565b34801561050957600080fd5b506103666105183660046135e0565b60126020526000908152604090205481565b34801561053657600080fd5b50610423610545366004613898565b610e0a565b34801561055657600080fd5b50610366610565366004613903565b610ed9565b34801561057657600080fd5b50610423610fd1565b34801561058b57600080fd5b506103eb6daaeb6d7670e522a718067333cd4e81565b3480156105ad57600080fd5b506104236105bc366004613744565b611005565b3480156105cd57600080fd5b506103666105dc366004613903565b61102a565b3480156105ed57600080fd5b50600954600160a01b900460ff16610399565b34801561060c57600080fd5b5061036661061b3660046135e0565b61107c565b34801561062c57600080fd5b506103eb61063b3660046135e0565b61110b565b34801561064c57600080fd5b50600c546103eb906001600160a01b031681565b61042361066e366004613920565b611116565b34801561067f57600080fd5b5061036661068e366004613903565b6112cc565b34801561069f57600080fd5b5061042361131a565b3480156106b457600080fd5b506106be61012c81565b60405163ffffffff9091168152602001610370565b3480156106df57600080fd5b506103666106ee366004613903565b61134e565b3480156106ff57600080fd5b50610423611484565b34801561071457600080fd5b5061036660105481565b6104236114b6565b34801561073257600080fd5b506009546001600160a01b03166103eb565b34801561075057600080fd5b50600d546103eb906001600160a01b031681565b34801561077057600080fd5b506103be61160a565b34801561078557600080fd5b50610423611619565b34801561079a57600080fd5b506104236107a9366004613950565b6116e9565b3480156107ba57600080fd5b506103666703782dace9d9000081565b3480156107d657600080fd5b506104236107e5366004613994565b6116fd565b3480156107f657600080fd5b50601454610815906001600160401b0380821691600160401b90041682565b604080516001600160401b03938416815292909116602083015201610370565b610423610843366004613a85565b61172a565b34801561085457600080fd5b50610366673782dace9d90000081565b34801561087057600080fd5b506103eb7f000000000000000000000000922a499399505b9a6775b94d57616e30ca7e5b8981565b3480156108a457600080fd5b506019546103999060ff1681565b3480156108be57600080fd5b506103be6108cd3660046135e0565b6117f8565b3480156108de57600080fd5b50610423611853565b3480156108f357600080fd5b50610423610902366004613903565b6118ee565b34801561091357600080fd5b5061042361193a565b34801561092857600080fd5b50610399610937366004613b1a565b611983565b34801561094857600080fd5b50610366611a01565b34801561095d57600080fd5b506103eb7f00000000000000000000000048656ee3ea6ffec99b52571baeab4c5b501da76c81565b34801561099157600080fd5b506104236109a0366004613903565b611ae6565b3480156109b157600080fd5b506103666109c03660046136a4565b611b7e565b3480156109d157600080fd5b506104236109e0366004613b48565b611baf565b60006109f082611ce2565b806109ff57506109ff82611ced565b92915050565b606060028054610a1490613b5a565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4090613b5a565b8015610a8d5780601f10610a6257610100808354040283529160200191610a8d565b820191906000526020600020905b815481529060010190602001808311610a7057829003601f168201915b5050505050905090565b6000610aa282611d22565b610abf576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610ae581611d49565b610aef8383611e02565b505050565b6009546001600160a01b03163314610b275760405162461bcd60e51b8152600401610b1e90613b8e565b60405180910390fd5b600d54600160a01b900460ff1615610b52576040516317efbd6b60e01b815260040160405180910390fd5b600d805460ff60a01b1916600160a01b179055806000805b82811015610c1e57848482818110610b8457610b84613bc3565b9050604002016020016020810190610b9c9190613bd9565b610bac9063ffffffff1683613c15565b9150610c0e858583818110610bc357610bc3613bc3565b610bd99260206040909202019081019150613903565b868684818110610beb57610beb613bc3565b9050604002016020016020810190610c039190613bd9565b63ffffffff16611ea2565b610c1781613c28565b9050610b6a565b5060068114610c40576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b0381163314610c6057610c6033611d49565b610c40848484611ee6565b600b5460009081906bffffffffffffffffffffffff16610c8d61271085613c57565b610c979190613c6b565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610cde5760405162461bcd60e51b8152600401610b1e90613b8e565b80610d2b5760405162461bcd60e51b815260206004820152601e60248201527f4261736520746f6b656e205552492063616e6e6f7420626520656d70747900006044820152606401610b1e565b8181610d38600182613c82565b818110610d4757610d47613bc3565b909101356001600160f81b031916602f60f81b039050610dc05760405162461bcd60e51b815260206004820152602e60248201527f4261736520746f6b656e20555249206d757374206e6f7420636f6e7461696e2060448201526d0e8e4c2d2d8d2dcce40e6d8c2e6d60931b6064820152608401610b1e565b6015610aef828483613cdb565b6009546001600160a01b03163314610df75760405162461bcd60e51b8152600401610b1e90613b8e565b6019805460ff1916911515919091179055565b6009546001600160a01b03163314610e345760405162461bcd60e51b8152600401610b1e90613b8e565b601760005b84811015610e8357610e72868683818110610e5657610e56613bc3565b9050602002016020810190610e6b9190613903565b83906120a4565b50610e7c81613c28565b9050610e39565b5060005b82811015610ed157610ec0848483818110610ea457610ea4613bc3565b9050602002016020810190610eb99190613903565b8390611be6565b50610eca81613c28565b9050610e87565b505050505050565b601454600090600160401b90046001600160401b0316421015610f0f5760405163ec25d02960e01b815260040160405180910390fd5b6000610f196120b9565b90506000610f26826120d8565b6001600160a01b038516600090815260136020526040812091925090815b8154811015610fc457600060126000848481548110610f6557610f65613bc3565b9060005260206000200154815260200190815260200160002054905080600003610f8f5750610fb2565b84610f9a8783613c82565b610fa49190613c15565b610fae9085613c15565b9350505b80610fbc81613c28565b915050610f44565b509093505050505b919050565b6009546001600160a01b03163314610ffb5760405162461bcd60e51b8152600401610b1e90613b8e565b611003612101565b565b826001600160a01b038116331461101f5761101f33611d49565b610c4084848461219e565b601454600090600160401b90046001600160401b03164210156110605760405163ec25d02960e01b815260040160405180910390fd5b61106982610ed9565b6110728361134e565b6109ff9190613c15565b60008161108881611d22565b6110a45760405162461bcd60e51b8152600401610b1e90613d9a565b60006110af846121b9565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b60006109ff82612230565b6014546001600160401b0316421015611142576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561116657604051634c013bd760e01b815260040160405180910390fd5b32331461118657604051639f8129d160e01b815260040160405180910390fd5b611191338383612297565b6111ae5760405163ea8e4eb560e01b815260040160405180910390fd5b600082815260126020526040902054156111db5760405163ea8e4eb560e01b815260040160405180910390fd5b60006111e5611a01565b9050803410156112085760405163078d696560e31b815260040160405180910390fd5b61012c6112186001546000540390565b611223906001613c15565b0361122e5760108190555b6703782dace9d90000810361127b576112706001600160a01b037f00000000000000000000000048656ee3ea6ffec99b52571baeab4c5b501da76c16346123e1565b610aef336001611ea2565b6000838152601260209081526040808320349055338352601382528220805460018101825590835290822001849055600f8054916112b883613c28565b9190505550610aef336001611ea2565b5050565b60006001600160a01b0382166112f5576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b031633146113445760405162461bcd60e51b8152600401610b1e90613b8e565b61100360006124fa565b601454600090600160401b90046001600160401b03164210156113845760405163ec25d02960e01b815260040160405180910390fd5b6001600160a01b0382166000908152601160209081526040808320805482518185028101850190935280835291929091908301828280156113e457602002820191906000526020600020905b8154815260200190600101908083116113d0575b5050505050905080516000036113fd5750600092915050565b60006114076120b9565b90506000805b835181101561147b578284828151811061142957611429613bc3565b60200260200101511115611469578284828151811061144a5761144a613bc3565b602002602001015161145c9190613c82565b6114669083613c15565b91505b8061147381613c28565b91505061140d565b50949350505050565b6009546001600160a01b031633146114ae5760405162461bcd60e51b8152600401610b1e90613b8e565b61100361254c565b6014546001600160401b03164210156114e2576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561150657604051634c013bd760e01b815260040160405180910390fd5b32331461152657604051639f8129d160e01b815260040160405180910390fd5b6000611530611a01565b9050803410156115535760405163078d696560e31b815260040160405180910390fd5b61012c6115636001546000540390565b61156e906001613c15565b036115795760108190555b6703782dace9d9000081036115c9576115bb6001600160a01b037f00000000000000000000000048656ee3ea6ffec99b52571baeab4c5b501da76c16346123e1565b6115c6336001611ea2565b50565b3360009081526011602090815260408220805460018101825590835290822034910155600e8054916115fa83613c28565b91905055506115c6336001611ea2565b606060038054610a1490613b5a565b601454600160401b90046001600160401b031642101561164c5760405163ec25d02960e01b815260040160405180910390fd5b600e5415801561165c5750600f54155b61100357600061166a6120b9565b9050600081600e5461167c9190613c6b565b90506000611689836120d8565b6116939084613c82565b600f546116a09190613c6b565b6000600e819055600f559050610aef6116b98284613c15565b6001600160a01b037f00000000000000000000000048656ee3ea6ffec99b52571baeab4c5b501da76c16906123e1565b816116f381611d49565b610aef83836125d4565b836001600160a01b03811633146117175761171733611d49565b61172385858585612699565b5050505050565b6014546001600160401b03164210611755576040516317efbd6b60e01b815260040160405180910390fd5b60195460ff161561177957604051634c013bd760e01b815260040160405180910390fd5b6002600a54036117cb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b1e565b6002600a556117eb868686868686601760166703782dace9d900006126dd565b50506001600a5550505050565b60608161180481611d22565b6118205760405162461bcd60e51b8152600401610b1e90613d9a565b601561182b8461283f565b60405160200161183c929190613ddc565b604051602081830303815290604052915050919050565b601454600160401b90046001600160401b03164210156118865760405163ec25d02960e01b815260040160405180910390fd5b60006118913361102a565b9050806000036118b457604051631b33a9b960e11b815260040160405180910390fd5b3360009081526011602052604081206118cc916135ae565b3360009081526013602052604081206118e4916135ae565b6115c633826123e1565b6009546001600160a01b031633146119185760405162461bcd60e51b8152600401610b1e90613b8e565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146119645760405162461bcd60e51b8152600401610b1e90613b8e565b7316485319aa0ad7a4e68176fbaada235c92acae2e6115c681476123e1565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff16156119bb575060016109ff565b6001600160a01b03831660009081526008602052604081205460ff1660018111156119e8576119e8613e82565b1480156119fa57506119fa8383612947565b9392505050565b6000601054600014611a14575060105490565b6000611a306703782dace9d90000673782dace9d900000613c82565b601454909150600090611a56906001600160401b0380821691600160401b900416613e98565b6014546001600160401b039182169250164211611a7d57673782dace9d9000009250505090565b601454600090611a96906001600160401b031642613c82565b9050600082611aa58386613c6b565b611aaf9190613c57565b905083811115611acb576703782dace9d9000094505050505090565b611add81673782dace9d900000613c82565b94505050505090565b6009546001600160a01b03163314611b105760405162461bcd60e51b8152600401610b1e90613b8e565b6001600160a01b038116611b755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b1e565b6115c6816124fa565b60136020528160005260406000208181548110611b9a57600080fd5b90600052602060002001600091509150505481565b6009546001600160a01b03163314611bd95760405162461bcd60e51b8152600401610b1e90613b8e565b806014610aef8282613ed1565b60006119fa836001600160a01b038416612985565b6000804660018114611c1d5760058114611c39576105398114611c5557611c6d565b73f034d6a4b1a64f0e6038632d87746ca24b79d3259150611c6d565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de659150611c6d565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b038116610fcc5760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610b1e565b60006109ff826129d4565b60006001600160e01b0319821663152a902d60e11b14806109ff57506301ffc9a760e01b6001600160e01b03198316146109ff565b60008054821080156109ff575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b156115c657604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dda9190613f2b565b6115c657604051633b79c77360e21b81526001600160a01b0382166004820152602401610b1e565b6000611e0d8261110b565b9050336001600160a01b03821614611e4657611e298133611983565b611e46576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61012c81611eb36001546000540390565b611ebd9190613c15565b1115611edc57604051639004693560e01b815260040160405180910390fd5b6112c88282612a22565b6000611ef182612230565b9050836001600160a01b0316816001600160a01b031614611f245760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611f7157611f548633611983565b611f7157604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611f9857604051633a954ecd60e21b815260040160405180910390fd5b611fa58686866001612b5b565b8015611fb057600082555b6001600160a01b0380871660009081526005602052604080822080546000190190559187168152208054600101905561200985611fee888287612bb9565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b8416900361205e5760018401600081815260046020526040812054900361205c57600054811461205c5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610ed1565b60006119fa836001600160a01b038416612bdc565b600080601054116120d157506703782dace9d9000090565b5060105490565b6000806120ed6703782dace9d9000084613c82565b90506119fa816703782dace9d90000612cd6565b600954600160a01b900460ff166121515760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b1e565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610aef838383604051806020016040528060008152506116fd565b6040805160808101825260008082526020820181905291810182905260608101919091526109ff6121e983612230565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b60008160005481101561227e5760008181526004602052604081205490600160e01b8216900361227c575b806000036119fa57506000190160008181526004602052604090205461225b565b505b604051636f96cda160e11b815260040160405180910390fd5b600c546040516331a9108f60e11b81526004810184905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa1580156122e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123099190613f48565b9050846001600160a01b0316816001600160a01b03160361232e5760019150506119fa565b826001600160a01b0316816001600160a01b0316036123d657600d54600c54604051631574d39f60e31b81526001600160a01b038881166004830152868116602483015291821660448201526064810187905291169063aba69cf890608401602060405180830381865afa1580156123aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ce9190613f2b565b9150506119fa565b506000949350505050565b804710156124315760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b1e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461247e576040519150601f19603f3d011682016040523d82523d6000602084013e612483565b606091505b5050905080610aef5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b1e565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156125995760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b1e565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121813390565b336125de81612cec565b6001600160a01b0316836001600160a01b03160361268f5781612602576001612605565b60005b6001600160a01b0382166000908152600860205260409020805460ff19166001838181111561263657612636613e82565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051612682911515815260200190565b60405180910390a3505050565b610aef8383612e43565b6126a4848484610c46565b6001600160a01b0383163b15610c40576126c084848484612ed8565b610c40576040516368d2bf6b60e11b815260040160405180910390fd5b346126ec8261ffff8b16613c6b565b1461270a5760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528b901b1660348201526001600160f01b031960f089901b1660488201526fffffffffffffffffffffffffffffffff19608088901b16604a82015260009061277b90605a01604051602081830303815290604052612fc3565b60008181526020859052604090205490915061ffff808a169161279f918c16613c15565b11156127be5760405163342e754760e21b815260040160405180910390fd5b6127ca84828888612ffe565b6000818152602084905260408120805461ffff8c1692906127ec908490613c15565b9091555061282590506001600160a01b037f00000000000000000000000048656ee3ea6ffec99b52571baeab4c5b501da76c16346123e1565b6128338a8a61ffff16611ea2565b50505050505050505050565b6060816000036128665750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612890578061287a81613c28565b91506128899050600a83613c57565b915061286a565b6000816001600160401b038111156128aa576128aa61397e565b6040519080825280601f01601f1916602001820160405280156128d4576020820181803683370190505b5090505b841561293f576128e9600183613c82565b91506128f6600a86613f65565b612901906030613c15565b60f81b81838151811061291657612916613bc3565b60200101906001600160f81b031916908160001a905350612938600a86613c57565b94506128d8565b949350505050565b60008061295384612cec565b90506001600160a01b0381161580159061293f5750826001600160a01b0316816001600160a01b031614949350505050565b60008181526001830160205260408120546129cc575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109ff565b5060006109ff565b60006301ffc9a760e01b6001600160e01b031983161480612a0557506380ac58cd60e01b6001600160e01b03198316145b806109ff5750506001600160e01b031916635b5e139f60e01b1490565b6000805490829003612a475760405163b562e8dd60e01b815260040160405180910390fd5b612a546000848385612b5b565b6001600160a01b03831660009081526005602052604081208054680100000000000000018502019055612aab908490612a8e908281612bb9565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612b3157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612af9565b5081600003612b5257604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff1615612bad5760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610b1e565b610c4084848484613062565b600060e882811c90612bcc868684613153565b62ffffff16901b95945050505050565b60008181526001830160205260408120548015612cc5576000612c00600183613c82565b8554909150600090612c1490600190613c82565b9050818114612c79576000866000018281548110612c3457612c34613bc3565b9060005260206000200154905080876000018481548110612c5757612c57613bc3565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612c8a57612c8a613f79565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109ff565b60009150506109ff565b5092915050565b6000818310612ce557816119fa565b5090919050565b600080468060018114612d215760898114612d3d5760048114612d5957620138818114612d75576105398114612d9157612da9565b73a5409ec958c83c3f309868babaca7c86dcb077c19250612da9565b7358807bad0b376efc12f5ad86aac70e78ed67deae9250612da9565b73f57b2c51ded3a29e6891aba85459d600256cf3179250612da9565b73ff7ca10af37178bdd056628ef42fd7f799fac77c9250612da9565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b0382161580612dc05750806089145b80612dcd57508062013881145b15612dd9575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa158015612e1f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293f9190613f48565b336001600160a01b03831603612e6c5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612f0d903390899088908890600401613f8f565b6020604051808303816000875af1925050508015612f48575060408051601f3d908101601f19168201909252612f4591810190613fcc565b60015b612fa6573d808015612f76576040519150601f19603f3d011682016040523d82523d6000602084013e612f7b565b606091505b508051600003612f9e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000612fcf825161283f565b82604051602001612fe1929190613fe9565b604051602081830303815290604052805190602001209050919050565b61300a84848484613173565b610c405760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610b1e565b6001600160a01b03831615806130a4575060016001600160a01b03841660009081526008602052604090205460ff1660018111156130a2576130a2613e82565b145b610c405760006130b384612cec565b90506001600160a01b0381166130ec57506001600160a01b0383166000908152600860205260409020805460ff19166001179055610c40565b6130f5846112cc565b60000361172357806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c316001604051613144911515815260200190565b60405180910390a35050505050565b60006001600160a01b038416612ccf5761316c836131c8565b90506119fa565b60006131bf6131b88585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061322892505050565b869061324c565b95945050505050565b600042446131d7600143613c82565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b6000806000613237858561326e565b91509150613244816132dc565b509392505050565b6001600160a01b038116600090815260018301602052604081205415156119fa565b60008082516041036132a45760208301516040840151606085015160001a61329887828585613492565b945094505050506132d5565b82516040036132cd57602083015160408401516132c286838361357f565b9350935050506132d5565b506000905060025b9250929050565b60008160048111156132f0576132f0613e82565b036132f85750565b600181600481111561330c5761330c613e82565b036133595760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b1e565b600281600481111561336d5761336d613e82565b036133ba5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b1e565b60038160048111156133ce576133ce613e82565b036134265760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b1e565b600481600481111561343a5761343a613e82565b036115c65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b1e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156134c95750600090506003613576565b8460ff16601b141580156134e157508460ff16601c14155b156134f25750600090506004613576565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613546573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661356f57600060019250925050613576565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016135a087828885613492565b935093505050935093915050565b50805460008255906000526020600020908101906115c691905b808211156135dc57600081556001016135c8565b5090565b6000602082840312156135f257600080fd5b5035919050565b6001600160e01b0319811681146115c657600080fd5b60006020828403121561362157600080fd5b81356119fa816135f9565b60005b8381101561364757818101518382015260200161362f565b50506000910152565b6000815180845261366881602086016020860161362c565b601f01601f19169290920160200192915050565b6020815260006119fa6020830184613650565b6001600160a01b03811681146115c657600080fd5b600080604083850312156136b757600080fd5b82356136c28161368f565b946020939093013593505050565b600080602083850312156136e357600080fd5b82356001600160401b03808211156136fa57600080fd5b818501915085601f83011261370e57600080fd5b81358181111561371d57600080fd5b8660208260061b850101111561373257600080fd5b60209290920196919550909350505050565b60008060006060848603121561375957600080fd5b83356137648161368f565b925060208401356137748161368f565b929592945050506040919091013590565b6000806040838503121561379857600080fd5b50508035926020909101359150565b60008083601f8401126137b957600080fd5b5081356001600160401b038111156137d057600080fd5b6020830191508360208285010111156132d557600080fd5b600080602083850312156137fb57600080fd5b82356001600160401b0381111561381157600080fd5b61381d858286016137a7565b90969095509350505050565b80151581146115c657600080fd5b60006020828403121561384957600080fd5b81356119fa81613829565b60008083601f84011261386657600080fd5b5081356001600160401b0381111561387d57600080fd5b6020830191508360208260051b85010111156132d557600080fd5b600080600080604085870312156138ae57600080fd5b84356001600160401b03808211156138c557600080fd5b6138d188838901613854565b909650945060208701359150808211156138ea57600080fd5b506138f787828801613854565b95989497509550505050565b60006020828403121561391557600080fd5b81356119fa8161368f565b6000806040838503121561393357600080fd5b8235915060208301356139458161368f565b809150509250929050565b6000806040838503121561396357600080fd5b823561396e8161368f565b9150602083013561394581613829565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156139aa57600080fd5b84356139b58161368f565b935060208501356139c58161368f565b92506040850135915060608501356001600160401b03808211156139e857600080fd5b818701915087601f8301126139fc57600080fd5b813581811115613a0e57613a0e61397e565b604051601f8201601f19908116603f01168101908382118183101715613a3657613a3661397e565b816040528281528a6020848701011115613a4f57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff81168114610fcc57600080fd5b60008060008060008060a08789031215613a9e57600080fd5b8635613aa98161368f565b9550613ab760208801613a73565b9450613ac560408801613a73565b935060608701356001600160801b0381168114613ae157600080fd5b925060808701356001600160401b03811115613afc57600080fd5b613b0889828a016137a7565b979a9699509497509295939492505050565b60008060408385031215613b2d57600080fd5b8235613b388161368f565b915060208301356139458161368f565b60006040828403121561110557600080fd5b600181811c90821680613b6e57607f821691505b60208210810361110557634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613beb57600080fd5b813563ffffffff811681146119fa57600080fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156109ff576109ff613bff565b600060018201613c3a57613c3a613bff565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082613c6657613c66613c41565b500490565b80820281158282048414176109ff576109ff613bff565b818103818111156109ff576109ff613bff565b601f821115610aef57600081815260208120601f850160051c81016020861015613cbc5750805b601f850160051c820191505b81811015610ed157828155600101613cc8565b6001600160401b03831115613cf257613cf261397e565b613d0683613d008354613b5a565b83613c95565b6000601f841160018114613d3a5760008515613d225750838201355b600019600387901b1c1916600186901b178355611723565b600083815260209020601f19861690835b82811015613d6b5786850135825560209485019460019092019101613d4b565b5086821015613d885760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b6000808454613dea81613b5a565b60018281168015613e025760018114613e1757613e46565b60ff1984168752821515830287019450613e46565b8860005260208060002060005b85811015613e3d5781548a820152908401908201613e24565b50505082870194505b50602f60f81b845286519250613e628382860160208a0161362c565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b03828116828216039080821115612ccf57612ccf613bff565b600081356001600160401b03811681146109ff57600080fd5b6001600160401b03613ee283613eb8565b168154816001600160401b031982161783556fffffffffffffffff0000000000000000613f1160208601613eb8565b60401b16826001600160801b031983161717835550505050565b600060208284031215613f3d57600080fd5b81516119fa81613829565b600060208284031215613f5a57600080fd5b81516119fa8161368f565b600082613f7457613f74613c41565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613fc290830184613650565b9695505050505050565b600060208284031215613fde57600080fd5b81516119fa816135f9565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000835161402181601a85016020880161362c565b83519083019061403881601a84016020880161362c565b01601a0194935050505056fea26469706673582212206d320bd1e91ff7037ddbe01c8c3e5e65b0ffecc4d98162cdcafc5df4208fe20e64736f6c63430008110033

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

000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000006468e070000000000000000000000000000000000000000000000000000000006468ee800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef00000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648000000000000000000000000000000000000000000000000000000000000003568747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f717561647261747572652f746f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd5952000000000000000000000000bbe65bb420b6005214e655ab385c3241a3f197d80000000000000000000000002726bba3e527584a1989c9fe392f21114307f72d0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000005500000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001

-----Decoded View---------------
Arg [0] : newOwner (address): 0xeDb7c032feF116163214FCDb6ca481E94794b187
Arg [1] : baseTokenURI (string): https://api.gmstudio.art/collections/quadrature/token
Arg [2] : config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [3] : payees (address[]): 0xe1a4cb40A1D672Bb7901b646Bb18Eb7B70BD5952,0xbBe65bB420B6005214e655AB385c3241a3F197d8,0x2726Bba3E527584a1989C9fe392f21114307F72d
Arg [4] : shares (uint256[]): 30,85,85
Arg [5] : sharesRoyalties (uint256[]): 1,1,1
Arg [6] : signersCurationPanelReserve (address): 0x5312fa01617678dCF4940c66b3adb5A468BC7Cef
Arg [7] : _gmToken (address): 0x36F4D96Fe0D4Eb33cdC2dC6C0bCA15b9Cdd0d648

-----Encoded View---------------
24 Constructor Arguments found :
Arg [0] : 000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b187
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 000000000000000000000000000000000000000000000000000000006468e070
Arg [3] : 000000000000000000000000000000000000000000000000000000006468ee80
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [7] : 0000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef
Arg [8] : 00000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [10] : 68747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374
Arg [11] : 696f6e732f717561647261747572652f746f6b656e0000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [13] : 000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd5952
Arg [14] : 000000000000000000000000bbe65bb420b6005214e655ab385c3241a3f197d8
Arg [15] : 0000000000000000000000002726bba3e527584a1989c9fe392f21114307f72d
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [17] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000055
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000055
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000001


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn 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.