ETH Price: $2,289.39 (+0.06%)

Contract

0x16e64C23C6eB58acB0BC21C3c198D91893fc9a88
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040193149152024-02-26 23:08:59194 days ago1708988939IN
 Create: RadbrOrdinalMintPassV1
0 ETH0.1460057237.37040485

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RadbrOrdinalMintPassV1

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 26 : RadbrOrdinal.sol
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

import { IERC721A } from "lib/erc721a/contracts/IERC721A.sol";
import { IERC721AUpgradeable } from "lib/ERC721A-Upgradeable/contracts/IERC721AUpgradeable.sol";
import { ERC721AUpgradeable } from "lib/ERC721A-Upgradeable/contracts/ERC721AUpgradeable.sol";
import {
    ERC721AQueryableUpgradeable
} from "lib/ERC721A-Upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol";

import {
    ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { ERC20 } from "lib/solmate/src/tokens/ERC20.sol";
import { RadlistV2 } from "./RadlistV2.sol";
import { SafeTransferLib } from "lib/solmate/src/utils/SafeTransferLib.sol";

/*                                                                                                                   
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555YYYYYYYYYYYYYYYYYYYYYYYYYYYYY555555555555555555555555PP####PP55555555555555
555555PGGGPPPPP55555555555555555555555555YYYYYJJJJJJJYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYJJYYYYY5555555555555P#@@@@@@@@#P555555555555
55555P#########BBBBBBBBBBBBBBPPPPYYYJJJJJJYYJJYYYY55555555555555555555555555555555555555YYYYYYJJYYY555G#@@@@@@@@@@@@##G555555555
55555###P7P############GGGYYYJJYYYYYYYYYYY55YJ555555555555555555555555Y5PPPGGGGPPP555555555555YYYYYYJJ55#@@@@@@@@@@@@@@&55555555
55555##7~PG5555#55GGYYYJJYYYY555555555555555J555555555555555555555Y5YY5GGGBGGB#GGBGGPP5555555555555555YYJ5B@@@@@@@@@@@@@&5555555
55555##P?YYJ~G~55?JJJYY55555555555555555555JY5555555555555555555YP5PG5GGBB&##&@BBGGGBBP555555555555555555YYYYBB@@@@@@@@@@B555555
!!!!!##577Y#YB5?JYY555555555555555555555555J5555555555555555555YPP5GGB##&@@BB@@###BGGGBG55555555555555555555YJJYG&@@@@@@@@PPPP55
~~~~~###B?55PJJY55555555555555555555555555JY555555555555555555YGPYGGGGBBB@@GG@@GG&@GGGGGP555555555555555555555YJJJG@@@@@@@@@@@BP
~~~~~####~GYJY5555555555555555555555555555J555555555555555555Y5GYGGGGGGGG#@GG@@BB@#GGGGGB55555555555555555555555YJJP&@@@@@@@@@@@
~~~~~####!YY55555555555555555555555555555JY555555555555555555YBYYGGGGGGGGG@&&@@@##GGGGGGG5555555555555555555555555YJJ@@@@@@@@@@&
~~~~~##GY55555555555555555555555555555555J5555555555555555555YPGYGGGGGGGGG@BBB@BB&&BGGGGB55555555555555555555555555YY5GGGGGGGGG5
~~~~~##JY55555555555555555555555555555555J5555555555555555555YYBYGGGGGGGGG@GGG@GGGB@GGGBG5555555555555555555555555555YY555555555
~~~~~7YJ555555555555555555555555555555555J55555555555555555555YPG5GBGGGG##@##B@###&&GBGP555555555555555555555555555555JY55555555
~~~~~?J5555555555555555555555555555555555J555555555555555555555YPGPPGGBBBB@B&&@BBBBGGP555555555555555555555555555555555J55555555
~~~~JJJ5555555555555555555555555555555555J5555555555555555555555Y555YYPP5GGGGGGGGGPP55555555555555555555555555555555555J55555555
~~~~JJ55555555555555555555555555555555555J5555555555555555555555555YYYYYY5555555555555555555555555555555555555555555555JJ5555555
~~~~JJ55555555555555555555555555555555555J5555555555555555555555555555555555555555YYYYYYYYYYYYYYYYYYJYYYJJJYYYYYYJJYYYYJJ5555555
~~~~J555555555555555555555555555555555555J55555555555555555555555555555YYYYYYYYYYYYYYYYYYY55555555555555555555555555YYJJJJY555J!
7JJJJ555555555555555555555555555555555555J55555555555555555YYYYYJYYYYYYYYYYYY555555555555555555555555555555555555555555YYJJJY7::
YYYJJ555555555555555555555555555555555555J5555555555YYJYYYYYYYYY55555555555555555555555555555555555555555555555555555555555YJJ?^
YYYJJ555555555555555555555555555555555555J555555YYYYY555555555555555555555555555555555555555555555555555555555555555555555555JJJ
YYJJJ555555555555555555555555555555555555J55YYJYY555555555555555555555555555555555555555555555555555555555555555555555555555YJJ!
Y5JJ5555555555555555555555555555555555555JYYY55555555555555555555555555555555555555555555555555555555555555555555555555555YJ?!^:
Y5JYJ55555555555555YYYJ??????!!!!!!!!!!??JY55555555555555555555555555555555555555555555555555555555555555555555555555555YJ??^:^^
YY~Y??JJYJJJJJJ?!!!!!!~~~~~~~~~~~~^^^~~~~!!??JYY55555555555555555555555555555555555555555555555555555555555555555555Y5Y??!^^^^^^
YY~~~~~~!~~~~~~~~~~~~~~~~~~~~~~~~~P77~~~~~~~~!!??YYYY55555555555555555555555555555555555555555555555555555555555YYYP5!!~~~^^^^^^
YY~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~5BBPP?~^~~~~~~~!G55YYY555555555555555555555555555555555555555555555555555YYY555GGPGY7~~~~^^^^^
YY~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^BBBBBP?~~^~~~~~BBBGG:!7YYYY555555555555555555555555555555555555555555YJ!YGGBBBBB55557~~~^^^^^
YY!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~BBBBBBBGGJ~^^^~BBBBBPPPGGG555YYY5555555555555555555555555555YYYYJJ~~~~. :BBBBBBB5555PY^^^^^^^
555???!!~~~~^^^^^^^^^^^~~~~~~~~~~~~BBBBBBBBBBGYYYGBBBBBBBBBBBBBBG5YYJJYY5555555YYYYYYYYYJJJJYY???5B?    7^  7BBBBBB55557^:^^^^^^
555555YY?^^!YYYYYYYYYYY!!~~~~~~~~~~BBBBBBBBBBBBBBBBBBBBBBBBPPPPBBBBBPPYYYYY555YYYYYPPPPPPPPY^^   .?.^   7?  .BBBBBB7555?~~^^^^^^
YY555555P55BBBBBBBBBBBBBB7~~~~~~~~~BBBBBBBBBBBBBBBBBBBBBB5~    ~~~~~!555BBBBBBBBBBBBBBBBBBB  ~.    ?G  .!: JBBBBBBB^Y55P5!^^^^^^
YYYYYYYPBBBBBBBBBBBBBBBBBB57~~~~~~5BBBBBBBBBBBBBBBBBBBB5~ .:   ^~       ~~YYBBBBBBBBBBBBBB^  ?7!:   .~^:  YBBBBBBB5^^55J!:^^^^^^
YYYYYYYBBBBBBBBBBBBBBBBBBBBBP?~~?PBBBBBBBBBBBBBBBBBBBY^   77! ?@P?   !    ::^YYBBBBBBBBBBBY  !77?!!!7J   5BBBBBBBB:^^J7^:^^^^^^^
JJJJJJJBBBBBBBBBBBBBBBBBBBBBBBPPBBBBBBBBBBBBBBBBBBBB^    :~77! ^   .75    7?.. :BBBBBBBBBBB! .:~!7!!~  !PBBBBBBBBY^^~~~~~^^^^^^~
????JJJYGBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBPP7.  :!7?7    ?Y    ^77~:  BBBBBBBBBBBB.     ....7BBBBBBBBG!^^^^~~~~~~~~~
!!!!7?JJJ5GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBG7.  :!77^..  ?J^77!~  7GBBBBBBBBBBBBG7..77GGGGBBBBBBBBB!~~^^:^^:^^^^~~~~
77777!7??7J7JJJJJJJGGGBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBG?:  :!!77~~JP7!~^  ?BBBBBBBBBBBBBBBBGGBBBBBBBBBBBBBGJ~~~^^~~~Y^^^^~~~~
7777777!!!7~^^^^^^^~~~?PPBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGJ:  ^^^~~~^^^.   BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBP?~^~~~^^####^^^~~~~~
7777777777~~~~~~~~~~~~~~~?PBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBY^^^^^^^^^^^^^YBBBBBBBB555BBBBBBBBBBBBBBBBBP?~~~~~~~~^?GGG^^^~~~~~
7777777777~~~~~~~~~~~~~~~~~7755BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBY^   ?BBBBBBBBBBBBB577~~~~~~~~~~~^^^^^^^^~~~~
777777777~~~~~~~~~~~~~~~~~~~~~~755BGJ^JBJ^^BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBJ^    ~BBBBBBBBBBB557~~~~~~~~~^^~~~^^^^^^^^^J~~
777777777~~~~~~~~~~~~~~~~~~~~~~^^^~!~~:^:^ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGG?:    !PBBBBBBBBBBBY^~~~~~~~~~~~^^^~~^^:^^!!!?J7~
77!!7777!~~~~~~~~~~~~~~~~!~~^^^!~~7???7::^ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB?: ..77PBBBBBBBBBGG5J^^~~~~~~~~~~~~^^^^^~!??JJJJJJ?
JJ??77!7~~~~~~~~~~~~~~~~~7~^~~7???????Y557 YGGBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGGGGBBBBBBBBBGG5JJJJ~^^~~~~~~~~~~^^^^~7?JJJJJJJJJJ
JJJJJJ?7~~~~~~~~~~~~~~~^~^!????????JY5PY?J:~77JJGBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBGG555JJ?JJJJJ7~^~~~~~^~~~7777JJJJJJJJJJJJJ
JJJJJJJ!~~~~~~~~~~~~~~::^~!777???JYPPPY^GBB 77!!7JJPPPPPPPBBBBBBBBBGGGGGGGGGGGGGPPPPPP5555Y555JJJJJJJ77~~~~7J77JJJJJJJJJJJJJJJJJ
JJJJJJ?~~~~~~~~~~~~~~~!^~^^^^^!7JPPPP^7BBPY 7!!7!!!77????????GGGGGGPPPPPPPPPPPPGPYPPPPPPPPPPPPPPP55YJJJ?~~~JJJJJJJJJJJJJJJJJJJJJ
PPPP55~~~~~~~~~~~~~~^^^^^:^^^?JG!JPG^YBBP?J .JJJJ7777???77~~~7YPGGGGGGGGPPPPPGPY7~7YYYYYY??????????YYJJJ~~!JJJJJJJJJJJJJJJJJJJJJ
5555PJ~~~~7Y~~~~~~~^^^^:~?JJY?^5^^G:5BG5?JJ  PBBBPJ77777!!!!!~~7Y???????PPPPPY7~~!!77777777777777777777?7JYYJJJJJJJJJJJJJJJJJJJJ
55555^~~?5PP~~~~~~^^^^^J?^   ~#^^^:PBG?JYJ~  .7GGBBPPJ7777777!!~~~!!?:::7!~^!~~!!777777777777777777777777?Y?55555YJJJJJJJJJJJJJJ
55555~~5PP55~~~~~~^^^^&:      ~&^^^BG?JJ7.     PPGBBBBPY?777777!!77JGG5BGJ7!!!!777777777777777777777777777^^J5PPPP5JJJJJJJJJJJJJ
5555555P5555~~~~!JJ^^^Y?^^   ^JY^~JGJGJ5       PGGBBBBBGJ7777777777775BY777777777777777777777777777777777^~777J555YJJJJJJJJJJJJJ
55555PP55555~~~J5PPJ!^:~??JJJ?~:^JJ?5J7G?::    PBBBBBGB57777777777777GP777777777777777!777777777777777777.777777P55555YYYYJJJJJJ
555555555555!!JPP55PP!^^:^^^^^^^?JJ7~GBBBGGJ:  PBBBBBPJ77777777777777GP7777777777777!777777777!7777777777:777777Y55555PPPP555555
555555555555PPP555555P~^^^???^^^!JJ:BBBBBBB#BY PBBBBP?7777777777777775B777777777777777!!!!777!!!!77777777.7777777P555555555555PP
5555555555555555555555~^^.~~P^^~?J^~BGPGGGGJJ?^GBBBBP7777777777777777P?7777777777777777!!7777777777777777^7777777?5P555555555555
555555555555555555555P~^^    :^~J?^PBG?????5Y~???GBP?7777777777777777G77777777777777777777777777777777777777777777?5555555555555
555555555555555555555Y7~^:..:^^~7JGBBBBBBBBBBBG5Y.Y?7777777777777777G5777777777777777777777777777777777777777777777?555555555555
                                         
    ░▒▓███████▓▒░ ░▒▓██████▓▒░░▒▓███████▓▒░░▒▓███████▓▒░░▒▓███████▓▒░ ░▒▓██████▓▒░                   
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░           
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░           
    ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░                  
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░           
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓██▓▒░           
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░                   
                                                                                                    
                                                                                                    
    ░▒▓███████▓▒░░▒▓██████▓▒░▒▓████████▓▒░▒▓██████▓▒░ ░▒▓███████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓███████▓▒░ 
    ░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░  ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░        
    ░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░  ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░        
    ░▒▓██████▓▒░░▒▓████████▓▒░ ░▒▓█▓▒░  ░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓██████▓▒░  
        ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░  ░▒▓█▓▒░░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░ 
        ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░  ░▒▓█▓▒░░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░ 
    ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░   ░▒▓██████▓▒░░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓███████▓▒░  
                                                                                                    
                                                                                                    
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓███████▓▒░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░                                 
    ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░                                
    ░▒▓█▓▒▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░                                
    ░▒▓█▓▒▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░                                
    ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░                                
    ░▒▓█▓▓█▓▒░ ░▒▓█▓▒░      ░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░                                
    ░▒▓██▓▒░  ░▒▓█▓▒░▒▓███████▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░                                
                                                                                                    
                                                                                                                                                                                    

5000 RadbrOrdinals inscribed on the BTC Blockchain.
So what are we minting on ETH?
Radbro BTC Passes are essentially 'cross-chain passes' to mint an ordinal on BTC.
- Mint a pass with ETH, RAD, BRO, or claim a free pass from the radlist.
- MINT PASSES ARE SOULBOUND. They cannot be traded.
- Claim your Ordinal using the claimOrdinal() function on the contract, or on Radbro.xyz. You *MUST* enter a valid Ordinals receiving address. Assets sent to the wrong address are lost.
- NOTE: Mint passes are also automatically minted to the burn address by an offchain bot when a BTC mint is detected.
*/

/// @notice Radbro BTC Passes.
/// @author 10xdegen
contract RadbrOrdinalMintPassV1 is ERC721AQueryableUpgradeable, RadlistV2, ReentrancyGuardUpgradeable {
    using SafeTransferLib for ERC20;

    /*//////////////////////////////////////////////////////////////
                            MINT CONSTANTS
    //////////////////////////////////////////////////////////////*/

    /// @notice Maximum number of mintable RadbrOrdinals.
    uint256 public constant MAX_SUPPLY = 5000;

    /// @notice the # of mints that can be minted to the dev wallet. (10% of supply)
    uint256 public constant MAX_DEV_MINTS = (MAX_SUPPLY * 10) / 100;

    /// @notice the # of mints that can be minted from the radlist. (10% of supply)
    uint256 public constant MAX_RADLIST_MINTS = (MAX_SUPPLY * 10) / 100;

    /// @notice the # of mints that can be minted with radcoin. (20% of supply)
    uint256 public constant MAX_RADCOIN_MINTS = (MAX_SUPPLY * 20) / 100;

    /// @notice the # of mints that can be minted by the public (remaining supply)
    uint256 public constant MAX_PUBLIC_MINTS = MAX_SUPPLY - MAX_DEV_MINTS - MAX_RADLIST_MINTS - MAX_RADCOIN_MINTS;

    /// @notice the max number of mints in a single tx.
    uint256 public constant MAX_MINTS_PER_TX = 10;

    /// @notice the price of a single pass in ETH.
    uint256 public constant ETH_PRICE = 0.025 ether;

    /// @notice the price of a single pass in RAD.
    uint256 public constant RAD_PRICE = 125 ether;

    /*//////////////////////////////////////////////////////////////
                                ADDRESSES
    //////////////////////////////////////////////////////////////*/

    /// @notice The address of the Radcoin V2 ERC20 token contract.
    ERC20 public constant radcoinV2 = ERC20(0xdDc6625FEcA10438857DD8660C021Cd1088806FB);

    /// @notice The address of the operator.
    address public operator;

    /// @notice The address of the bitcoin oracle.
    address public oracle;

    /// @notice The address of the beneficiary.
    address payable public beneficiary;

    /*//////////////////////////////////////////////////////////////
                            MINTING
    //////////////////////////////////////////////////////////////*/

    /// @notice Total number minted via Radlist.
    uint256 public mintedFromRadlist;

    /// @notice Total number minted via $RAD.
    uint256 public mintedFromRAD;

    /// @notice Total number minted by public mint (ETH/BTC).
    uint256 public mintedByPublic;

    /// @notice Total number minted by devs.
    uint256 public mintedByDevs;

    /// @notice addresses that claimed a radlist mint
    mapping(address => bool) public radlistMintsClaimed;

    /// @notice Enables radlist mints.
    bool public radlistMintsEnabled;

    /// @notice Enables ETH mints.
    bool public ethMintsEnabled;

    /// @notice Enables RAD mints.
    bool public radMintsEnabled;

    /// @notice addresses that claimed their ordinal
    struct OrdinalClaim {
        address owner;
        string orderId;
        string btcAddress;
    }

    /// @notice id => ordinal claim
    // ordinal can only be claimed once
    mapping(uint256 => OrdinalClaim) public ordinalClaims;

    /// @notice addresses that claimed their ordinal
    struct FullfilledOrder {
        string orderId;
        uint256[] ids;
    }
    /// @notice order id => claimed ids
    mapping(string => FullfilledOrder) public claimedIdsForOrders;

    /*//////////////////////////////////////////////////////////////
                                 TOKEN URI
    //////////////////////////////////////////////////////////////*/

    /// @notice Base token URI used as a prefix by tokenURI().
    string public baseURI;

    /*//////////////////////////////////////////////////////////////
                            EVENTS
    //////////////////////////////////////////////////////////////*/

    /// @notice Emitted when a user claims their Radbro Satoshi's Vision Ordinal Inscription
    event OrdinalClaimed(uint256[] ids, string btcAddress);

    /*//////////////////////////////////////////////////////////////
                                 MODIFIERS
    //////////////////////////////////////////////////////////////*/

    /// @notice Only the operator can call this function.
    modifier onlyOperator() {
        require(msg.sender == operator || msg.sender == owner(), "RadbrOrdinal: caller is not the operator");
        _;
    }

    /// @notice Only the oracle can call this function.
    modifier onlyOracle() {
        require(msg.sender == oracle || msg.sender == owner(), "RadbrOrdinal: caller is not the oracle");
        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTUCTOR
    //////////////////////////////////////////////////////////////*/

    /// @notice Initialize RadbrOrdinals.
    function initialize(address _oracle) external initializerERC721A initializer {
        __ERC721A_init("RadbrOrdinals: Mint Pass", "ORDBRO");
        __ERC721AQueryable_init();
        __ReentrancyGuard_init();
        __RadlistV2_init();

        beneficiary = payable(msg.sender);
        operator = msg.sender;
        oracle = _oracle;
    }

    /*//////////////////////////////////////////////////////////////
                               ADMIN
    //////////////////////////////////////////////////////////////*/

    /// @notice Set the operator address.
    /// @dev Ownership and Operatorship are designed to be revoked for the contract, for full decentralization.
    /// @dev The operator is the only address that can manage the admin functions, other than the owner.
    /// @dev The operator can be set to the zero address, to disable admin functions.
    function setOperator(address _operator) external onlyOperator {
        operator = _operator;
    }

    /// @notice Set the oracle address.
    /// @dev The oracle is the only address that can mint ordinal passes for mints claimed natively by BTC users (BTC payment or claim/airdrop).
    function setOracle(address _oracle) external onlyOperator {
        oracle = _oracle;
    }

    /// @notice Set the beneficiary address.
    function setBeneficiary(address payable _beneficiary) external onlyOperator {
        beneficiary = _beneficiary;
    }

    /// @notice Enables or disables ETH minting.
    function setETHMintingEnabled(bool _mintingEnabled) external onlyOperator {
        ethMintsEnabled = _mintingEnabled;
    }

    /// @notice Enables or disables RAD minting.
    function setRADMintingEnabled(bool _mintingEnabled) external onlyOperator {
        radMintsEnabled = _mintingEnabled;
    }

    /// @notice Enables or disables radlist minting.
    function setRadlistMintingEnabled(bool _mintingEnabled) external onlyOperator {
        radlistMintsEnabled = _mintingEnabled;
    }

    /// @notice Change the base token uri.
    function setBaseURI(string calldata _uri) external onlyOperator {
        baseURI = _uri;
    }

    /// @notice pull all ETH from the contract.
    function pullETH() external onlyOperator {
        // send all Ether to beneficiary
        (bool success, ) = beneficiary.call{ value: address(this).balance }("");
        require(success, "RadbrOrdinal: ETH transfer failed");
    }

    /// @notice pull the given amount of RAD from the contract.
    function pullRAD(uint256 amount) external onlyOperator {
        // pull all RAD
        radcoinV2.transfer(beneficiary, amount);
    }

    /*//////////////////////////////////////////////////////////////
                               MINTING
    //////////////////////////////////////////////////////////////*/

    /// @notice Mint using ETH.
    /// @param to The address to mint to.
    /// @param amount The number to mint.
    function mintFromETH(address to, uint256 amount) external payable nonReentrant {
        require(ethMintsEnabled, "RadbrOrdinal: ETH minting is disabled");
        unchecked {
            require(
                mintedByPublic + amount <= MAX_PUBLIC_MINTS,
                "RadbrOrdinal: max public mints reached. Check the chain!!"
            );

            mintedByPublic += amount;
        }

        uint256 inputValue = ETH_PRICE * amount;
        require(msg.value >= inputValue, "RadbrOrdinal: Insufficient ETH sent for mint");

        // refund any extra ETH sent
        if (msg.value > inputValue) {
            payable(msg.sender).transfer(msg.value - inputValue);
        }

        _mintInternal(to, amount);
    }

    /// @notice Mint using $RAD.
    /// @param to The address to mint to.
    /// @param amount The number to mint.
    function mintFromRAD(address to, uint256 amount) external nonReentrant {
        require(radMintsEnabled, "RadbrOrdinal: RAD minting is disabled");

        unchecked {
            require(
                mintedFromRAD + amount <= MAX_RADCOIN_MINTS,
                "RadbrOrdinal: max $RAD mints reached. Check the chain!!"
            );

            mintedFromRAD += amount;
        }

        uint256 inputValue = RAD_PRICE * amount;

        radcoinV2.transferFrom(msg.sender, beneficiary, inputValue);

        _mintInternal(to, amount);
    }

    /**
    @notice Mint free RadbrOrdinals (requires radlist).
     */
    function mintRadlist(address to, uint32 amount, bytes32[] calldata radlistProof) external nonReentrant {
        require(radlistMintsEnabled, "RadbrOrdinal: Radlist Minting is disabled");
        unchecked {
            require(
                mintedFromRadlist + amount <= MAX_RADLIST_MINTS,
                "RadbrOrdinal: max radlist mints reached. Check the chain!!"
            );
        }

        require(
            this.verifyMerkleProof(0, amount, msg.sender, radlistProof),
            "RadbrOrdinal: Not on the radlist. Check the chain!!"
        );

        require(!radlistMintsClaimed[msg.sender], "RadbrOrdinal: Already claimed your radlist mints");

        radlistMintsClaimed[msg.sender] = true;

        unchecked {
            mintedFromRadlist += amount;
        }

        _mintInternal(to, amount);
    }

    /**
    @notice Mint free RadbrOrdinals (devs only)
     */
    function mintDev(address to, uint32 amount) external onlyOperator {
        unchecked {
            require(mintedByDevs + amount <= MAX_DEV_MINTS, "RadbrOrdinal: max dev mints reached. Check the chain!!");

            mintedByDevs += amount;
        }

        _mintInternal(to, amount);
    }

    /**
    @notice Mints to the oracle wallet. This will be called by the cross-chain oracle when an ordinal is minted natively on BTC.
     */
    function mintForBitcoin(
        uint32 amount,
        string calldata btcAddress,
        string calldata orderId
    ) external onlyOracle returns (uint256[] memory) {
        require(claimedIdsForOrders[orderId].ids.length == 0, "RadbrOrdinal: Order already fulfilled");

        uint256 firstId = totalSupply() + 1;
        _mintInternal(oracle, amount);
        uint256[] memory ids = new uint256[](amount);
        for (uint256 i = firstId; i < firstId + amount; i++) {
            ordinalClaims[i] = OrdinalClaim({ owner: oracle, orderId: orderId, btcAddress: btcAddress });
            ids[i - firstId] = i;
        }

        claimedIdsForOrders[orderId] = FullfilledOrder({ orderId: orderId, ids: ids });

        emit OrdinalClaimed(ids, btcAddress);
        return ids;
    }

    /**
    @notice Mints to the oracle wallet. This will be called by the cross-chain oracle when an ordinal is minted natively on BTC.
     */
    function getClaimedIdsForOrder(string calldata orderId) external view returns (uint256[] memory) {
        return claimedIdsForOrders[orderId].ids;
    }

    function _mintInternal(address to, uint256 amount) internal {
        require(amount <= MAX_MINTS_PER_TX, "RadbrOrdinal: Max mints per tx exceeded");
        unchecked {
            require(totalSupply() + amount <= MAX_SUPPLY, "RadbrOrdinal: Max supply reached");
        }
        _safeMint(to, amount);
    }

    // override start token id to 1
    function _startTokenId() internal pure override returns (uint256) {
        return 1;
    }

    /*//////////////////////////////////////////////////////////////
                               ORDINAL CLAIMING
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Claim the RadbrOrdinal which will be sent to the user's wallet via an off-chain oracle.
     */
    function claimRadbrOrdinal(uint256[] calldata ids, string calldata btcAddress) external {
        require(ids.length > 0, "RadbrOrdinal: No ids to claim");
        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            require(
                _msgSender() == owner() || _msgSender() == ownerOf(id),
                "RadbrOrdinal: caller is not owner of token"
            );
            require(
                _msgSender() == owner() || ordinalClaims[id].owner == address(0),
                "RadbrOrdinal: id already claimed"
            );
            ordinalClaims[id] = OrdinalClaim({ owner: _msgSender(), orderId: "", btcAddress: btcAddress });
        }

        emit OrdinalClaimed(ids, btcAddress);
    }

    /**
     * @notice Returns the ordinal claims for the all the minted tokens.
     */
    function getOrdinalClaims() external view returns (OrdinalClaim[] memory) {
        uint256 _totalSupply = totalSupply();
        OrdinalClaim[] memory claims = new OrdinalClaim[](_totalSupply);
        for (uint256 i = _startTokenId(); i <= _totalSupply; i++) {
            claims[i - 1] = ordinalClaims[i];
        }

        return claims;
    }

    /*//////////////////////////////////////////////////////////////
                               SOULBOUND
    //////////////////////////////////////////////////////////////*/

    /**
     * @notice Prevents RadbrOrdinal Mint Passes from being transferred.
     * Trade the Ordinals, not the passes.
     */
    function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override {
        require(from == address(0) || to == address(0), "Token not transferable");
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    /*//////////////////////////////////////////////////////////////
                               OVERRIDEN FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(
        uint256 tokenId
    ) public view override(IERC721AUpgradeable, ERC721AUpgradeable) returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : "";
    }

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

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

import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/structs/BitMaps.sol";

/**
@notice Allows holders of ERC721 tokens to redeem rights to some claim; for
example, the right to mint a token of some other collection.
*/
library ERC721Redeemer {
    using BitMaps for BitMaps.BitMap;
    using Strings for uint256;

    /**
    @notice Storage value to track already-claimed redemptions for a specific
    token collection.
     */
    struct Claims {
        /**
        @dev This field MUST NOT be considered part of the public API. Instead,
        prefer `using ERC721Redeemer for ERC721Redeemer.Claims` and utilise the
        provided functions.
         */
        mapping(uint256 => uint256) _total;
    }

    /**
    @notice Storage value to track already-claimed redemptions for a specific
    token collection, given that there is only a single claim allowed per
    tokenId.
     */
    struct SingleClaims {
        /**
        @dev This field MUST NOT be considered part of the public API. Instead,
        prefer `using ERC721Redeemer for ERC721Redeemer.SingleClaims` and
        utilise the provided functions.
         */
        BitMaps.BitMap _claimed;
    }

    /**
    @notice Emitted when a token's claim is redeemed.
     */
    event Redemption(
        IERC721 indexed token,
        address indexed redeemer,
        uint256 tokenId,
        uint256 n
    );

    /**
    @notice Checks that the redeemer is allowed to redeem the claims for the
    tokenIds by being either the owner or approved address for all tokenIds, and
    updates the Claims to reflect this.
    @dev For more efficient gas usage, recurring values in tokenIds SHOULD be
    adjacent to one another as this will batch expensive operations. The
    simplest way to achieve this is by sorting tokenIds.
    @param tokenIds The token IDs for which the claims are being redeemed. If
    maxAllowance > 1 then identical tokenIds can be passed more than once; see
    dev comments.
    @return The number of redeemed claims; either 0 or tokenIds.length;
     */
    function redeem(
        Claims storage claims,
        uint256 maxAllowance,
        address redeemer,
        IERC721 token,
        uint256[] calldata tokenIds
    ) internal returns (uint256) {
        if (maxAllowance == 0 || tokenIds.length == 0) {
            return 0;
        }

        // See comment for `endSameId`.
        bool multi = maxAllowance > 1;

        for (
            uint256 i = 0;
            i < tokenIds.length; /* note increment at end */

        ) {
            uint256 tokenId = tokenIds[i];
            requireOwnerOrApproved(token, tokenId, redeemer);

            uint256 n = 1;
            if (multi) {
                // If allowed > 1 we can save on expensive operations like
                // checking ownership / remaining allowance by batching equal
                // tokenIds. The algorithm assumes that equal IDs are adjacent
                // in the array.
                uint256 endSameId;
                for (
                    endSameId = i + 1;
                    endSameId < tokenIds.length &&
                        tokenIds[endSameId] == tokenId;
                    endSameId++
                ) {} // solhint-disable-line no-empty-blocks
                n = endSameId - i;
            }

            claims._total[tokenId] += n;
            if (claims._total[tokenId] > maxAllowance) {
                revertWithTokenId(
                    "ERC721Redeemer: over allowance for",
                    tokenId
                );
            }
            i += n;

            emit Redemption(token, redeemer, tokenId, n);
        }

        return tokenIds.length;
    }

    /**
    @notice Checks that the redeemer is allowed to redeem the single claim for
    each of the tokenIds by being either the owner or approved address for all
    tokenIds, and updates the SingleClaims to reflect this.
    @param tokenIds The token IDs for which the claims are being redeemed. Only
    a single claim can be made against a tokenId.
    @return The number of redeemed claims; either 0 or tokenIds.length;
     */
    function redeem(
        SingleClaims storage claims,
        address redeemer,
        IERC721 token,
        uint256[] calldata tokenIds
    ) internal returns (uint256) {
        if (tokenIds.length == 0) {
            return 0;
        }

        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            requireOwnerOrApproved(token, tokenId, redeemer);

            if (claims._claimed.get(tokenId)) {
                revertWithTokenId(
                    "ERC721Redeemer: over allowance for",
                    tokenId
                );
            }

            claims._claimed.set(tokenId);
            emit Redemption(token, redeemer, tokenId, 1);
        }
        return tokenIds.length;
    }

    /**
    @dev Reverts if neither the owner nor approved for the tokenId.
     */
    function requireOwnerOrApproved(
        IERC721 token,
        uint256 tokenId,
        address redeemer
    ) private view {
        if (
            token.ownerOf(tokenId) != redeemer &&
            token.getApproved(tokenId) != redeemer
        ) {
            revertWithTokenId(
                "ERC721Redeemer: not approved nor owner of",
                tokenId
            );
        }
    }

    /**
    @notice Reverts with the concatenation of revertMsg and tokenId.toString().
    @dev Used to save gas by constructing the revert message only as required,
    instead of passing it to require().
     */
    function revertWithTokenId(string memory revertMsg, uint256 tokenId)
        private
        pure
    {
        revert(string(abi.encodePacked(revertMsg, " ", tokenId.toString())));
    }

    /**
    @notice Returns the number of claimed redemptions for the token.
     */
    function claimed(Claims storage claims, uint256 tokenId)
        internal
        view
        returns (uint256)
    {
        return claims._total[tokenId];
    }

    /**
    @notice Returns whether the token has had a claim made against it.
     */
    function claimed(SingleClaims storage claims, uint256 tokenId)
        internal
        view
        returns (bool)
    {
        return claims._claimed.get(tokenId);
    }
}

File 3 of 26 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 26 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

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

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

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

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

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

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

File 5 of 26 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

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

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 6 of 26 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

File 7 of 26 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 8 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 10 of 26 : 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 11 of 26 : 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 12 of 26 : 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 13 of 26 : 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 26 : BitMaps.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/BitMaps.sol)
pragma solidity ^0.8.0;

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */
library BitMaps {
    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(BitMap storage bitmap, uint256 index, bool value) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = 1 << (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }
}

File 15 of 26 : RadlistV2.sol
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.0;

/*

╢╬╬╬╬╠╠╟╠╬╢╠╬╬╠╠╠╢╬╬╠╠╠╠╬╬╬╣▌▌▓▌▌▌▌▌▌╬╬▓▓▓▓▓▓▌▓▓▓▓▒░»=┐;»:»░»¡;":¡░¡!:░┐░░░░░!░░
╠╠╠╠╠╠╠╬╣╬╬╬╬╬╬╠╠╠╠╠╠╬╬▓████████████████████████████▌▄φφφφφφφφ╦▒φφ╦φ╦▒φ╦╦╦╦φφφφφ
▒╠▓╬▒▒▒▒▒▒▒▒╠╠╠╠╠╣╣╬▓██████████████████████████████████▓▓▌╬╟╬╢╠╟╠╠╠╠╠╟╟╠╠╠╠╠╠╠╠╠
▒╚▓╣▓▓▓▓╣╬▄▓▓▒▒╠▓▒▒▓███████████████████████████▓▓▓█▓█▓█▓▓█▓▓╬╠╠╟╠╠╠╠╢╠╠╠╠╠╬╢╠╠╠╠
▒Å▓▓▓▓▓▓█▓▓▓╬╫▌╠▓▓████████████████████▓▓████████▓█▓▓█▓▓▓▓█▓█▓▓╬╠╠╠╠╠╠╠╠╠╠╬╠╬╠╠╠╟
▒╚╚░▒╚╚╩╠╬╣▓╬╣▓╣▓███████████████▓█▓██████████████████▓█▓██▓█▓██▓╬╢╟╠╠╠╢╠╟╠╠╠╠╠╟╟
╟▒▒░░Γ▒╣▒▒░#▒▒╚▓████████████████▓██████▓████████████████████████▓╬╠╠╠╟╠╬╠╟╠╬╠╠╠╠
▒╠╠╩▒▒╟▓▓▓▓╣▓▓▓███████████████▓████████████▀╫███████████████████▓▓╬╠╠╠╠╠╠╠╠╠╬╠╠╠
▒▒▒Γ░Γ▒╬╬▀╬╣▓▓███████████████████████████▓╨░░╫████████████████████▓╬╠╠╠╠╠╠╠╠╠╠╠╠
▓▓▓▓▌╬╬╠╬▒▒▒▒████████████████████████████░¡░░!╫██████████▓╟██▓██████▌╠╠╠╠╠╠╠╠╠╠╠
███████████▓██████▓████████▀╫███████████▒∩¡░░░░╙▀▓╟████▌┤░░╫███▀▀███▌╠╠╠╠╠╠╠╠╠╠╠
███████████████████████████░╙███▌│╩╨╙██▌░░░░░░░░░░░██▓╝░░░Q▓███████▓╠╠╠╟╠╠╠╠╠╠╠╠
▓▓▓███████████████████████▌ü███▓▄▄Q░░██▒\░░░░¡░░░░░╫▓▌▓███████▀▀▀╫╬╠╠╬╠╠╟╟╠╠╠╠╠╟
╬▓╬╣╬╣╣╣╣╬▓╬████████████╩▀▒░▀▀▀▀▀▀▀███████▓▌▄µ░░░░░▀▀▀╫███████Γ░░╠╟╠╠╠╠╠╠╠╠╠╠╠╠╠
█▓▓▓▓▓▓▓▓▓▓▓▓███████████░░░░░░∩░░░Q▄▄▄▄░░░┘┤╨├░¡░░░░░▄███▄█████▒░╟╠╠╠╠╠╠╠╠╠╠╠╠╠╠
▓▓▓▓▓▓▓▓▓▓▓▓▓███████████▒░░░░░▓███▀█████▄░░░░░░░¡░░ΓΓ██████████┤Γ╬╠╠╠╠╠╬╠╠╠╠╠╠╠╠
╬╬╬╣╬╣╬╬╣╬╬╬╣▓███████████░░░▄█████████████▄░░░░░¡░░░░█████████δ░░▓╬╣╣▓▓▓▓▓▓╣╣▓▓▓
╬╬╬╬╣╬╣╬╬╬╬╬╬▓████▒░░∩░▀█▒░▀██╙█▓███████▓█▌░░¡░░░░░░░╚█████▓█▒░░╫▓████▓█▓▓▓▓▓▓▓▓
╬╣╬╢╬╬╣╬╣╬╬╬╣▓███▌░░░░░░░░░░░┤~╙█▓█████▀██▒░¡░░░░░░φ░░███▓██▒░░░▓▓▓╬╚╙╫╬╫███████
╬╬╣╬╬╬╣▓▓██▓╬▓███▓░░░░░░░░░░░░(=├▀██▓█████░░░¡░>░""░Γ░░░░░░Γ░░░╫▓▓▓▓▓▓▓█▓█▓▓▓▓▓▓
╬╫╬╬╬╬╣▓╬╟╬▓╬█████▓▄▒░░░░░░░░░∩░░│▀▀▀╫╨╨╨╨░░░¡░¡░░¡¡░░░░░░░░░░╢▓██▓▓█████████▓██
▓▓▓▓▓▓▓▓╬╬╫█████████████▓▌▒░░░░░░░░░░!░░░░¡░░░░Q▄▄▄▄▄░░░░Γ░Γ▄▓▓█████████████████
▓█████╬╣▓▓▓████████████████▓▌▒░░░░░░░░░░░░░░░░████▀▀░░░░░░▄▓▓▓██████████████████
▓▓▓╬▓▓╬╣╬╬╬╬╬╬╬╬███████████████▌▄▒░░░░░░░░░░░░░░░░░░░░½▄▓▓███▓██████████████████
▓╬╠▓▓▓▓╣╣╬╣╣╬╣▓╬████▓██████████████▓▓▌▄▄░░░░░░░░φ╦▄▄▓▓███████▓█████████████▓╠▓██
▓▌╠▓▓▓╬╬╣╬╬╬╬╬╬╬▓█▓████▓█▓╬╢▓██▓▓▓▓▓▓▓▓▓▒Σ▒▒#░#▓▓▓▓▓▓██████████████▓▓████▓▓▓╬╬╬╬
▓▓╠▓███▓▓╣╣╬╣╬╣╢▓▓▓▓▓▓██▓▓▓╣▓▓█▓▓█▓██▓╬#Γ#▒▒▒░Σ╣█████████████▓╣╬▓███▓████▓╣╣╬╣╣▓
▓▓╬▓▓▓▓▓▓▓▓▓▓█▓╬▓▓▓▓▓▓▓▓█████████████▄ΓΓ╚Γ░ΓΓΓ▐▄█████████████▓╬╬╬╫█████▓╬╬╣╬╬╬╬╬
▓▓▓▓▓▓▓▓▓▓▓█████████████████▓▓██████████▓▓▓▓▓████████████▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
▓███████████████████████████████████████████████████████╬╣╬╬╬╬╬╬╬╬╬╬╬╫╬╬╬╬╬╣╬╬╬╬
▓████████████████████████████████████████████████████████╬╬╬╬╫╬╬╬╬╬╣╬╬╬╬╬╬╬╬╣╬╬╬
██████████████████████████████████▓██▓█▓▓▓███▓██▓█████████╬╬╣╬╬╣╬╬╬╬╬╣╬╬╬╬╬╬╬╬╣╣
▓█████████████████▓▓▓▓╬╬╬██████████████████▓██▓██╣████████▓╬╬╫╬╢╬╫╬╬╬╬╬╣╬╣╬╬╬╣╬╣
██████▓█▓▓╬╬╬╬╬╬╬╬╬╬╣╬╬╬▓██████████▌▓╬▒╫▓▓▌╣██▓▓╬▒█████████▌╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣╬
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣╬╬╬╬╬╬╣████████████╣╟▓╬╣▓▓▓▓▓▓▓▓▓╫█████████╬╬╬╬╬╣╬╬╬╬╬╬╬╬╬╣╬╬╬░
                          ;                                          
                          ED.                                  :     
                          E#Wi                                t#,    
 j.                       E###G.      .          j.          ;##W.   
 EW,                   .. E#fD#W;     Ef.        EW,        :#L:WE   
 E##j                 ;W, E#t t##L    E#Wi       E##j      .KG  ,#D  
 E###D.              j##, E#t  .E#K,  E#K#D:     E###D.    EE    ;#f 
 E#jG#W;            G###, E#t    j##f E#t,E#f.   E#jG#W;  f#.     t#i
 E#t t##f         :E####, E#t    :E#K:E#WEE##Wt  E#t t##f :#G     GK 
 E#t  :K#E:      ;W#DG##, E#t   t##L  E##Ei;;;;. E#t  :K#E:;#L   LW. 
 E#KDDDD###i    j###DW##, E#t .D#W;   E#DWWt     E#KDDDD###it#f f#:  
 E#f,t#Wi,,,   G##i,,G##, E#tiW#G.    E#t f#K;   E#f,t#Wi,,, f#D#;   
 E#t  ;#W:   :K#K:   L##, E#K##i      E#Dfff##E, E#t  ;#W:    G#t    
 DWi   ,KK: ;##D.    L##, E##D.       jLLLLLLLLL;DWi   ,KK:    t     
            ,,,      .,,  E#t                                        
                          L:                                         

*/

import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { ERC721Redeemer } from "@divergencetech/ethier/contracts/erc721/ERC721Redeemer.sol";
import { MerkleProofLib } from "lib/solmate/src/utils/MerkleProofLib.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";

/// @notice A contract for redeeming ERC721 tokens from a merkle root, as well as whitelisted NFT collections.
/// @author 10xdegen

/// @notice Radlist, on-chain Radness verification.
/// @author 10xdegen
abstract contract RadlistV2 is OwnableUpgradeable {
    using Strings for uint16;

    /*//////////////////////////////////////////////////////////////
                                 STATE
    //////////////////////////////////////////////////////////////*/

    // radlist merkle roots
    mapping(uint32 => bytes32) public merkleRoots;

    /*//////////////////////////////////////////////////////////////
                                 INITIALIZER
    //////////////////////////////////////////////////////////////*/

    function __RadlistV2_init() internal initializer {
        __Ownable_init();
    }

    /*//////////////////////////////////////////////////////////////
                                 FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
    @dev Update the merkle root, for adding new radlisters.
     */
    function setMerkleRoot(uint32 key, bytes32 _merkleRoot) external onlyOwner {
        merkleRoots[key] = _merkleRoot;
    }

    /*//////////////////////////////////////////////////////////////
                                 INTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
     * @dev Verify a merkle proof.
     * @param key The merkle root key (for supporting multiple).
     * @param value an custom 32 bit value to check against.
     * @param wallet The address to check the merkle proof for.
     * @param merkleProof The merkle proof.
     * @return valid if the proof is valid.
     */
    function verifyMerkleProof(
        uint32 key,
        uint32 value,
        address wallet,
        bytes32[] calldata merkleProof
    ) public view returns (bool valid) {
        bytes32 merkleRoot = merkleRoots[key];
        require(merkleRoot != bytes32(0), "Radlist: merkle root not set");
        bytes32 node = keccak256(abi.encodePacked(wallet, value));
        valid = MerkleProofLib.verify(merkleProof, merkleRoot, node);
    }
}

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

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

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

abstract contract ERC721A__Initializable {
    using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout;

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

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

        _;

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

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

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

File 17 of 26 : ERC721A__InitializableStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

File 18 of 26 : ERC721AStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

        // The next token ID to be minted.
        uint256 _currentIndex;
        // The number of tokens burned.
        uint256 _burnCounter;
        // Token name
        string _name;
        // Token symbol
        string _symbol;
        // Mapping from token ID to ownership details
        // An empty struct value does not necessarily mean the token is unowned.
        // See {_packedOwnershipOf} implementation for details.
        //
        // Bits Layout:
        // - [0..159]   `addr`
        // - [160..223] `startTimestamp`
        // - [224]      `burned`
        // - [225]      `nextInitialized`
        // - [232..255] `extraData`
        mapping(uint256 => uint256) _packedOwnerships;
        // Mapping owner address to address data.
        //
        // Bits Layout:
        // - [0..63]    `balance`
        // - [64..127]  `numberMinted`
        // - [128..191] `numberBurned`
        // - [192..255] `aux`
        mapping(address => uint256) _packedAddressData;
        // Mapping from token ID to approved address.
        mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals;
        // Mapping from owner to operator approvals
        mapping(address => mapping(address => bool)) _operatorApprovals;
    }

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

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

File 19 of 26 : ERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
        ERC721AStorage.layout()._name = name_;
        ERC721AStorage.layout()._symbol = symbol_;
        ERC721AStorage.layout()._currentIndex = _startTokenId();
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
        if (_startTokenId() <= tokenId) {
            packed = ERC721AStorage.layout()._packedOwnerships[tokenId];
            // If not burned.
            if (packed & _BITMASK_BURNED == 0) {
                // If the data at the starting slot does not exist, start the scan.
                if (packed == 0) {
                    if (tokenId >= ERC721AStorage.layout()._currentIndex)
                        _revert(OwnerQueryForNonexistentToken.selector);
                    // 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, `tokenId` will not underflow.
                    //
                    // We can directly compare the packed value.
                    // If the address is zero, packed will be zero.
                    for (;;) {
                        unchecked {
                            packed = ERC721AStorage.layout()._packedOwnerships[--tokenId];
                        }
                        if (packed == 0) continue;
                        return packed;
                    }
                }
                // Otherwise, the data exists and is not burned. We can skip the scan.
                // This is possible because we have already achieved the target condition.
                // This saves 2143 gas on transfers of initialized tokens.
                return packed;
            }
        }
        _revert(OwnerQueryForNonexistentToken.selector);
    }

    /**
     * @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. See {ERC721A-_approve}.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     */
    function approve(address to, uint256 tokenId) public payable virtual override {
        _approve(to, tokenId, true);
    }

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

        return ERC721AStorage.layout()._tokenApprovals[tokenId].value;
    }

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

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

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

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

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

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

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

        // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
        from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));

        if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);

        (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.selector);

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

        // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
        uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
        assembly {
            // 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.
                from, // `from`.
                toMasked, // `to`.
                tokenId // `tokenId`.
            )
        }
        if (toMasked == 0) _revert(TransferToZeroAddress.selector);

        _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.selector);
            }
    }

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

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

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

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

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

        _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:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
            uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;

            if (toMasked == 0) _revert(MintToZeroAddress.selector);

            uint256 end = startTokenId + quantity;
            uint256 tokenId = startTokenId;

            do {
                assembly {
                    // 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`.
                        tokenId // `tokenId`.
                    )
                }
                // The `!=` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
            } while (++tokenId != end);

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @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:
     *
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId, bool approvalCheck) internal virtual {
        address owner = ownerOf(tokenId);

        if (approvalCheck && _msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                _revert(ApprovalCallerNotOwnerNorApproved.selector);
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev For more efficient reverts.
     */
    function _revert(bytes4 errorSelector) internal pure {
        assembly {
            mstore(0x00, errorSelector)
            revert(0x00, 0x04)
        }
    }
}

File 20 of 26 : ERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AQueryableUpgradeable.sol';
import '../ERC721AUpgradeable.sol';
import '../ERC721A__Initializable.sol';

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryableUpgradeable is
    ERC721A__Initializable,
    ERC721AUpgradeable,
    IERC721AQueryableUpgradeable
{
    function __ERC721AQueryable_init() internal onlyInitializingERC721A {
        __ERC721AQueryable_init_unchained();
    }

    function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {}

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (TokenOwnership memory ownership)
    {
        if (tokenId >= _startTokenId()) {
            if (tokenId < _nextTokenId()) {
                ownership = _ownershipAt(tokenId);
                if (!ownership.burned) {
                    ownership = _ownershipOf(tokenId);
                }
            }
        }
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        TokenOwnership[] memory ownerships;
        uint256 i = tokenIds.length;
        assembly {
            // Grab the free memory pointer.
            ownerships := mload(0x40)
            // Store the length.
            mstore(ownerships, i)
            // Allocate one word for the length,
            // `tokenIds.length` words for the pointers.
            i := shl(5, i) // Multiply `i` by 32.
            mstore(0x40, add(add(ownerships, 0x20), i))
        }
        while (i != 0) {
            uint256 tokenId;
            assembly {
                i := sub(i, 0x20)
                tokenId := calldataload(add(tokenIds.offset, i))
            }
            TokenOwnership memory ownership = explicitOwnershipOf(tokenId);
            assembly {
                // Store the pointer of `ownership` in the `ownerships` array.
                mstore(add(add(ownerships, 0x20), i), ownership)
            }
        }
        return ownerships;
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) _revert(InvalidQueryRange.selector);
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            uint256 stopLimit = _nextTokenId();
            // Set `stop = min(stop, stopLimit)`.
            if (stop >= stopLimit) {
                stop = stopLimit;
            }
            uint256[] memory tokenIds;
            uint256 tokenIdsMaxLength = balanceOf(owner);
            bool startLtStop = start < stop;
            assembly {
                // Set `tokenIdsMaxLength` to zero if `start` is less than `stop`.
                tokenIdsMaxLength := mul(tokenIdsMaxLength, startLtStop)
            }
            if (tokenIdsMaxLength != 0) {
                // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
                // to cater for cases where `balanceOf(owner)` is too big.
                if (stop - start <= tokenIdsMaxLength) {
                    tokenIdsMaxLength = stop - start;
                }
                assembly {
                    // Grab the free memory pointer.
                    tokenIds := mload(0x40)
                    // Allocate one word for the length, and `tokenIdsMaxLength` words
                    // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
                    mstore(0x40, add(tokenIds, shl(5, add(tokenIdsMaxLength, 1))))
                }
                // We need to call `explicitOwnershipOf(start)`,
                // because the slot at `start` may not be initialized.
                TokenOwnership memory ownership = explicitOwnershipOf(start);
                address currOwnershipAddr;
                // If the starting slot exists (i.e. not burned),
                // initialize `currOwnershipAddr`.
                // `ownership.address` will not be zero,
                // as `start` is clamped to the valid token ID range.
                if (!ownership.burned) {
                    currOwnershipAddr = ownership.addr;
                }
                uint256 tokenIdsIdx;
                // Use a do-while, which is slightly more efficient for this case,
                // as the array will at least contain one element.
                do {
                    ownership = _ownershipAt(start);
                    assembly {
                        // if `ownership.burned == false`.
                        if iszero(mload(add(ownership, 0x40))) {
                            // if `ownership.addr != address(0)`.
                            // The `addr` already has it's upper 96 bits clearned,
                            // since it is written to memory with regular Solidity.
                            if mload(ownership) {
                                currOwnershipAddr := mload(ownership)
                            }
                            // if `currOwnershipAddr == owner`.
                            // The `shl(96, x)` is to make the comparison agnostic to any
                            // dirty upper 96 bits in `owner`.
                            if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                                tokenIdsIdx := add(tokenIdsIdx, 1)
                                mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)
                            }
                        }
                        start := add(start, 1)
                    }
                } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));
                // Store the length of the array.
                assembly {
                    mstore(tokenIds, tokenIdsIdx)
                }
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
        uint256 tokenIdsLength = balanceOf(owner);
        uint256[] memory tokenIds;
        assembly {
            // Grab the free memory pointer.
            tokenIds := mload(0x40)
            // Allocate one word for the length, and `tokenIdsMaxLength` words
            // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
            mstore(0x40, add(tokenIds, shl(5, add(tokenIdsLength, 1))))
            // Store the length of `tokenIds`.
            mstore(tokenIds, tokenIdsLength)
        }
        address currOwnershipAddr;
        uint256 tokenIdsIdx;
        for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ) {
            TokenOwnership memory ownership = _ownershipAt(i);
            assembly {
                // if `ownership.burned == false`.
                if iszero(mload(add(ownership, 0x40))) {
                    // if `ownership.addr != address(0)`.
                    // The `addr` already has it's upper 96 bits clearned,
                    // since it is written to memory with regular Solidity.
                    if mload(ownership) {
                        currOwnershipAddr := mload(ownership)
                    }
                    // if `currOwnershipAddr == owner`.
                    // The `shl(96, x)` is to make the comparison agnostic to any
                    // dirty upper 96 bits in `owner`.
                    if iszero(shl(96, xor(currOwnershipAddr, owner))) {
                        tokenIdsIdx := add(tokenIdsIdx, 1)
                        mstore(add(tokenIds, shl(5, tokenIdsIdx)), i)
                    }
                }
                i := add(i, 1)
            }
        }
        return tokenIds;
    }
}

File 21 of 26 : IERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721AUpgradeable.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

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

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`,
     * checking first that contract recipients are aware of the ERC721 protocol
     * to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move
     * this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external 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 23 of 26 : 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 24 of 26 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

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

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

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

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

    string public name;

    string public symbol;

    uint8 public immutable decimals;

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

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

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

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

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

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

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

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

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

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

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

        return true;
    }

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

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

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

        return true;
    }

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

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

        balanceOf[from] -= amount;

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

        emit Transfer(from, to, amount);

        return true;
    }

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

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

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

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

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

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

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

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

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

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

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

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

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

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

File 25 of 26 : MerkleProofLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Gas optimized merkle proof verification library.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)
/// @author Modified from Solady (https://github.com/Vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)
library MerkleProofLib {
    function verify(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool isValid) {
        /// @solidity memory-safe-assembly
        assembly {
            if proof.length {
                // Left shifting by 5 is like multiplying by 32.
                let end := add(proof.offset, shl(5, proof.length))

                // Initialize offset to the offset of the proof in calldata.
                let offset := proof.offset

                // Iterate over proof elements to compute root hash.
                // prettier-ignore
                for {} 1 {} {
                    // Slot where the leaf should be put in scratch space. If
                    // leaf > calldataload(offset): slot 32, otherwise: slot 0.
                    let leafSlot := shl(5, gt(leaf, calldataload(offset)))

                    // Store elements to hash contiguously in scratch space.
                    // The xor puts calldataload(offset) in whichever slot leaf
                    // is not occupying, so 0 if leafSlot is 32, and 32 otherwise.
                    mstore(leafSlot, leaf)
                    mstore(xor(leafSlot, 32), calldataload(offset))

                    // Reuse leaf to store the hash to reduce stack operations.
                    leaf := keccak256(0, 64) // Hash both slots of scratch space.

                    offset := add(offset, 32) // Shift 1 word per cycle.

                    // prettier-ignore
                    if iszero(lt(offset, end)) { break }
                }
            }

            isValid := eq(leaf, root) // The proof is valid if the roots match.
        }
    }
}

File 26 of 26 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

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

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

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

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

        require(success, "ETH_TRANSFER_FAILED");
    }

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

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

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

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

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

        require(success, "TRANSFER_FROM_FAILED");
    }

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

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

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

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

        require(success, "TRANSFER_FAILED");
    }

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

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

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

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

        require(success, "APPROVE_FAILED");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","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":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"string","name":"btcAddress","type":"string"}],"name":"OrdinalClaimed","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":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"ETH_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DEV_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINTS_PER_TX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PUBLIC_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RADCOIN_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RADLIST_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RAD_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":"beneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"string","name":"btcAddress","type":"string"}],"name":"claimRadbrOrdinal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"claimedIdsForOrders","outputs":[{"internalType":"string","name":"orderId","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethMintsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"ownership","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"orderId","type":"string"}],"name":"getClaimedIdsForOrder","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOrdinalClaims","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"orderId","type":"string"},{"internalType":"string","name":"btcAddress","type":"string"}],"internalType":"struct RadbrOrdinalMintPassV1.OrdinalClaim[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"merkleRoots","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"amount","type":"uint32"}],"name":"mintDev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"amount","type":"uint32"},{"internalType":"string","name":"btcAddress","type":"string"},{"internalType":"string","name":"orderId","type":"string"}],"name":"mintForBitcoin","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintFromETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintFromRAD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"amount","type":"uint32"},{"internalType":"bytes32[]","name":"radlistProof","type":"bytes32[]"}],"name":"mintRadlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedByDevs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedByPublic","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedFromRAD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedFromRadlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ordinalClaims","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"orderId","type":"string"},{"internalType":"string","name":"btcAddress","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pullETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"pullRAD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"radMintsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"radcoinV2","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"radlistMintsClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"radlistMintsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_beneficiary","type":"address"}],"name":"setBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintingEnabled","type":"bool"}],"name":"setETHMintingEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"key","type":"uint32"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintingEnabled","type":"bool"}],"name":"setRADMintingEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mintingEnabled","type":"bool"}],"name":"setRadlistMintingEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":"uint32","name":"key","type":"uint32"},{"internalType":"uint32","name":"value","type":"uint32"},{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"verifyMerkleProof","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b5061459f8061001d5f395ff3fe6080604052600436106103bd575f3560e01c80636f22c1af116101f457806399a2557a11610113578063c4d66de8116100a8578063d84b20aa11610078578063d84b20aa14610a93578063e4ffb7c514610ab2578063e985e9c514610ad1578063f1f80ee414610af0578063f2fde38b14610b1e575f80fd5b8063c4d66de814610a41578063c6a91b4214610a60578063c87b56dd14610a74578063d445f7e214610936575f80fd5b8063b3ab15fb116100e3578063b3ab15fb146109bc578063b88d4fde146109db578063bfc8cd42146109ee578063c23dc68f14610a15575f80fd5b806399a2557a1461094a578063a22cb46514610969578063a29c87cf14610988578063a459445f1461099d575f80fd5b80638462151c116101895780638da5cb5b116101595780638da5cb5b146108d757806392223b70146108f457806395d89b41146109225780639803a95314610936575f80fd5b80638462151c1461086a578063850219b1146108895780638832bc291461089e5780638ba4df9a146108b8575f80fd5b80637adbf973116101c45780637adbf973146107f95780637cde7e18146108185780637dc0d1d01461082c57806381f6b9e41461084b575f80fd5b80636f22c1af1461077b57806370a082311461079a578063715018a6146107b9578063738dae58146107cd575f80fd5b806339a22756116102e0578063570ca73511610275578063650898bd11610245578063650898bd146107015780636b4d9ebc1461072c5780636c0360eb1461074b5780636d4bcb831461075f575f80fd5b8063570ca735146106795780635a42c66c146106985780635bbb2177146106b65780636352211e146106e2575f80fd5b80634936b747116102b05780634936b747146106125780634dd5486c146106315780634e2ce1f51461064657806355f804b31461065a575f80fd5b806339a22756146105ad5780633c59faa0146105cc57806342842e0e146105eb578063479c7a71146105fe575f80fd5b806317f3d2b11161035657806329983cf91161032657806329983cf91461053b5780632f9e6a301461055a57806332cb6b0c1461057957806338af3eed1461058e575f80fd5b806317f3d2b1146104d657806318160ddd146104f55780631c31f7101461050957806323b872dd14610528575f80fd5b8063081812fc11610391578063081812fc1461045e57806308fa599d14610495578063095ea7b3146104aa57806312de8752146104bd575f80fd5b80627261bd146103c157806301ffc9a7146103eb57806306d27d791461041a57806306fdde031461043d575b5f80fd5b3480156103cc575f80fd5b506103d5610b3d565b6040516103e29190613820565b60405180910390f35b3480156103f6575f80fd5b5061040a6104053660046138cf565b610d5b565b60405190151581526020016103e2565b348015610425575f80fd5b5061042f609b5481565b6040519081526020016103e2565b348015610448575f80fd5b50610451610d6b565b6040516103e291906138f1565b348015610469575f80fd5b5061047d610478366004613903565b610e04565b6040516001600160a01b0390911681526020016103e2565b6104a86104a336600461392e565b610e46565b005b6104a86104b836600461392e565b61100c565b3480156104c8575f80fd5b5060a05461040a9060ff1681565b3480156104e1575f80fd5b506104a86104f0366004613965565b611018565b348015610500575f80fd5b5061042f61106a565b348015610514575f80fd5b506104a8610523366004613980565b611089565b6104a861053636600461399b565b6110ea565b348015610546575f80fd5b506104a86105553660046139ec565b6112af565b348015610565575f80fd5b506104a8610574366004613965565b6112cf565b348015610584575f80fd5b5061042f61138881565b348015610599575f80fd5b50609a5461047d906001600160a01b031681565b3480156105b8575f80fd5b506104a86105c7366004613a4d565b61132a565b3480156105d7575f80fd5b506104a86105e6366004613965565b6115aa565b6104a86105f936600461399b565b611603565b348015610609575f80fd5b506104a8611622565b34801561061d575f80fd5b506104a861062c366004613903565b61170e565b34801561063c575f80fd5b5061042f609c5481565b348015610651575f80fd5b5061042f6117d3565b348015610665575f80fd5b506104a8610674366004613ae8565b6117ef565b348015610684575f80fd5b5060985461047d906001600160a01b031681565b3480156106a3575f80fd5b5060a05461040a90610100900460ff1681565b3480156106c1575f80fd5b506106d56106d0366004613b26565b61183b565b6040516103e29190613b94565b3480156106ed575f80fd5b5061047d6106fc366004613903565b611886565b34801561070c575f80fd5b5061042f61071b366004613bd5565b60656020525f908152604090205481565b348015610737575f80fd5b5061040a610746366004613bee565b611890565b348015610756575f80fd5b50610451611957565b34801561076a575f80fd5b5061042f6806c6b935b8bbd4000081565b348015610786575f80fd5b50610451610795366004613ce6565b6119e3565b3480156107a5575f80fd5b5061042f6107b4366004613980565b611a8a565b3480156107c4575f80fd5b506104a8611ae6565b3480156107d8575f80fd5b506107ec6107e7366004613ae8565b611af9565b6040516103e29190613d63565b348015610804575f80fd5b506104a8610813366004613980565b611b6d565b348015610823575f80fd5b5061042f611bce565b348015610837575f80fd5b5060995461047d906001600160a01b031681565b348015610856575f80fd5b506107ec610865366004613d75565b611c39565b348015610875575f80fd5b506107ec610884366004613980565b611fc7565b348015610894575f80fd5b5061042f609d5481565b3480156108a9575f80fd5b5061042f6658d15e1762800081565b3480156108c3575f80fd5b506104a86108d2366004613dde565b61204e565b3480156108e2575f80fd5b506033546001600160a01b031661047d565b3480156108ff575f80fd5b5061040a61090e366004613980565b609f6020525f908152604090205460ff1681565b34801561092d575f80fd5b50610451612300565b348015610941575f80fd5b5061042f612318565b348015610955575f80fd5b506107ec610964366004613e38565b612327565b348015610974575f80fd5b506104a8610983366004613e6a565b61241b565b348015610993575f80fd5b5061042f609e5481565b3480156109a8575f80fd5b5060a05461040a9062010000900460ff1681565b3480156109c7575f80fd5b506104a86109d6366004613980565b612497565b6104a86109e9366004613ea1565b6124f8565b3480156109f9575f80fd5b5061047d73ddc6625feca10438857dd8660c021cd1088806fb81565b348015610a20575f80fd5b50610a34610a2f366004613903565b612533565b6040516103e29190613f1b565b348015610a4c575f80fd5b506104a8610a5b366004613980565b61258f565b348015610a6b575f80fd5b5061042f600a81565b348015610a7f575f80fd5b50610451610a8e366004613903565b6127f8565b348015610a9e575f80fd5b506104a8610aad366004613f29565b61287a565b348015610abd575f80fd5b506104a8610acc36600461392e565b612953565b348015610adc575f80fd5b5061040a610aeb366004613f5c565b612ae9565b348015610afb575f80fd5b50610b0f610b0a366004613903565b612b24565b6040516103e293929190613f88565b348015610b29575f80fd5b506104a8610b38366004613980565b612c5c565b60605f610b4861106a565b90505f816001600160401b03811115610b6357610b63613c60565b604051908082528060200260200182016040528015610bc057816020015b610bad60405180606001604052805f6001600160a01b0316815260200160608152602001606081525090565b815260200190600190039081610b815790505b50905060015b828111610d54575f81815260a1602090815260409182902082516060810190935280546001600160a01b031683526001810180549192840191610c0890613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3490613fc7565b8015610c7f5780601f10610c5657610100808354040283529160200191610c7f565b820191905f5260205f20905b815481529060010190602001808311610c6257829003601f168201915b50505050508152602001600282018054610c9890613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc490613fc7565b8015610d0f5780601f10610ce657610100808354040283529160200191610d0f565b820191905f5260205f20905b815481529060010190602001808311610cf257829003601f168201915b50505050508152505082600183610d269190614013565b81518110610d3657610d36614026565b60200260200101819052508080610d4c9061403a565b915050610bc6565b5092915050565b5f610d6582612cd2565b92915050565b6060610d75612d1f565b6002018054610d8390613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610daf90613fc7565b8015610dfa5780601f10610dd157610100808354040283529160200191610dfa565b820191905f5260205f20905b815481529060010190602001808311610ddd57829003601f168201915b5050505050905090565b5f610e0e82612d43565b610e2257610e226333d1c03960e21b612d8a565b610e2a612d1f565b5f9283526006016020525060409020546001600160a01b031690565b610e4e612d92565b60a054610100900460ff16610eb85760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a20455448206d696e74696e672069732064697360448201526418589b195960da1b60648201526084015b60405180910390fd5b609d54610bb89082011115610f355760405162461bcd60e51b815260206004820152603960248201527f52616462724f7264696e616c3a206d6178207075626c6963206d696e7473207260448201527f6561636865642e20436865636b2074686520636861696e2121000000000000006064820152608401610eaf565b609d8054820190555f610f4f826658d15e17628000614052565b905080341015610fb65760405162461bcd60e51b815260206004820152602c60248201527f52616462724f7264696e616c3a20496e73756666696369656e7420455448207360448201526b195b9d08199bdc881b5a5b9d60a21b6064820152608401610eaf565b80341115610ff357336108fc610fcc8334614013565b6040518115909202915f818181858888f19350505050158015610ff1573d5f803e3d5ffd5b505b610ffd8383612deb565b506110086001606655565b5050565b61100882826001612eb8565b6098546001600160a01b031633148061103b57506033546001600160a01b031633145b6110575760405162461bcd60e51b8152600401610eaf90614069565b60a0805460ff1916911515919091179055565b5f6001611075612d1f565b60010154611081612d1f565b540303919050565b6098546001600160a01b03163314806110ac57506033546001600160a01b031633145b6110c85760405162461bcd60e51b8152600401610eaf90614069565b609a80546001600160a01b0319166001600160a01b0392909216919091179055565b5f6110f482612f67565b6001600160a01b03948516949091508116841461111a5761111a62a1148160e81b612d8a565b5f8061112584612ffc565b9150915061114a81876111353390565b6001600160a01b039081169116811491141790565b61116c576111588633612ae9565b61116c5761116c632ce44b5f60e11b612d8a565b6111798686866001613021565b8015611183575f82555b61118b612d1f565b6001600160a01b0387165f9081526005919091016020526040902080545f190190556111b5612d1f565b6001600160a01b0386165f8181526005929092016020526040909120805460010190554260a01b17600160e11b176111eb612d1f565b5f8681526004919091016020526040812091909155600160e11b8416900361125e5760018401611219612d1f565b5f8281526004919091016020526040812054900361125c57611239612d1f565b54811461125c5783611249612d1f565b5f83815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4805f036112a6576112a6633a954ecd60e21b612d8a565b50505050505050565b6112b7613088565b63ffffffff9091165f90815260656020526040902055565b6098546001600160a01b03163314806112f257506033546001600160a01b031633145b61130e5760405162461bcd60e51b8152600401610eaf90614069565b60a08054911515620100000262ff000019909216919091179055565b611332612d92565b60a05460ff166113965760405162461bcd60e51b815260206004820152602960248201527f52616462724f7264696e616c3a205261646c697374204d696e74696e6720697360448201526808191a5cd8589b195960ba1b6064820152608401610eaf565b606461c350048363ffffffff16609b5401111561141b5760405162461bcd60e51b815260206004820152603a60248201527f52616462724f7264696e616c3a206d6178207261646c697374206d696e74732060448201527f726561636865642e20436865636b2074686520636861696e21210000000000006064820152608401610eaf565b604051631ad367af60e21b81523090636b4d9ebc90611446905f9087903390889088906004016140e1565b602060405180830381865afa158015611461573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114859190614124565b6114ed5760405162461bcd60e51b815260206004820152603360248201527f52616462724f7264696e616c3a204e6f74206f6e20746865207261646c6973746044820152722e20436865636b2074686520636861696e212160681b6064820152608401610eaf565b335f908152609f602052604090205460ff16156115655760405162461bcd60e51b815260206004820152603060248201527f52616462724f7264696e616c3a20416c726561647920636c61696d656420796f60448201526f7572207261646c697374206d696e747360801b6064820152608401610eaf565b335f908152609f60205260409020805460ff19166001179055609b805463ffffffff851690810190915561159a908590612deb565b6115a46001606655565b50505050565b6098546001600160a01b03163314806115cd57506033546001600160a01b031633145b6115e95760405162461bcd60e51b8152600401610eaf90614069565b60a080549115156101000261ff0019909216919091179055565b61161d83838360405180602001604052805f8152506124f8565b505050565b6098546001600160a01b031633148061164557506033546001600160a01b031633145b6116615760405162461bcd60e51b8152600401610eaf90614069565b609a546040515f916001600160a01b03169047908381818185875af1925050503d805f81146116ab576040519150601f19603f3d011682016040523d82523d5f602084013e6116b0565b606091505b505090508061170b5760405162461bcd60e51b815260206004820152602160248201527f52616462724f7264696e616c3a20455448207472616e73666572206661696c656044820152601960fa1b6064820152608401610eaf565b50565b6098546001600160a01b031633148061173157506033546001600160a01b031633145b61174d5760405162461bcd60e51b8152600401610eaf90614069565b609a5460405163a9059cbb60e01b81526001600160a01b0390911660048201526024810182905273ddc6625feca10438857dd8660c021cd1088806fb9063a9059cbb906044016020604051808303815f875af11580156117af573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110089190614124565b60646117e26113886014614052565b6117ec919061413f565b81565b6098546001600160a01b031633148061181257506033546001600160a01b031633145b61182e5760405162461bcd60e51b8152600401610eaf90614069565b60a361161d8284836141ab565b60408051828152600583901b8082016020019092526060915b801561187e57601f1980820191860101355f61186f82612533565b84840160200152506118549050565b509392505050565b5f610d6582612f67565b63ffffffff85165f90815260656020526040812054806118f25760405162461bcd60e51b815260206004820152601c60248201527f5261646c6973743a206d65726b6c6520726f6f74206e6f7420736574000000006044820152606401610eaf565b6040516bffffffffffffffffffffffff19606087901b1660208201526001600160e01b031960e088901b1660348201525f9060380160405160208183030381529060405280519060200120905061194b858584846130e2565b98975050505050505050565b60a3805461196490613fc7565b80601f016020809104026020016040519081016040528092919081815260200182805461199090613fc7565b80156119db5780601f106119b2576101008083540402835291602001916119db565b820191905f5260205f20905b8154815290600101906020018083116119be57829003601f168201915b505050505081565b805160208183018101805160a282529282019190930120915280548190611a0990613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a3590613fc7565b8015611a805780601f10611a5757610100808354040283529160200191611a80565b820191905f5260205f20905b815481529060010190602001808311611a6357829003601f168201915b5050505050905081565b5f6001600160a01b038216611aa957611aa96323d3ad8160e21b612d8a565b6001600160401b03611ab9612d1f565b6005015f846001600160a01b03166001600160a01b031681526020019081526020015f2054169050919050565b611aee613088565b611af75f61311a565b565b606060a28383604051611b0d929190614265565b9081526040805191829003602090810183206001018054808302850183019093528284529190830182828015611b6057602002820191905f5260205f20905b815481526020019060010190808311611b4c575b5050505050905092915050565b6098546001600160a01b0316331480611b9057506033546001600160a01b031633145b611bac5760405162461bcd60e51b8152600401610eaf90614069565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b6064611bdd6113886014614052565b611be7919061413f565b6064611bf6611388600a614052565b611c00919061413f565b6064611c0f611388600a614052565b611c19919061413f565b611c2590611388614013565b611c2f9190614013565b6117ec9190614013565b6099546060906001600160a01b0316331480611c5f57506033546001600160a01b031633145b611cba5760405162461bcd60e51b815260206004820152602660248201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f7420746865206044820152656f7261636c6560d01b6064820152608401610eaf565b60a28383604051611ccc929190614265565b9081526040519081900360200190206001015415611d3a5760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a204f7264657220616c72656164792066756c666044820152641a5b1b195960da1b6064820152608401610eaf565b5f611d4361106a565b611d4e906001614274565b609954909150611d6d906001600160a01b031663ffffffff8916612deb565b5f8763ffffffff166001600160401b03811115611d8c57611d8c613c60565b604051908082528060200260200182016040528015611db5578160200160208202803683370190505b509050815b611dca63ffffffff8a1684614274565b811015611ef057604080516060810182526099546001600160a01b0316815281516020601f89018190048102820181019093528781529091808301919089908990819084018382808284375f92019190915250505090825250604080516020601f8c018190048102820181019092528a815291810191908b908b90819084018382808284375f92018290525093909452505083815260a160209081526040909120835181546001600160a01b0319166001600160a01b03909116178155908301519091506001820190611e9d9082614287565b5060408201516002820190611eb29082614287565b50829150839050611ec38583614013565b81518110611ed357611ed3614026565b602090810291909101015280611ee88161403a565b915050611dba565b506040805160606020601f880181900402820181018352918101868152909182919088908890819085018382808284375f9201919091525050509082525060200182905260405160a290611f479088908890614265565b90815260405190819003602001902081518190611f649082614287565b506020828101518051611f7d9260018501920190613776565b509050507f7677da4ed600206fde21dea46d0b4da9170af84461cdad92916cf41d3e3af8b1818888604051611fb49392919061436a565b60405180910390a1979650505050505050565b60605f611fd383611a8a565b9050606060405190506001820160051b81016040528181525f805f611ff6600190565b90505b848214612043575f61200a8261316b565b9050604081015161203a5780511561202157805193505b87841860601b61203a57600183019250818360051b8601525b50600101611ff9565b509195945050505050565b8261209b5760405162461bcd60e51b815260206004820152601d60248201527f52616462724f7264696e616c3a204e6f2069647320746f20636c61696d0000006044820152606401610eaf565b5f5b838110156122bc575f8585838181106120b8576120b8614026565b9050602002013590506120d36033546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061210b57506120f681611886565b6001600160a01b0316336001600160a01b0316145b61216a5760405162461bcd60e51b815260206004820152602a60248201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f74206f776e65604482015269391037b3103a37b5b2b760b11b6064820152608401610eaf565b6033546001600160a01b031633148061219757505f81815260a160205260409020546001600160a01b0316155b6121e35760405162461bcd60e51b815260206004820181905260248201527f52616462724f7264696e616c3a20696420616c726561647920636c61696d65646044820152606401610eaf565b60405180606001604052806121f53390565b6001600160a01b0316815260200160405180602001604052805f815250815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525093909452505083815260a160209081526040909120835181546001600160a01b0319166001600160a01b0390911617815590830151909150600182019061228f9082614287565b50604082015160028201906122a49082614287565b509050505080806122b49061403a565b91505061209d565b507f7677da4ed600206fde21dea46d0b4da9170af84461cdad92916cf41d3e3af8b1848484846040516122f2949392919061438f565b60405180910390a150505050565b606061230a612d1f565b6003018054610d8390613fc7565b60646117e2611388600a614052565b606081831061234057612340631960ccad60e11b612d8a565b600183101561234e57600192505b5f6123576131b0565b9050808310612364578092505b60605f61237087611a8a565b8587109081029150811561240f57818787031161238d5786860391505b60405192506001820160051b83016040525f6123a888612533565b90505f81604001516123b8575080515b5f5b6123c38a61316b565b925060408301516123f2578251156123da57825191505b8a821860601b6123f257600101600581901b86018a90525b60018a019950888a148061240557508481145b156123ba57855250505b50909695505050505050565b80612424612d1f565b335f818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6098546001600160a01b03163314806124ba57506033546001600160a01b031633145b6124d65760405162461bcd60e51b8152600401610eaf90614069565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b6125038484846110ea565b6001600160a01b0383163b156115a45761251f848484846131bf565b6115a4576115a46368d2bf6b60e11b612d8a565b604080516080810182525f8082526020820181905291810182905260608101919091526001821061258a576125666131b0565b82101561258a576125768261316b565b9050806040015161258a57610d658261329e565b919050565b5f8051602061457383398151915254610100900460ff166125c2575f805160206145738339815191525460ff16156125c6565b303b155b6126385760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610eaf565b5f8051602061457383398151915254610100900460ff16158015612672575f80516020614573833981519152805461ffff19166101011790555b5f54610100900460ff161580801561269057505f54600160ff909116105b806126a95750303b1580156126a957505f5460ff166001145b6126c55760405162461bcd60e51b8152600401610eaf906143b5565b5f805460ff1916600117905580156126e6575f805461ff0019166101001790555b6127436040518060400160405280601881526020017f52616462724f7264696e616c733a204d696e7420506173730000000000000000815250604051806040016040528060068152602001654f524442524f60d01b8152506132d2565b61274b61330f565b61275361334a565b61275b613378565b609a8054336001600160a01b03199182168117909255609880548216909217909155609980549091166001600160a01b03851617905580156127d6575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5080156110085750505f80516020614573833981519152805461ff0019169055565b606061280382612d43565b61282057604051630a14c4b560e41b815260040160405180910390fd5b60a3805461282d90613fc7565b90505f036128495760405180602001604052805f815250610d65565b60a36128548361343b565b604051602001612865929190614403565b60405160208183030381529060405292915050565b6098546001600160a01b031633148061289d57506033546001600160a01b031633145b6128b95760405162461bcd60e51b8152600401610eaf90614069565b606461c350048163ffffffff16609e540111156129375760405162461bcd60e51b815260206004820152603660248201527f52616462724f7264696e616c3a206d617820646576206d696e747320726561636044820152756865642e20436865636b2074686520636861696e212160501b6064820152608401610eaf565b609e805463ffffffff8316908101909155611008908390612deb565b61295b612d92565b60a05462010000900460ff166129c15760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a20524144206d696e74696e672069732064697360448201526418589b195960da1b6064820152608401610eaf565b609c546103e89082011115612a3e5760405162461bcd60e51b815260206004820152603760248201527f52616462724f7264696e616c3a206d61782024524144206d696e74732072656160448201527f636865642e20436865636b2074686520636861696e21210000000000000000006064820152608401610eaf565b609c8054820190555f612a5a826806c6b935b8bbd40000614052565b609a546040516323b872dd60e01b81523360048201526001600160a01b0390911660248201526044810182905290915073ddc6625feca10438857dd8660c021cd1088806fb906323b872dd906064016020604051808303815f875af1158015612ac5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ff19190614124565b5f612af2612d1f565b6001600160a01b039384165f908152600791909101602090815260408083209490951682529290925250205460ff1690565b60a16020525f9081526040902080546001820180546001600160a01b039092169291612b4f90613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054612b7b90613fc7565b8015612bc65780601f10612b9d57610100808354040283529160200191612bc6565b820191905f5260205f20905b815481529060010190602001808311612ba957829003601f168201915b505050505090806002018054612bdb90613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054612c0790613fc7565b8015612c525780601f10612c2957610100808354040283529160200191612c52565b820191905f5260205f20905b815481529060010190602001808311612c3557829003601f168201915b5050505050905083565b612c64613088565b6001600160a01b038116612cc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610eaf565b61170b8161311a565b5f6301ffc9a760e01b6001600160e01b031983161480612d0257506380ac58cd60e01b6001600160e01b03198316145b80610d655750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b5f81600111158015612d5c5750612d58612d1f565b5482105b8015610d655750600160e01b612d70612d1f565b5f8481526004919091016020526040902054161592915050565b805f5260045ffd5b600260665403612de45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eaf565b6002606655565b600a811115612e4c5760405162461bcd60e51b815260206004820152602760248201527f52616462724f7264696e616c3a204d6178206d696e74732070657220747820656044820152661e18d95959195960ca1b6064820152608401610eaf565b61138881612e5861106a565b011115612ea75760405162461bcd60e51b815260206004820181905260248201527f52616462724f7264696e616c3a204d617820737570706c7920726561636865646044820152606401610eaf565b611008828261347e565b6001606655565b5f612ec283611886565b9050818015612eda5750336001600160a01b03821614155b15612efd57612ee98133612ae9565b612efd57612efd6367d9dca160e11b612d8a565b83612f06612d1f565b5f858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b5f81600111612fec57612f78612d1f565b5f83815260049190910160205260408120549150600160e01b82169003612fec57805f0361258a57612fa8612d1f565b548210612fbf57612fbf636f96cda160e11b612d8a565b612fc7612d1f565b5f199092015f81815260049390930160205260409092205490508015612fbf57919050565b61258a636f96cda160e11b612d8a565b5f805f613007612d1f565b5f9485526006016020525050604090912080549092909150565b6001600160a01b038416158061303e57506001600160a01b038316155b6130835760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610eaf565b6115a4565b6033546001600160a01b03163314611af75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eaf565b5f8315613112578360051b8501855b803580851160051b94855260209485185260405f2093018181106130f15750505b501492915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516080810182525f808252602082018190529181018290526060810191909152610d65613199612d1f565b5f8481526004919091016020526040902054613497565b5f6131b9612d1f565b54919050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906131f3903390899088908890600401614486565b6020604051808303815f875af192505050801561322d575060408051601f3d908101601f1916820190925261322a918101906144b8565b60015b613280573d80801561325a576040519150601f19603f3d011682016040523d82523d5f602084013e61325f565b606091505b5080515f03613278576132786368d2bf6b60e11b612d8a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182525f808252602082018190529181018290526060810191909152610d656132cd83612f67565b613497565b5f8051602061457383398151915254610100900460ff166133055760405162461bcd60e51b8152600401610eaf906144d3565b61100882826134de565b5f8051602061457383398151915254610100900460ff166133425760405162461bcd60e51b8152600401610eaf906144d3565b611af7613550565b5f54610100900460ff166133705760405162461bcd60e51b8152600401610eaf90614527565b611af7613583565b5f54610100900460ff161580801561339657505f54600160ff909116105b806133af5750303b1580156133af57505f5460ff166001145b6133cb5760405162461bcd60e51b8152600401610eaf906143b5565b5f805460ff1916600117905580156133ec575f805461ff0019166101001790555b6133f46135a9565b801561170b575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806134545750819003601f19909101908152919050565b611008828260405180602001604052805f8152506135d7565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b5f8051602061457383398151915254610100900460ff166135115760405162461bcd60e51b8152600401610eaf906144d3565b8161351a612d1f565b600201906135289082614287565b5080613532612d1f565b600301906135409082614287565b50600161354b612d1f565b555050565b5f8051602061457383398151915254610100900460ff16611af75760405162461bcd60e51b8152600401610eaf906144d3565b5f54610100900460ff16612eb15760405162461bcd60e51b8152600401610eaf90614527565b5f54610100900460ff166135cf5760405162461bcd60e51b8152600401610eaf90614527565b611af761364d565b6135e1838361367c565b6001600160a01b0383163b1561161d575f6135fa612d1f565b5490508281035b6136135f8683806001019450866131bf565b613627576136276368d2bf6b60e11b612d8a565b8181106136015781613637612d1f565b5414613646576136465f612d8a565b5050505050565b5f54610100900460ff166136735760405162461bcd60e51b8152600401610eaf90614527565b611af73361311a565b5f613685612d1f565b5490505f8290036136a0576136a063b562e8dd60e01b612d8a565b6136ac5f848385613021565b6001600160a01b0383164260a01b6001841460e11b17176136cb612d1f565b5f83815260049190910160205260409020556801000000000000000182026136f1612d1f565b6001600160a01b0385165f81815260059290920160205260408220805490930190925581900361372a5761372a622e076360e81b612d8a565b818301825b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a481816001019150810361372f578161376c612d1f565b555061161d915050565b828054828255905f5260205f209081019282156137af579160200282015b828111156137af578251825591602001919060010190613794565b506137bb9291506137bf565b5090565b5b808211156137bb575f81556001016137c0565b5f5b838110156137ed5781810151838201526020016137d5565b50505f910152565b5f815180845261380c8160208601602086016137d3565b601f01601f19169290920160200192915050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b838110156138ac57888303603f19018552815180516001600160a01b031684528781015160608986018190529061387e828701826137f5565b9150508782015191508481038886015261389881836137f5565b968901969450505090860190600101613845565b509098975050505050505050565b6001600160e01b03198116811461170b575f80fd5b5f602082840312156138df575f80fd5b81356138ea816138ba565b9392505050565b602081525f6138ea60208301846137f5565b5f60208284031215613913575f80fd5b5035919050565b6001600160a01b038116811461170b575f80fd5b5f806040838503121561393f575f80fd5b823561394a8161391a565b946020939093013593505050565b801515811461170b575f80fd5b5f60208284031215613975575f80fd5b81356138ea81613958565b5f60208284031215613990575f80fd5b81356138ea8161391a565b5f805f606084860312156139ad575f80fd5b83356139b88161391a565b925060208401356139c88161391a565b929592945050506040919091013590565b803563ffffffff8116811461258a575f80fd5b5f80604083850312156139fd575f80fd5b61394a836139d9565b5f8083601f840112613a16575f80fd5b5081356001600160401b03811115613a2c575f80fd5b6020830191508360208260051b8501011115613a46575f80fd5b9250929050565b5f805f8060608587031215613a60575f80fd5b8435613a6b8161391a565b9350613a79602086016139d9565b925060408501356001600160401b03811115613a93575f80fd5b613a9f87828801613a06565b95989497509550505050565b5f8083601f840112613abb575f80fd5b5081356001600160401b03811115613ad1575f80fd5b602083019150836020828501011115613a46575f80fd5b5f8060208385031215613af9575f80fd5b82356001600160401b03811115613b0e575f80fd5b613b1a85828601613aab565b90969095509350505050565b5f8060208385031215613b37575f80fd5b82356001600160401b03811115613b4c575f80fd5b613b1a85828601613a06565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f9190848201906040850190845b8181101561240f57613bc2838551613b58565b9284019260809290920191600101613baf565b5f60208284031215613be5575f80fd5b6138ea826139d9565b5f805f805f60808688031215613c02575f80fd5b613c0b866139d9565b9450613c19602087016139d9565b93506040860135613c298161391a565b925060608601356001600160401b03811115613c43575f80fd5b613c4f88828901613a06565b969995985093965092949392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6001600160401b0380841115613c8d57613c8d613c60565b604051601f8501601f19908116603f01168101908282118183101715613cb557613cb5613c60565b81604052809350858152868686011115613ccd575f80fd5b858560208301375f602087830101525050509392505050565b5f60208284031215613cf6575f80fd5b81356001600160401b03811115613d0b575f80fd5b8201601f81018413613d1b575f80fd5b61329684823560208401613c74565b5f8151808452602080850194508084015f5b83811015613d5857815187529582019590820190600101613d3c565b509495945050505050565b602081525f6138ea6020830184613d2a565b5f805f805f60608688031215613d89575f80fd5b613d92866139d9565b945060208601356001600160401b0380821115613dad575f80fd5b613db989838a01613aab565b90965094506040880135915080821115613dd1575f80fd5b50613c4f88828901613aab565b5f805f8060408587031215613df1575f80fd5b84356001600160401b0380821115613e07575f80fd5b613e1388838901613a06565b90965094506020870135915080821115613e2b575f80fd5b50613a9f87828801613aab565b5f805f60608486031215613e4a575f80fd5b8335613e558161391a565b95602085013595506040909401359392505050565b5f8060408385031215613e7b575f80fd5b8235613e868161391a565b91506020830135613e9681613958565b809150509250929050565b5f805f8060808587031215613eb4575f80fd5b8435613ebf8161391a565b93506020850135613ecf8161391a565b92506040850135915060608501356001600160401b03811115613ef0575f80fd5b8501601f81018713613f00575f80fd5b613f0f87823560208401613c74565b91505092959194509250565b60808101610d658284613b58565b5f8060408385031215613f3a575f80fd5b8235613f458161391a565b9150613f53602084016139d9565b90509250929050565b5f8060408385031215613f6d575f80fd5b8235613f788161391a565b91506020830135613e968161391a565b6001600160a01b03841681526060602082018190525f90613fab908301856137f5565b8281036040840152613fbd81856137f5565b9695505050505050565b600181811c90821680613fdb57607f821691505b602082108103613ff957634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d6557610d65613fff565b634e487b7160e01b5f52603260045260245ffd5b5f6001820161404b5761404b613fff565b5060010190565b8082028115828204841417610d6557610d65613fff565b60208082526028908201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f74207468652060408201526737b832b930ba37b960c11b606082015260800190565b8183525f6001600160fb1b038311156140c8575f80fd5b8260051b80836020870137939093016020019392505050565b63ffffffff8681168252851660208201526001600160a01b03841660408201526080606082018190525f9061411990830184866140b1565b979650505050505050565b5f60208284031215614134575f80fd5b81516138ea81613958565b5f8261415957634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561161d575f81815260208120601f850160051c810160208610156141845750805b601f850160051c820191505b818110156141a357828155600101614190565b505050505050565b6001600160401b038311156141c2576141c2613c60565b6141d6836141d08354613fc7565b8361415e565b5f601f841160018114614207575f85156141f05750838201355b5f19600387901b1c1916600186901b178355613646565b5f83815260209020601f19861690835b828110156142375786850135825560209485019460019092019101614217565b5086821015614253575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b80820180821115610d6557610d65613fff565b81516001600160401b038111156142a0576142a0613c60565b6142b4816142ae8454613fc7565b8461415e565b602080601f8311600181146142e7575f84156142d05750858301515b5f19600386901b1c1916600185901b1785556141a3565b5f85815260208120601f198616915b82811015614315578886015182559484019460019091019084016142f6565b508582101561433257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f61437c6040830186613d2a565b8281036020840152613fbd818587614342565b604081525f6143a26040830186886140b1565b8281036020840152614119818587614342565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b5f80845461441081613fc7565b60018281168015614428576001811461443d57614469565b60ff1984168752821515830287019450614469565b885f526020805f205f5b858110156144605781548a820152908401908201614447565b50505082870194505b50505050835161447d8183602088016137d3565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613fbd908301846137f5565b5f602082840312156144c8575f80fd5b81516138ea816138ba565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa164736f6c6343000814000a

Deployed Bytecode

0x6080604052600436106103bd575f3560e01c80636f22c1af116101f457806399a2557a11610113578063c4d66de8116100a8578063d84b20aa11610078578063d84b20aa14610a93578063e4ffb7c514610ab2578063e985e9c514610ad1578063f1f80ee414610af0578063f2fde38b14610b1e575f80fd5b8063c4d66de814610a41578063c6a91b4214610a60578063c87b56dd14610a74578063d445f7e214610936575f80fd5b8063b3ab15fb116100e3578063b3ab15fb146109bc578063b88d4fde146109db578063bfc8cd42146109ee578063c23dc68f14610a15575f80fd5b806399a2557a1461094a578063a22cb46514610969578063a29c87cf14610988578063a459445f1461099d575f80fd5b80638462151c116101895780638da5cb5b116101595780638da5cb5b146108d757806392223b70146108f457806395d89b41146109225780639803a95314610936575f80fd5b80638462151c1461086a578063850219b1146108895780638832bc291461089e5780638ba4df9a146108b8575f80fd5b80637adbf973116101c45780637adbf973146107f95780637cde7e18146108185780637dc0d1d01461082c57806381f6b9e41461084b575f80fd5b80636f22c1af1461077b57806370a082311461079a578063715018a6146107b9578063738dae58146107cd575f80fd5b806339a22756116102e0578063570ca73511610275578063650898bd11610245578063650898bd146107015780636b4d9ebc1461072c5780636c0360eb1461074b5780636d4bcb831461075f575f80fd5b8063570ca735146106795780635a42c66c146106985780635bbb2177146106b65780636352211e146106e2575f80fd5b80634936b747116102b05780634936b747146106125780634dd5486c146106315780634e2ce1f51461064657806355f804b31461065a575f80fd5b806339a22756146105ad5780633c59faa0146105cc57806342842e0e146105eb578063479c7a71146105fe575f80fd5b806317f3d2b11161035657806329983cf91161032657806329983cf91461053b5780632f9e6a301461055a57806332cb6b0c1461057957806338af3eed1461058e575f80fd5b806317f3d2b1146104d657806318160ddd146104f55780631c31f7101461050957806323b872dd14610528575f80fd5b8063081812fc11610391578063081812fc1461045e57806308fa599d14610495578063095ea7b3146104aa57806312de8752146104bd575f80fd5b80627261bd146103c157806301ffc9a7146103eb57806306d27d791461041a57806306fdde031461043d575b5f80fd5b3480156103cc575f80fd5b506103d5610b3d565b6040516103e29190613820565b60405180910390f35b3480156103f6575f80fd5b5061040a6104053660046138cf565b610d5b565b60405190151581526020016103e2565b348015610425575f80fd5b5061042f609b5481565b6040519081526020016103e2565b348015610448575f80fd5b50610451610d6b565b6040516103e291906138f1565b348015610469575f80fd5b5061047d610478366004613903565b610e04565b6040516001600160a01b0390911681526020016103e2565b6104a86104a336600461392e565b610e46565b005b6104a86104b836600461392e565b61100c565b3480156104c8575f80fd5b5060a05461040a9060ff1681565b3480156104e1575f80fd5b506104a86104f0366004613965565b611018565b348015610500575f80fd5b5061042f61106a565b348015610514575f80fd5b506104a8610523366004613980565b611089565b6104a861053636600461399b565b6110ea565b348015610546575f80fd5b506104a86105553660046139ec565b6112af565b348015610565575f80fd5b506104a8610574366004613965565b6112cf565b348015610584575f80fd5b5061042f61138881565b348015610599575f80fd5b50609a5461047d906001600160a01b031681565b3480156105b8575f80fd5b506104a86105c7366004613a4d565b61132a565b3480156105d7575f80fd5b506104a86105e6366004613965565b6115aa565b6104a86105f936600461399b565b611603565b348015610609575f80fd5b506104a8611622565b34801561061d575f80fd5b506104a861062c366004613903565b61170e565b34801561063c575f80fd5b5061042f609c5481565b348015610651575f80fd5b5061042f6117d3565b348015610665575f80fd5b506104a8610674366004613ae8565b6117ef565b348015610684575f80fd5b5060985461047d906001600160a01b031681565b3480156106a3575f80fd5b5060a05461040a90610100900460ff1681565b3480156106c1575f80fd5b506106d56106d0366004613b26565b61183b565b6040516103e29190613b94565b3480156106ed575f80fd5b5061047d6106fc366004613903565b611886565b34801561070c575f80fd5b5061042f61071b366004613bd5565b60656020525f908152604090205481565b348015610737575f80fd5b5061040a610746366004613bee565b611890565b348015610756575f80fd5b50610451611957565b34801561076a575f80fd5b5061042f6806c6b935b8bbd4000081565b348015610786575f80fd5b50610451610795366004613ce6565b6119e3565b3480156107a5575f80fd5b5061042f6107b4366004613980565b611a8a565b3480156107c4575f80fd5b506104a8611ae6565b3480156107d8575f80fd5b506107ec6107e7366004613ae8565b611af9565b6040516103e29190613d63565b348015610804575f80fd5b506104a8610813366004613980565b611b6d565b348015610823575f80fd5b5061042f611bce565b348015610837575f80fd5b5060995461047d906001600160a01b031681565b348015610856575f80fd5b506107ec610865366004613d75565b611c39565b348015610875575f80fd5b506107ec610884366004613980565b611fc7565b348015610894575f80fd5b5061042f609d5481565b3480156108a9575f80fd5b5061042f6658d15e1762800081565b3480156108c3575f80fd5b506104a86108d2366004613dde565b61204e565b3480156108e2575f80fd5b506033546001600160a01b031661047d565b3480156108ff575f80fd5b5061040a61090e366004613980565b609f6020525f908152604090205460ff1681565b34801561092d575f80fd5b50610451612300565b348015610941575f80fd5b5061042f612318565b348015610955575f80fd5b506107ec610964366004613e38565b612327565b348015610974575f80fd5b506104a8610983366004613e6a565b61241b565b348015610993575f80fd5b5061042f609e5481565b3480156109a8575f80fd5b5060a05461040a9062010000900460ff1681565b3480156109c7575f80fd5b506104a86109d6366004613980565b612497565b6104a86109e9366004613ea1565b6124f8565b3480156109f9575f80fd5b5061047d73ddc6625feca10438857dd8660c021cd1088806fb81565b348015610a20575f80fd5b50610a34610a2f366004613903565b612533565b6040516103e29190613f1b565b348015610a4c575f80fd5b506104a8610a5b366004613980565b61258f565b348015610a6b575f80fd5b5061042f600a81565b348015610a7f575f80fd5b50610451610a8e366004613903565b6127f8565b348015610a9e575f80fd5b506104a8610aad366004613f29565b61287a565b348015610abd575f80fd5b506104a8610acc36600461392e565b612953565b348015610adc575f80fd5b5061040a610aeb366004613f5c565b612ae9565b348015610afb575f80fd5b50610b0f610b0a366004613903565b612b24565b6040516103e293929190613f88565b348015610b29575f80fd5b506104a8610b38366004613980565b612c5c565b60605f610b4861106a565b90505f816001600160401b03811115610b6357610b63613c60565b604051908082528060200260200182016040528015610bc057816020015b610bad60405180606001604052805f6001600160a01b0316815260200160608152602001606081525090565b815260200190600190039081610b815790505b50905060015b828111610d54575f81815260a1602090815260409182902082516060810190935280546001600160a01b031683526001810180549192840191610c0890613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3490613fc7565b8015610c7f5780601f10610c5657610100808354040283529160200191610c7f565b820191905f5260205f20905b815481529060010190602001808311610c6257829003601f168201915b50505050508152602001600282018054610c9890613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc490613fc7565b8015610d0f5780601f10610ce657610100808354040283529160200191610d0f565b820191905f5260205f20905b815481529060010190602001808311610cf257829003601f168201915b50505050508152505082600183610d269190614013565b81518110610d3657610d36614026565b60200260200101819052508080610d4c9061403a565b915050610bc6565b5092915050565b5f610d6582612cd2565b92915050565b6060610d75612d1f565b6002018054610d8390613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054610daf90613fc7565b8015610dfa5780601f10610dd157610100808354040283529160200191610dfa565b820191905f5260205f20905b815481529060010190602001808311610ddd57829003601f168201915b5050505050905090565b5f610e0e82612d43565b610e2257610e226333d1c03960e21b612d8a565b610e2a612d1f565b5f9283526006016020525060409020546001600160a01b031690565b610e4e612d92565b60a054610100900460ff16610eb85760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a20455448206d696e74696e672069732064697360448201526418589b195960da1b60648201526084015b60405180910390fd5b609d54610bb89082011115610f355760405162461bcd60e51b815260206004820152603960248201527f52616462724f7264696e616c3a206d6178207075626c6963206d696e7473207260448201527f6561636865642e20436865636b2074686520636861696e2121000000000000006064820152608401610eaf565b609d8054820190555f610f4f826658d15e17628000614052565b905080341015610fb65760405162461bcd60e51b815260206004820152602c60248201527f52616462724f7264696e616c3a20496e73756666696369656e7420455448207360448201526b195b9d08199bdc881b5a5b9d60a21b6064820152608401610eaf565b80341115610ff357336108fc610fcc8334614013565b6040518115909202915f818181858888f19350505050158015610ff1573d5f803e3d5ffd5b505b610ffd8383612deb565b506110086001606655565b5050565b61100882826001612eb8565b6098546001600160a01b031633148061103b57506033546001600160a01b031633145b6110575760405162461bcd60e51b8152600401610eaf90614069565b60a0805460ff1916911515919091179055565b5f6001611075612d1f565b60010154611081612d1f565b540303919050565b6098546001600160a01b03163314806110ac57506033546001600160a01b031633145b6110c85760405162461bcd60e51b8152600401610eaf90614069565b609a80546001600160a01b0319166001600160a01b0392909216919091179055565b5f6110f482612f67565b6001600160a01b03948516949091508116841461111a5761111a62a1148160e81b612d8a565b5f8061112584612ffc565b9150915061114a81876111353390565b6001600160a01b039081169116811491141790565b61116c576111588633612ae9565b61116c5761116c632ce44b5f60e11b612d8a565b6111798686866001613021565b8015611183575f82555b61118b612d1f565b6001600160a01b0387165f9081526005919091016020526040902080545f190190556111b5612d1f565b6001600160a01b0386165f8181526005929092016020526040909120805460010190554260a01b17600160e11b176111eb612d1f565b5f8681526004919091016020526040812091909155600160e11b8416900361125e5760018401611219612d1f565b5f8281526004919091016020526040812054900361125c57611239612d1f565b54811461125c5783611249612d1f565b5f83815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4805f036112a6576112a6633a954ecd60e21b612d8a565b50505050505050565b6112b7613088565b63ffffffff9091165f90815260656020526040902055565b6098546001600160a01b03163314806112f257506033546001600160a01b031633145b61130e5760405162461bcd60e51b8152600401610eaf90614069565b60a08054911515620100000262ff000019909216919091179055565b611332612d92565b60a05460ff166113965760405162461bcd60e51b815260206004820152602960248201527f52616462724f7264696e616c3a205261646c697374204d696e74696e6720697360448201526808191a5cd8589b195960ba1b6064820152608401610eaf565b606461c350048363ffffffff16609b5401111561141b5760405162461bcd60e51b815260206004820152603a60248201527f52616462724f7264696e616c3a206d6178207261646c697374206d696e74732060448201527f726561636865642e20436865636b2074686520636861696e21210000000000006064820152608401610eaf565b604051631ad367af60e21b81523090636b4d9ebc90611446905f9087903390889088906004016140e1565b602060405180830381865afa158015611461573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114859190614124565b6114ed5760405162461bcd60e51b815260206004820152603360248201527f52616462724f7264696e616c3a204e6f74206f6e20746865207261646c6973746044820152722e20436865636b2074686520636861696e212160681b6064820152608401610eaf565b335f908152609f602052604090205460ff16156115655760405162461bcd60e51b815260206004820152603060248201527f52616462724f7264696e616c3a20416c726561647920636c61696d656420796f60448201526f7572207261646c697374206d696e747360801b6064820152608401610eaf565b335f908152609f60205260409020805460ff19166001179055609b805463ffffffff851690810190915561159a908590612deb565b6115a46001606655565b50505050565b6098546001600160a01b03163314806115cd57506033546001600160a01b031633145b6115e95760405162461bcd60e51b8152600401610eaf90614069565b60a080549115156101000261ff0019909216919091179055565b61161d83838360405180602001604052805f8152506124f8565b505050565b6098546001600160a01b031633148061164557506033546001600160a01b031633145b6116615760405162461bcd60e51b8152600401610eaf90614069565b609a546040515f916001600160a01b03169047908381818185875af1925050503d805f81146116ab576040519150601f19603f3d011682016040523d82523d5f602084013e6116b0565b606091505b505090508061170b5760405162461bcd60e51b815260206004820152602160248201527f52616462724f7264696e616c3a20455448207472616e73666572206661696c656044820152601960fa1b6064820152608401610eaf565b50565b6098546001600160a01b031633148061173157506033546001600160a01b031633145b61174d5760405162461bcd60e51b8152600401610eaf90614069565b609a5460405163a9059cbb60e01b81526001600160a01b0390911660048201526024810182905273ddc6625feca10438857dd8660c021cd1088806fb9063a9059cbb906044016020604051808303815f875af11580156117af573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110089190614124565b60646117e26113886014614052565b6117ec919061413f565b81565b6098546001600160a01b031633148061181257506033546001600160a01b031633145b61182e5760405162461bcd60e51b8152600401610eaf90614069565b60a361161d8284836141ab565b60408051828152600583901b8082016020019092526060915b801561187e57601f1980820191860101355f61186f82612533565b84840160200152506118549050565b509392505050565b5f610d6582612f67565b63ffffffff85165f90815260656020526040812054806118f25760405162461bcd60e51b815260206004820152601c60248201527f5261646c6973743a206d65726b6c6520726f6f74206e6f7420736574000000006044820152606401610eaf565b6040516bffffffffffffffffffffffff19606087901b1660208201526001600160e01b031960e088901b1660348201525f9060380160405160208183030381529060405280519060200120905061194b858584846130e2565b98975050505050505050565b60a3805461196490613fc7565b80601f016020809104026020016040519081016040528092919081815260200182805461199090613fc7565b80156119db5780601f106119b2576101008083540402835291602001916119db565b820191905f5260205f20905b8154815290600101906020018083116119be57829003601f168201915b505050505081565b805160208183018101805160a282529282019190930120915280548190611a0990613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a3590613fc7565b8015611a805780601f10611a5757610100808354040283529160200191611a80565b820191905f5260205f20905b815481529060010190602001808311611a6357829003601f168201915b5050505050905081565b5f6001600160a01b038216611aa957611aa96323d3ad8160e21b612d8a565b6001600160401b03611ab9612d1f565b6005015f846001600160a01b03166001600160a01b031681526020019081526020015f2054169050919050565b611aee613088565b611af75f61311a565b565b606060a28383604051611b0d929190614265565b9081526040805191829003602090810183206001018054808302850183019093528284529190830182828015611b6057602002820191905f5260205f20905b815481526020019060010190808311611b4c575b5050505050905092915050565b6098546001600160a01b0316331480611b9057506033546001600160a01b031633145b611bac5760405162461bcd60e51b8152600401610eaf90614069565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b6064611bdd6113886014614052565b611be7919061413f565b6064611bf6611388600a614052565b611c00919061413f565b6064611c0f611388600a614052565b611c19919061413f565b611c2590611388614013565b611c2f9190614013565b6117ec9190614013565b6099546060906001600160a01b0316331480611c5f57506033546001600160a01b031633145b611cba5760405162461bcd60e51b815260206004820152602660248201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f7420746865206044820152656f7261636c6560d01b6064820152608401610eaf565b60a28383604051611ccc929190614265565b9081526040519081900360200190206001015415611d3a5760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a204f7264657220616c72656164792066756c666044820152641a5b1b195960da1b6064820152608401610eaf565b5f611d4361106a565b611d4e906001614274565b609954909150611d6d906001600160a01b031663ffffffff8916612deb565b5f8763ffffffff166001600160401b03811115611d8c57611d8c613c60565b604051908082528060200260200182016040528015611db5578160200160208202803683370190505b509050815b611dca63ffffffff8a1684614274565b811015611ef057604080516060810182526099546001600160a01b0316815281516020601f89018190048102820181019093528781529091808301919089908990819084018382808284375f92019190915250505090825250604080516020601f8c018190048102820181019092528a815291810191908b908b90819084018382808284375f92018290525093909452505083815260a160209081526040909120835181546001600160a01b0319166001600160a01b03909116178155908301519091506001820190611e9d9082614287565b5060408201516002820190611eb29082614287565b50829150839050611ec38583614013565b81518110611ed357611ed3614026565b602090810291909101015280611ee88161403a565b915050611dba565b506040805160606020601f880181900402820181018352918101868152909182919088908890819085018382808284375f9201919091525050509082525060200182905260405160a290611f479088908890614265565b90815260405190819003602001902081518190611f649082614287565b506020828101518051611f7d9260018501920190613776565b509050507f7677da4ed600206fde21dea46d0b4da9170af84461cdad92916cf41d3e3af8b1818888604051611fb49392919061436a565b60405180910390a1979650505050505050565b60605f611fd383611a8a565b9050606060405190506001820160051b81016040528181525f805f611ff6600190565b90505b848214612043575f61200a8261316b565b9050604081015161203a5780511561202157805193505b87841860601b61203a57600183019250818360051b8601525b50600101611ff9565b509195945050505050565b8261209b5760405162461bcd60e51b815260206004820152601d60248201527f52616462724f7264696e616c3a204e6f2069647320746f20636c61696d0000006044820152606401610eaf565b5f5b838110156122bc575f8585838181106120b8576120b8614026565b9050602002013590506120d36033546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061210b57506120f681611886565b6001600160a01b0316336001600160a01b0316145b61216a5760405162461bcd60e51b815260206004820152602a60248201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f74206f776e65604482015269391037b3103a37b5b2b760b11b6064820152608401610eaf565b6033546001600160a01b031633148061219757505f81815260a160205260409020546001600160a01b0316155b6121e35760405162461bcd60e51b815260206004820181905260248201527f52616462724f7264696e616c3a20696420616c726561647920636c61696d65646044820152606401610eaf565b60405180606001604052806121f53390565b6001600160a01b0316815260200160405180602001604052805f815250815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92018290525093909452505083815260a160209081526040909120835181546001600160a01b0319166001600160a01b0390911617815590830151909150600182019061228f9082614287565b50604082015160028201906122a49082614287565b509050505080806122b49061403a565b91505061209d565b507f7677da4ed600206fde21dea46d0b4da9170af84461cdad92916cf41d3e3af8b1848484846040516122f2949392919061438f565b60405180910390a150505050565b606061230a612d1f565b6003018054610d8390613fc7565b60646117e2611388600a614052565b606081831061234057612340631960ccad60e11b612d8a565b600183101561234e57600192505b5f6123576131b0565b9050808310612364578092505b60605f61237087611a8a565b8587109081029150811561240f57818787031161238d5786860391505b60405192506001820160051b83016040525f6123a888612533565b90505f81604001516123b8575080515b5f5b6123c38a61316b565b925060408301516123f2578251156123da57825191505b8a821860601b6123f257600101600581901b86018a90525b60018a019950888a148061240557508481145b156123ba57855250505b50909695505050505050565b80612424612d1f565b335f818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6098546001600160a01b03163314806124ba57506033546001600160a01b031633145b6124d65760405162461bcd60e51b8152600401610eaf90614069565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b6125038484846110ea565b6001600160a01b0383163b156115a45761251f848484846131bf565b6115a4576115a46368d2bf6b60e11b612d8a565b604080516080810182525f8082526020820181905291810182905260608101919091526001821061258a576125666131b0565b82101561258a576125768261316b565b9050806040015161258a57610d658261329e565b919050565b5f8051602061457383398151915254610100900460ff166125c2575f805160206145738339815191525460ff16156125c6565b303b155b6126385760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610eaf565b5f8051602061457383398151915254610100900460ff16158015612672575f80516020614573833981519152805461ffff19166101011790555b5f54610100900460ff161580801561269057505f54600160ff909116105b806126a95750303b1580156126a957505f5460ff166001145b6126c55760405162461bcd60e51b8152600401610eaf906143b5565b5f805460ff1916600117905580156126e6575f805461ff0019166101001790555b6127436040518060400160405280601881526020017f52616462724f7264696e616c733a204d696e7420506173730000000000000000815250604051806040016040528060068152602001654f524442524f60d01b8152506132d2565b61274b61330f565b61275361334a565b61275b613378565b609a8054336001600160a01b03199182168117909255609880548216909217909155609980549091166001600160a01b03851617905580156127d6575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5080156110085750505f80516020614573833981519152805461ff0019169055565b606061280382612d43565b61282057604051630a14c4b560e41b815260040160405180910390fd5b60a3805461282d90613fc7565b90505f036128495760405180602001604052805f815250610d65565b60a36128548361343b565b604051602001612865929190614403565b60405160208183030381529060405292915050565b6098546001600160a01b031633148061289d57506033546001600160a01b031633145b6128b95760405162461bcd60e51b8152600401610eaf90614069565b606461c350048163ffffffff16609e540111156129375760405162461bcd60e51b815260206004820152603660248201527f52616462724f7264696e616c3a206d617820646576206d696e747320726561636044820152756865642e20436865636b2074686520636861696e212160501b6064820152608401610eaf565b609e805463ffffffff8316908101909155611008908390612deb565b61295b612d92565b60a05462010000900460ff166129c15760405162461bcd60e51b815260206004820152602560248201527f52616462724f7264696e616c3a20524144206d696e74696e672069732064697360448201526418589b195960da1b6064820152608401610eaf565b609c546103e89082011115612a3e5760405162461bcd60e51b815260206004820152603760248201527f52616462724f7264696e616c3a206d61782024524144206d696e74732072656160448201527f636865642e20436865636b2074686520636861696e21210000000000000000006064820152608401610eaf565b609c8054820190555f612a5a826806c6b935b8bbd40000614052565b609a546040516323b872dd60e01b81523360048201526001600160a01b0390911660248201526044810182905290915073ddc6625feca10438857dd8660c021cd1088806fb906323b872dd906064016020604051808303815f875af1158015612ac5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ff19190614124565b5f612af2612d1f565b6001600160a01b039384165f908152600791909101602090815260408083209490951682529290925250205460ff1690565b60a16020525f9081526040902080546001820180546001600160a01b039092169291612b4f90613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054612b7b90613fc7565b8015612bc65780601f10612b9d57610100808354040283529160200191612bc6565b820191905f5260205f20905b815481529060010190602001808311612ba957829003601f168201915b505050505090806002018054612bdb90613fc7565b80601f0160208091040260200160405190810160405280929190818152602001828054612c0790613fc7565b8015612c525780601f10612c2957610100808354040283529160200191612c52565b820191905f5260205f20905b815481529060010190602001808311612c3557829003601f168201915b5050505050905083565b612c64613088565b6001600160a01b038116612cc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610eaf565b61170b8161311a565b5f6301ffc9a760e01b6001600160e01b031983161480612d0257506380ac58cd60e01b6001600160e01b03198316145b80610d655750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b5f81600111158015612d5c5750612d58612d1f565b5482105b8015610d655750600160e01b612d70612d1f565b5f8481526004919091016020526040902054161592915050565b805f5260045ffd5b600260665403612de45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eaf565b6002606655565b600a811115612e4c5760405162461bcd60e51b815260206004820152602760248201527f52616462724f7264696e616c3a204d6178206d696e74732070657220747820656044820152661e18d95959195960ca1b6064820152608401610eaf565b61138881612e5861106a565b011115612ea75760405162461bcd60e51b815260206004820181905260248201527f52616462724f7264696e616c3a204d617820737570706c7920726561636865646044820152606401610eaf565b611008828261347e565b6001606655565b5f612ec283611886565b9050818015612eda5750336001600160a01b03821614155b15612efd57612ee98133612ae9565b612efd57612efd6367d9dca160e11b612d8a565b83612f06612d1f565b5f858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b5f81600111612fec57612f78612d1f565b5f83815260049190910160205260408120549150600160e01b82169003612fec57805f0361258a57612fa8612d1f565b548210612fbf57612fbf636f96cda160e11b612d8a565b612fc7612d1f565b5f199092015f81815260049390930160205260409092205490508015612fbf57919050565b61258a636f96cda160e11b612d8a565b5f805f613007612d1f565b5f9485526006016020525050604090912080549092909150565b6001600160a01b038416158061303e57506001600160a01b038316155b6130835760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610eaf565b6115a4565b6033546001600160a01b03163314611af75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eaf565b5f8315613112578360051b8501855b803580851160051b94855260209485185260405f2093018181106130f15750505b501492915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516080810182525f808252602082018190529181018290526060810191909152610d65613199612d1f565b5f8481526004919091016020526040902054613497565b5f6131b9612d1f565b54919050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906131f3903390899088908890600401614486565b6020604051808303815f875af192505050801561322d575060408051601f3d908101601f1916820190925261322a918101906144b8565b60015b613280573d80801561325a576040519150601f19603f3d011682016040523d82523d5f602084013e61325f565b606091505b5080515f03613278576132786368d2bf6b60e11b612d8a565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182525f808252602082018190529181018290526060810191909152610d656132cd83612f67565b613497565b5f8051602061457383398151915254610100900460ff166133055760405162461bcd60e51b8152600401610eaf906144d3565b61100882826134de565b5f8051602061457383398151915254610100900460ff166133425760405162461bcd60e51b8152600401610eaf906144d3565b611af7613550565b5f54610100900460ff166133705760405162461bcd60e51b8152600401610eaf90614527565b611af7613583565b5f54610100900460ff161580801561339657505f54600160ff909116105b806133af5750303b1580156133af57505f5460ff166001145b6133cb5760405162461bcd60e51b8152600401610eaf906143b5565b5f805460ff1916600117905580156133ec575f805461ff0019166101001790555b6133f46135a9565b801561170b575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806134545750819003601f19909101908152919050565b611008828260405180602001604052805f8152506135d7565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b5f8051602061457383398151915254610100900460ff166135115760405162461bcd60e51b8152600401610eaf906144d3565b8161351a612d1f565b600201906135289082614287565b5080613532612d1f565b600301906135409082614287565b50600161354b612d1f565b555050565b5f8051602061457383398151915254610100900460ff16611af75760405162461bcd60e51b8152600401610eaf906144d3565b5f54610100900460ff16612eb15760405162461bcd60e51b8152600401610eaf90614527565b5f54610100900460ff166135cf5760405162461bcd60e51b8152600401610eaf90614527565b611af761364d565b6135e1838361367c565b6001600160a01b0383163b1561161d575f6135fa612d1f565b5490508281035b6136135f8683806001019450866131bf565b613627576136276368d2bf6b60e11b612d8a565b8181106136015781613637612d1f565b5414613646576136465f612d8a565b5050505050565b5f54610100900460ff166136735760405162461bcd60e51b8152600401610eaf90614527565b611af73361311a565b5f613685612d1f565b5490505f8290036136a0576136a063b562e8dd60e01b612d8a565b6136ac5f848385613021565b6001600160a01b0383164260a01b6001841460e11b17176136cb612d1f565b5f83815260049190910160205260409020556801000000000000000182026136f1612d1f565b6001600160a01b0385165f81815260059290920160205260408220805490930190925581900361372a5761372a622e076360e81b612d8a565b818301825b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a481816001019150810361372f578161376c612d1f565b555061161d915050565b828054828255905f5260205f209081019282156137af579160200282015b828111156137af578251825591602001919060010190613794565b506137bb9291506137bf565b5090565b5b808211156137bb575f81556001016137c0565b5f5b838110156137ed5781810151838201526020016137d5565b50505f910152565b5f815180845261380c8160208601602086016137d3565b601f01601f19169290920160200192915050565b5f6020808301818452808551808352604092508286019150828160051b8701018488015f5b838110156138ac57888303603f19018552815180516001600160a01b031684528781015160608986018190529061387e828701826137f5565b9150508782015191508481038886015261389881836137f5565b968901969450505090860190600101613845565b509098975050505050505050565b6001600160e01b03198116811461170b575f80fd5b5f602082840312156138df575f80fd5b81356138ea816138ba565b9392505050565b602081525f6138ea60208301846137f5565b5f60208284031215613913575f80fd5b5035919050565b6001600160a01b038116811461170b575f80fd5b5f806040838503121561393f575f80fd5b823561394a8161391a565b946020939093013593505050565b801515811461170b575f80fd5b5f60208284031215613975575f80fd5b81356138ea81613958565b5f60208284031215613990575f80fd5b81356138ea8161391a565b5f805f606084860312156139ad575f80fd5b83356139b88161391a565b925060208401356139c88161391a565b929592945050506040919091013590565b803563ffffffff8116811461258a575f80fd5b5f80604083850312156139fd575f80fd5b61394a836139d9565b5f8083601f840112613a16575f80fd5b5081356001600160401b03811115613a2c575f80fd5b6020830191508360208260051b8501011115613a46575f80fd5b9250929050565b5f805f8060608587031215613a60575f80fd5b8435613a6b8161391a565b9350613a79602086016139d9565b925060408501356001600160401b03811115613a93575f80fd5b613a9f87828801613a06565b95989497509550505050565b5f8083601f840112613abb575f80fd5b5081356001600160401b03811115613ad1575f80fd5b602083019150836020828501011115613a46575f80fd5b5f8060208385031215613af9575f80fd5b82356001600160401b03811115613b0e575f80fd5b613b1a85828601613aab565b90969095509350505050565b5f8060208385031215613b37575f80fd5b82356001600160401b03811115613b4c575f80fd5b613b1a85828601613a06565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f9190848201906040850190845b8181101561240f57613bc2838551613b58565b9284019260809290920191600101613baf565b5f60208284031215613be5575f80fd5b6138ea826139d9565b5f805f805f60808688031215613c02575f80fd5b613c0b866139d9565b9450613c19602087016139d9565b93506040860135613c298161391a565b925060608601356001600160401b03811115613c43575f80fd5b613c4f88828901613a06565b969995985093965092949392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6001600160401b0380841115613c8d57613c8d613c60565b604051601f8501601f19908116603f01168101908282118183101715613cb557613cb5613c60565b81604052809350858152868686011115613ccd575f80fd5b858560208301375f602087830101525050509392505050565b5f60208284031215613cf6575f80fd5b81356001600160401b03811115613d0b575f80fd5b8201601f81018413613d1b575f80fd5b61329684823560208401613c74565b5f8151808452602080850194508084015f5b83811015613d5857815187529582019590820190600101613d3c565b509495945050505050565b602081525f6138ea6020830184613d2a565b5f805f805f60608688031215613d89575f80fd5b613d92866139d9565b945060208601356001600160401b0380821115613dad575f80fd5b613db989838a01613aab565b90965094506040880135915080821115613dd1575f80fd5b50613c4f88828901613aab565b5f805f8060408587031215613df1575f80fd5b84356001600160401b0380821115613e07575f80fd5b613e1388838901613a06565b90965094506020870135915080821115613e2b575f80fd5b50613a9f87828801613aab565b5f805f60608486031215613e4a575f80fd5b8335613e558161391a565b95602085013595506040909401359392505050565b5f8060408385031215613e7b575f80fd5b8235613e868161391a565b91506020830135613e9681613958565b809150509250929050565b5f805f8060808587031215613eb4575f80fd5b8435613ebf8161391a565b93506020850135613ecf8161391a565b92506040850135915060608501356001600160401b03811115613ef0575f80fd5b8501601f81018713613f00575f80fd5b613f0f87823560208401613c74565b91505092959194509250565b60808101610d658284613b58565b5f8060408385031215613f3a575f80fd5b8235613f458161391a565b9150613f53602084016139d9565b90509250929050565b5f8060408385031215613f6d575f80fd5b8235613f788161391a565b91506020830135613e968161391a565b6001600160a01b03841681526060602082018190525f90613fab908301856137f5565b8281036040840152613fbd81856137f5565b9695505050505050565b600181811c90821680613fdb57607f821691505b602082108103613ff957634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d6557610d65613fff565b634e487b7160e01b5f52603260045260245ffd5b5f6001820161404b5761404b613fff565b5060010190565b8082028115828204841417610d6557610d65613fff565b60208082526028908201527f52616462724f7264696e616c3a2063616c6c6572206973206e6f74207468652060408201526737b832b930ba37b960c11b606082015260800190565b8183525f6001600160fb1b038311156140c8575f80fd5b8260051b80836020870137939093016020019392505050565b63ffffffff8681168252851660208201526001600160a01b03841660408201526080606082018190525f9061411990830184866140b1565b979650505050505050565b5f60208284031215614134575f80fd5b81516138ea81613958565b5f8261415957634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561161d575f81815260208120601f850160051c810160208610156141845750805b601f850160051c820191505b818110156141a357828155600101614190565b505050505050565b6001600160401b038311156141c2576141c2613c60565b6141d6836141d08354613fc7565b8361415e565b5f601f841160018114614207575f85156141f05750838201355b5f19600387901b1c1916600186901b178355613646565b5f83815260209020601f19861690835b828110156142375786850135825560209485019460019092019101614217565b5086821015614253575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b80820180821115610d6557610d65613fff565b81516001600160401b038111156142a0576142a0613c60565b6142b4816142ae8454613fc7565b8461415e565b602080601f8311600181146142e7575f84156142d05750858301515b5f19600386901b1c1916600185901b1785556141a3565b5f85815260208120601f198616915b82811015614315578886015182559484019460019091019084016142f6565b508582101561433257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b604081525f61437c6040830186613d2a565b8281036020840152613fbd818587614342565b604081525f6143a26040830186886140b1565b8281036020840152614119818587614342565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b5f80845461441081613fc7565b60018281168015614428576001811461443d57614469565b60ff1984168752821515830287019450614469565b885f526020805f205f5b858110156144605781548a820152908401908201614447565b50505082870194505b50505050835161447d8183602088016137d3565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613fbd908301846137f5565b5f602082840312156144c8575f80fd5b81516138ea816138ba565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa164736f6c6343000814000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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