ETH Price: $2,528.97 (-2.58%)

Contract

0x473833FBB446cf8EfE5f762455F9f17592277e52
 

Overview

ETH Balance

0.03 ETH

Eth Value

$75.87 (@ $2,528.97/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint Public207942432024-09-20 20:39:4710 days ago1726864787IN
0x473833FB...592277e52
0.01 ETH0.0014153822.67148389
Reveal207783392024-09-18 15:21:3513 days ago1726672895IN
0x473833FB...592277e52
0 ETH0.0029467512
Mint Public207782742024-09-18 15:08:2313 days ago1726672103IN
0x473833FB...592277e52
0.01 ETH0.0007491612
Reveal207760072024-09-18 7:31:5913 days ago1726644719IN
0x473833FB...592277e52
0 ETH0.001777497.78021392
Mint Public207759272024-09-18 7:15:5913 days ago1726643759IN
0x473833FB...592277e52
0.01 ETH0.000445095.59658936
Force Reveal207752352024-09-18 4:56:4713 days ago1726635407IN
0x473833FB...592277e52
0 ETH0.003045428.41417765
Create New Threa...207750612024-09-18 4:21:3513 days ago1726633295IN
0x473833FB...592277e52
0 ETH0.000340034.33919212
Swap Curios207748332024-09-18 3:35:2313 days ago1726630523IN
0x473833FB...592277e52
0 ETH0.001381547.19734576
Swap Curios207739562024-09-18 0:39:2313 days ago1726619963IN
0x473833FB...592277e52
0 ETH0.000891394.64382733
Swap Curios207737072024-09-17 23:49:1113 days ago1726616951IN
0x473833FB...592277e52
0 ETH0.00079593.53790423
Swap Curios207726102024-09-17 20:07:4713 days ago1726603667IN
0x473833FB...592277e52
0 ETH0.0032608722.05436691
Withdraw207716352024-09-17 16:51:2313 days ago1726591883IN
0x473833FB...592277e52
0 ETH0.0009321930.69474462
Swap Curios207209052024-09-10 14:48:3521 days ago1725979715IN
0x473833FB...592277e52
0 ETH0.001343747
Reveal207160292024-09-09 22:26:1121 days ago1725920771IN
0x473833FB...592277e52
0 ETH0.000506742.06359969
Reveal Many207150532024-09-09 19:10:2321 days ago1725909023IN
0x473833FB...592277e52
0 ETH0.009860479.24058666
Reveal207148722024-09-09 18:33:5921 days ago1725906839IN
0x473833FB...592277e52
0 ETH0.001644057.77878283
Mint Public207146882024-09-09 17:56:5921 days ago1725904619IN
0x473833FB...592277e52
0.01 ETH0.000534838.56700718
Reveal207131472024-09-09 12:47:2322 days ago1725886043IN
0x473833FB...592277e52
0 ETH0.000985844.01464469
Mint Public207130322024-09-09 12:24:1122 days ago1725884651IN
0x473833FB...592277e52
0.01 ETH0.00026153.28818118
Swap Curios207121552024-09-09 9:27:3522 days ago1725874055IN
0x473833FB...592277e52
0 ETH0.000671023.49580019
Swap Curios207121492024-09-09 9:26:2322 days ago1725873983IN
0x473833FB...592277e52
0 ETH0.000672553.50420937
Mint Public207116042024-09-09 7:36:3522 days ago1725867395IN
0x473833FB...592277e52
0.01 ETH0.000163722.62252481
Mint Public207116032024-09-09 7:36:2322 days ago1725867383IN
0x473833FB...592277e52
0.01 ETH0.000210262.64383232
Swap Curios Betw...207089132024-09-08 22:36:2322 days ago1725834983IN
0x473833FB...592277e52
0 ETH0.001000154.16312226
Swap Curios207089072024-09-08 22:35:1122 days ago1725834911IN
0x473833FB...592277e52
0 ETH0.000872184.54403505
View all transactions

Latest 4 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
207716352024-09-17 16:51:2313 days ago1726591883
0x473833FB...592277e52
0.3 ETH
198216422024-05-08 0:03:47146 days ago1715126627
0x473833FB...592277e52
2.51 ETH
185002432023-11-04 17:44:59331 days ago1699119899
0x473833FB...592277e52
0.09 ETH
184433682023-10-27 18:35:59339 days ago1698431759
0x473833FB...592277e52
8.55 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Poppets

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
File 1 of 35 : Poppets.sol
// SPDX-License-Identifier: UNLICENSED

//
// The NFTs managed by this smart contract are subject to the license found at IPFS CID
// bafkreih646uk4xlbk3vnogrwtb4mpwwmqd5ubhnwtgemp4rc5hy5xvs5cq
// https://ipfs.io/ipfs/bafkreih646uk4xlbk3vnogrwtb4mpwwmqd5ubhnwtgemp4rc5hy5xvs5cq
//

pragma solidity 0.8.20;

import "./lib/PoppetBase.sol";

contract Poppets is PoppetBase {
    constructor(
        string memory name_,
        string memory symbol_,
        address signer_,
        address curios_,
        string memory uri_
    ) PoppetBase(name_, symbol_, signer_, uri_) {
        _setDefaultRoyalty(msg.sender, 500);
        _setCuriosAddress(curios_);
    }

    function airdrop(
        address to_,
        uint256 quantity
    ) external payable onlyOwner activeThreadOnly quantityAvailable(quantity) {
        _mint(to_, quantity);
    }

    /**
     * @dev Airdrops Poppets tokens to a list of recipients.
     * @param recipients An array of addresses to receive the tokens.
     * @param quantities An array of token amounts to be sent to each recipient.
     * @notice The length of `recipients` and `quantities` arrays must be equal.
     * @notice Only the contract owner can call this function.
     */
    function poppetsplosion(
        address[] calldata recipients,
        uint256[] calldata quantities
    ) public payable onlyOwner activeThreadOnly {
        if (recipients.length != quantities.length) {
            revert MismatchedParameters();
        }

        for (uint i = 0; i < recipients.length; i++) {
            _mint(recipients[i], quantities[i]);
        }

        /* Not ideal to have this after mints happen, but it saves gas  to not check every time through the loop */
        if (_nextTokenId() > _getConfig().maxTokenId) {
            revert ExceedsMaxSupply();
        }
    }

    /**
     * @dev Mints a specified quantity of Poppet tokens to the caller of the function.
     *      The caller must send enough ether to cover the cost of the tokens.
     *      The price of the tokens is determined by the publicMintPrice value in the contract's configuration.
     *      If the publicMintPrice is set to 0, the function will revert with a PublicMintUnavailable error.
     *      If the caller sends insufficient funds, the function will revert with an InsufficientFunds error.
     * @param quantity The number of tokens to mint.
     */
    function mintPublic(
        uint256 quantity
    ) public payable quantityAvailable(quantity) activeThreadOnly {
        ThreadConfig storage config = _getConfig();
        if (config.publicMintPrice == 0) {
            revert PublicMintUnavailable();
        }
        if (msg.value < quantity * config.publicMintPrice) {
            revert InsufficientFunds();
        }

        _mint(msg.sender, quantity);
    }

    /**
     * @dev Mints a specified quantity of Poppet tokens to the caller of the function, provided that the caller's signature is valid.
     *      The caller must send enough ether to cover the cost of the tokens.
     *      The price of the tokens is determined by the signedMintPrice value in the contract's configuration.
     *      If the signedMintPrice is set to 0, the function will revert with a SignedMintUnavailable error.
     *      If the caller sends insufficient funds, the function will revert with an InsufficientFunds error.
     *      If the signature is invalid, the function will revert with an InvalidSignature error.
     * @param quantity The number of tokens to mint.
     * @param nonce The nonce used to sign the message.
     * @param signature The signature used to sign the message.
     */
    function mintSigned(
        uint256 quantity,
        uint256 nonce,
        bytes calldata signature
    ) public payable quantityAvailable(quantity) activeThreadOnly {
        ThreadConfig storage config = _getConfig();
        if (config.signedMintPrice == 0) {
            revert SignedMintUnavailable();
        }
        if (msg.value < quantity * config.signedMintPrice) {
            revert InsufficientFunds();
        }

        verifyMintKey(signature, msg.sender, config.currentThreadId, nonce);

        _mint(msg.sender, quantity);
    }

    function reveal(
        uint256 tokenId,
        uint256[] calldata poppet_accessories,
        uint256[] calldata bonus_accessories,
        uint256 free_poppets,
        uint256 nonce,
        bytes calldata signature
    ) public payable quantityAvailable(free_poppets) onlyPoppetOwner(tokenId) {
        if (REVEAL_PRICE > msg.value) {
            revert InsufficientFunds();
        }
        verifyRevealKey(
            signature,
            _msgSender(),
            tokenId,
            poppet_accessories,
            bonus_accessories,
            free_poppets,
            nonce
        );

        if (free_poppets > 0) {
            _mint(msg.sender, free_poppets);
        }

        if (poppet_accessories.length > 0) {
            ICurios(CURIOS).mintFromPack(
                _getTokenAccount(tokenId),
                poppet_accessories
            );
        }

        if (bonus_accessories.length > 0) {
            ICurios(CURIOS).mintFromPack(_msgSender(), bonus_accessories);
        }

        _reveal(_asSingletonArray(tokenId));
    }

    function forceReveal(
        uint256[] calldata tokenIds,
        RevealKey[] calldata revealKeys
    ) public payable onlyOwner {
        if (tokenIds.length != revealKeys.length) {
            revert MismatchedParameters();
        }
        for (uint i = 0; i < revealKeys.length; i++) {
            if (revealKeys[i].free_poppets > 0) {
                _mint(revealKeys[i].wallet, revealKeys[i].free_poppets);
            }

            if (revealKeys[i].poppet_accessories.length > 0) {
                ICurios(CURIOS).mintFromPack(
                    _getTokenAccount(revealKeys[i].tokenId),
                    revealKeys[i].poppet_accessories
                );
            }

            if (revealKeys[i].bonus_accessories.length > 0) {
                ICurios(CURIOS).mintFromPack(
                    revealKeys[i].wallet,
                    revealKeys[i].bonus_accessories
                );
            }
        }
        _reveal(tokenIds);
    }

    function revealMany(
        RevealKey[] calldata revealKeys,
        bytes[] calldata signatures
    ) public payable {
        if (REVEAL_PRICE * revealKeys.length > msg.value) {
            revert InsufficientFunds();
        }

        for (uint i = 0; i < revealKeys.length; i++) {
            reveal(
                revealKeys[i].tokenId,
                revealKeys[i].poppet_accessories,
                revealKeys[i].bonus_accessories,
                revealKeys[i].free_poppets,
                revealKeys[i].nonce,
                signatures[i]
            );
        }
    }

    function swapCurios(
        SwapKey calldata swapKey,
        Amounts calldata amounts,
        bytes calldata signature
    ) public payable onlyPoppetOwnerIfUnlocked(swapKey.tokenId) {
        if (SWAP_PRICE > msg.value) {
            revert InsufficientFunds();
        }

        verifySwapKey(signature, swapKey, _msgSender());
        _swapCurios(
            _msgSender(),
            _getTokenAccount(swapKey.tokenId),
            swapKey.remove,
            amounts.removeAmounts,
            swapKey.add,
            amounts.addAmounts
        );

        _swapCommunityCurios(
            _msgSender(),
            _getTokenAccount(swapKey.tokenId),
            swapKey.removeC,
            amounts.removeCAmounts,
            swapKey.addC,
            amounts.addCAmounts
        );

        _initializeOwnershipAt(swapKey.tokenId);
        _setExtraDataAt(swapKey.tokenId, uint24(block.number));

        emit PoppetTraitsUpdated(
            swapKey.tokenId,
            swapKey.remove,
            swapKey.add,
            swapKey.removeC,
            swapKey.addC
        );
    }

    function swapWithPermission(
        SwapPermissionKey calldata swapKeyA,
        SwapPermissionKey calldata swapKeyB,
        SwapPermissionMasterKey calldata swapPermissionMasterKey,
        Amounts calldata amounts,
        bytes calldata masterSignature
    )
        public
        payable
        unlockedOrOwner(swapKeyA.fromPoppet)
        unlockedOrOwner(swapKeyB.fromPoppet)
    {
        if (SWAP_PRICE * 2 > msg.value) {
            revert InsufficientFunds();
        }

        if (swapKeyA.fromPoppet != swapKeyB.toPoppet) {
            revert MismatchedParameters();
        }
        if (swapKeyB.fromPoppet != swapKeyA.toPoppet) {
            revert MismatchedParameters();
        }

        if (_msgSender() != ownerOf(swapKeyA.fromPoppet)) {
            if (_msgSender() != ownerOf(swapKeyB.fromPoppet)) {
                revert InsufficientPermissions();
            }
        }

        if (
            keccak256(
                abi.encodePacked(
                    abi.encodePacked(swapKeyA.add),
                    abi.encodePacked(swapKeyA.remove),
                    abi.encodePacked(swapKeyA.addC),
                    abi.encodePacked(swapKeyA.removeC)
                )
            ) !=
            keccak256(
                abi.encodePacked(
                    abi.encodePacked(swapKeyB.remove),
                    abi.encodePacked(swapKeyB.add),
                    abi.encodePacked(swapKeyB.removeC),
                    abi.encodePacked(swapKeyB.addC)
                )
            )
        ) {
            revert MismatchedParameters();
        }

        verifySwapPermissionKey(
            swapPermissionMasterKey.signatureA,
            swapKeyA,
            ownerOf(swapKeyA.fromPoppet)
        );
        verifySwapPermissionKey(
            swapPermissionMasterKey.signatureB,
            swapKeyB,
            ownerOf(swapKeyB.fromPoppet)
        );

        verifySwapPermissionMasterKey(masterSignature, swapPermissionMasterKey);

        _swapCurios(
            _getTokenAccount(swapKeyA.toPoppet),
            _getTokenAccount(swapKeyA.fromPoppet),
            swapKeyA.remove,
            amounts.removeAmounts,
            swapKeyA.add,
            amounts.addAmounts
        );

        _swapCommunityCurios(
            _getTokenAccount(swapKeyA.toPoppet),
            _getTokenAccount(swapKeyA.fromPoppet),
            swapKeyA.removeC,
            amounts.removeCAmounts,
            swapKeyA.addC,
            amounts.addCAmounts
        );

        _initializeOwnershipAt(swapKeyA.fromPoppet);
        _setExtraDataAt(swapKeyA.fromPoppet, uint24(block.number));
        _initializeOwnershipAt(swapKeyB.toPoppet);
        _setExtraDataAt(swapKeyB.fromPoppet, uint24(block.number));

        emit PoppetTraitsUpdated(
            swapKeyA.fromPoppet,
            swapKeyA.remove,
            swapKeyA.add,
            swapKeyA.removeC,
            swapKeyA.addC
        );
        emit PoppetTraitsUpdated(
            swapKeyB.fromPoppet,
            swapKeyB.remove,
            swapKeyB.add,
            swapKeyB.removeC,
            swapKeyB.addC
        );
    }

    function swapCuriosBetweenOwnedPoppets(
        SwapPermissionKey calldata swapKey,
        Amounts calldata amounts,
        SwapPermissionMasterKey calldata masterKey,
        bytes calldata masterSignature
    )
        public
        payable
        onlyPoppetOwnerIfUnlocked(swapKey.toPoppet)
        onlyPoppetOwnerIfUnlocked(swapKey.fromPoppet)
    {
        if (SWAP_PRICE * 2 > msg.value) {
            revert InsufficientFunds();
        }

        verifySwapPermissionKey(masterKey.signatureA, swapKey, _msgSender());
        verifySwapPermissionMasterKey(masterSignature, masterKey);

        _swapCurios(
            _getTokenAccount(swapKey.toPoppet),
            _getTokenAccount(swapKey.fromPoppet),
            swapKey.remove,
            amounts.removeAmounts,
            swapKey.add,
            amounts.addAmounts
        );
        _swapCommunityCurios(
            _getTokenAccount(swapKey.toPoppet),
            _getTokenAccount(swapKey.fromPoppet),
            swapKey.removeC,
            amounts.removeCAmounts,
            swapKey.addC,
            amounts.addCAmounts
        );

        _initializeOwnershipAt(swapKey.fromPoppet);
        _setExtraDataAt(swapKey.fromPoppet, uint24(block.number));
        _initializeOwnershipAt(swapKey.toPoppet);
        _setExtraDataAt(swapKey.toPoppet, uint24(block.number));

        emit PoppetTraitsUpdated(
            swapKey.fromPoppet,
            swapKey.remove,
            swapKey.add,
            swapKey.removeC,
            swapKey.addC
        );
        emit PoppetTraitsUpdated(
            swapKey.toPoppet,
            swapKey.add,
            swapKey.remove,
            swapKey.addC,
            swapKey.removeC
        );
    }

    function journal(
        bytes calldata signature,
        uint256 tokenId,
        string calldata ipfs_cid
    ) external onlyPoppetOwner(tokenId) {
        if (JOURNAL == address(0)) {
            revert JournalNotEnabled();
        }
        verifyJournalKey(signature, tokenId, ipfs_cid);
        IJournal(JOURNAL).mint(_msgSender(), tokenId);
        emit JournalEntry(tokenId, ipfs_cid);
    }

    function deactivateSwapPermissionKey(bytes calldata signature) public {
        _markUsed(signature);
    }
}

File 2 of 35 : PoppetBase.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;

import "@erc721a/ERC721A.sol";

import "../interfaces/ICurios.sol";
import "../interfaces/IJournal.sol";

import "@openzeppelin/v4.9.2/token/common/ERC2981.sol";
import "@openzeppelin/v4.9.2/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/v4.9.2/token/ERC1155/utils/ERC1155Holder.sol";

import "@openzeppelin/v4.9.2/access/Ownable.sol";

import "@operator-filter-registry/v1.4.2/RevokableDefaultOperatorFilterer.sol";
import "@operator-filter-registry/v1.4.2/UpdatableOperatorFilterer.sol";

import "../interfaces/IERC4906.4.9.2.sol";

import "../interfaces/IERC5192.sol";

import "./PoppetSignatureChecks.sol";

import "./PoppetErrorsAndEvents.sol";
import "./PoppetStructs.sol";

contract PoppetBase is
    PoppetErrorsAndEvents,
    PoppetStructs,
    PoppetEIP712,
    ERC721A,
    IERC4906,
    IERC5192,
    ERC2981,
    RevokableDefaultOperatorFilterer,
    Ownable,
    ERC721Holder,
    ERC1155Holder
{
    uint80 public SWAP_PRICE;

    uint80 public REVEAL_PRICE;

    address public CURIOS;

    address public COMMUNITY_CURIOS;

    address public JOURNAL;

    address private _receiver;

    address public WINTER;

    ThreadConfig public config;

    string public baseURI;

    address public PACKS;

    mapping(uint256 => bool) private _locked;

    constructor(
        string memory name_,
        string memory symbol_,
        address signer_,
        string memory uri_
    ) ERC721A(name_, symbol_) PoppetEIP712(name_, signer_) {
        _receiver = msg.sender;
        _setBaseURI(uri_);
    }

    // ███    ███  ██████  ██████  ██ ███████ ██ ███████ ██████  ███████
    // ████  ████ ██    ██ ██   ██ ██ ██      ██ ██      ██   ██ ██
    // ██ ████ ██ ██    ██ ██   ██ ██ █████   ██ █████   ██████  ███████
    // ██  ██  ██ ██    ██ ██   ██ ██ ██      ██ ██      ██   ██      ██
    // ██      ██  ██████  ██████  ██ ██      ██ ███████ ██   ██ ███████

    modifier onlyPoppetOwner(uint256 tokenId) {
        if (_msgSender() != ownerOf(tokenId)) {
            revert InsufficientPermissions();
        }
        _;
    }

    modifier onlyPoppetOwnerIfUnlocked(uint256 tokenId) {
        if (_msgSender() != ownerOf(tokenId)) {
            revert InsufficientPermissions();
        }
        if (_locked[tokenId]) {
            revert LockedToken();
        }
        _;
    }

    modifier activeThreadOnly() {
        if (config.maxTokenId < _nextTokenId()) {
            revert ExceedsMaxSupply();
        }
        if (block.timestamp > config.endTimestamp) {
            revert ThreadNotActive();
        }
        _;
    }

    modifier quantityAvailable(uint256 quantity) {
        if (_nextTokenId() + quantity > config.maxTokenId) {
            revert ExceedsMaxSupply();
        }
        _;
    }

    modifier unlockedOrOwner(uint256 tokenId) {
        if (_locked[tokenId]) {
            if (_msgSender() != owner()) {
                revert LockedToken();
            }
        }
        _;
    }

    //  █████  ██████  ███    ███ ██ ███    ██
    // ██   ██ ██   ██ ████  ████ ██ ████   ██
    // ███████ ██   ██ ██ ████ ██ ██ ██ ██  ██
    // ██   ██ ██   ██ ██  ██  ██ ██ ██  ██ ██
    // ██   ██ ██████  ██      ██ ██ ██   ████

    function setSigner(address signer_) external payable onlyOwner {
        _setSigner(signer_);
    }

    function setCuriosAddress(address curios_) external payable onlyOwner {
        _setCuriosAddress(curios_);
    }

    function _setCuriosAddress(address curios) internal {
        CURIOS = curios;
    }

    function setCommunityCuriosAddress(
        address curios_
    ) external payable onlyOwner {
        _setCommunityCuriosAddress(curios_);
    }

    function _setCommunityCuriosAddress(address curios) internal {
        COMMUNITY_CURIOS = curios;
    }

    function setWinterAddress(address winter_) external payable onlyOwner {
        _setWinterAddress(winter_);
    }

    function _setWinterAddress(address winter) internal {
        WINTER = winter;
    }

    function setJournalAddress(address journal_) external payable onlyOwner {
        _setJournalAddress(journal_);
    }

    function _setJournalAddress(address journal) internal {
        JOURNAL = journal;
    }

    function _setBaseURI(string memory uri_) internal {
        baseURI = uri_;
    }

    function setBaseURI(string calldata uri_) external payable onlyOwner {
        _setBaseURI(uri_);
        emit BatchMetadataUpdate(1, _nextTokenId() - 1);
    }

    function setSwapPrice(uint80 swapPrice_) external payable onlyOwner {
        _setSwapPrice(swapPrice_);
    }

    function _setSwapPrice(uint80 swapPrice_) internal {
        SWAP_PRICE = swapPrice_;
    }

    function setRevealPrice(uint80 revealPrice_) external payable onlyOwner {
        _setRevealPrice(revealPrice_);
    }

    function _setRevealPrice(uint80 revealPrice_) internal {
        REVEAL_PRICE = revealPrice_;
    }

    function setPacksAddress(address packs_) external payable onlyOwner {
        _setPackAddress(packs_);
    }

    function _setPackAddress(address packs_) internal {
        PACKS = packs_;
    }

    function disableJournalEntry(
        uint256 tokenId,
        string calldata ipfs_cid
    ) external payable onlyOwner {
        emit JournalEntryDisabled(tokenId, ipfs_cid);
    }

    function createNewThread(
        uint publicMintPrice,
        uint signedMintPrice,
        uint supply,
        uint endTimestamp
    ) external payable onlyOwner {
        unchecked {
            ++config.currentThreadId;
        }
        config.publicMintPrice = uint80(publicMintPrice);
        config.signedMintPrice = uint80(signedMintPrice);
        config.maxTokenId = uint16(_nextTokenId() + supply);
        config.endTimestamp = uint40(endTimestamp);
        config.threadSeed = uint24(
            uint256(
                keccak256(
                    abi.encodePacked(config.threadSeed, config.currentThreadId)
                )
            ) % (2 ** 24 - 1)
        );

        uint256 team_supply = supply / 20;

        if (team_supply > 0) {
            _mint(owner(), team_supply);
        } else {
            _mint(owner(), 1);
        }

        emit ThreadStarted(
            config.currentThreadId,
            config.endTimestamp,
            config.threadSeed
        );
    }

    //     ███    ███  ██████  ███    ███ ████████
    //     ████  ████ ██       ████  ████    ██
    //     ██ ████ ██ ██   ███ ██ ████ ██    ██
    //     ██  ██  ██ ██    ██ ██  ██  ██    ██
    //     ██      ██  ██████  ██      ██    ██

    /**
     * @notice Swaps Curios (accessories) tokens between the contract and a specified owner in batches
     * @dev Creating the amounts arrays off-chain is WAY cheaper than doing so on EVM and it's not mysterious
     * @param _owner The address of the owner to swap tokens with.
     * @param remove An array of token IDs to remove from the contract.
     * @param removeAmounts An array of amounts for each token ID to remove. Should be [1,1...] with length of remove
     * @param add An array of token IDs to add to the contract.
     * @param addAmounts An array of amounts for each token ID to add. Should be [1,1...] with length of add
     */
    function _swapCurios(
        address _owner,
        address _tokenAccount,
        uint256[] calldata remove,
        uint256[] calldata removeAmounts,
        uint256[] calldata add,
        uint256[] calldata addAmounts
    ) internal {
        if (remove.length > 0) {
            ICurios(CURIOS).safeBatchTransferFrom(
                _tokenAccount,
                _owner,
                remove,
                removeAmounts,
                ""
            );
        }
        if (add.length > 0) {
            ICurios(CURIOS).safeBatchTransferFrom(
                _owner,
                _tokenAccount,
                add,
                addAmounts,
                ""
            );
        }
    }

    /**
     * @notice Swaps Curios (accessories) tokens between the contract and a specified owner in batches
     * @dev Creating the amounts arrays off-chain is WAY cheaper than doing so on EVM and it's not mysterious
     * @param _owner The address of the owner to swap tokens with.
     * @param remove An array of token IDs to remove from the contract.
     * @param removeAmounts An array of amounts for each token ID to remove. Should be [1,1...] with length of remove
     * @param add An array of token IDs to add to the contract.
     * @param addAmounts An array of amounts for each token ID to add. Should be [1,1...] with length of add
     */
    function _swapCommunityCurios(
        address _owner,
        address _tokenAccount,
        uint256[] calldata remove,
        uint256[] calldata removeAmounts,
        uint256[] calldata add,
        uint256[] calldata addAmounts
    ) internal {
        if (remove.length > 0) {
            ICurios(COMMUNITY_CURIOS).safeBatchTransferFrom(
                _tokenAccount,
                _owner,
                remove,
                removeAmounts,
                ""
            );
        }
        if (add.length > 0) {
            ICurios(COMMUNITY_CURIOS).safeBatchTransferFrom(
                _owner,
                _tokenAccount,
                add,
                addAmounts,
                ""
            );
        }
    }

    function _reveal(uint256[] memory tokenIds) internal {
        emit PoppetsRevealed(_msgSender(), tokenIds);
    }

    // ███    ███ ██ ███    ██ ████████
    // ████  ████ ██ ████   ██    ██
    // ██ ████ ██ ██ ██ ██  ██    ██
    // ██  ██  ██ ██ ██  ██ ██    ██
    // ██      ██ ██ ██   ████    ██

    function mintFromWinter(address to_, uint amt) public payable {
        if (_msgSender() != WINTER) {
            revert InsufficientPermissions();
        }
        _mint(to_, amt);
    }

    //  ██████  ███████ ████████ ████████ ███████ ██████  ███████
    // ██       ██         ██       ██    ██      ██   ██ ██
    // ██   ███ █████      ██       ██    █████   ██████  ███████
    // ██    ██ ██         ██       ██    ██      ██   ██      ██
    //  ██████  ███████    ██       ██    ███████ ██   ██ ███████

    function _getConfig() internal view returns (ThreadConfig storage) {
        return config;
    }

    function _getPublicPrice() external view returns (uint) {
        return config.publicMintPrice;
    }

    function _getSignedPrice() external view returns (uint) {
        return config.signedMintPrice;
    }

    /*
        We're just going to treat tokenIds as accounts - the odds of someone having
        the private key to 0x00..1 through 0x00..ffff or whatever are infinitesmally low.
    */
    function _getTokenAccount(uint256 tokenId) internal pure returns (address) {
        // 00000000005f3dd0d326e1d00000000000000000
        return address(uint160(494521973352776966419055802073481216 + tokenId));
    }

    //  ██████  ██    ██ ███████ ██████  ██████  ██ ██████  ███████ ███████
    // ██    ██ ██    ██ ██      ██   ██ ██   ██ ██ ██   ██ ██      ██
    // ██    ██ ██    ██ █████   ██████  ██████  ██ ██   ██ █████   ███████
    // ██    ██  ██  ██  ██      ██   ██ ██   ██ ██ ██   ██ ██           ██
    //  ██████    ████   ███████ ██   ██ ██   ██ ██ ██████  ███████ ███████
    //
    // Functions that override ERC-standards, primarily for the OS Operator Filter
    // and soulbound tokens

    /// @notice Returns the locking status of an Soulbound Token
    /// @dev SBTs assigned to zero address are considered invalid, and queries
    /// about them do throw.
    /// @param tokenId The identifier for an SBT.
    function locked(uint256 tokenId) external view returns (bool) {
        return _locked[tokenId];
    }

    function lock(uint256 tokenId) external onlyPoppetOwner(tokenId) {
        _locked[tokenId] = true;
        emit Locked(tokenId);
    }

    function unlock(uint256 tokenId) external onlyOwner {
        _locked[tokenId] = false;
        emit Unlocked(tokenId);
    }

    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    /**
     * @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 override returns (string memory) {
        return baseURI;
    }

    /**
     * @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,
        address,
        uint24 previousExtraData
    ) internal view override returns (uint24) {
        // Revert if the current block isn't 48 hours after the previous extraData (12 seconds = 1 block)
        unchecked {
            if (
                previousExtraData != 0 &&
                uint24(previousExtraData + 14400) > uint24(block.number)
            ) {
                revert CooldownNotComplete();
            }
        }

        return previousExtraData;
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * Overrides here include checks for individual token supply limits, tracking
     * totalSupply for each token,
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal override {
        if (from == address(0)) {
            // Minting - make sure totalSupply is less than maxSupply
            if (_nextTokenId() + quantity > config.maxTokenId) {
                revert ExceedsMaxSupply();
            }
        } else if (to != address(0)) {}
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    /**
     * @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 override {
        if (from == address(0)) {
            // Minting - set extraData to block number for trait generation purposes
            unchecked {
                uint24 seed = uint24(block.number - 14400);
                _setExtraDataAt(startTokenId, seed);
                emit PoppetsMinted(startTokenId, seed, to, quantity);
            }
        } else {
            // Check for journal entries and transfer if they exist
            if (JOURNAL != address(0)) {
                IJournal(JOURNAL).safeTransferFrom(
                    _getTokenAccount(startTokenId),
                    to,
                    startTokenId
                );
            }
        }
        super._afterTokenTransfers(from, to, startTokenId, quantity);
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function setApprovalForAll(
        address operator,
        bool approved
    ) public override onlyAllowedOperatorApproval(operator) {
        super.setApprovalForAll(operator, approved);
    }

    /**
     * @dev See {IERC721-approve}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function approve(
        address operator,
        uint256 tokenId
    ) public payable override onlyAllowedOperatorApproval(operator) {
        super.approve(operator, tokenId);
    }

    /**
     * @dev See {IERC721-transferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    )
        public
        payable
        override
        onlyAllowedOperator(from)
        unlockedOrOwner(tokenId)
    {
        super.transferFrom(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    )
        public
        payable
        override
        onlyAllowedOperator(from)
        unlockedOrOwner(tokenId)
    {
        super.safeTransferFrom(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     *      In this example the added modifier ensures that the operator is allowed by the OperatorFilterRegistry.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    )
        public
        payable
        override
        onlyAllowedOperator(from)
        unlockedOrOwner(tokenId)
    {
        super.safeTransferFrom(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the ERC721 token contract.
     */
    function owner()
        public
        view
        virtual
        override(Ownable, UpdatableOperatorFilterer)
        returns (address)
    {
        return Ownable.owner();
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(
        bytes4 interfaceId
    )
        public
        view
        virtual
        override(ERC721A, ERC1155Receiver, ERC2981)
        returns (bool)
    {
        return
            interfaceId == bytes4(0x49064906) || // ERC-4906
            ERC721A.supportsInterface(interfaceId) ||
            ERC1155Receiver.supportsInterface(interfaceId) ||
            super.supportsInterface(interfaceId);
    }

    // ███████ ██ ███    ██  █████  ███    ██  ██████ ███████ ███████
    // ██      ██ ████   ██ ██   ██ ████   ██ ██      ██      ██
    // █████   ██ ██ ██  ██ ███████ ██ ██  ██ ██      █████   ███████
    // ██      ██ ██  ██ ██ ██   ██ ██  ██ ██ ██      ██           ██
    // ██      ██ ██   ████ ██   ██ ██   ████  ██████ ███████ ███████

    function withdraw() public payable {
        (bool sent, bytes memory data) = payable(_receiver).call{
            value: address(this).balance
        }("");
        require(sent, "Failed to send Ether");
    }

    function setDefaultRoyalty(
        address receiver,
        uint96 feeNumerator
    ) public payable onlyOwner {
        _receiver = receiver;
        _setDefaultRoyalty(_receiver, feeNumerator);
    }

    // ░░    ░░ ░░░░░░░░ ░░ ░░      ░░ ░░░░░░░░ ░░    ░░
    // ▒▒    ▒▒    ▒▒    ▒▒ ▒▒      ▒▒    ▒▒     ▒▒  ▒▒
    // ▒▒    ▒▒    ▒▒    ▒▒ ▒▒      ▒▒    ▒▒      ▒▒▒▒
    // ▓▓    ▓▓    ▓▓    ▓▓ ▓▓      ▓▓    ▓▓       ▓▓
    //  ██████     ██    ██ ███████ ██    ██       ██

    function _asSingletonArray(
        uint256 element
    ) internal pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }

    function mintCuriosFromPacks(
        address to_,
        uint[] calldata ids
    ) external payable {
        if (_msgSender() != PACKS) {
            revert InsufficientPermissions();
        }
        ICurios(CURIOS).mintFromPack(to_, ids);
    }

    function mintCommunityCuriosFromPacks(
        address to_,
        uint[] calldata ids
    ) external payable {
        if (_msgSender() != PACKS) {
            revert InsufficientPermissions();
        }
        ICurios(COMMUNITY_CURIOS).mintFromPack(to_, ids);
    }
}

File 3 of 35 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        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 4 of 35 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 5 of 35 : ICurios.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;

interface ICurios {
    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;

    function mintFromPoppets(uint[] calldata ids) external;

    function mintFromPack(address to_, uint[] calldata ids) external;

    function balanceOf(
        address account,
        uint256 id
    ) external view returns (uint256);
}

File 6 of 35 : PoppetStructs.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;

interface PoppetStructs {
    struct ThreadConfig {
        // 256 bits available
        uint80 publicMintPrice; // 80
        uint80 signedMintPrice; // 160
        uint16 maxTokenId; // 176
        uint40 endTimestamp; // 216
        uint16 currentThreadId; // 232
        uint24 threadSeed; // 256
    }
}

File 7 of 35 : PoppetSignatureChecks.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;
import "@openzeppelin/v4.9.2/utils/cryptography/EIP712.sol";
import "./PoppetErrorsAndEvents.sol";

contract PoppetEIP712 is EIP712, PoppetErrorsAndEvents {
    struct MintKey {
        address wallet;
        uint256 threadId;
        uint256 nonce;
    }

    struct JournalKey {
        uint256 tokenId;
        string ipfs_cid;
    }

    struct SwapKey {
        address wallet;
        uint256 tokenId;
        uint256[] remove;
        uint256[] add;
        uint256[] removeC;
        uint256[] addC;
        uint256 nonce;
    }

    struct SwapPermissionKey {
        address wallet;
        uint256 fromPoppet;
        uint256 toPoppet;
        uint256[] remove;
        uint256[] add;
        uint256[] removeC;
        uint256[] addC;
        uint256 nonce;
    }

    struct SwapPermissionMasterKey {
        bytes signatureA;
        bytes signatureB;
        uint256 nonce;
    }

    struct RevealKey {
        address wallet;
        uint256 tokenId;
        uint256[] poppet_accessories;
        uint256[] bonus_accessories;
        uint256 free_poppets;
        uint256 nonce;
    }

    struct Amounts {
        uint256[] removeAmounts;
        uint256[] addAmounts;
        uint256[] removeCAmounts;
        uint256[] addCAmounts;
    }

    mapping(bytes => bool) private _signature_used;

    bytes32 private constant MINTKEY_TYPE_HASH =
        keccak256("MintKey(address wallet,uint256 threadId,uint256 nonce)");

    bytes32 private constant JOURNALKEY_TYPE_HASH =
        keccak256("JournalKey(uint256 tokenId,string ipfs_cid)");

    bytes32 private constant SWAPKEY_TYPE_HASH =
        keccak256(
            "SwapKey(address wallet,uint256 tokenId,uint256[] remove,uint256[] add,uint256[] removeC,uint256[] addC,uint256 nonce)"
        );

    bytes32 private constant SWAP_PERMISSIONKEY_TYPE_HASH =
        keccak256(
            "SwapPermissionKey(address wallet,uint256 fromPoppet,uint256 toPoppet,uint256[] remove,uint256[] add,uint256[] removeC,uint256[] addC,uint256 nonce)"
        );

    bytes32 private constant SWAP_PERMISSION_MASTERKEY_TYPE_HASH =
        keccak256(
            "SwapPermissionMasterKey(bytes signatureA,bytes signatureB,uint256 nonce)"
        );

    bytes32 private constant REVEALKEY_TYPE_HASH =
        keccak256(
            "RevealKey(address wallet,uint256 tokenId,uint256[] poppet_accessories,uint256[] bonus_accessories,uint256 free_poppets,uint256 nonce)"
        );

    address private _signer;

    constructor(string memory name_, address signer_) EIP712(name_, "1") {
        _setSigner(signer_);
    }

    function _setSigner(address signer) internal {
        _signer = signer;
    }

    function _markUsed(bytes calldata signature) internal {
        _signature_used[signature] = true;
    }

    function verifyMintKey(
        bytes calldata signature,
        address wallet,
        uint256 threadId,
        uint256 nonce
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(abi.encode(MINTKEY_TYPE_HASH, wallet, threadId, nonce))
        );

        if (ECDSA.recover(digest, signature) == _signer) {
            _signature_used[signature] = true;
            return true;
        }
        revert InvalidSignature();
    }

    function verifySwapKey(
        bytes calldata signature,
        SwapKey calldata swapKey,
        address wallet
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    SWAPKEY_TYPE_HASH,
                    wallet,
                    swapKey.tokenId,
                    keccak256(abi.encodePacked(swapKey.remove)),
                    keccak256(abi.encodePacked(swapKey.add)),
                    keccak256(abi.encodePacked(swapKey.removeC)),
                    keccak256(abi.encodePacked(swapKey.addC)),
                    swapKey.nonce
                )
            )
        );

        if (ECDSA.recover(digest, signature) == _signer) {
            _signature_used[signature] = true;
            return true;
        }
        revert InvalidSignature();
    }

    function verifySwapPermissionKey(
        bytes calldata signature,
        SwapPermissionKey calldata swapPermissionKey,
        address wallet
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    SWAP_PERMISSIONKEY_TYPE_HASH,
                    swapPermissionKey.wallet,
                    swapPermissionKey.fromPoppet,
                    swapPermissionKey.toPoppet,
                    keccak256(abi.encodePacked(swapPermissionKey.remove)),
                    keccak256(abi.encodePacked(swapPermissionKey.add)),
                    keccak256(abi.encodePacked(swapPermissionKey.removeC)),
                    keccak256(abi.encodePacked(swapPermissionKey.addC)),
                    swapPermissionKey.nonce
                )
            )
        );

        if (ECDSA.recover(digest, signature) == wallet) {
            _signature_used[signature] = true;
            return true;
        }

        revert InvalidSignature();
    }

    function verifySwapPermissionMasterKey(
        bytes calldata signature,
        SwapPermissionMasterKey calldata swapPermissionMasterKey
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    SWAP_PERMISSION_MASTERKEY_TYPE_HASH,
                    keccak256(
                        abi.encodePacked(swapPermissionMasterKey.signatureA)
                    ),
                    keccak256(
                        abi.encodePacked(swapPermissionMasterKey.signatureB)
                    ),
                    swapPermissionMasterKey.nonce
                )
            )
        );

        if (ECDSA.recover(digest, signature) == _signer) {
            _signature_used[signature] = true;
            return true;
        }
        revert InvalidSignature();
    }

    function verifyJournalKey(
        bytes calldata signature,
        uint256 tokenId,
        string calldata ipfs_cid
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    JOURNALKEY_TYPE_HASH,
                    tokenId,
                    keccak256(abi.encodePacked(bytes(ipfs_cid)))
                )
            )
        );

        if (ECDSA.recover(digest, signature) == _signer) {
            _signature_used[signature] = true;
            return true;
        }

        revert InvalidSignature();
    }

    function verifyRevealKey(
        bytes calldata signature,
        address wallet,
        uint256 tokenId,
        uint256[] calldata poppet_accessories,
        uint256[] calldata bonus_accessories,
        uint256 free_poppets,
        uint256 nonce
    ) internal returns (bool) {
        if (_signature_used[signature]) {
            revert SignatureAlreadyUsed();
        }

        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    REVEALKEY_TYPE_HASH,
                    wallet,
                    tokenId,
                    keccak256(abi.encodePacked(poppet_accessories)),
                    keccak256(abi.encodePacked(bonus_accessories)),
                    free_poppets,
                    nonce
                )
            )
        );

        if (ECDSA.recover(digest, signature) == _signer) {
            _signature_used[signature] = true;
            return true;
        }

        revert InvalidSignature();
    }
}

File 8 of 35 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.8;

import "./ECDSA.sol";
import "../ShortStrings.sol";
import "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * _Available since v3.4._
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _name.toStringWithFallback(_nameFallback),
            _version.toStringWithFallback(_versionFallback),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }
}

File 9 of 35 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.8;

import "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(_FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 10 of 35 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 11 of 35 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.0;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 12 of 35 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

    /**
     * @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 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 13 of 35 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

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

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

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

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

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

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 14 of 35 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 16 of 35 : PoppetErrorsAndEvents.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;

interface PoppetErrorsAndEvents {
    error InsufficientFunds();

    error ExceedsMaxSupply();

    error PublicMintUnavailable();

    error SignedMintUnavailable();

    error InvalidSignature();

    error SignatureAlreadyUsed();

    error MismatchedParameters();

    error InsufficientPermissions();

    error ThreadNotActive();

    error CooldownNotComplete();

    error JournalNotEnabled();

    error LockedToken();

    event ThreadStarted(
        uint16 indexed thread_id,
        uint40 indexed end_timestamp,
        uint24 thread_seed
    );

    event PoppetsMinted(
        uint256 indexed start_token_id,
        uint24 indexed seed,
        address indexed minter,
        uint256 quantity
    );

    event PoppetsRevealed(address indexed owner, uint256[] token_ids);

    event PoppetTraitsUpdated(
        uint256 indexed token_id,
        uint256[] removed_official,
        uint256[] added_official,
        uint256[] removed_community,
        uint256[] added_community
    );

    event JournalEntry(uint256 indexed token_id, string ipfs_cid);

    event JournalEntryDisabled(uint256 indexed token_id, string ipfs_cid);

    event WTF(uint256 indexed token_id, uint256 balance, address wallet);

    event WTFBytes(bytes data, bytes data2, uint256 nonce);
}

File 17 of 35 : IERC4906.4.9.2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/// @title EIP-721 Metadata Update Extension
interface IERC4906 {
    /// @dev This event emits when the metadata of a token is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFT.
    event MetadataUpdate(uint256 _tokenId);

    /// @dev This event emits when the metadata of a range of tokens is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFTs.    
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

File 18 of 35 : RevokableDefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {RevokableOperatorFilterer} from "./RevokableOperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION, CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
/**
 * @title  RevokableDefaultOperatorFilterer
 * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription.
 *         Note that OpenSea will disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 */

abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor()
        RevokableOperatorFilterer(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION, true)
    {}
}

File 19 of 35 : RevokableOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  RevokableOperatorFilterer
 * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The
 *         Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at
 *         any point. As implemented, this abstract contract allows the contract owner to permanently skip the
 *         OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry
 *         address cannot be further updated.
 *         Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 */
abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer {
    /// @dev Emitted when the registry has already been revoked.
    error RegistryHasBeenRevoked();
    /// @dev Emitted when the initial registry address is attempted to be set to the zero address.
    error InitialRegistryAddressCannotBeZeroAddress();

    event OperatorFilterRegistryRevoked();

    bool public isOperatorFilterRegistryRevoked;

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe)
        UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe)
    {
        // don't allow creating a contract with a permanently revoked registry
        if (_registry == address(0)) {
            revert InitialRegistryAddressCannotBeZeroAddress();
        }
    }

    /**
     * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero
     *         address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner.
     */
    function updateOperatorFilterRegistryAddress(address newRegistry) public override {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        // if registry has been revoked, do not allow further updates
        if (isOperatorFilterRegistryRevoked) {
            revert RegistryHasBeenRevoked();
        }

        operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
        emit OperatorFilterRegistryAddressUpdated(newRegistry);
    }

    /**
     * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner.
     */
    function revokeOperatorFilterRegistry() public {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        // if registry has been revoked, do not allow further updates
        if (isOperatorFilterRegistryRevoked) {
            revert RegistryHasBeenRevoked();
        }

        // set to zero address to bypass checks
        operatorFilterRegistry = IOperatorFilterRegistry(address(0));
        isOperatorFilterRegistryRevoked = true;
        emit OperatorFilterRegistryRevoked();
    }
}

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

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 21 of 35 : UpdatableOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  UpdatableOperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the
 *         OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address,
 *         which will bypass registry checks.
 *         Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 * @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 UpdatableOperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);
    /// @dev Emitted when someone other than the owner is trying to call an only owner function.
    error OnlyOwner();

    event OperatorFilterRegistryAddressUpdated(address newRegistry);

    IOperatorFilterRegistry public operatorFilterRegistry;

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) {
        IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry);
        operatorFilterRegistry = registry;
        // 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(registry).code.length > 0) {
            if (subscribe) {
                registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    registry.register(address(this));
                }
            }
        }
    }

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    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);
        }
        _;
    }

    /**
     * @dev A helper function to check if the operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero
     *         address, checks will be bypassed. OnlyOwner.
     */
    function updateOperatorFilterRegistryAddress(address newRegistry) public virtual {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
        emit OperatorFilterRegistryAddressUpdated(newRegistry);
    }

    /**
     * @dev Assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract.
     */
    function owner() public view virtual returns (address);

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        IOperatorFilterRegistry registry = operatorFilterRegistry;
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(registry) != address(0) && address(registry).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!registry.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

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

pragma solidity ^0.8.4;

import './IERC721A.sol';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return _tokenApprovals[tokenId].value;
    }

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 24 of 35 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 25 of 35 : IJournal.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.20;

interface IJournal {
    function mint(address to, uint256 tokenId) external;

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;
}

File 26 of 35 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

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

pragma solidity ^0.8.0;

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

File 28 of 35 : IERC5192.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IERC5192 {
    /// @notice Emitted when the locking status is changed to locked.
    /// @dev If a token is minted and the status is locked, this event should be emitted.
    /// @param tokenId The identifier for a token.
    event Locked(uint256 tokenId);

    /// @notice Emitted when the locking status is changed to unlocked.
    /// @dev If a token is minted and the status is unlocked, this event should be emitted.
    /// @param tokenId The identifier for a token.
    event Unlocked(uint256 tokenId);

    /// @notice Returns the locking status of an Soulbound Token
    /// @dev SBTs assigned to zero address are considered invalid, and queries
    /// about them do throw.
    /// @param tokenId The identifier for an SBT.
    function locked(uint256 tokenId) external view returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

        return (royalty.receiver, royaltyAmount);
    }

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

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

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

File 33 of 35 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 34 of 35 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 35 of 35 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@erc721a=.cache/erc721a/v4.2.3",
    "@openzeppelin/v4.9.2=.cache/OpenZeppelin/v4.9.2",
    "@operator-filter-registry/v1.4.2=.cache/OpenSeaOperatorFilter/v1.4.2"
  ],
  "viaIR": false
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"signer_","type":"address"},{"internalType":"address","name":"curios_","type":"address"},{"internalType":"string","name":"uri_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CooldownNotComplete","type":"error"},{"inputs":[],"name":"ExceedsMaxSupply","type":"error"},{"inputs":[],"name":"InitialRegistryAddressCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InsufficientPermissions","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"JournalNotEnabled","type":"error"},{"inputs":[],"name":"LockedToken","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"MismatchedParameters","type":"error"},{"inputs":[],"name":"OnlyOwner","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":"PublicMintUnavailable","type":"error"},{"inputs":[],"name":"RegistryHasBeenRevoked","type":"error"},{"inputs":[],"name":"SignatureAlreadyUsed","type":"error"},{"inputs":[],"name":"SignedMintUnavailable","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[],"name":"ThreadNotActive","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"token_id","type":"uint256"},{"indexed":false,"internalType":"string","name":"ipfs_cid","type":"string"}],"name":"JournalEntry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"token_id","type":"uint256"},{"indexed":false,"internalType":"string","name":"ipfs_cid","type":"string"}],"name":"JournalEntryDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRegistry","type":"address"}],"name":"OperatorFilterRegistryAddressUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"OperatorFilterRegistryRevoked","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":true,"internalType":"uint256","name":"token_id","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"removed_official","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"added_official","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"removed_community","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"added_community","type":"uint256[]"}],"name":"PoppetTraitsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"start_token_id","type":"uint256"},{"indexed":true,"internalType":"uint24","name":"seed","type":"uint24"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"PoppetsMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"token_ids","type":"uint256[]"}],"name":"PoppetsRevealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"thread_id","type":"uint16"},{"indexed":true,"internalType":"uint40","name":"end_timestamp","type":"uint40"},{"indexed":false,"internalType":"uint24","name":"thread_seed","type":"uint24"}],"name":"ThreadStarted","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":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"token_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"WTF","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"data2","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"WTFBytes","type":"event"},{"inputs":[],"name":"COMMUNITY_CURIOS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURIOS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"JOURNAL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PACKS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REVEAL_PRICE","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAP_PRICE","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WINTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_getPublicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_getSignedPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint80","name":"publicMintPrice","type":"uint80"},{"internalType":"uint80","name":"signedMintPrice","type":"uint80"},{"internalType":"uint16","name":"maxTokenId","type":"uint16"},{"internalType":"uint40","name":"endTimestamp","type":"uint40"},{"internalType":"uint16","name":"currentThreadId","type":"uint16"},{"internalType":"uint24","name":"threadSeed","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"publicMintPrice","type":"uint256"},{"internalType":"uint256","name":"signedMintPrice","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"createNewThread","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"deactivateSwapPermissionKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"ipfs_cid","type":"string"}],"name":"disableJournalEntry","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"poppet_accessories","type":"uint256[]"},{"internalType":"uint256[]","name":"bonus_accessories","type":"uint256[]"},{"internalType":"uint256","name":"free_poppets","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.RevealKey[]","name":"revealKeys","type":"tuple[]"}],"name":"forceReveal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"ipfs_cid","type":"string"}],"name":"journal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"mintCommunityCuriosFromPacks","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"mintCuriosFromPacks","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"mintFromWinter","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintSigned","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"}],"name":"poppetsplosion","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"poppet_accessories","type":"uint256[]"},{"internalType":"uint256[]","name":"bonus_accessories","type":"uint256[]"},{"internalType":"uint256","name":"free_poppets","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"reveal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"poppet_accessories","type":"uint256[]"},{"internalType":"uint256[]","name":"bonus_accessories","type":"uint256[]"},{"internalType":"uint256","name":"free_poppets","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.RevealKey[]","name":"revealKeys","type":"tuple[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"revealMany","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"curios_","type":"address"}],"name":"setCommunityCuriosAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"curios_","type":"address"}],"name":"setCuriosAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"journal_","type":"address"}],"name":"setJournalAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"packs_","type":"address"}],"name":"setPacksAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint80","name":"revealPrice_","type":"uint80"}],"name":"setRevealPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint80","name":"swapPrice_","type":"uint80"}],"name":"setSwapPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"winter_","type":"address"}],"name":"setWinterAddress","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"remove","type":"uint256[]"},{"internalType":"uint256[]","name":"add","type":"uint256[]"},{"internalType":"uint256[]","name":"removeC","type":"uint256[]"},{"internalType":"uint256[]","name":"addC","type":"uint256[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapKey","name":"swapKey","type":"tuple"},{"components":[{"internalType":"uint256[]","name":"removeAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"removeCAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addCAmounts","type":"uint256[]"}],"internalType":"struct PoppetEIP712.Amounts","name":"amounts","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"swapCurios","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"fromPoppet","type":"uint256"},{"internalType":"uint256","name":"toPoppet","type":"uint256"},{"internalType":"uint256[]","name":"remove","type":"uint256[]"},{"internalType":"uint256[]","name":"add","type":"uint256[]"},{"internalType":"uint256[]","name":"removeC","type":"uint256[]"},{"internalType":"uint256[]","name":"addC","type":"uint256[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapPermissionKey","name":"swapKey","type":"tuple"},{"components":[{"internalType":"uint256[]","name":"removeAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"removeCAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addCAmounts","type":"uint256[]"}],"internalType":"struct PoppetEIP712.Amounts","name":"amounts","type":"tuple"},{"components":[{"internalType":"bytes","name":"signatureA","type":"bytes"},{"internalType":"bytes","name":"signatureB","type":"bytes"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapPermissionMasterKey","name":"masterKey","type":"tuple"},{"internalType":"bytes","name":"masterSignature","type":"bytes"}],"name":"swapCuriosBetweenOwnedPoppets","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"fromPoppet","type":"uint256"},{"internalType":"uint256","name":"toPoppet","type":"uint256"},{"internalType":"uint256[]","name":"remove","type":"uint256[]"},{"internalType":"uint256[]","name":"add","type":"uint256[]"},{"internalType":"uint256[]","name":"removeC","type":"uint256[]"},{"internalType":"uint256[]","name":"addC","type":"uint256[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapPermissionKey","name":"swapKeyA","type":"tuple"},{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"fromPoppet","type":"uint256"},{"internalType":"uint256","name":"toPoppet","type":"uint256"},{"internalType":"uint256[]","name":"remove","type":"uint256[]"},{"internalType":"uint256[]","name":"add","type":"uint256[]"},{"internalType":"uint256[]","name":"removeC","type":"uint256[]"},{"internalType":"uint256[]","name":"addC","type":"uint256[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapPermissionKey","name":"swapKeyB","type":"tuple"},{"components":[{"internalType":"bytes","name":"signatureA","type":"bytes"},{"internalType":"bytes","name":"signatureB","type":"bytes"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct PoppetEIP712.SwapPermissionMasterKey","name":"swapPermissionMasterKey","type":"tuple"},{"components":[{"internalType":"uint256[]","name":"removeAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"removeCAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"addCAmounts","type":"uint256[]"}],"internalType":"struct PoppetEIP712.Amounts","name":"amounts","type":"tuple"},{"internalType":"bytes","name":"masterSignature","type":"bytes"}],"name":"swapWithPermission","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]

61016060405234801562000011575f80fd5b50604051620065ce380380620065ce83398101604081905262000034916200062b565b848484836daaeb6d7670e522a718067333cd4e733cc6cdda760b79bafa08df41ecfa224f810dceb6600182828289898b8a81604051806040016040528060018152602001603160f81b815250620000955f836200036360201b90919060201c565b61012052620000a681600162000363565b61014052815160208084019190912060e052815190820120610100524660a0526200013360e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b60805250503060c052600380546001600160a01b0319166001600160a01b038316179055506006905062000168838262000767565b50600762000177828262000767565b5060016004555050600e80546001600160a01b0319166001600160a01b03851690811790915583903b15620002ae5781156200021257604051633e9f1edf60e11b81523060048201526001600160a01b038481166024830152821690637d3e3dbe906044015b5f604051808303815f87803b158015620001f5575f80fd5b505af115801562000208573d5f803e3d5ffd5b50505050620002ae565b6001600160a01b03831615620002575760405163a0af290360e01b81523060048201526001600160a01b03848116602483015282169063a0af290390604401620001dd565b604051632210724360e11b81523060048201526001600160a01b03821690634420e486906024015f604051808303815f87803b15801562000296575f80fd5b505af1158015620002a9573d5f803e3d5ffd5b505050505b5050506001600160a01b0384169050620002db5760405163c49d17ad60e01b815260040160405180910390fd5b505050620002f8620002f26200039b60201b60201c565b6200039f565b601380546001600160a01b031916331790556200031581620003f0565b505050506200032d336101f46200040260201b60201c565b60108054600160501b600160f01b0319166a01000000000000000000006001600160a01b03851602179055505050505062000887565b5f60208351101562000382576200037a8362000507565b905062000395565b816200038f848262000767565b5060ff90505b92915050565b3390565b600f80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6016620003fe828262000767565b5050565b6127106001600160601b0382161115620004765760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620004ce5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200046d565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b5f80829050601f8151111562000534578260405163305a27a960e01b81526004016200046d91906200082f565b8051620005418262000863565b179392505050565b634e487b7160e01b5f52604160045260245ffd5b5f5b83811015620005795781810151838201526020016200055f565b50505f910152565b5f82601f83011262000591575f80fd5b81516001600160401b0380821115620005ae57620005ae62000549565b604051601f8301601f19908116603f01168101908282118183101715620005d957620005d962000549565b81604052838152866020858801011115620005f2575f80fd5b620006058460208301602089016200055d565b9695505050505050565b80516001600160a01b038116811462000626575f80fd5b919050565b5f805f805f60a0868803121562000640575f80fd5b85516001600160401b038082111562000657575f80fd5b6200066589838a0162000581565b965060208801519150808211156200067b575f80fd5b6200068989838a0162000581565b955062000699604089016200060f565b9450620006a9606089016200060f565b93506080880151915080821115620006bf575f80fd5b50620006ce8882890162000581565b9150509295509295909350565b600181811c90821680620006f057607f821691505b6020821081036200070f57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111562000762575f81815260208120601f850160051c810160208610156200073d5750805b601f850160051c820191505b818110156200075e5782815560010162000749565b5050505b505050565b81516001600160401b0381111562000783576200078362000549565b6200079b81620007948454620006db565b8462000715565b602080601f831160018114620007d1575f8415620007b95750858301515b5f19600386901b1c1916600185901b1785556200075e565b5f85815260208120601f198616915b828110156200080157888601518255948401946001909101908401620007e0565b50858210156200081f57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b602081525f82518060208401526200084f8160408501602087016200055d565b601f01601f19169190910160400192915050565b805160208083015191908110156200070f575f1960209190910360031b1b16919050565b60805160a05160c05160e051610100516101205161014051615cf5620008d95f395f6120ac01525f61208201525f6149fb01525f6149d301525f61492e01525f61495801525f6149820152615cf55ff3fe6080604052600436106103df575f3560e01c806381d5df49116101ff578063bc197c8111610113578063df6d481a116100a8578063ed477e8911610078578063ed477e8914610b3b578063efd0cbf914610b4e578063f23a6e6114610b61578063f2fde38b14610b8c578063fc80fff914610bab575f80fd5b8063df6d481a14610ad6578063e38ae1d314610ae9578063e985e9c514610afc578063ecba222a14610b1b575f80fd5b8063dad786a3116100e3578063dad786a314610a72578063dd46706414610a91578063df2b911914610ab0578063df63e72014610ac3575f80fd5b8063bc197c8114610a02578063bc990ff114610a21578063c87b56dd14610a40578063cd1b007a14610a5f575f80fd5b8063a22cb46511610194578063b0ccc31e11610164578063b0ccc31e14610964578063b3574cb714610983578063b45a3c0e146109a2578063b88d4fde146109d0578063b8d1e532146109e3575f80fd5b8063a22cb465146108e8578063a320bf1914610907578063adac84a01461091a578063ae14329f1461093e575f80fd5b806395d89b41116101cf57806395d89b411461089157806399b9675e146108a55780639b5dfceb146108b85780639eb7e99d146108cb575f80fd5b806381d5df491461083057806384b0196e146108435780638ba4cc3c1461086a5780638da5cb5b1461087d575f80fd5b80634d6dd844116102f65780636650cc8b1161028b578063715018a61161025b578063715018a61461072457806371e55e5a1461073857806378314a5d1461074b57806379502c55146107715780637d76a5851461081d575f80fd5b80636650cc8b146106bf5780636c0360eb146106de5780636c19e783146106f257806370a0823114610705575f80fd5b80635ef9432a116102c65780635ef9432a1461065a5780636198e3391461066e578063633de2bc1461068d5780636352211e146106a0575f80fd5b80634d6dd84414610602578063510051181461061557806355f804b3146106345780635ac4e55014610647575f80fd5b806318160ddd116103775780632a55205a116103475780632a55205a146105835780633a01e866146105c15780633ac1202f146105d45780633ccfd60b146105e757806342842e0e146105ef575f80fd5b806318160ddd146105015780631bf793321461052657806323b872dd1461053957806329ba8f9c1461054c575f80fd5b8063081c3909116103b2578063081c390914610484578063095ea7b3146104a3578063150b7a02146104b657806317263cae146104ee575f80fd5b806301ffc9a7146103e357806304634d8d1461041757806306fdde031461042c578063081812fc1461044d575b5f80fd5b3480156103ee575f80fd5b506104026103fd366004614ccc565b610bbe565b60405190151581526020015b60405180910390f35b61042a610425366004614d02565b610c06565b005b348015610437575f80fd5b50610440610c3a565b60405161040e9190614d8f565b348015610458575f80fd5b5061046c610467366004614da1565b610cca565b6040516001600160a01b03909116815260200161040e565b34801561048f575f80fd5b5060125461046c906001600160a01b031681565b61042a6104b1366004614db8565b610d0c565b3480156104c1575f80fd5b506104d56104d0366004614e8f565b610d25565b6040516001600160e01b0319909116815260200161040e565b61042a6104fc366004614ef2565b610d36565b34801561050c575f80fd5b50600554600454035f19015b60405190815260200161040e565b61042a610534366004614f95565b610f0c565b61042a610547366004615063565b611496565b348015610557575f80fd5b5060105461056b906001600160501b031681565b6040516001600160501b03909116815260200161040e565b34801561058e575f80fd5b506105a261059d36600461509c565b611513565b604080516001600160a01b03909316835260208301919091520161040e565b61042a6105cf3660046150bc565b6115bf565b61042a6105e2366004615147565b61177a565b61042a6117a3565b61042a6105fd366004615063565b611844565b61042a610610366004615160565b6118ba565b348015610620575f80fd5b5060115461046c906001600160a01b031681565b61042a6106423660046151a7565b611901565b61042a6106553660046151e5565b61199b565b348015610665575f80fd5b5061042a611c90565b348015610679575f80fd5b5061042a610688366004614da1565b611d34565b61042a61069b366004615147565b611d8e565b3480156106ab575f80fd5b5061046c6106ba366004614da1565b611db4565b3480156106ca575f80fd5b5060175461046c906001600160a01b031681565b3480156106e9575f80fd5b50610440611dbe565b61042a610700366004615147565b611e4a565b348015610710575f80fd5b5061051861071f366004615147565b611e70565b34801561072f575f80fd5b5061042a611ebc565b61042a6107463660046152d0565b611ecf565b348015610756575f80fd5b5060105461046c90600160501b90046001600160a01b031681565b34801561077c575f80fd5b506015546107d0906001600160501b0380821691600160501b81049091169061ffff600160a01b820481169164ffffffffff600160b01b82041691600160d81b8204169062ffffff600160e81b9091041686565b604080516001600160501b03978816815296909516602087015261ffff9384169486019490945264ffffffffff909116606085015216608083015262ffffff1660a082015260c00161040e565b61042a61082b36600461532a565b612026565b61042a61083e366004615147565b61204f565b34801561084e575f80fd5b50610857612075565b60405161040e9796959493929190615389565b61042a610878366004614db8565b6120fb565b348015610888575f80fd5b5061046c6121b2565b34801561089c575f80fd5b506104406121ca565b61042a6108b33660046153ea565b6121d9565b61042a6108c636600461532a565b6123a9565b3480156108d6575f80fd5b506015546001600160501b0316610518565b3480156108f3575f80fd5b5061042a6109023660046154a6565b6123db565b61042a6109153660046154d0565b6123ef565b348015610925575f80fd5b50601554600160501b90046001600160501b0316610518565b348015610949575f80fd5b50600f5461056b90600160a01b90046001600160501b031681565b34801561096f575f80fd5b50600e5461046c906001600160a01b031681565b34801561098e575f80fd5b5060145461046c906001600160a01b031681565b3480156109ad575f80fd5b506104026109bc366004614da1565b5f9081526018602052604090205460ff1690565b61042a6109de366004614e8f565b612532565b3480156109ee575f80fd5b5061042a6109fd366004615147565b6125a9565b348015610a0d575f80fd5b506104d5610a1c36600461558e565b61265b565b348015610a2c575f80fd5b5061042a610a3b366004615630565b61266d565b348015610a4b575f80fd5b50610440610a5a366004614da1565b61278e565b61042a610a6d366004614db8565b61280f565b348015610a7d575f80fd5b5061042a610a8c3660046151a7565b61284d565b348015610a9c575f80fd5b5061042a610aab366004614da1565b612857565b61042a610abe366004615147565b6128dc565b61042a610ad13660046152d0565b612902565b61042a610ae43660046152d0565b612c1d565b61042a610af7366004615685565b612d42565b348015610b07575f80fd5b50610402610b163660046156c6565b612de2565b348015610b26575f80fd5b50600e5461040290600160a01b900460ff1681565b61042a610b49366004615147565b612e0f565b61042a610b5c366004614da1565b612e53565b348015610b6c575f80fd5b506104d5610b7b3660046156f7565b63f23a6e6160e01b95945050505050565b348015610b97575f80fd5b5061042a610ba6366004615147565b612f63565b61042a610bb9366004615685565b612fd9565b5f6001600160e01b03198216632483248360e11b1480610be25750610be282613041565b80610bf15750610bf18261308e565b80610c005750610c008261308e565b92915050565b610c0e6130b2565b601380546001600160a01b0319166001600160a01b038416908117909155610c369082613111565b5050565b606060068054610c4990615756565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7590615756565b8015610cc05780601f10610c9757610100808354040283529160200191610cc0565b820191905f5260205f20905b815481529060010190602001808311610ca357829003601f168201915b5050505050905090565b5f610cd48261320e565b610cf1576040516333d1c03960e21b815260040160405180910390fd5b505f908152600a60205260409020546001600160a01b031690565b81610d1681613241565b610d208383613300565b505050565b630a85bd0160e11b5b949350505050565b610d3e6130b2565b601580546001600160501b03858116600160501b026001600160a01b0319600161ffff600160d81b808704821692909201160216600168ffff0000000000000160a01b0319909316929092179087161717905581610d9b60045490565b610da5919061579c565b6015805464ffffffffff8416600160b01b0264ffffffffff60b01b1961ffff94909416600160a01b029390931666ffffffffffffff60a01b19909116179190911790819055604051600160e81b820460e81b6001600160e81b0319166020820152600160d81b90910460f01b6001600160f01b031916602382015262ffffff90602501604051602081830303815290604052805190602001205f1c610e4a91906157c3565b6015805462ffffff92909216600160e81b026001600160e81b039092169190911790555f610e796014846157d6565b90508015610e9757610e92610e8c6121b2565b8261339e565b610ea9565b610ea9610ea26121b2565b600161339e565b601554604051600160e81b820462ffffff168152600160b01b820464ffffffffff1691600160d81b900461ffff16907f80044e735723e7b02701a584f166c2f37b7b4aa459d8c59b97b9e9895cabc33e9060200160405180910390a35050505050565b6020808701355f818152601890925260409091205460ff1615610f6257610f316121b2565b6001600160a01b0316336001600160a01b031614610f6257604051630e620e2360e01b815260040160405180910390fd5b6020808701355f818152601890925260409091205460ff1615610fb857610f876121b2565b6001600160a01b0316336001600160a01b031614610fb857604051630e620e2360e01b815260040160405180910390fd5b600f543490610fd890600160a01b90046001600160501b031660026157e9565b6001600160501b031611156110005760405163356680b760e01b815260040160405180910390fd5b86604001358860200135146110285760405163a9b1729f60e01b815260040160405180910390fd5b87604001358760200135146110505760405163a9b1729f60e01b815260040160405180910390fd5b61105d8860200135611db4565b6001600160a01b0316336001600160a01b0316146110b3576110828760200135611db4565b6001600160a01b0316336001600160a01b0316146110b35760405163061cbdd360e51b815260040160405180910390fd5b6110c06060880188615814565b6040516020016110d1929190615859565b60408051601f198184030181529190526110ee6080890189615814565b6040516020016110ff929190615859565b60408051601f1981840301815291905261111c60a08a018a615814565b60405160200161112d929190615859565b60408051601f1981840301815291905261114a60c08b018b615814565b60405160200161115b929190615859565b60408051601f198184030181529082905261117b94939291602001615880565b60408051601f1981840301815291905280516020909101206111a060808a018a615814565b6040516020016111b1929190615859565b60408051601f198184030181529190526111ce60608b018b615814565b6040516020016111df929190615859565b60408051601f198184030181529190526111fc60c08c018c615814565b60405160200161120d929190615859565b60408051601f1981840301815291905261122a60a08d018d615814565b60405160200161123b929190615859565b60408051601f198184030181529082905261125b94939291602001615880565b604051602081830303815290604052805190602001201461128f5760405163a9b1729f60e01b815260040160405180910390fd5b6112af61129c87806158d6565b8a6112aa8c60200135611db4565b6134d7565b506112ce6112c060208801886158d6565b896112aa8b60200135611db4565b506112da84848861374e565b506113316112eb89604001356138e6565b6112f88a602001356138e6565b61130560608c018c615814565b61130f8a80615814565b8e806080019061131f9190615814565b61132c60208f018f615814565b613900565b61138a61134189604001356138e6565b61134e8a602001356138e6565b61135b60a08c018c615814565b61136860408b018b615814565b8e8060c001906113789190615814565b61138560608f018f615814565b6139f4565b6113978860200135613aa2565b6113a5886020013543613ad0565b6113b28760400135613aa2565b6113c0876020013543613ad0565b60208801355f80516020615ca08339815191526113e060608b018b615814565b6113ed60808d018d615814565b6113fa60a08f018f615814565b8f8060c0019061140a9190615814565b60405161141e989796959493929190615948565b60405180910390a260208701355f80516020615ca083398151915261144660608a018a615814565b61145360808c018c615814565b61146060a08e018e615814565b8e8060c001906114709190615814565b604051611484989796959493929190615948565b60405180910390a25050505050505050565b826001600160a01b03811633146114b0576114b033613241565b5f82815260186020526040902054829060ff1615611501576114d06121b2565b6001600160a01b0316336001600160a01b03161461150157604051630e620e2360e01b815260040160405180910390fd5b61150c858585613b23565b5050505050565b5f828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291611587575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f90612710906115a5906001600160601b0316876159a7565b6115af91906157d6565b91519350909150505b9250929050565b83602001356115cd81611db4565b6001600160a01b0316336001600160a01b0316146115fe5760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff161561162d57604051630e620e2360e01b815260040160405180910390fd5b600f5434600160a01b9091046001600160501b031611156116615760405163356680b760e01b815260040160405180910390fd5b61166d83838733613ce1565b506116b03361167f87602001356138e6565b61168c6040890189615814565b6116968980615814565b6116a360608d018d615814565b61132c60208e018e615814565b6116f5336116c187602001356138e6565b6116ce6080890189615814565b6116db60408a018a615814565b6116e860a08d018d615814565b61138560608e018e615814565b6117028560200135613aa2565b611710856020013543613ad0565b60208501355f80516020615ca08339815191526117306040880188615814565b61173d60608a018a615814565b61174a60808c018c615814565b61175760a08e018e615814565b60405161176b989796959493929190615948565b60405180910390a25050505050565b6117826130b2565b601180546001600160a01b0319166001600160a01b03831617905550565b50565b6013546040515f9182916001600160a01b039091169047908381818185875af1925050503d805f81146117f1576040519150601f19603f3d011682016040523d82523d5f602084013e6117f6565b606091505b509150915081610c365760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b826001600160a01b038116331461185e5761185e33613241565b5f82815260186020526040902054829060ff16156118af5761187e6121b2565b6001600160a01b0316336001600160a01b0316146118af57604051630e620e2360e01b815260040160405180910390fd5b61150c858585613ecd565b6118c26130b2565b827f8f58419035b8628f770a76eea1727d8652058d13668583e68b35af246960c8d783836040516118f49291906159be565b60405180910390a2505050565b6119096130b2565b61194782828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250613ee792505050565b7f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c60018061197460045490565b61197e91906159ec565b604080519283526020830191909152015b60405180910390a15050565b84604001356119a981611db4565b6001600160a01b0316336001600160a01b0316146119da5760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff1615611a0957604051630e620e2360e01b815260040160405180910390fd5b8560200135611a1781611db4565b6001600160a01b0316336001600160a01b031614611a485760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff1615611a7757604051630e620e2360e01b815260040160405180910390fd5b600f543490611a9790600160a01b90046001600160501b031660026157e9565b6001600160501b03161115611abf5760405163356680b760e01b815260040160405180910390fd5b611ad3611acc86806158d6565b89336134d7565b50611adf84848761374e565b50611b31611af088604001356138e6565b611afd89602001356138e6565b611b0a60608b018b615814565b611b148b80615814565b611b2160808f018f615814565b8e806020019061132c9190615814565b611b85611b4188604001356138e6565b611b4e89602001356138e6565b611b5b60a08b018b615814565b611b6860408c018c615814565b611b7560c08f018f615814565b8e80606001906113859190615814565b611b928760200135613aa2565b611ba0876020013543613ad0565b611bad8760400135613aa2565b611bbb876040013543613ad0565b60208701355f80516020615ca0833981519152611bdb60608a018a615814565b611be860808c018c615814565b611bf560a08e018e615814565b8e8060c00190611c059190615814565b604051611c19989796959493929190615948565b60405180910390a260408701355f80516020615ca0833981519152611c4160808a018a615814565b611c4e60608c018c615814565b611c5b60c08e018e615814565b8e8060a00190611c6b9190615814565b604051611c7f989796959493929190615948565b60405180910390a250505050505050565b611c986121b2565b6001600160a01b0316336001600160a01b031614611cc957604051635fc483c560e01b815260040160405180910390fd5b600e54600160a01b900460ff1615611cf457604051631551a48f60e11b815260040160405180910390fd5b600e80546001600160a81b031916600160a01b1790556040517f51e2d870cc2e10853e38dc06fcdae46ad3c3f588f326608803dac6204541ad16905f90a1565b611d3c6130b2565b5f8181526018602052604090819020805460ff19169055517ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290611d839083815260200190565b60405180910390a150565b611d966130b2565b601480546001600160a01b0319166001600160a01b03831617905550565b5f610c0082613ef3565b60168054611dcb90615756565b80601f0160208091040260200160405190810160405280929190818152602001828054611df790615756565b8015611e425780601f10611e1957610100808354040283529160200191611e42565b820191905f5260205f20905b815481529060010190602001808311611e2557829003601f168201915b505050505081565b611e526130b2565b600380546001600160a01b0319166001600160a01b03831617905550565b5f6001600160a01b038216611e98576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600960205260409020546001600160401b031690565b611ec46130b2565b611ecd5f613f5d565b565b6010543490611ee89085906001600160501b03166159a7565b1115611f075760405163356680b760e01b815260040160405180910390fd5b5f5b8381101561150c57612014858583818110611f2657611f266159ff565b9050602002810190611f389190615a13565b60200135868684818110611f4e57611f4e6159ff565b9050602002810190611f609190615a13565b611f6e906040810190615814565b888886818110611f8057611f806159ff565b9050602002810190611f929190615a13565b611fa0906060810190615814565b8a8a88818110611fb257611fb26159ff565b9050602002810190611fc49190615a13565b608001358b8b89818110611fda57611fda6159ff565b9050602002810190611fec9190615a13565b60a001358a8a8a818110612002576120026159ff565b90506020028101906108b391906158d6565b8061201e81615a31565b915050611f09565b61202e6130b2565b6010805469ffffffffffffffffffff19166001600160501b03831617905550565b6120576130b2565b601280546001600160a01b0319166001600160a01b03831617905550565b5f606080828080836120a77f000000000000000000000000000000000000000000000000000000000000000083613fae565b6120d27f00000000000000000000000000000000000000000000000000000000000000006001613fae565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6121036130b2565b600454601554600160a01b900461ffff1610156121335760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff164211156121645760405163a56cc6ed60e01b815260040160405180910390fd5b601554819061ffff600160a01b909104168161217f60045490565b612189919061579c565b11156121a85760405163c30436e960e01b815260040160405180910390fd5b610d20838361339e565b5f6121c5600f546001600160a01b031690565b905090565b606060078054610c4990615756565b601554849061ffff600160a01b90910416816121f460045490565b6121fe919061579c565b111561221d5760405163c30436e960e01b815260040160405180910390fd5b8961222781611db4565b6001600160a01b0316336001600160a01b0316146122585760405163061cbdd360e51b815260040160405180910390fd5b601054346001600160501b0390911611156122865760405163356680b760e01b815260040160405180910390fd5b6122988484338e8e8e8e8e8e8e614057565b5085156122a9576122a9338761339e565b881561231e57601054600160501b90046001600160a01b031663c626d4b06122d08d6138e6565b8c8c6040518463ffffffff1660e01b81526004016122f093929190615a49565b5f604051808303815f87803b158015612307575f80fd5b505af1158015612319573d5f803e3d5ffd5b505050505b861561238b57601054600160501b90046001600160a01b031663c626d4b0338a8a6040518463ffffffff1660e01b815260040161235d93929190615a49565b5f604051808303815f87803b158015612374575f80fd5b505af1158015612386573d5f803e3d5ffd5b505050505b61239c6123978c614210565b614259565b5050505050505050505050565b6123b16130b2565b600f805469ffffffffffffffffffff60a01b1916600160a01b6001600160501b0384160217905550565b816123e581613241565b610d20838361429d565b601554849061ffff600160a01b909104168161240a60045490565b612414919061579c565b11156124335760405163c30436e960e01b815260040160405180910390fd5b600454601554600160a01b900461ffff1610156124635760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff164211156124945760405163a56cc6ed60e01b815260040160405180910390fd5b60158054600160501b90046001600160501b03165f036124c65760405162010a0160e81b815260040160405180910390fd5b80546124e290600160501b90046001600160501b0316876159a7565b3410156125025760405163356680b760e01b815260040160405180910390fd5b805461251f90859085903390600160d81b900461ffff1689614308565b5061252a338761339e565b505050505050565b836001600160a01b038116331461254c5761254c33613241565b5f83815260186020526040902054839060ff161561259d5761256c6121b2565b6001600160a01b0316336001600160a01b03161461259d57604051630e620e2360e01b815260040160405180910390fd5b61252a86868686614440565b6125b16121b2565b6001600160a01b0316336001600160a01b0316146125e257604051635fc483c560e01b815260040160405180910390fd5b600e54600160a01b900460ff161561260d57604051631551a48f60e11b815260040160405180910390fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de47690602001611d83565b63bc197c8160e01b5b95945050505050565b8261267781611db4565b6001600160a01b0316336001600160a01b0316146126a85760405163061cbdd360e51b815260040160405180910390fd5b6012546001600160a01b03166126d157604051631762b79960e11b815260040160405180910390fd5b6126de8686868686614484565b506012546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018790526044015f604051808303815f87803b158015612736575f80fd5b505af1158015612748573d5f803e3d5ffd5b50505050837ff91e506b1a3f294d887b750be5ca03481579f6e769703b5eb48218750787fcb9848460405161277e9291906159be565b60405180910390a2505050505050565b60606127998261320e565b6127b657604051630a14c4b560e41b815260040160405180910390fd5b5f6127bf614536565b905080515f036127dd5760405180602001604052805f815250612808565b806127e784614545565b6040516020016127f8929190615a6d565b6040516020818303038152906040525b9392505050565b6014546001600160a01b0316336001600160a01b0316146128435760405163061cbdd360e51b815260040160405180910390fd5b610c36828261339e565b610c368282614588565b8061286181611db4565b6001600160a01b0316336001600160a01b0316146128925760405163061cbdd360e51b815260040160405180910390fd5b5f8281526018602052604090819020805460ff19166001179055517f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119061198f9084815260200190565b6128e46130b2565b601780546001600160a01b0319166001600160a01b03831617905550565b61290a6130b2565b82811461292a5760405163a9b1729f60e01b815260040160405180910390fd5b5f5b81811015612bdb575f838383818110612947576129476159ff565b90506020028101906129599190615a13565b6080013511156129c5576129c5838383818110612978576129786159ff565b905060200281019061298a9190615a13565b612998906020810190615147565b8484848181106129aa576129aa6159ff565b90506020028101906129bc9190615a13565b6080013561339e565b5f8383838181106129d8576129d86159ff565b90506020028101906129ea9190615a13565b6129f8906040810190615814565b90501115612ac657601054600160501b90046001600160a01b031663c626d4b0612a48858585818110612a2d57612a2d6159ff565b9050602002810190612a3f9190615a13565b602001356138e6565b858585818110612a5a57612a5a6159ff565b9050602002810190612a6c9190615a13565b612a7a906040810190615814565b6040518463ffffffff1660e01b8152600401612a9893929190615a49565b5f604051808303815f87803b158015612aaf575f80fd5b505af1158015612ac1573d5f803e3d5ffd5b505050505b5f838383818110612ad957612ad96159ff565b9050602002810190612aeb9190615a13565b612af9906060810190615814565b90501115612bc957601054600160501b90046001600160a01b031663c626d4b0848484818110612b2b57612b2b6159ff565b9050602002810190612b3d9190615a13565b612b4b906020810190615147565b858585818110612b5d57612b5d6159ff565b9050602002810190612b6f9190615a13565b612b7d906060810190615814565b6040518463ffffffff1660e01b8152600401612b9b93929190615a49565b5f604051808303815f87803b158015612bb2575f80fd5b505af1158015612bc4573d5f803e3d5ffd5b505050505b80612bd381615a31565b91505061292c565b50612c178484808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525061425992505050565b50505050565b612c256130b2565b600454601554600160a01b900461ffff161015612c555760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff16421115612c865760405163a56cc6ed60e01b815260040160405180910390fd5b828114612ca65760405163a9b1729f60e01b815260040160405180910390fd5b5f5b83811015612d0a57612cf8858583818110612cc557612cc56159ff565b9050602002016020810190612cda9190615147565b848484818110612cec57612cec6159ff565b9050602002013561339e565b80612d0281615a31565b915050612ca8565b5060155461ffff600160a01b90910416612d2360045490565b1115612c175760405163c30436e960e01b815260040160405180910390fd5b6017546001600160a01b0316336001600160a01b031614612d765760405163061cbdd360e51b815260040160405180910390fd5b601054604051630c626d4b60e41b8152600160501b9091046001600160a01b03169063c626d4b090612db090869086908690600401615a49565b5f604051808303815f87803b158015612dc7575f80fd5b505af1158015612dd9573d5f803e3d5ffd5b50505050505050565b6001600160a01b039182165f908152600b6020908152604080832093909416825291909152205460ff1690565b612e176130b2565b601080547fffff0000000000000000000000000000000000000000ffffffffffffffffffff16600160501b6001600160a01b0384160217905550565b601554819061ffff600160a01b9091041681612e6e60045490565b612e78919061579c565b1115612e975760405163c30436e960e01b815260040160405180910390fd5b600454601554600160a01b900461ffff161015612ec75760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff16421115612ef85760405163a56cc6ed60e01b815260040160405180910390fd5b601580546001600160501b03165f03612f2457604051637338bcbd60e11b815260040160405180910390fd5b8054612f39906001600160501b0316846159a7565b341015612f595760405163356680b760e01b815260040160405180910390fd5b610d20338461339e565b612f6b6130b2565b6001600160a01b038116612fd05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161183b565b6117a081613f5d565b6017546001600160a01b0316336001600160a01b03161461300d5760405163061cbdd360e51b815260040160405180910390fd5b601154604051630c626d4b60e41b81526001600160a01b039091169063c626d4b090612db090869086908690600401615a49565b5f6301ffc9a760e01b6001600160e01b03198316148061307157506380ac58cd60e01b6001600160e01b03198316145b80610c005750506001600160e01b031916635b5e139f60e01b1490565b5f6001600160e01b03198216630271189760e51b1480610c005750610c00826145c0565b336130bb6121b2565b6001600160a01b031614611ecd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161183b565b6127106001600160601b038216111561317f5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840161183b565b6001600160a01b0382166131d55760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161183b565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b5f81600111158015613221575060045482105b8015610c005750505f90815260086020526040902054600160e01b161590565b600e546001600160a01b0316801580159061326557505f816001600160a01b03163b115b15610c3657604051633185c44d60e21b81523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa1580156132b4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132d89190615a9b565b610c3657604051633b79c77360e21b81526001600160a01b038316600482015260240161183b565b5f61330a82611db4565b9050336001600160a01b03821614613343576133268133612de2565b613343576040516367d9dca160e11b815260040160405180910390fd5b5f828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6004545f8290036133c25760405163b562e8dd60e01b815260040160405180910390fd5b6133ce5f8483856145f4565b6001600160a01b0383165f9081526009602052604081208054680100000000000000018502019055613424908490613407908281614649565b6001851460e11b174260a01b176001600160a01b03919091161790565b5f828152600860205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146134a75780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101613471565b50815f036134c757604051622e076360e81b815260040160405180910390fd5b60045550610d205f84838561466b565b5f600285856040516134ea929190615ab6565b9081526040519081900360200190205460ff161561351b5760405163900bb2c960e01b815260040160405180910390fd5b5f61369e7fed63cd5971c5ed8680952305f179845201a81643bb98e843082312ac8aaa42f261354d6020870187615147565b6020870135604088013561356460608a018a615814565b604051602001613575929190615859565b60408051601f19818403018152919052805160209091012061359a60808b018b615814565b6040516020016135ab929190615859565b60408051601f1981840301815291905280516020909101206135d060a08c018c615814565b6040516020016135e1929190615859565b60408051601f19818403018152919052805160209091012061360660c08d018d615814565b604051602001613617929190615859565b60408051601f198184030181528282528051602091820120908301999099526001600160a01b03909716968101969096526060860194909452608085019290925260a084015260c083015260e08083019190915261010082019290925290860135610120820152610140015b6040516020818303038152906040528051906020012061476c565b9050826001600160a01b03166136e98288888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061479892505050565b6001600160a01b0316036137355760016002878760405161370b929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555060019050610d2e565b604051638baa579f60e01b815260040160405180910390fd5b5f60028484604051613761929190615ab6565b9081526040519081900360200190205460ff16156137925760405163900bb2c960e01b815260040160405180910390fd5b5f6138477f701f885bb814379c47427ba459448982cdfe1b3656500617c7d38baef520a4466137c185806158d6565b6040516020016137d2929190615ab6565b604051602081830303815290604052805190602001208580602001906137f891906158d6565b604051602001613809929190615ab6565b60408051808303601f19018152828252805160209182012090830194909452818101929092526060810192909252850135608082015260a001613683565b600354604080516020601f89018190048102820181019092528781529293506001600160a01b03909116916138989184919089908990819084018382808284375f9201919091525061479892505050565b6001600160a01b031603613735576001600286866040516138ba929190615ab6565b908152604051908190036020019020805491151560ff1990921691909117905550600190509392505050565b5f610c00826e5f3dd0d326e1d0000000000000000061579c565b861561397457601054604051631759616b60e11b8152600160501b9091046001600160a01b031690632eb2c2d690613946908c908e908d908d908d908d90600401615ac5565b5f604051808303815f87803b15801561395d575f80fd5b505af115801561396f573d5f803e3d5ffd5b505050505b82156139e857601054604051631759616b60e11b8152600160501b9091046001600160a01b031690632eb2c2d6906139ba908d908d908990899089908990600401615ac5565b5f604051808303815f87803b1580156139d1575f80fd5b505af11580156139e3573d5f803e3d5ffd5b505050505b50505050505050505050565b8615613a6257601154604051631759616b60e11b81526001600160a01b0390911690632eb2c2d690613a34908c908e908d908d908d908d90600401615ac5565b5f604051808303815f87803b158015613a4b575f80fd5b505af1158015613a5d573d5f803e3d5ffd5b505050505b82156139e857601154604051631759616b60e11b81526001600160a01b0390911690632eb2c2d6906139ba908d908d908990899089908990600401615ac5565b5f8181526008602052604081205490036117a057613abf81613ef3565b5f8281526008602052604090205550565b5f8281526008602052604081205490819003613afe5760405162d5815360e01b815260040160405180910390fd5b5f928352600860205260409092206001600160e81b039290921660e89190911b179055565b5f613b2d82613ef3565b9050836001600160a01b0316816001600160a01b031614613b605760405162a1148160e81b815260040160405180910390fd5b5f828152600a602052604090208054338082146001600160a01b03881690911417613bac57613b8f8633612de2565b613bac57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516613bd357604051633a954ecd60e21b815260040160405180910390fd5b613be086868660016145f4565b8015613bea575f82555b6001600160a01b038087165f9081526009602052604080822080545f1901905591871681522080546001019055613c4185613c26888287614649565b600160e11b174260a01b176001600160a01b03919091161790565b5f85815260086020526040812091909155600160e11b84169003613c9357600184015f818152600860205260408120549003613c91576004548114613c91575f8181526008602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461252a868686600161466b565b5f60028585604051613cf4929190615ab6565b9081526040519081900360200190205460ff1615613d255760405163900bb2c960e01b815260040160405180910390fd5b5f613e7c7fa18eb071a9bf77e50fceeec095039d77f3380a8cc9e424b82df3f795dc691446846020870135613d5d6040890189615814565b604051602001613d6e929190615859565b60408051601f198184030181529190528051602090910120613d9360608a018a615814565b604051602001613da4929190615859565b60408051601f198184030181529190528051602090910120613dc960808b018b615814565b604051602001613dda929190615859565b60408051601f198184030181529190528051602090910120613dff60a08c018c615814565b604051602001613e10929190615859565b604051602081830303815290604052805190602001208b60c001356040516020016136839897969594939291909788526001600160a01b0396909616602088015260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b600354604080516020601f8a018190048102820181019092528881529293506001600160a01b03909116916136e9918491908a908a90819084018382808284375f9201919091525061479892505050565b610d2083838360405180602001604052805f815250612532565b6016610c368282615b67565b5f8180600111613f4457600454811015613f44575f8181526008602052604081205490600160e01b82169003613f42575b805f0361280857505f19015f81815260086020526040902054613f24565b505b604051636f96cda160e11b815260040160405180910390fd5b600f80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b606060ff8314613fc857613fc1836147ba565b9050610c00565b818054613fd490615756565b80601f016020809104026020016040519081016040528092919081815260200182805461400090615756565b801561404b5780601f106140225761010080835404028352916020019161404b565b820191905f5260205f20905b81548152906001019060200180831161402e57829003601f168201915b50505050509050610c00565b5f60028b8b60405161406a929190615ab6565b9081526040519081900360200190205460ff161561409b5760405163900bb2c960e01b815260040160405180910390fd5b5f61415b7f6aa73e9f6030cbd2c261d73e016cc34d56bdf362c69abf604bd0fc64b40382038b8b8b8b6040516020016140d5929190615859565b604051602081830303815290604052805190602001208a8a6040516020016140fe929190615859565b60408051601f198184030181528282528051602091820120908301969096526001600160a01b03909416938101939093526060830191909152608082015260a081019190915260c0810186905260e0810185905261010001613683565b905060035f9054906101000a90046001600160a01b03166001600160a01b03166141ba828e8e8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061479892505050565b6001600160a01b03160361373557600160028d8d6040516141dc929190615ab6565b908152604051908190036020019020805491151560ff1990921691909117905550600190505b9a9950505050505050505050565b6040805160018082528183019092526060915f91906020808301908036833701905050905082815f81518110614248576142486159ff565b602090810291909101015292915050565b336001600160a01b03167f6622ba6eaf77853a5f8efe73c835e558a4e38fb8cbd2f029b5c129143838fbb9826040516142929190615c22565b60405180910390a250565b335f818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6002868660405161431b929190615ab6565b9081526040519081900360200190205460ff161561434c5760405163900bb2c960e01b815260040160405180910390fd5b604080517f426a9c4d797eca66406705cd15ee3a439b5c337d9a1a457763834c6b248340ab60208201526001600160a01b0386169181019190915260608101849052608081018390525f906143a39060a001613683565b600354604080516020601f8b018190048102820181019092528981529293506001600160a01b03909116916143f4918491908b908b90819084018382808284375f9201919091525061479892505050565b6001600160a01b03160361373557600160028888604051614416929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555060019050612664565b61444b848484611496565b6001600160a01b0383163b15612c1757614467848484846147f7565b612c17576040516368d2bf6b60e11b815260040160405180910390fd5b5f60028686604051614497929190615ab6565b9081526040519081900360200190205460ff16156144c85760405163900bb2c960e01b815260040160405180910390fd5b5f6143a37f2885e7a8c4933ede965c15eb35025182fd268aa571c8d46a46d4452bb9e8bf9a868686604051602001614501929190615ab6565b60408051601f198184030181528282528051602091820120908301949094528101919091526060810191909152608001613683565b606060168054610c4990615756565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a90048061455e5750819003601f19909101908152919050565b60016002838360405161459c929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555050565b5f6001600160e01b0319821663152a902d60e11b1480610c0057506301ffc9a760e01b6001600160e01b0319831614610c00565b6001600160a01b0384166146445760155461ffff600160a01b909104168161461b60045490565b614625919061579c565b11156146445760405163c30436e960e01b815260040160405180910390fd5b612c17565b5f60e882811c9061465b8686846148db565b62ffffff16901b95945050505050565b6001600160a01b0384166146d95761383f1943016146898382613ad0565b836001600160a01b03168162ffffff16847f759931ee62eca086261eaf5026904de9d82d76cb85470074063fad43d45a4e4e856040516146cb91815260200190565b60405180910390a450612c17565b6012546001600160a01b031615614644576012546001600160a01b03166342842e0e614704846138e6565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529086166024820152604481018590526064015f604051808303815f87803b158015614751575f80fd5b505af1158015614763573d5f803e3d5ffd5b50505050612c17565b5f610c00614778614922565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f6147a58585614a4b565b915091506147b281614a8a565b509392505050565b60605f6147c683614bd3565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061482b903390899088908890600401615c34565b6020604051808303815f875af1925050508015614865575060408051601f3d908101601f1916820190925261486291810190615c70565b60015b6148c1573d808015614892576040519150601f19603f3d011682016040523d82523d5f602084013e614897565b606091505b5080515f036148b9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d2e565b5f62ffffff8216158015906148fd57504362ffffff16826138400162ffffff16115b1561491b5760405163111bb2f160e31b815260040160405180910390fd5b5092915050565b5f306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561497a57507f000000000000000000000000000000000000000000000000000000000000000046145b156149a457507f000000000000000000000000000000000000000000000000000000000000000090565b6121c5604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b5f808251604103614a7f576020830151604084015160608501515f1a614a7387828585614bfa565b945094505050506115b8565b505f905060026115b8565b5f816004811115614a9d57614a9d615c8b565b03614aa55750565b6001816004811115614ab957614ab9615c8b565b03614b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161183b565b6002816004811115614b1a57614b1a615c8b565b03614b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161183b565b6003816004811115614b7b57614b7b615c8b565b036117a05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161183b565b5f60ff8216601f811115610c0057604051632cd44ac360e21b815260040160405180910390fd5b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614c2f57505f90506003614cae565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614c80573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116614ca8575f60019250925050614cae565b91505f90505b94509492505050565b6001600160e01b0319811681146117a0575f80fd5b5f60208284031215614cdc575f80fd5b813561280881614cb7565b80356001600160a01b0381168114614cfd575f80fd5b919050565b5f8060408385031215614d13575f80fd5b614d1c83614ce7565b915060208301356001600160601b0381168114614d37575f80fd5b809150509250929050565b5f5b83811015614d5c578181015183820152602001614d44565b50505f910152565b5f8151808452614d7b816020860160208601614d42565b601f01601f19169290920160200192915050565b602081525f6128086020830184614d64565b5f60208284031215614db1575f80fd5b5035919050565b5f8060408385031215614dc9575f80fd5b614dd283614ce7565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715614e1c57614e1c614de0565b604052919050565b5f82601f830112614e33575f80fd5b81356001600160401b03811115614e4c57614e4c614de0565b614e5f601f8201601f1916602001614df4565b818152846020838601011115614e73575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f8060808587031215614ea2575f80fd5b614eab85614ce7565b9350614eb960208601614ce7565b92506040850135915060608501356001600160401b03811115614eda575f80fd5b614ee687828801614e24565b91505092959194509250565b5f805f8060808587031215614f05575f80fd5b5050823594602084013594506040840135936060013592509050565b5f6101008284031215614f32575f80fd5b50919050565b5f60608284031215614f32575f80fd5b5f60808284031215614f32575f80fd5b5f8083601f840112614f68575f80fd5b5081356001600160401b03811115614f7e575f80fd5b6020830191508360208285010111156115b8575f80fd5b5f805f805f8060a08789031215614faa575f80fd5b86356001600160401b0380821115614fc0575f80fd5b614fcc8a838b01614f21565b97506020890135915080821115614fe1575f80fd5b614fed8a838b01614f21565b96506040890135915080821115615002575f80fd5b61500e8a838b01614f38565b95506060890135915080821115615023575f80fd5b61502f8a838b01614f48565b94506080890135915080821115615044575f80fd5b5061505189828a01614f58565b979a9699509497509295939492505050565b5f805f60608486031215615075575f80fd5b61507e84614ce7565b925061508c60208501614ce7565b9150604084013590509250925092565b5f80604083850312156150ad575f80fd5b50508035926020909101359150565b5f805f80606085870312156150cf575f80fd5b84356001600160401b03808211156150e5575f80fd5b9086019060e082890312156150f8575f80fd5b9094506020860135908082111561510d575f80fd5b61511988838901614f48565b9450604087013591508082111561512e575f80fd5b5061513b87828801614f58565b95989497509550505050565b5f60208284031215615157575f80fd5b61280882614ce7565b5f805f60408486031215615172575f80fd5b8335925060208401356001600160401b0381111561518e575f80fd5b61519a86828701614f58565b9497909650939450505050565b5f80602083850312156151b8575f80fd5b82356001600160401b038111156151cd575f80fd5b6151d985828601614f58565b90969095509350505050565b5f805f805f608086880312156151f9575f80fd5b85356001600160401b038082111561520f575f80fd5b61521b89838a01614f21565b96506020880135915080821115615230575f80fd5b61523c89838a01614f48565b95506040880135915080821115615251575f80fd5b61525d89838a01614f38565b94506060880135915080821115615272575f80fd5b5061527f88828901614f58565b969995985093965092949392505050565b5f8083601f8401126152a0575f80fd5b5081356001600160401b038111156152b6575f80fd5b6020830191508360208260051b85010111156115b8575f80fd5b5f805f80604085870312156152e3575f80fd5b84356001600160401b03808211156152f9575f80fd5b61530588838901615290565b9096509450602087013591508082111561531d575f80fd5b5061513b87828801615290565b5f6020828403121561533a575f80fd5b81356001600160501b0381168114612808575f80fd5b5f8151808452602080850194508084015f5b8381101561537e57815187529582019590820190600101615362565b509495945050505050565b60ff60f81b8816815260e060208201525f6153a760e0830189614d64565b82810360408401526153b98189614d64565b606084018890526001600160a01b038716608085015260a0840186905283810360c085015290506142028185615350565b5f805f805f805f805f60c08a8c031215615402575f80fd5b8935985060208a01356001600160401b038082111561541f575f80fd5b61542b8d838e01615290565b909a50985060408c0135915080821115615443575f80fd5b61544f8d838e01615290565b909850965060608c0135955060808c0135945060a08c0135915080821115615475575f80fd5b506154828c828d01614f58565b915080935050809150509295985092959850929598565b80151581146117a0575f80fd5b5f80604083850312156154b7575f80fd5b6154c083614ce7565b91506020830135614d3781615499565b5f805f80606085870312156154e3575f80fd5b843593506020850135925060408501356001600160401b03811115615506575f80fd5b61513b87828801614f58565b5f82601f830112615521575f80fd5b813560206001600160401b0382111561553c5761553c614de0565b8160051b61554b828201614df4565b9283528481018201928281019087851115615564575f80fd5b83870192505b848310156155835782358252918301919083019061556a565b979650505050505050565b5f805f805f60a086880312156155a2575f80fd5b6155ab86614ce7565b94506155b960208701614ce7565b935060408601356001600160401b03808211156155d4575f80fd5b6155e089838a01615512565b945060608801359150808211156155f5575f80fd5b61560189838a01615512565b93506080880135915080821115615616575f80fd5b5061562388828901614e24565b9150509295509295909350565b5f805f805f60608688031215615644575f80fd5b85356001600160401b038082111561565a575f80fd5b61566689838a01614f58565b9097509550602088013594506040880135915080821115615272575f80fd5b5f805f60408486031215615697575f80fd5b6156a084614ce7565b925060208401356001600160401b038111156156ba575f80fd5b61519a86828701615290565b5f80604083850312156156d7575f80fd5b6156e083614ce7565b91506156ee60208401614ce7565b90509250929050565b5f805f805f60a0868803121561570b575f80fd5b61571486614ce7565b945061572260208701614ce7565b9350604086013592506060860135915060808601356001600160401b0381111561574a575f80fd5b61562388828901614e24565b600181811c9082168061576a57607f821691505b602082108103614f3257634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c0057610c00615788565b634e487b7160e01b5f52601260045260245ffd5b5f826157d1576157d16157af565b500690565b5f826157e4576157e46157af565b500490565b6001600160501b0381811683821602808216919082811461580c5761580c615788565b505092915050565b5f808335601e19843603018112615829575f80fd5b8301803591506001600160401b03821115615842575f80fd5b6020019150600581901b36038213156115b8575f80fd5b5f6001600160fb1b0383111561586d575f80fd5b8260051b80858437919091019392505050565b5f8551615891818460208a01614d42565b8551908301906158a5818360208a01614d42565b85519101906158b8818360208901614d42565b84519101906158cb818360208801614d42565b019695505050505050565b5f808335601e198436030181126158eb575f80fd5b8301803591506001600160401b03821115615904575f80fd5b6020019150368190038213156115b8575f80fd5b8183525f6001600160fb1b0383111561592f575f80fd5b8260051b80836020870137939093016020019392505050565b608081525f61595b608083018a8c615918565b828103602084015261596e81898b615918565b90508281036040840152615983818789615918565b90508281036060840152615998818587615918565b9b9a5050505050505050505050565b8082028115828204841417610c0057610c00615788565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b81810381811115610c0057610c00615788565b634e487b7160e01b5f52603260045260245ffd5b5f823560be19833603018112615a27575f80fd5b9190910192915050565b5f60018201615a4257615a42615788565b5060010190565b6001600160a01b03841681526040602082018190525f906126649083018486615918565b5f8351615a7e818460208801614d42565b835190830190615a92818360208801614d42565b01949350505050565b5f60208284031215615aab575f80fd5b815161280881615499565b818382375f9101908152919050565b6001600160a01b0387811682528616602082015260a0604082018190525f90615af19083018688615918565b8281036060840152615b04818587615918565b83810360809094019390935250505f81526020019695505050505050565b601f821115610d20575f81815260208120601f850160051c81016020861015615b485750805b601f850160051c820191505b8181101561252a57828155600101615b54565b81516001600160401b03811115615b8057615b80614de0565b615b9481615b8e8454615756565b84615b22565b602080601f831160018114615bc7575f8415615bb05750858301515b5f19600386901b1c1916600185901b17855561252a565b5f85815260208120601f198616915b82811015615bf557888601518255948401946001909101908401615bd6565b5085821015615c1257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b602081525f6128086020830184615350565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90615c6690830184614d64565b9695505050505050565b5f60208284031215615c80575f80fd5b815161280881614cb7565b634e487b7160e01b5f52602160045260245ffdfeeec7cdcc53e8a06714f8fa7d7c32f8fce6fcc56feb01b3b12cabca26d8f01631a2646970667358221220b535a77c4742193ae969000bc07aef4a6c91d53e5497f89a1007210969ccb41164736f6c6343000814003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000001783091457be14521c9c3873ccf749984d338058000000000000000000000000007f9b7fabd7ec162f0416dfc1fcefba59ba9cd90000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000e506c6167756520506f70706574730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007504f505045545300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a68747470733a2f2f6d657461646174612e706c61677565706f70706574732e696f2f706f70706574732f00000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106103df575f3560e01c806381d5df49116101ff578063bc197c8111610113578063df6d481a116100a8578063ed477e8911610078578063ed477e8914610b3b578063efd0cbf914610b4e578063f23a6e6114610b61578063f2fde38b14610b8c578063fc80fff914610bab575f80fd5b8063df6d481a14610ad6578063e38ae1d314610ae9578063e985e9c514610afc578063ecba222a14610b1b575f80fd5b8063dad786a3116100e3578063dad786a314610a72578063dd46706414610a91578063df2b911914610ab0578063df63e72014610ac3575f80fd5b8063bc197c8114610a02578063bc990ff114610a21578063c87b56dd14610a40578063cd1b007a14610a5f575f80fd5b8063a22cb46511610194578063b0ccc31e11610164578063b0ccc31e14610964578063b3574cb714610983578063b45a3c0e146109a2578063b88d4fde146109d0578063b8d1e532146109e3575f80fd5b8063a22cb465146108e8578063a320bf1914610907578063adac84a01461091a578063ae14329f1461093e575f80fd5b806395d89b41116101cf57806395d89b411461089157806399b9675e146108a55780639b5dfceb146108b85780639eb7e99d146108cb575f80fd5b806381d5df491461083057806384b0196e146108435780638ba4cc3c1461086a5780638da5cb5b1461087d575f80fd5b80634d6dd844116102f65780636650cc8b1161028b578063715018a61161025b578063715018a61461072457806371e55e5a1461073857806378314a5d1461074b57806379502c55146107715780637d76a5851461081d575f80fd5b80636650cc8b146106bf5780636c0360eb146106de5780636c19e783146106f257806370a0823114610705575f80fd5b80635ef9432a116102c65780635ef9432a1461065a5780636198e3391461066e578063633de2bc1461068d5780636352211e146106a0575f80fd5b80634d6dd84414610602578063510051181461061557806355f804b3146106345780635ac4e55014610647575f80fd5b806318160ddd116103775780632a55205a116103475780632a55205a146105835780633a01e866146105c15780633ac1202f146105d45780633ccfd60b146105e757806342842e0e146105ef575f80fd5b806318160ddd146105015780631bf793321461052657806323b872dd1461053957806329ba8f9c1461054c575f80fd5b8063081c3909116103b2578063081c390914610484578063095ea7b3146104a3578063150b7a02146104b657806317263cae146104ee575f80fd5b806301ffc9a7146103e357806304634d8d1461041757806306fdde031461042c578063081812fc1461044d575b5f80fd5b3480156103ee575f80fd5b506104026103fd366004614ccc565b610bbe565b60405190151581526020015b60405180910390f35b61042a610425366004614d02565b610c06565b005b348015610437575f80fd5b50610440610c3a565b60405161040e9190614d8f565b348015610458575f80fd5b5061046c610467366004614da1565b610cca565b6040516001600160a01b03909116815260200161040e565b34801561048f575f80fd5b5060125461046c906001600160a01b031681565b61042a6104b1366004614db8565b610d0c565b3480156104c1575f80fd5b506104d56104d0366004614e8f565b610d25565b6040516001600160e01b0319909116815260200161040e565b61042a6104fc366004614ef2565b610d36565b34801561050c575f80fd5b50600554600454035f19015b60405190815260200161040e565b61042a610534366004614f95565b610f0c565b61042a610547366004615063565b611496565b348015610557575f80fd5b5060105461056b906001600160501b031681565b6040516001600160501b03909116815260200161040e565b34801561058e575f80fd5b506105a261059d36600461509c565b611513565b604080516001600160a01b03909316835260208301919091520161040e565b61042a6105cf3660046150bc565b6115bf565b61042a6105e2366004615147565b61177a565b61042a6117a3565b61042a6105fd366004615063565b611844565b61042a610610366004615160565b6118ba565b348015610620575f80fd5b5060115461046c906001600160a01b031681565b61042a6106423660046151a7565b611901565b61042a6106553660046151e5565b61199b565b348015610665575f80fd5b5061042a611c90565b348015610679575f80fd5b5061042a610688366004614da1565b611d34565b61042a61069b366004615147565b611d8e565b3480156106ab575f80fd5b5061046c6106ba366004614da1565b611db4565b3480156106ca575f80fd5b5060175461046c906001600160a01b031681565b3480156106e9575f80fd5b50610440611dbe565b61042a610700366004615147565b611e4a565b348015610710575f80fd5b5061051861071f366004615147565b611e70565b34801561072f575f80fd5b5061042a611ebc565b61042a6107463660046152d0565b611ecf565b348015610756575f80fd5b5060105461046c90600160501b90046001600160a01b031681565b34801561077c575f80fd5b506015546107d0906001600160501b0380821691600160501b81049091169061ffff600160a01b820481169164ffffffffff600160b01b82041691600160d81b8204169062ffffff600160e81b9091041686565b604080516001600160501b03978816815296909516602087015261ffff9384169486019490945264ffffffffff909116606085015216608083015262ffffff1660a082015260c00161040e565b61042a61082b36600461532a565b612026565b61042a61083e366004615147565b61204f565b34801561084e575f80fd5b50610857612075565b60405161040e9796959493929190615389565b61042a610878366004614db8565b6120fb565b348015610888575f80fd5b5061046c6121b2565b34801561089c575f80fd5b506104406121ca565b61042a6108b33660046153ea565b6121d9565b61042a6108c636600461532a565b6123a9565b3480156108d6575f80fd5b506015546001600160501b0316610518565b3480156108f3575f80fd5b5061042a6109023660046154a6565b6123db565b61042a6109153660046154d0565b6123ef565b348015610925575f80fd5b50601554600160501b90046001600160501b0316610518565b348015610949575f80fd5b50600f5461056b90600160a01b90046001600160501b031681565b34801561096f575f80fd5b50600e5461046c906001600160a01b031681565b34801561098e575f80fd5b5060145461046c906001600160a01b031681565b3480156109ad575f80fd5b506104026109bc366004614da1565b5f9081526018602052604090205460ff1690565b61042a6109de366004614e8f565b612532565b3480156109ee575f80fd5b5061042a6109fd366004615147565b6125a9565b348015610a0d575f80fd5b506104d5610a1c36600461558e565b61265b565b348015610a2c575f80fd5b5061042a610a3b366004615630565b61266d565b348015610a4b575f80fd5b50610440610a5a366004614da1565b61278e565b61042a610a6d366004614db8565b61280f565b348015610a7d575f80fd5b5061042a610a8c3660046151a7565b61284d565b348015610a9c575f80fd5b5061042a610aab366004614da1565b612857565b61042a610abe366004615147565b6128dc565b61042a610ad13660046152d0565b612902565b61042a610ae43660046152d0565b612c1d565b61042a610af7366004615685565b612d42565b348015610b07575f80fd5b50610402610b163660046156c6565b612de2565b348015610b26575f80fd5b50600e5461040290600160a01b900460ff1681565b61042a610b49366004615147565b612e0f565b61042a610b5c366004614da1565b612e53565b348015610b6c575f80fd5b506104d5610b7b3660046156f7565b63f23a6e6160e01b95945050505050565b348015610b97575f80fd5b5061042a610ba6366004615147565b612f63565b61042a610bb9366004615685565b612fd9565b5f6001600160e01b03198216632483248360e11b1480610be25750610be282613041565b80610bf15750610bf18261308e565b80610c005750610c008261308e565b92915050565b610c0e6130b2565b601380546001600160a01b0319166001600160a01b038416908117909155610c369082613111565b5050565b606060068054610c4990615756565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7590615756565b8015610cc05780601f10610c9757610100808354040283529160200191610cc0565b820191905f5260205f20905b815481529060010190602001808311610ca357829003601f168201915b5050505050905090565b5f610cd48261320e565b610cf1576040516333d1c03960e21b815260040160405180910390fd5b505f908152600a60205260409020546001600160a01b031690565b81610d1681613241565b610d208383613300565b505050565b630a85bd0160e11b5b949350505050565b610d3e6130b2565b601580546001600160501b03858116600160501b026001600160a01b0319600161ffff600160d81b808704821692909201160216600168ffff0000000000000160a01b0319909316929092179087161717905581610d9b60045490565b610da5919061579c565b6015805464ffffffffff8416600160b01b0264ffffffffff60b01b1961ffff94909416600160a01b029390931666ffffffffffffff60a01b19909116179190911790819055604051600160e81b820460e81b6001600160e81b0319166020820152600160d81b90910460f01b6001600160f01b031916602382015262ffffff90602501604051602081830303815290604052805190602001205f1c610e4a91906157c3565b6015805462ffffff92909216600160e81b026001600160e81b039092169190911790555f610e796014846157d6565b90508015610e9757610e92610e8c6121b2565b8261339e565b610ea9565b610ea9610ea26121b2565b600161339e565b601554604051600160e81b820462ffffff168152600160b01b820464ffffffffff1691600160d81b900461ffff16907f80044e735723e7b02701a584f166c2f37b7b4aa459d8c59b97b9e9895cabc33e9060200160405180910390a35050505050565b6020808701355f818152601890925260409091205460ff1615610f6257610f316121b2565b6001600160a01b0316336001600160a01b031614610f6257604051630e620e2360e01b815260040160405180910390fd5b6020808701355f818152601890925260409091205460ff1615610fb857610f876121b2565b6001600160a01b0316336001600160a01b031614610fb857604051630e620e2360e01b815260040160405180910390fd5b600f543490610fd890600160a01b90046001600160501b031660026157e9565b6001600160501b031611156110005760405163356680b760e01b815260040160405180910390fd5b86604001358860200135146110285760405163a9b1729f60e01b815260040160405180910390fd5b87604001358760200135146110505760405163a9b1729f60e01b815260040160405180910390fd5b61105d8860200135611db4565b6001600160a01b0316336001600160a01b0316146110b3576110828760200135611db4565b6001600160a01b0316336001600160a01b0316146110b35760405163061cbdd360e51b815260040160405180910390fd5b6110c06060880188615814565b6040516020016110d1929190615859565b60408051601f198184030181529190526110ee6080890189615814565b6040516020016110ff929190615859565b60408051601f1981840301815291905261111c60a08a018a615814565b60405160200161112d929190615859565b60408051601f1981840301815291905261114a60c08b018b615814565b60405160200161115b929190615859565b60408051601f198184030181529082905261117b94939291602001615880565b60408051601f1981840301815291905280516020909101206111a060808a018a615814565b6040516020016111b1929190615859565b60408051601f198184030181529190526111ce60608b018b615814565b6040516020016111df929190615859565b60408051601f198184030181529190526111fc60c08c018c615814565b60405160200161120d929190615859565b60408051601f1981840301815291905261122a60a08d018d615814565b60405160200161123b929190615859565b60408051601f198184030181529082905261125b94939291602001615880565b604051602081830303815290604052805190602001201461128f5760405163a9b1729f60e01b815260040160405180910390fd5b6112af61129c87806158d6565b8a6112aa8c60200135611db4565b6134d7565b506112ce6112c060208801886158d6565b896112aa8b60200135611db4565b506112da84848861374e565b506113316112eb89604001356138e6565b6112f88a602001356138e6565b61130560608c018c615814565b61130f8a80615814565b8e806080019061131f9190615814565b61132c60208f018f615814565b613900565b61138a61134189604001356138e6565b61134e8a602001356138e6565b61135b60a08c018c615814565b61136860408b018b615814565b8e8060c001906113789190615814565b61138560608f018f615814565b6139f4565b6113978860200135613aa2565b6113a5886020013543613ad0565b6113b28760400135613aa2565b6113c0876020013543613ad0565b60208801355f80516020615ca08339815191526113e060608b018b615814565b6113ed60808d018d615814565b6113fa60a08f018f615814565b8f8060c0019061140a9190615814565b60405161141e989796959493929190615948565b60405180910390a260208701355f80516020615ca083398151915261144660608a018a615814565b61145360808c018c615814565b61146060a08e018e615814565b8e8060c001906114709190615814565b604051611484989796959493929190615948565b60405180910390a25050505050505050565b826001600160a01b03811633146114b0576114b033613241565b5f82815260186020526040902054829060ff1615611501576114d06121b2565b6001600160a01b0316336001600160a01b03161461150157604051630e620e2360e01b815260040160405180910390fd5b61150c858585613b23565b5050505050565b5f828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291611587575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f90612710906115a5906001600160601b0316876159a7565b6115af91906157d6565b91519350909150505b9250929050565b83602001356115cd81611db4565b6001600160a01b0316336001600160a01b0316146115fe5760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff161561162d57604051630e620e2360e01b815260040160405180910390fd5b600f5434600160a01b9091046001600160501b031611156116615760405163356680b760e01b815260040160405180910390fd5b61166d83838733613ce1565b506116b03361167f87602001356138e6565b61168c6040890189615814565b6116968980615814565b6116a360608d018d615814565b61132c60208e018e615814565b6116f5336116c187602001356138e6565b6116ce6080890189615814565b6116db60408a018a615814565b6116e860a08d018d615814565b61138560608e018e615814565b6117028560200135613aa2565b611710856020013543613ad0565b60208501355f80516020615ca08339815191526117306040880188615814565b61173d60608a018a615814565b61174a60808c018c615814565b61175760a08e018e615814565b60405161176b989796959493929190615948565b60405180910390a25050505050565b6117826130b2565b601180546001600160a01b0319166001600160a01b03831617905550565b50565b6013546040515f9182916001600160a01b039091169047908381818185875af1925050503d805f81146117f1576040519150601f19603f3d011682016040523d82523d5f602084013e6117f6565b606091505b509150915081610c365760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b60448201526064015b60405180910390fd5b826001600160a01b038116331461185e5761185e33613241565b5f82815260186020526040902054829060ff16156118af5761187e6121b2565b6001600160a01b0316336001600160a01b0316146118af57604051630e620e2360e01b815260040160405180910390fd5b61150c858585613ecd565b6118c26130b2565b827f8f58419035b8628f770a76eea1727d8652058d13668583e68b35af246960c8d783836040516118f49291906159be565b60405180910390a2505050565b6119096130b2565b61194782828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250613ee792505050565b7f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c60018061197460045490565b61197e91906159ec565b604080519283526020830191909152015b60405180910390a15050565b84604001356119a981611db4565b6001600160a01b0316336001600160a01b0316146119da5760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff1615611a0957604051630e620e2360e01b815260040160405180910390fd5b8560200135611a1781611db4565b6001600160a01b0316336001600160a01b031614611a485760405163061cbdd360e51b815260040160405180910390fd5b5f8181526018602052604090205460ff1615611a7757604051630e620e2360e01b815260040160405180910390fd5b600f543490611a9790600160a01b90046001600160501b031660026157e9565b6001600160501b03161115611abf5760405163356680b760e01b815260040160405180910390fd5b611ad3611acc86806158d6565b89336134d7565b50611adf84848761374e565b50611b31611af088604001356138e6565b611afd89602001356138e6565b611b0a60608b018b615814565b611b148b80615814565b611b2160808f018f615814565b8e806020019061132c9190615814565b611b85611b4188604001356138e6565b611b4e89602001356138e6565b611b5b60a08b018b615814565b611b6860408c018c615814565b611b7560c08f018f615814565b8e80606001906113859190615814565b611b928760200135613aa2565b611ba0876020013543613ad0565b611bad8760400135613aa2565b611bbb876040013543613ad0565b60208701355f80516020615ca0833981519152611bdb60608a018a615814565b611be860808c018c615814565b611bf560a08e018e615814565b8e8060c00190611c059190615814565b604051611c19989796959493929190615948565b60405180910390a260408701355f80516020615ca0833981519152611c4160808a018a615814565b611c4e60608c018c615814565b611c5b60c08e018e615814565b8e8060a00190611c6b9190615814565b604051611c7f989796959493929190615948565b60405180910390a250505050505050565b611c986121b2565b6001600160a01b0316336001600160a01b031614611cc957604051635fc483c560e01b815260040160405180910390fd5b600e54600160a01b900460ff1615611cf457604051631551a48f60e11b815260040160405180910390fd5b600e80546001600160a81b031916600160a01b1790556040517f51e2d870cc2e10853e38dc06fcdae46ad3c3f588f326608803dac6204541ad16905f90a1565b611d3c6130b2565b5f8181526018602052604090819020805460ff19169055517ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290611d839083815260200190565b60405180910390a150565b611d966130b2565b601480546001600160a01b0319166001600160a01b03831617905550565b5f610c0082613ef3565b60168054611dcb90615756565b80601f0160208091040260200160405190810160405280929190818152602001828054611df790615756565b8015611e425780601f10611e1957610100808354040283529160200191611e42565b820191905f5260205f20905b815481529060010190602001808311611e2557829003601f168201915b505050505081565b611e526130b2565b600380546001600160a01b0319166001600160a01b03831617905550565b5f6001600160a01b038216611e98576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600960205260409020546001600160401b031690565b611ec46130b2565b611ecd5f613f5d565b565b6010543490611ee89085906001600160501b03166159a7565b1115611f075760405163356680b760e01b815260040160405180910390fd5b5f5b8381101561150c57612014858583818110611f2657611f266159ff565b9050602002810190611f389190615a13565b60200135868684818110611f4e57611f4e6159ff565b9050602002810190611f609190615a13565b611f6e906040810190615814565b888886818110611f8057611f806159ff565b9050602002810190611f929190615a13565b611fa0906060810190615814565b8a8a88818110611fb257611fb26159ff565b9050602002810190611fc49190615a13565b608001358b8b89818110611fda57611fda6159ff565b9050602002810190611fec9190615a13565b60a001358a8a8a818110612002576120026159ff565b90506020028101906108b391906158d6565b8061201e81615a31565b915050611f09565b61202e6130b2565b6010805469ffffffffffffffffffff19166001600160501b03831617905550565b6120576130b2565b601280546001600160a01b0319166001600160a01b03831617905550565b5f606080828080836120a77f506c6167756520506f707065747300000000000000000000000000000000000e83613fae565b6120d27f31000000000000000000000000000000000000000000000000000000000000016001613fae565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6121036130b2565b600454601554600160a01b900461ffff1610156121335760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff164211156121645760405163a56cc6ed60e01b815260040160405180910390fd5b601554819061ffff600160a01b909104168161217f60045490565b612189919061579c565b11156121a85760405163c30436e960e01b815260040160405180910390fd5b610d20838361339e565b5f6121c5600f546001600160a01b031690565b905090565b606060078054610c4990615756565b601554849061ffff600160a01b90910416816121f460045490565b6121fe919061579c565b111561221d5760405163c30436e960e01b815260040160405180910390fd5b8961222781611db4565b6001600160a01b0316336001600160a01b0316146122585760405163061cbdd360e51b815260040160405180910390fd5b601054346001600160501b0390911611156122865760405163356680b760e01b815260040160405180910390fd5b6122988484338e8e8e8e8e8e8e614057565b5085156122a9576122a9338761339e565b881561231e57601054600160501b90046001600160a01b031663c626d4b06122d08d6138e6565b8c8c6040518463ffffffff1660e01b81526004016122f093929190615a49565b5f604051808303815f87803b158015612307575f80fd5b505af1158015612319573d5f803e3d5ffd5b505050505b861561238b57601054600160501b90046001600160a01b031663c626d4b0338a8a6040518463ffffffff1660e01b815260040161235d93929190615a49565b5f604051808303815f87803b158015612374575f80fd5b505af1158015612386573d5f803e3d5ffd5b505050505b61239c6123978c614210565b614259565b5050505050505050505050565b6123b16130b2565b600f805469ffffffffffffffffffff60a01b1916600160a01b6001600160501b0384160217905550565b816123e581613241565b610d20838361429d565b601554849061ffff600160a01b909104168161240a60045490565b612414919061579c565b11156124335760405163c30436e960e01b815260040160405180910390fd5b600454601554600160a01b900461ffff1610156124635760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff164211156124945760405163a56cc6ed60e01b815260040160405180910390fd5b60158054600160501b90046001600160501b03165f036124c65760405162010a0160e81b815260040160405180910390fd5b80546124e290600160501b90046001600160501b0316876159a7565b3410156125025760405163356680b760e01b815260040160405180910390fd5b805461251f90859085903390600160d81b900461ffff1689614308565b5061252a338761339e565b505050505050565b836001600160a01b038116331461254c5761254c33613241565b5f83815260186020526040902054839060ff161561259d5761256c6121b2565b6001600160a01b0316336001600160a01b03161461259d57604051630e620e2360e01b815260040160405180910390fd5b61252a86868686614440565b6125b16121b2565b6001600160a01b0316336001600160a01b0316146125e257604051635fc483c560e01b815260040160405180910390fd5b600e54600160a01b900460ff161561260d57604051631551a48f60e11b815260040160405180910390fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f9f513fe86dc42fdbac355fa4d9b1d5be7b5e6cd2df67e30db8003766568de47690602001611d83565b63bc197c8160e01b5b95945050505050565b8261267781611db4565b6001600160a01b0316336001600160a01b0316146126a85760405163061cbdd360e51b815260040160405180910390fd5b6012546001600160a01b03166126d157604051631762b79960e11b815260040160405180910390fd5b6126de8686868686614484565b506012546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018790526044015f604051808303815f87803b158015612736575f80fd5b505af1158015612748573d5f803e3d5ffd5b50505050837ff91e506b1a3f294d887b750be5ca03481579f6e769703b5eb48218750787fcb9848460405161277e9291906159be565b60405180910390a2505050505050565b60606127998261320e565b6127b657604051630a14c4b560e41b815260040160405180910390fd5b5f6127bf614536565b905080515f036127dd5760405180602001604052805f815250612808565b806127e784614545565b6040516020016127f8929190615a6d565b6040516020818303038152906040525b9392505050565b6014546001600160a01b0316336001600160a01b0316146128435760405163061cbdd360e51b815260040160405180910390fd5b610c36828261339e565b610c368282614588565b8061286181611db4565b6001600160a01b0316336001600160a01b0316146128925760405163061cbdd360e51b815260040160405180910390fd5b5f8281526018602052604090819020805460ff19166001179055517f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119061198f9084815260200190565b6128e46130b2565b601780546001600160a01b0319166001600160a01b03831617905550565b61290a6130b2565b82811461292a5760405163a9b1729f60e01b815260040160405180910390fd5b5f5b81811015612bdb575f838383818110612947576129476159ff565b90506020028101906129599190615a13565b6080013511156129c5576129c5838383818110612978576129786159ff565b905060200281019061298a9190615a13565b612998906020810190615147565b8484848181106129aa576129aa6159ff565b90506020028101906129bc9190615a13565b6080013561339e565b5f8383838181106129d8576129d86159ff565b90506020028101906129ea9190615a13565b6129f8906040810190615814565b90501115612ac657601054600160501b90046001600160a01b031663c626d4b0612a48858585818110612a2d57612a2d6159ff565b9050602002810190612a3f9190615a13565b602001356138e6565b858585818110612a5a57612a5a6159ff565b9050602002810190612a6c9190615a13565b612a7a906040810190615814565b6040518463ffffffff1660e01b8152600401612a9893929190615a49565b5f604051808303815f87803b158015612aaf575f80fd5b505af1158015612ac1573d5f803e3d5ffd5b505050505b5f838383818110612ad957612ad96159ff565b9050602002810190612aeb9190615a13565b612af9906060810190615814565b90501115612bc957601054600160501b90046001600160a01b031663c626d4b0848484818110612b2b57612b2b6159ff565b9050602002810190612b3d9190615a13565b612b4b906020810190615147565b858585818110612b5d57612b5d6159ff565b9050602002810190612b6f9190615a13565b612b7d906060810190615814565b6040518463ffffffff1660e01b8152600401612b9b93929190615a49565b5f604051808303815f87803b158015612bb2575f80fd5b505af1158015612bc4573d5f803e3d5ffd5b505050505b80612bd381615a31565b91505061292c565b50612c178484808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525061425992505050565b50505050565b612c256130b2565b600454601554600160a01b900461ffff161015612c555760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff16421115612c865760405163a56cc6ed60e01b815260040160405180910390fd5b828114612ca65760405163a9b1729f60e01b815260040160405180910390fd5b5f5b83811015612d0a57612cf8858583818110612cc557612cc56159ff565b9050602002016020810190612cda9190615147565b848484818110612cec57612cec6159ff565b9050602002013561339e565b80612d0281615a31565b915050612ca8565b5060155461ffff600160a01b90910416612d2360045490565b1115612c175760405163c30436e960e01b815260040160405180910390fd5b6017546001600160a01b0316336001600160a01b031614612d765760405163061cbdd360e51b815260040160405180910390fd5b601054604051630c626d4b60e41b8152600160501b9091046001600160a01b03169063c626d4b090612db090869086908690600401615a49565b5f604051808303815f87803b158015612dc7575f80fd5b505af1158015612dd9573d5f803e3d5ffd5b50505050505050565b6001600160a01b039182165f908152600b6020908152604080832093909416825291909152205460ff1690565b612e176130b2565b601080547fffff0000000000000000000000000000000000000000ffffffffffffffffffff16600160501b6001600160a01b0384160217905550565b601554819061ffff600160a01b9091041681612e6e60045490565b612e78919061579c565b1115612e975760405163c30436e960e01b815260040160405180910390fd5b600454601554600160a01b900461ffff161015612ec75760405163c30436e960e01b815260040160405180910390fd5b601554600160b01b900464ffffffffff16421115612ef85760405163a56cc6ed60e01b815260040160405180910390fd5b601580546001600160501b03165f03612f2457604051637338bcbd60e11b815260040160405180910390fd5b8054612f39906001600160501b0316846159a7565b341015612f595760405163356680b760e01b815260040160405180910390fd5b610d20338461339e565b612f6b6130b2565b6001600160a01b038116612fd05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161183b565b6117a081613f5d565b6017546001600160a01b0316336001600160a01b03161461300d5760405163061cbdd360e51b815260040160405180910390fd5b601154604051630c626d4b60e41b81526001600160a01b039091169063c626d4b090612db090869086908690600401615a49565b5f6301ffc9a760e01b6001600160e01b03198316148061307157506380ac58cd60e01b6001600160e01b03198316145b80610c005750506001600160e01b031916635b5e139f60e01b1490565b5f6001600160e01b03198216630271189760e51b1480610c005750610c00826145c0565b336130bb6121b2565b6001600160a01b031614611ecd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161183b565b6127106001600160601b038216111561317f5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840161183b565b6001600160a01b0382166131d55760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161183b565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b5f81600111158015613221575060045482105b8015610c005750505f90815260086020526040902054600160e01b161590565b600e546001600160a01b0316801580159061326557505f816001600160a01b03163b115b15610c3657604051633185c44d60e21b81523060048201526001600160a01b03838116602483015282169063c617113490604401602060405180830381865afa1580156132b4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132d89190615a9b565b610c3657604051633b79c77360e21b81526001600160a01b038316600482015260240161183b565b5f61330a82611db4565b9050336001600160a01b03821614613343576133268133612de2565b613343576040516367d9dca160e11b815260040160405180910390fd5b5f828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6004545f8290036133c25760405163b562e8dd60e01b815260040160405180910390fd5b6133ce5f8483856145f4565b6001600160a01b0383165f9081526009602052604081208054680100000000000000018502019055613424908490613407908281614649565b6001851460e11b174260a01b176001600160a01b03919091161790565b5f828152600860205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146134a75780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4600101613471565b50815f036134c757604051622e076360e81b815260040160405180910390fd5b60045550610d205f84838561466b565b5f600285856040516134ea929190615ab6565b9081526040519081900360200190205460ff161561351b5760405163900bb2c960e01b815260040160405180910390fd5b5f61369e7fed63cd5971c5ed8680952305f179845201a81643bb98e843082312ac8aaa42f261354d6020870187615147565b6020870135604088013561356460608a018a615814565b604051602001613575929190615859565b60408051601f19818403018152919052805160209091012061359a60808b018b615814565b6040516020016135ab929190615859565b60408051601f1981840301815291905280516020909101206135d060a08c018c615814565b6040516020016135e1929190615859565b60408051601f19818403018152919052805160209091012061360660c08d018d615814565b604051602001613617929190615859565b60408051601f198184030181528282528051602091820120908301999099526001600160a01b03909716968101969096526060860194909452608085019290925260a084015260c083015260e08083019190915261010082019290925290860135610120820152610140015b6040516020818303038152906040528051906020012061476c565b9050826001600160a01b03166136e98288888080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061479892505050565b6001600160a01b0316036137355760016002878760405161370b929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555060019050610d2e565b604051638baa579f60e01b815260040160405180910390fd5b5f60028484604051613761929190615ab6565b9081526040519081900360200190205460ff16156137925760405163900bb2c960e01b815260040160405180910390fd5b5f6138477f701f885bb814379c47427ba459448982cdfe1b3656500617c7d38baef520a4466137c185806158d6565b6040516020016137d2929190615ab6565b604051602081830303815290604052805190602001208580602001906137f891906158d6565b604051602001613809929190615ab6565b60408051808303601f19018152828252805160209182012090830194909452818101929092526060810192909252850135608082015260a001613683565b600354604080516020601f89018190048102820181019092528781529293506001600160a01b03909116916138989184919089908990819084018382808284375f9201919091525061479892505050565b6001600160a01b031603613735576001600286866040516138ba929190615ab6565b908152604051908190036020019020805491151560ff1990921691909117905550600190509392505050565b5f610c00826e5f3dd0d326e1d0000000000000000061579c565b861561397457601054604051631759616b60e11b8152600160501b9091046001600160a01b031690632eb2c2d690613946908c908e908d908d908d908d90600401615ac5565b5f604051808303815f87803b15801561395d575f80fd5b505af115801561396f573d5f803e3d5ffd5b505050505b82156139e857601054604051631759616b60e11b8152600160501b9091046001600160a01b031690632eb2c2d6906139ba908d908d908990899089908990600401615ac5565b5f604051808303815f87803b1580156139d1575f80fd5b505af11580156139e3573d5f803e3d5ffd5b505050505b50505050505050505050565b8615613a6257601154604051631759616b60e11b81526001600160a01b0390911690632eb2c2d690613a34908c908e908d908d908d908d90600401615ac5565b5f604051808303815f87803b158015613a4b575f80fd5b505af1158015613a5d573d5f803e3d5ffd5b505050505b82156139e857601154604051631759616b60e11b81526001600160a01b0390911690632eb2c2d6906139ba908d908d908990899089908990600401615ac5565b5f8181526008602052604081205490036117a057613abf81613ef3565b5f8281526008602052604090205550565b5f8281526008602052604081205490819003613afe5760405162d5815360e01b815260040160405180910390fd5b5f928352600860205260409092206001600160e81b039290921660e89190911b179055565b5f613b2d82613ef3565b9050836001600160a01b0316816001600160a01b031614613b605760405162a1148160e81b815260040160405180910390fd5b5f828152600a602052604090208054338082146001600160a01b03881690911417613bac57613b8f8633612de2565b613bac57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516613bd357604051633a954ecd60e21b815260040160405180910390fd5b613be086868660016145f4565b8015613bea575f82555b6001600160a01b038087165f9081526009602052604080822080545f1901905591871681522080546001019055613c4185613c26888287614649565b600160e11b174260a01b176001600160a01b03919091161790565b5f85815260086020526040812091909155600160e11b84169003613c9357600184015f818152600860205260408120549003613c91576004548114613c91575f8181526008602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461252a868686600161466b565b5f60028585604051613cf4929190615ab6565b9081526040519081900360200190205460ff1615613d255760405163900bb2c960e01b815260040160405180910390fd5b5f613e7c7fa18eb071a9bf77e50fceeec095039d77f3380a8cc9e424b82df3f795dc691446846020870135613d5d6040890189615814565b604051602001613d6e929190615859565b60408051601f198184030181529190528051602090910120613d9360608a018a615814565b604051602001613da4929190615859565b60408051601f198184030181529190528051602090910120613dc960808b018b615814565b604051602001613dda929190615859565b60408051601f198184030181529190528051602090910120613dff60a08c018c615814565b604051602001613e10929190615859565b604051602081830303815290604052805190602001208b60c001356040516020016136839897969594939291909788526001600160a01b0396909616602088015260408701949094526060860192909252608085015260a084015260c083015260e08201526101000190565b600354604080516020601f8a018190048102820181019092528881529293506001600160a01b03909116916136e9918491908a908a90819084018382808284375f9201919091525061479892505050565b610d2083838360405180602001604052805f815250612532565b6016610c368282615b67565b5f8180600111613f4457600454811015613f44575f8181526008602052604081205490600160e01b82169003613f42575b805f0361280857505f19015f81815260086020526040902054613f24565b505b604051636f96cda160e11b815260040160405180910390fd5b600f80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b606060ff8314613fc857613fc1836147ba565b9050610c00565b818054613fd490615756565b80601f016020809104026020016040519081016040528092919081815260200182805461400090615756565b801561404b5780601f106140225761010080835404028352916020019161404b565b820191905f5260205f20905b81548152906001019060200180831161402e57829003601f168201915b50505050509050610c00565b5f60028b8b60405161406a929190615ab6565b9081526040519081900360200190205460ff161561409b5760405163900bb2c960e01b815260040160405180910390fd5b5f61415b7f6aa73e9f6030cbd2c261d73e016cc34d56bdf362c69abf604bd0fc64b40382038b8b8b8b6040516020016140d5929190615859565b604051602081830303815290604052805190602001208a8a6040516020016140fe929190615859565b60408051601f198184030181528282528051602091820120908301969096526001600160a01b03909416938101939093526060830191909152608082015260a081019190915260c0810186905260e0810185905261010001613683565b905060035f9054906101000a90046001600160a01b03166001600160a01b03166141ba828e8e8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061479892505050565b6001600160a01b03160361373557600160028d8d6040516141dc929190615ab6565b908152604051908190036020019020805491151560ff1990921691909117905550600190505b9a9950505050505050505050565b6040805160018082528183019092526060915f91906020808301908036833701905050905082815f81518110614248576142486159ff565b602090810291909101015292915050565b336001600160a01b03167f6622ba6eaf77853a5f8efe73c835e558a4e38fb8cbd2f029b5c129143838fbb9826040516142929190615c22565b60405180910390a250565b335f818152600b602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6002868660405161431b929190615ab6565b9081526040519081900360200190205460ff161561434c5760405163900bb2c960e01b815260040160405180910390fd5b604080517f426a9c4d797eca66406705cd15ee3a439b5c337d9a1a457763834c6b248340ab60208201526001600160a01b0386169181019190915260608101849052608081018390525f906143a39060a001613683565b600354604080516020601f8b018190048102820181019092528981529293506001600160a01b03909116916143f4918491908b908b90819084018382808284375f9201919091525061479892505050565b6001600160a01b03160361373557600160028888604051614416929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555060019050612664565b61444b848484611496565b6001600160a01b0383163b15612c1757614467848484846147f7565b612c17576040516368d2bf6b60e11b815260040160405180910390fd5b5f60028686604051614497929190615ab6565b9081526040519081900360200190205460ff16156144c85760405163900bb2c960e01b815260040160405180910390fd5b5f6143a37f2885e7a8c4933ede965c15eb35025182fd268aa571c8d46a46d4452bb9e8bf9a868686604051602001614501929190615ab6565b60408051601f198184030181528282528051602091820120908301949094528101919091526060810191909152608001613683565b606060168054610c4990615756565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a90048061455e5750819003601f19909101908152919050565b60016002838360405161459c929190615ab6565b908152604051908190036020019020805491151560ff199092169190911790555050565b5f6001600160e01b0319821663152a902d60e11b1480610c0057506301ffc9a760e01b6001600160e01b0319831614610c00565b6001600160a01b0384166146445760155461ffff600160a01b909104168161461b60045490565b614625919061579c565b11156146445760405163c30436e960e01b815260040160405180910390fd5b612c17565b5f60e882811c9061465b8686846148db565b62ffffff16901b95945050505050565b6001600160a01b0384166146d95761383f1943016146898382613ad0565b836001600160a01b03168162ffffff16847f759931ee62eca086261eaf5026904de9d82d76cb85470074063fad43d45a4e4e856040516146cb91815260200190565b60405180910390a450612c17565b6012546001600160a01b031615614644576012546001600160a01b03166342842e0e614704846138e6565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529086166024820152604481018590526064015f604051808303815f87803b158015614751575f80fd5b505af1158015614763573d5f803e3d5ffd5b50505050612c17565b5f610c00614778614922565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f6147a58585614a4b565b915091506147b281614a8a565b509392505050565b60605f6147c683614bd3565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061482b903390899088908890600401615c34565b6020604051808303815f875af1925050508015614865575060408051601f3d908101601f1916820190925261486291810190615c70565b60015b6148c1573d808015614892576040519150601f19603f3d011682016040523d82523d5f602084013e614897565b606091505b5080515f036148b9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d2e565b5f62ffffff8216158015906148fd57504362ffffff16826138400162ffffff16115b1561491b5760405163111bb2f160e31b815260040160405180910390fd5b5092915050565b5f306001600160a01b037f000000000000000000000000473833fbb446cf8efe5f762455f9f17592277e521614801561497a57507f000000000000000000000000000000000000000000000000000000000000000146145b156149a457507f93370d528048b76b88bf6e8eca68d44f2ef9d5e2a412a7ca90af0807d696bc5d90565b6121c5604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527ff41090e36ddbd810a12a21bafd56e4303fee630b52c0e8c11b46f8d0b49849cf918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a08201525f9060c00160405160208183030381529060405280519060200120905090565b5f808251604103614a7f576020830151604084015160608501515f1a614a7387828585614bfa565b945094505050506115b8565b505f905060026115b8565b5f816004811115614a9d57614a9d615c8b565b03614aa55750565b6001816004811115614ab957614ab9615c8b565b03614b065760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161183b565b6002816004811115614b1a57614b1a615c8b565b03614b675760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161183b565b6003816004811115614b7b57614b7b615c8b565b036117a05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161183b565b5f60ff8216601f811115610c0057604051632cd44ac360e21b815260040160405180910390fd5b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115614c2f57505f90506003614cae565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614c80573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116614ca8575f60019250925050614cae565b91505f90505b94509492505050565b6001600160e01b0319811681146117a0575f80fd5b5f60208284031215614cdc575f80fd5b813561280881614cb7565b80356001600160a01b0381168114614cfd575f80fd5b919050565b5f8060408385031215614d13575f80fd5b614d1c83614ce7565b915060208301356001600160601b0381168114614d37575f80fd5b809150509250929050565b5f5b83811015614d5c578181015183820152602001614d44565b50505f910152565b5f8151808452614d7b816020860160208601614d42565b601f01601f19169290920160200192915050565b602081525f6128086020830184614d64565b5f60208284031215614db1575f80fd5b5035919050565b5f8060408385031215614dc9575f80fd5b614dd283614ce7565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715614e1c57614e1c614de0565b604052919050565b5f82601f830112614e33575f80fd5b81356001600160401b03811115614e4c57614e4c614de0565b614e5f601f8201601f1916602001614df4565b818152846020838601011115614e73575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f8060808587031215614ea2575f80fd5b614eab85614ce7565b9350614eb960208601614ce7565b92506040850135915060608501356001600160401b03811115614eda575f80fd5b614ee687828801614e24565b91505092959194509250565b5f805f8060808587031215614f05575f80fd5b5050823594602084013594506040840135936060013592509050565b5f6101008284031215614f32575f80fd5b50919050565b5f60608284031215614f32575f80fd5b5f60808284031215614f32575f80fd5b5f8083601f840112614f68575f80fd5b5081356001600160401b03811115614f7e575f80fd5b6020830191508360208285010111156115b8575f80fd5b5f805f805f8060a08789031215614faa575f80fd5b86356001600160401b0380821115614fc0575f80fd5b614fcc8a838b01614f21565b97506020890135915080821115614fe1575f80fd5b614fed8a838b01614f21565b96506040890135915080821115615002575f80fd5b61500e8a838b01614f38565b95506060890135915080821115615023575f80fd5b61502f8a838b01614f48565b94506080890135915080821115615044575f80fd5b5061505189828a01614f58565b979a9699509497509295939492505050565b5f805f60608486031215615075575f80fd5b61507e84614ce7565b925061508c60208501614ce7565b9150604084013590509250925092565b5f80604083850312156150ad575f80fd5b50508035926020909101359150565b5f805f80606085870312156150cf575f80fd5b84356001600160401b03808211156150e5575f80fd5b9086019060e082890312156150f8575f80fd5b9094506020860135908082111561510d575f80fd5b61511988838901614f48565b9450604087013591508082111561512e575f80fd5b5061513b87828801614f58565b95989497509550505050565b5f60208284031215615157575f80fd5b61280882614ce7565b5f805f60408486031215615172575f80fd5b8335925060208401356001600160401b0381111561518e575f80fd5b61519a86828701614f58565b9497909650939450505050565b5f80602083850312156151b8575f80fd5b82356001600160401b038111156151cd575f80fd5b6151d985828601614f58565b90969095509350505050565b5f805f805f608086880312156151f9575f80fd5b85356001600160401b038082111561520f575f80fd5b61521b89838a01614f21565b96506020880135915080821115615230575f80fd5b61523c89838a01614f48565b95506040880135915080821115615251575f80fd5b61525d89838a01614f38565b94506060880135915080821115615272575f80fd5b5061527f88828901614f58565b969995985093965092949392505050565b5f8083601f8401126152a0575f80fd5b5081356001600160401b038111156152b6575f80fd5b6020830191508360208260051b85010111156115b8575f80fd5b5f805f80604085870312156152e3575f80fd5b84356001600160401b03808211156152f9575f80fd5b61530588838901615290565b9096509450602087013591508082111561531d575f80fd5b5061513b87828801615290565b5f6020828403121561533a575f80fd5b81356001600160501b0381168114612808575f80fd5b5f8151808452602080850194508084015f5b8381101561537e57815187529582019590820190600101615362565b509495945050505050565b60ff60f81b8816815260e060208201525f6153a760e0830189614d64565b82810360408401526153b98189614d64565b606084018890526001600160a01b038716608085015260a0840186905283810360c085015290506142028185615350565b5f805f805f805f805f60c08a8c031215615402575f80fd5b8935985060208a01356001600160401b038082111561541f575f80fd5b61542b8d838e01615290565b909a50985060408c0135915080821115615443575f80fd5b61544f8d838e01615290565b909850965060608c0135955060808c0135945060a08c0135915080821115615475575f80fd5b506154828c828d01614f58565b915080935050809150509295985092959850929598565b80151581146117a0575f80fd5b5f80604083850312156154b7575f80fd5b6154c083614ce7565b91506020830135614d3781615499565b5f805f80606085870312156154e3575f80fd5b843593506020850135925060408501356001600160401b03811115615506575f80fd5b61513b87828801614f58565b5f82601f830112615521575f80fd5b813560206001600160401b0382111561553c5761553c614de0565b8160051b61554b828201614df4565b9283528481018201928281019087851115615564575f80fd5b83870192505b848310156155835782358252918301919083019061556a565b979650505050505050565b5f805f805f60a086880312156155a2575f80fd5b6155ab86614ce7565b94506155b960208701614ce7565b935060408601356001600160401b03808211156155d4575f80fd5b6155e089838a01615512565b945060608801359150808211156155f5575f80fd5b61560189838a01615512565b93506080880135915080821115615616575f80fd5b5061562388828901614e24565b9150509295509295909350565b5f805f805f60608688031215615644575f80fd5b85356001600160401b038082111561565a575f80fd5b61566689838a01614f58565b9097509550602088013594506040880135915080821115615272575f80fd5b5f805f60408486031215615697575f80fd5b6156a084614ce7565b925060208401356001600160401b038111156156ba575f80fd5b61519a86828701615290565b5f80604083850312156156d7575f80fd5b6156e083614ce7565b91506156ee60208401614ce7565b90509250929050565b5f805f805f60a0868803121561570b575f80fd5b61571486614ce7565b945061572260208701614ce7565b9350604086013592506060860135915060808601356001600160401b0381111561574a575f80fd5b61562388828901614e24565b600181811c9082168061576a57607f821691505b602082108103614f3257634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c0057610c00615788565b634e487b7160e01b5f52601260045260245ffd5b5f826157d1576157d16157af565b500690565b5f826157e4576157e46157af565b500490565b6001600160501b0381811683821602808216919082811461580c5761580c615788565b505092915050565b5f808335601e19843603018112615829575f80fd5b8301803591506001600160401b03821115615842575f80fd5b6020019150600581901b36038213156115b8575f80fd5b5f6001600160fb1b0383111561586d575f80fd5b8260051b80858437919091019392505050565b5f8551615891818460208a01614d42565b8551908301906158a5818360208a01614d42565b85519101906158b8818360208901614d42565b84519101906158cb818360208801614d42565b019695505050505050565b5f808335601e198436030181126158eb575f80fd5b8301803591506001600160401b03821115615904575f80fd5b6020019150368190038213156115b8575f80fd5b8183525f6001600160fb1b0383111561592f575f80fd5b8260051b80836020870137939093016020019392505050565b608081525f61595b608083018a8c615918565b828103602084015261596e81898b615918565b90508281036040840152615983818789615918565b90508281036060840152615998818587615918565b9b9a5050505050505050505050565b8082028115828204841417610c0057610c00615788565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b81810381811115610c0057610c00615788565b634e487b7160e01b5f52603260045260245ffd5b5f823560be19833603018112615a27575f80fd5b9190910192915050565b5f60018201615a4257615a42615788565b5060010190565b6001600160a01b03841681526040602082018190525f906126649083018486615918565b5f8351615a7e818460208801614d42565b835190830190615a92818360208801614d42565b01949350505050565b5f60208284031215615aab575f80fd5b815161280881615499565b818382375f9101908152919050565b6001600160a01b0387811682528616602082015260a0604082018190525f90615af19083018688615918565b8281036060840152615b04818587615918565b83810360809094019390935250505f81526020019695505050505050565b601f821115610d20575f81815260208120601f850160051c81016020861015615b485750805b601f850160051c820191505b8181101561252a57828155600101615b54565b81516001600160401b03811115615b8057615b80614de0565b615b9481615b8e8454615756565b84615b22565b602080601f831160018114615bc7575f8415615bb05750858301515b5f19600386901b1c1916600185901b17855561252a565b5f85815260208120601f198616915b82811015615bf557888601518255948401946001909101908401615bd6565b5085821015615c1257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b602081525f6128086020830184615350565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90615c6690830184614d64565b9695505050505050565b5f60208284031215615c80575f80fd5b815161280881614cb7565b634e487b7160e01b5f52602160045260245ffdfeeec7cdcc53e8a06714f8fa7d7c32f8fce6fcc56feb01b3b12cabca26d8f01631a2646970667358221220b535a77c4742193ae969000bc07aef4a6c91d53e5497f89a1007210969ccb41164736f6c63430008140033

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

00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000001783091457be14521c9c3873ccf749984d338058000000000000000000000000007f9b7fabd7ec162f0416dfc1fcefba59ba9cd90000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000e506c6167756520506f70706574730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007504f505045545300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a68747470733a2f2f6d657461646174612e706c61677565706f70706574732e696f2f706f70706574732f00000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): Plague Poppets
Arg [1] : symbol_ (string): POPPETS
Arg [2] : signer_ (address): 0x1783091457Be14521c9c3873CCf749984d338058
Arg [3] : curios_ (address): 0x007F9B7fAbd7EC162F0416DFC1fCefBA59bA9cD9
Arg [4] : uri_ (string): https://metadata.plaguepoppets.io/poppets/

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000001783091457be14521c9c3873ccf749984d338058
Arg [3] : 000000000000000000000000007f9b7fabd7ec162f0416dfc1fcefba59ba9cd9
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000e
Arg [6] : 506c6167756520506f7070657473000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [8] : 504f505045545300000000000000000000000000000000000000000000000000
Arg [9] : 000000000000000000000000000000000000000000000000000000000000002a
Arg [10] : 68747470733a2f2f6d657461646174612e706c61677565706f70706574732e69
Arg [11] : 6f2f706f70706574732f00000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.