ETH Price: $2,443.27 (-1.27%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040192045192024-02-11 11:27:11268 days ago1707650831IN
 Create: LevelUp
0 ETH0.0836427623.11635504

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LevelUp

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : LevelUpNFT.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.5;

import "../lib/ERC721A-Upgradeable/contracts/ERC721AUpgradeable.sol";
import "../lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
import "../lib/openzeppelin-contracts/contracts/utils/Strings.sol";
import "../lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol";
import "./IERC20.sol";
import "./IERC721Burnable.sol";

contract LevelUp is Initializable, ERC721AUpgradeable {
    using Strings for uint256;

    struct level {
        uint128 silk;
        uint8 elixer;
        uint8 immortal;
        uint8 advelixer;
        uint32 successPercent;
        uint32 minSuccessPercent;
        uint32 maxSuccessPercent;
        uint8 variation;
    }

    struct mintRoutine {
        uint256 startTime;
        uint256 endTime;
        uint256 maxMint;
        bytes32 eligibilityRoot;
    }

    address public owner;
    bool public paused;

    uint256 public totalNFT;

    IERC20 public silk;
    IERC721Burnable public Exlixer;
    IERC721Burnable public Immortal;
    IERC721Burnable public Advelixer;
    uint256 public nonce;

    mapping(uint256 => level) public levelInfo;
    mapping(uint256 => uint256) private cardLevels;
    mapping(address => bool) public verifiedNode;
    mapping(uint256 => bool) public nonceServed;
    mapping(address => uint256[3]) public mintPerWallet;

    string public baseURI;
    string public baseExtension;

    uint256 public startTime;

    uint256 public primarySaleEndTime;
    uint256 public primaryMaxMint;
    uint256 public primaryMintPrice;
    bytes32 public primaryMintRoot;

    uint256 public secondarySaleEndTime;
    uint256 public secondaryMaxMint;
    uint256 public secondaryMintPrice;
    bytes32 public secondaryMintRoot;

    uint256 public maxMint;
    uint256 public mintPrice;

    uint256 public constant GAS_NEEDED_TO_UPGRADE = 70000;

    event Withdraw(address indexed owner, uint256 amount);
    event UpdateOwner(address currentOwner, address previousOwner);
    event PriceUpdate(address indexed owner, uint256 newPrice);
    event LevelUpdated(uint256 indexed levelNumber, level levelInfo);
    event RequestForUpdate(
        uint256 nonce,
        address owner,
        uint256 nftId,
        bool safety
    );
    event RequestServed(
        uint256 nonce,
        address owner,
        uint256 nftId,
        bool upgrade
    );

    error UnknownFreeNode();
    error ContractPaused();
    error InvalidAmount();
    error NotNFTOwner();
    error MaxAmountReached();
    error NonceServed();
    error InvalidOption();
    error InsufficientFundForUpgrade();
    error InvalidProof();
    error SaleNotStarted();

    function initialize(
        address _owner,
        uint256 _totalNFT,
        level[] memory _levelInfo,
        string memory _initBaseURI,
        string memory _name,
        string memory _symbol,
        string memory _baseExtension
    ) external initializerERC721A initializer {
        __ERC721A_init(_name, _symbol);
        owner = _owner;
        baseURI = _initBaseURI;
        totalNFT = _totalNFT;
        baseExtension = _baseExtension;
        for (uint256 i; i < _levelInfo.length; ) {
            levelInfo[i] = _levelInfo[i];
            unchecked {
                ++i;
            }
        }
    }

    modifier onlyOwner() {
        require(owner == msg.sender, "LU:Invalid Owner");
        _;
    }

    function onlyVerifierFreeNode() private view {
        if (verifiedNode[msg.sender] != true) {
            revert UnknownFreeNode();
        }
    }

    function whenNotPaused() private view {
        if (paused) revert ContractPaused();
    }

    function checkNFTOwner(uint256 _tokenId) private view {
        if (ownerOf(_tokenId) != msg.sender) revert NotNFTOwner();
    }

    function checkOwner() private view onlyOwner {}

    function isPriceEqual(uint256 _price, uint256 _quantity) private view {
        if (mintPrice * _quantity != _price) revert InvalidAmount();
    }

    function updateVerifyNodeOperators(address freenode, bool add) external {
        checkOwner();
        if (add) {
            verifiedNode[freenode] = true;
        } else {
            verifiedNode[freenode] = false;
        }
    }

    function updateContracts(address _contract, uint256 _option) external {
        checkOwner();
        if (_option == 0) silk = IERC20(_contract);
        else if (_option == 1) Exlixer = IERC721Burnable(_contract);
        else if (_option == 2) Immortal = IERC721Burnable(_contract);
        else if (_option == 3) Advelixer = IERC721Burnable(_contract);
        else revert InvalidOption();
    }

    function changeLevelInfo(uint256 _levelNo, level calldata _newLevelInfo)
        external
    {
        checkOwner();
        levelInfo[_levelNo] = _newLevelInfo;
        emit LevelUpdated(_levelNo, _newLevelInfo);
    }

    function setOwner(address _owner) external {
        checkOwner();
        owner = _owner;
        emit UpdateOwner(msg.sender, owner);
    }

    function setPrimaryMint(
        bytes32 root,
        uint256 _primarySaleEndTime,
        uint256 _maxMint,
        uint256 price
    ) external {
        checkOwner();
        primaryMintRoot = root;
        primarySaleEndTime = _primarySaleEndTime;
        primaryMaxMint = _maxMint;
        primaryMintPrice = price;
    }

    function setSecondaryMint(
        bytes32 root,
        uint256 _secondarySaleEndTime,
        uint256 _maxMint,
        uint256 price
    ) external {
        checkOwner();
        secondaryMintRoot = root;
        secondarySaleEndTime = _secondarySaleEndTime;
        secondaryMaxMint = _maxMint;
        secondaryMintPrice = price;
    }

    function setMaxMintPerWallet(
        uint256 saleStartTime,
        uint256 _maxMint,
        uint256 price
    ) external {
        checkOwner();
        startTime = saleStartTime;
        maxMint = _maxMint;
        mintPrice = price;
    }

    function setBaseURI(string memory _newBaseURI) external {
        checkOwner();
        baseURI = _newBaseURI;
    }

    function setBaseExtension(string memory _newBaseExtension) external {
        checkOwner();
        baseExtension = _newBaseExtension;
    }

    function pauseOnExternalMint(bool _state) external {
        checkOwner();
        paused = _state;
    }

    function updatePrice(uint256 _price) external {
        checkOwner();
        mintPrice = _price;
        emit PriceUpdate(msg.sender, _price);
    }

    function updateTotalNFT(uint256 _tnft) external {
        checkOwner();
        totalNFT = _tnft;
    }

    function staticAirdrop(address[] calldata _to, uint256 _quantity) external {
        if (totalNFT < (_nextTokenId() + _quantity)) revert MaxAmountReached();
        for (uint256 i; i < _to.length; ) {
            _safeMint(_to[i], _quantity);
            unchecked {
                ++i;
            }
        }
    }

    function variableAirdrop(
        address[] calldata _to,
        uint256[] calldata _quantity
    ) external {
        checkOwner();
        require(_to.length == _quantity.length, "LU:Entries Mismatch");
        uint256 total;
        for (uint256 i; i < _to.length; ) {
            total += _quantity[i];
            unchecked {
                ++i;
            }
        }
        if (totalNFT < (_nextTokenId() + total)) revert MaxAmountReached();
        for (uint256 i; i < _to.length; ) {
            _safeMint(_to[i], _quantity[i]);
            unchecked {
                ++i;
            }
        }
    }

    function mint(uint256 _quantity, bytes32[] calldata proof)
        external
        payable
    {
        whenNotPaused();
        if (totalNFT < (_nextTokenId() + _quantity)) revert MaxAmountReached();
        if (
            block.timestamp > startTime && block.timestamp <= primarySaleEndTime
        ) {
            if (
                MerkleProof.verifyCalldata(
                    proof,
                    primaryMintRoot,
                    keccak256(abi.encodePacked(msg.sender))
                ) == false
            ) {
                revert InvalidProof();
            }
            require(
                mintPerWallet[msg.sender][0] + _quantity <= primaryMaxMint,
                "LU: Mint Limit Exceed"
            );
            require(
                msg.value == _quantity * primaryMintPrice,
                "LU : Insufficient Fund"
            );
            mintPerWallet[msg.sender][0] =
                mintPerWallet[msg.sender][0] +
                _quantity;
        } else if (
            block.timestamp > primarySaleEndTime &&
            block.timestamp <= secondarySaleEndTime
        ) {
            if (
                MerkleProof.verifyCalldata(
                    proof,
                    secondaryMintRoot,
                    keccak256(abi.encodePacked(msg.sender))
                ) == false
            ) {
                revert InvalidProof();
            }
            require(
                mintPerWallet[msg.sender][1] + _quantity <= secondaryMaxMint,
                "LU: Mint Limit Exceed"
            );
            require(
                msg.value == _quantity * secondaryMintPrice,
                "LU : Insufficient Fund"
            );
            mintPerWallet[msg.sender][1] =
                mintPerWallet[msg.sender][1] +
                _quantity;
        } else if (block.timestamp > secondarySaleEndTime) {
            require(
                mintPerWallet[msg.sender][2] + _quantity <= maxMint,
                "LU: Mint Limit Exceed"
            );
            require(
                msg.value == _quantity * mintPrice,
                "LU : Insufficient Fund"
            );
            mintPerWallet[msg.sender][2] =
                mintPerWallet[msg.sender][2] +
                _quantity;
        } else if (block.timestamp < startTime) {
            revert SaleNotStarted();
        }
        _safeMint(msg.sender, _quantity);
    }

    function withdrawFunds(uint256 _amount) external {
        checkOwner();
        payable(owner).transfer(address(this).balance);
        emit Withdraw(owner, _amount);
    }

    function burn(uint256 _tokenId) external {
        checkNFTOwner(_tokenId);
        _burn(_tokenId);
    }

    function multipleNFTTransfer(
        address from,
        address to,
        uint256[] memory tokenId
    ) external {
        require(tokenId.length != 0, "LU: Length cannot be zero");
        for (uint256 i; i < tokenId.length; ) {
            safeTransferFrom(from, to, tokenId[i]);
            unchecked {
                ++i;
            }
        }
    }

    function checkLevel(uint256 tokenID) public view returns (uint256) {
        return cardLevels[tokenID] + 1;
    }

    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function upgrade(
        uint256 nftid,
        bool safety,
        uint256[] calldata elixerIds,
        uint256[] calldata immortalIds,
        uint256[] calldata advElixerIds
    ) external payable {
        if (msg.value < GAS_NEEDED_TO_UPGRADE * tx.gasprice) {
            revert InsufficientFundForUpgrade();
        }
        checkNFTOwner(nftid);
        uint256 currentLevel = cardLevels[nftid];
        level storage currentLevelInfo = levelInfo[currentLevel];
        IERC20(silk).burnFrom(msg.sender, currentLevelInfo.silk);
        if (elixerIds.length != currentLevelInfo.elixer)
            revert("LU: Unsuccessful Upgrade");
        IERC721Burnable(Exlixer).burnFrom(msg.sender, elixerIds);
        if (currentLevel > 3) {
            if (advElixerIds.length != currentLevelInfo.advelixer)
                revert("LU: Unsuccessful Upgrade");
            IERC721Burnable(Advelixer).burnFrom(msg.sender, advElixerIds);
        }
        if (safety && currentLevel < 5) {
            if (immortalIds.length != currentLevelInfo.immortal)
                revert("LU: Unsuccessful Upgrade");
            IERC721Burnable(Immortal).burnFrom(msg.sender, immortalIds);
        }
        emit RequestForUpdate(nonce++, msg.sender, nftid, safety);
    }

    function updateNftForUser(
        uint256 nonce_,
        address user,
        uint256 nftId,
        bool safety,
        uint256 randomNumber
    ) external {
        if (nonceServed[nonce_] == true) revert NonceServed();
        onlyVerifierFreeNode();
        if (ownerOf(nftId) != user) revert NotNFTOwner();
        nonceServed[nonce_] = true;
        uint256 currentLevel = cardLevels[nftId];
        level storage currentLevelInfo = levelInfo[currentLevel];

        if (safety && currentLevel < 5) {
            // 8 decimal as u32 is used
            if (currentLevelInfo.successPercent > randomNumber % 1000000000) {
                cardLevels[nftId] = min(currentLevel + 1, 6);
                uint256 finalSuccessPercent = currentLevelInfo.successPercent -
                    ((currentLevelInfo.successPercent *
                        currentLevelInfo.variation) / 100);
                currentLevelInfo.successPercent = uint32(
                    max(finalSuccessPercent, currentLevelInfo.minSuccessPercent)
                );
                emit RequestServed(nonce_, user, nftId, true);
            } else {
                uint256 finalSuccessPercent = currentLevelInfo.successPercent +
                    ((currentLevelInfo.successPercent *
                        currentLevelInfo.variation) / 100);
                currentLevelInfo.successPercent = uint32(
                    min(finalSuccessPercent, currentLevelInfo.maxSuccessPercent)
                );
                emit RequestServed(nonce_, user, nftId, false);
            }
        } else {
            // 8 decimal as u32 is used
            if (currentLevelInfo.successPercent > randomNumber % 1000000000) {
                cardLevels[nftId] = min(currentLevel + 1, 6);
                uint256 finalSuccessPercent = currentLevelInfo.successPercent -
                    ((currentLevelInfo.successPercent *
                        currentLevelInfo.variation) / 100);
                currentLevelInfo.successPercent = uint32(
                    max(finalSuccessPercent, currentLevelInfo.minSuccessPercent)
                );
                emit RequestServed(nonce_, user, nftId, true);
            } else {
                cardLevels[nftId] = 0;
                uint256 finalSuccessPercent = currentLevelInfo.successPercent +
                    ((currentLevelInfo.successPercent *
                        currentLevelInfo.variation) / 100);
                currentLevelInfo.successPercent = uint32(
                    min(finalSuccessPercent, currentLevelInfo.maxSuccessPercent)
                );
                emit RequestServed(nonce_, user, nftId, false);
            }
        }
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );

        string memory currentBaseURI = _baseURI();
        return
            bytes(currentBaseURI).length > 0
                ? string(
                    abi.encodePacked(
                        currentBaseURI,
                        "/",
                        checkLevel(tokenId).toString(),
                        "/",
                        tokenId.toString(),
                        baseExtension
                    )
                )
                : "";
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }
}

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

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 3 of 13 : IERC721Burnable.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.5;
// import {
//     IERC721Enumerable
// } from "openzeppelin-contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IERC721Burnable {
    function burn(uint256 tokenId) external returns(bool);
    function mint(address user,uint256 quantity) external returns(bool);
    function burnFrom(address user,uint256[] calldata tokenId) external returns(bool);
    function checkLevel(uint256 tokenId) external returns (uint256);
}

File 4 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT


pragma solidity ^0.8.5;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);


    function decimals() external view returns (uint8);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    function mint(address user,uint256 amount) external returns(bool);
    function burnFrom(address user,uint256 amount) external returns(bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.2;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 13 : 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 10 of 13 : 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 11 of 13 : 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 12 of 13 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

Settings
{
  "viaIR": false,
  "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":"ContractPaused","type":"error"},{"inputs":[],"name":"InsufficientFundForUpgrade","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidOption","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"MaxAmountReached","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NonceServed","type":"error"},{"inputs":[],"name":"NotNFTOwner","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SaleNotStarted","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"UnknownFreeNode","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":true,"internalType":"uint256","name":"levelNumber","type":"uint256"},{"components":[{"internalType":"uint128","name":"silk","type":"uint128"},{"internalType":"uint8","name":"elixer","type":"uint8"},{"internalType":"uint8","name":"immortal","type":"uint8"},{"internalType":"uint8","name":"advelixer","type":"uint8"},{"internalType":"uint32","name":"successPercent","type":"uint32"},{"internalType":"uint32","name":"minSuccessPercent","type":"uint32"},{"internalType":"uint32","name":"maxSuccessPercent","type":"uint32"},{"internalType":"uint8","name":"variation","type":"uint8"}],"indexed":false,"internalType":"struct LevelUp.level","name":"levelInfo","type":"tuple"}],"name":"LevelUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"PriceUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"safety","type":"bool"}],"name":"RequestForUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"upgrade","type":"bool"}],"name":"RequestServed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"currentOwner","type":"address"},{"indexed":false,"internalType":"address","name":"previousOwner","type":"address"}],"name":"UpdateOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"Advelixer","outputs":[{"internalType":"contract IERC721Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Exlixer","outputs":[{"internalType":"contract IERC721Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAS_NEEDED_TO_UPGRADE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Immortal","outputs":[{"internalType":"contract IERC721Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseExtension","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_levelNo","type":"uint256"},{"components":[{"internalType":"uint128","name":"silk","type":"uint128"},{"internalType":"uint8","name":"elixer","type":"uint8"},{"internalType":"uint8","name":"immortal","type":"uint8"},{"internalType":"uint8","name":"advelixer","type":"uint8"},{"internalType":"uint32","name":"successPercent","type":"uint32"},{"internalType":"uint32","name":"minSuccessPercent","type":"uint32"},{"internalType":"uint32","name":"maxSuccessPercent","type":"uint32"},{"internalType":"uint8","name":"variation","type":"uint8"}],"internalType":"struct LevelUp.level","name":"_newLevelInfo","type":"tuple"}],"name":"changeLevelInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"checkLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_totalNFT","type":"uint256"},{"components":[{"internalType":"uint128","name":"silk","type":"uint128"},{"internalType":"uint8","name":"elixer","type":"uint8"},{"internalType":"uint8","name":"immortal","type":"uint8"},{"internalType":"uint8","name":"advelixer","type":"uint8"},{"internalType":"uint32","name":"successPercent","type":"uint32"},{"internalType":"uint32","name":"minSuccessPercent","type":"uint32"},{"internalType":"uint32","name":"maxSuccessPercent","type":"uint32"},{"internalType":"uint8","name":"variation","type":"uint8"}],"internalType":"struct LevelUp.level[]","name":"_levelInfo","type":"tuple[]"},{"internalType":"string","name":"_initBaseURI","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseExtension","type":"string"}],"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":"uint256","name":"","type":"uint256"}],"name":"levelInfo","outputs":[{"internalType":"uint128","name":"silk","type":"uint128"},{"internalType":"uint8","name":"elixer","type":"uint8"},{"internalType":"uint8","name":"immortal","type":"uint8"},{"internalType":"uint8","name":"advelixer","type":"uint8"},{"internalType":"uint32","name":"successPercent","type":"uint32"},{"internalType":"uint32","name":"minSuccessPercent","type":"uint32"},{"internalType":"uint32","name":"maxSuccessPercent","type":"uint32"},{"internalType":"uint8","name":"variation","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","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":"multipleNFTTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceServed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"pauseOnExternalMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryMaxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primaryMintRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primarySaleEndTime","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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"secondaryMaxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondaryMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondaryMintRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondarySaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"_newBaseExtension","type":"string"}],"name":"setBaseExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleStartTime","type":"uint256"},{"internalType":"uint256","name":"_maxMint","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint256","name":"_primarySaleEndTime","type":"uint256"},{"internalType":"uint256","name":"_maxMint","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPrimaryMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint256","name":"_secondarySaleEndTime","type":"uint256"},{"internalType":"uint256","name":"_maxMint","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setSecondaryMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"silk","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"staticAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalNFT","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"uint256","name":"_option","type":"uint256"}],"name":"updateContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce_","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"bool","name":"safety","type":"bool"},{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"updateNftForUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tnft","type":"uint256"}],"name":"updateTotalNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"freenode","type":"address"},{"internalType":"bool","name":"add","type":"bool"}],"name":"updateVerifyNodeOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftid","type":"uint256"},{"internalType":"bool","name":"safety","type":"bool"},{"internalType":"uint256[]","name":"elixerIds","type":"uint256[]"},{"internalType":"uint256[]","name":"immortalIds","type":"uint256[]"},{"internalType":"uint256[]","name":"advElixerIds","type":"uint256[]"}],"name":"upgrade","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_quantity","type":"uint256[]"}],"name":"variableAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"verifiedNode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061407c806100206000396000f3fe6080604052600436106103ac5760003560e01c806372dc731b116101e7578063ba41b0c61161010d578063e02b7ad1116100a0578063eb1528351161006f578063eb15283514610a86578063edf501ad14610aa6578063f0b0799f14610b80578063f73db56714610ba057600080fd5b8063e02b7ad114610a10578063e65a1c2b14610a30578063e985e9c514610a46578063e9e77b1014610a6657600080fd5b8063c87b56dd116100dc578063c87b56dd14610990578063d8b5685a146109b0578063da3ef23f146109d0578063def44aea146109f057600080fd5b8063ba41b0c61461093f578063bf6bbbe414610952578063c1401d3314610965578063c66828621461097b57600080fd5b80639a8eb94811610185578063aba62e1d11610154578063aba62e1d146108d3578063affed0e0146108e9578063b0f809e1146108ff578063b88d4fde1461091f57600080fd5b80639a8eb948146108535780639ae69ad514610873578063a22cb46514610893578063a98f10d2146108b357600080fd5b80637bdd39af116101c15780637bdd39af146107d85780638d6cc56d146107f85780638da5cb5b1461081857806395d89b411461083e57600080fd5b806372dc731b146107955780637501f741146107ac57806378e97925146107c257600080fd5b806336fd69a4116102d757806359e7b58c1161026a5780636817c76c116102395780636817c76c146107345780636c0360eb1461074a5780636e8b0b9f1461075f57806370a082311461077557600080fd5b806359e7b58c146106bd5780635a707823146106dd5780635c975abb146106f35780636352211e1461071457600080fd5b806342966c68116102a657806342966c68146106475780634f435c5514610667578063546529d31461068757806355f804b31461069d57600080fd5b806336fd69a4146105b75780633e40e8d9146105e7578063419238311461060757806342842e0e1461062757600080fd5b80630f0b7a731161034f57806318160ddd1161031e57806318160ddd1461054257806321efa6601461055757806323b872dd146105775780632911da911461059757600080fd5b80630f0b7a73146104cc57806311200d70146104e257806313af403514610502578063155dd5ee1461052257600080fd5b806306fdde031161038b57806306fdde031461043a578063081812fc1461045c578063095ea7b3146104945780630d56f285146104b657600080fd5b8062456379146103b157806301ffc9a7146103da578063022c890e1461040a575b600080fd5b3480156103bd57600080fd5b506103c760015481565b6040519081526020015b60405180910390f35b3480156103e657600080fd5b506103fa6103f5366004612f5b565b610bc0565b60405190151581526020016103d1565b34801561041657600080fd5b506103fa610425366004612f78565b600a6020526000908152604090205460ff1681565b34801561044657600080fd5b5061044f610c12565b6040516103d19190612fe1565b34801561046857600080fd5b5061047c610477366004612f78565b610cad565b6040516001600160a01b0390911681526020016103d1565b3480156104a057600080fd5b506104b46104af366004613010565b610cfa565b005b3480156104c257600080fd5b506103c760105481565b3480156104d857600080fd5b506103c760145481565b3480156104ee57600080fd5b506103c76104fd366004612f78565b610da8565b34801561050e57600080fd5b506104b461051d36600461303a565b610dc2565b34801561052e57600080fd5b506104b461053d366004612f78565b610e34565b34801561054e57600080fd5b506103c7610eca565b34801561056357600080fd5b5060055461047c906001600160a01b031681565b34801561058357600080fd5b506104b4610592366004613055565b610ee9565b3480156105a357600080fd5b506104b46105b2366004613091565b6110ce565b3480156105c357600080fd5b506103fa6105d236600461303a565b60096020526000908152604090205460ff1681565b3480156105f357600080fd5b506104b4610602366004612f78565b6110ea565b34801561061357600080fd5b5060045461047c906001600160a01b031681565b34801561063357600080fd5b506104b4610642366004613055565b6110f7565b34801561065357600080fd5b506104b4610662366004612f78565b611117565b34801561067357600080fd5b506104b46106823660046130c3565b61112c565b34801561069357600080fd5b506103c760115481565b3480156106a957600080fd5b506104b46106b83660046131d5565b611142565b3480156106c957600080fd5b5060025461047c906001600160a01b031681565b3480156106e957600080fd5b506103c760165481565b3480156106ff57600080fd5b506000546103fa90600160b01b900460ff1681565b34801561072057600080fd5b5061047c61072f366004612f78565b61115a565b34801561074057600080fd5b506103c760185481565b34801561075657600080fd5b5061044f611165565b34801561076b57600080fd5b506103c760125481565b34801561078157600080fd5b506103c761079036600461303a565b6111f3565b3480156107a157600080fd5b506103c76201117081565b3480156107b857600080fd5b506103c760175481565b3480156107ce57600080fd5b506103c7600e5481565b3480156107e457600080fd5b506104b46107f3366004613010565b61125b565b34801561080457600080fd5b506104b4610813366004612f78565b611320565b34801561082457600080fd5b5060005461047c906201000090046001600160a01b031681565b34801561084a57600080fd5b5061044f61135f565b34801561085f57600080fd5b5060035461047c906001600160a01b031681565b34801561087f57600080fd5b506104b461088e36600461322c565b611377565b34801561089f57600080fd5b506104b46108ae3660046132f2565b61140b565b3480156108bf57600080fd5b506103c76108ce366004613010565b611488565b3480156108df57600080fd5b506103c760155481565b3480156108f557600080fd5b506103c760065481565b34801561090b57600080fd5b506104b461091a366004613477565b6114ad565b34801561092b57600080fd5b506104b461093a366004613562565b611834565b6104b461094d366004613628565b611878565b6104b4610960366004613673565b611bab565b34801561097157600080fd5b506103c760135481565b34801561098757600080fd5b5061044f611edf565b34801561099c57600080fd5b5061044f6109ab366004612f78565b611eec565b3480156109bc57600080fd5b506104b46109cb366004613728565b611fcc565b3480156109dc57600080fd5b506104b46109eb3660046131d5565b611ff2565b3480156109fc57600080fd5b506104b4610a0b366004613745565b612006565b348015610a1c57600080fd5b506104b4610a2b3660046132f2565b61211e565b348015610a3c57600080fd5b506103c7600f5481565b348015610a5257600080fd5b506103fa610a613660046137b0565b612175565b348015610a7257600080fd5b506104b4610a813660046137e3565b6121b2565b348015610a9257600080fd5b506104b4610aa1366004613091565b612213565b348015610ab257600080fd5b50610b2a610ac1366004612f78565b6007602052600090815260409020546001600160801b0381169060ff600160801b8204811691600160881b8104821691600160901b820481169163ffffffff600160981b8204811692600160b81b8304821692600160d81b810490921691600160f81b90041688565b604080516001600160801b03909916895260ff97881660208a015295871695880195909552928516606087015263ffffffff9182166080870152811660a08601521660c08401521660e0820152610100016103d1565b348015610b8c57600080fd5b506104b4610b9b36600461381d565b61222f565b348015610bac57600080fd5b506104b4610bbb36600461386d565b6125d6565b60006301ffc9a760e01b6001600160e01b031983161480610bf157506380ac58cd60e01b6001600160e01b03198316145b80610c0c5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610c1c61264e565b6002018054610c2a906138b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610c56906138b8565b8015610ca35780601f10610c7857610100808354040283529160200191610ca3565b820191906000526020600020905b815481529060010190602001808311610c8657829003601f168201915b5050505050905090565b6000610cb882612672565b610cd5576040516333d1c03960e21b815260040160405180910390fd5b610cdd61264e565b60009283526006016020525060409020546001600160a01b031690565b6000610d058261115a565b9050336001600160a01b03821614610d3e57610d218133612175565b610d3e576040516367d9dca160e11b815260040160405180910390fd5b82610d4761264e565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b600081815260086020526040812054610c0c906001613908565b610dca6126ae565b6000805462010000600160b01b031916620100006001600160a01b0384811682029290921792839055604080513381529190930490911660208201527fe2c7d1c4da37855e682bde14f17826d185497973b73fba7554daa6da467058d9910160405180910390a150565b610e3c6126ae565b600080546040516001600160a01b036201000090920491909116914780156108fc02929091818181858888f19350505050158015610e7e573d6000803e3d6000fd5b50600054604051828152620100009091046001600160a01b0316907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a250565b600080610ed561264e565b60010154610ee161264e565b540303919050565b6000610ef482612703565b9050836001600160a01b0316816001600160a01b031614610f275760405162a1148160e81b815260040160405180910390fd5b600080610f338461278f565b91509150610f588187610f433390565b6001600160a01b039081169116811491141790565b610f8357610f668633612175565b610f8357604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610faa57604051633a954ecd60e21b815260040160405180910390fd5b8015610fb557600082555b610fbd61264e565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610fe961264e565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761102061264e565b60008681526004919091016020526040812091909155600160e11b84169003611096576001840161104f61264e565b6000828152600491909101602052604081205490036110945761107061264e565b548114611094578361108061264e565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b031660008051602061400783398151915260405160405180910390a45b505050505050565b6110d66126ae565b601693909355601391909155601455601555565b6110f26126ae565b600155565b61111283838360405180602001604052806000815250611834565b505050565b611120816127b7565b611129816127e8565b50565b6111346126ae565b600e92909255601755601855565b61114a6126ae565b600c6111568282613961565b5050565b6000610c0c82612703565b600c8054611172906138b8565b80601f016020809104026020016040519081016040528092919081815260200182805461119e906138b8565b80156111eb5780601f106111c0576101008083540402835291602001916111eb565b820191906000526020600020905b8154815290600101906020018083116111ce57829003601f168201915b505050505081565b60006001600160a01b03821661121c576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b0361122c61264e565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b6112636126ae565b8060000361128c57600280546001600160a01b0384166001600160a01b03199091161790555050565b806001036112b557600380546001600160a01b0384166001600160a01b03199091161790555050565b806002036112de57600480546001600160a01b0384166001600160a01b03199091161790555050565b8060030361130757600580546001600160a01b0384166001600160a01b03199091161790555050565b604051632a71953160e01b815260040160405180910390fd5b6113286126ae565b601881905560405181815233907f64e6e7bd72b853c4e62fd6ceaca05a104700c70a4cb567c75c7f2242ba7f037c90602001610ebf565b606061136961264e565b6003018054610c2a906138b8565b80516000036113cd5760405162461bcd60e51b815260206004820152601960248201527f4c553a204c656e6774682063616e6e6f74206265207a65726f0000000000000060448201526064015b60405180910390fd5b60005b8151811015611405576113fd84848484815181106113f0576113f0613a20565b60200260200101516110f7565b6001016113d0565b50505050565b8061141461264e565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600b60205281600052604060002081600381106114a457600080fd5b01549150829050565b60008051602061402783398151915254610100900460ff166114e2576000805160206140278339815191525460ff16156114e6565b303b155b6115585760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016113c4565b60008051602061402783398151915254610100900460ff1615801561159457600080516020614027833981519152805461ffff19166101011790555b600054610100900460ff16158080156115b45750600054600160ff909116105b806115ce5750303b1580156115ce575060005460ff166001145b6116315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016113c4565b6000805460ff191660011790558015611654576000805461ff0019166101001790555b61165e85856127f3565b6000805462010000600160b01b031916620100006001600160a01b038c1602179055600c61168c8782613961565b506001889055600d61169e8482613961565b5060005b87518110156117c3578781815181106116bd576116bd613a20565b6020908102919091018101516000838152600783526040908190208251815494840151928401516060850151608086015160a087015160c088015160e0909801516001600160801b039095166001600160881b031990991698909817600160801b60ff978816021761ffff60881b1916600160881b9387169390930260ff60901b191692909217600160901b918616919091021767ffffffffffffffff60981b1916600160981b63ffffffff9283160263ffffffff60b81b191617600160b81b96821696909602959095176001600160d81b0316600160d81b95909416949094026001600160f81b031692909217600160f81b91909316029190911790556001016116a2565b50801561180a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50801561182a57600080516020614027833981519152805461ff00191690555b5050505050505050565b61183f848484610ee9565b6001600160a01b0383163b156114055761185b84848484612831565b611405576040516368d2bf6b60e11b815260040160405180910390fd5b61188061291d565b82611889612948565b6118939190613908565b60015410156118b55760405163393ff8f760e21b815260040160405180910390fd5b600e54421180156118c85750600f544211155b156119cf576012546040516bffffffffffffffffffffffff193360601b1660208201526119139184918491906034015b60405160208183030381529060405280519060200120612958565b1515600003611935576040516309bde33960e01b815260040160405180910390fd5b601054336000908152600b6020526040902054611953908590613908565b11156119715760405162461bcd60e51b81526004016113c490613a36565b60115461197e9084613a65565b341461199c5760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b60205260409020546119b7908490613908565b336000908152600b60205260408120905b0155611ba1565b600f54421180156119e257506013544211155b15611ad6576016546040516bffffffffffffffffffffffff193360601b166020820152611a169184918491906034016118f8565b1515600003611a38576040516309bde33960e01b815260040160405180910390fd5b601454336000908152600b6020526040902060010154611a59908590613908565b1115611a775760405162461bcd60e51b81526004016113c490613a36565b601554611a849084613a65565b3414611aa25760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b6020526040902060010154611ac0908490613908565b336000908152600b6020526040902060016119c8565b601354421115611b7e57601754336000908152600b6020526040902060020154611b01908590613908565b1115611b1f5760405162461bcd60e51b81526004016113c490613a36565b601854611b2c9084613a65565b3414611b4a5760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b6020526040902060020154611b68908490613908565b336000908152600b6020526040902060026119c8565b600e54421015611ba1576040516316851a3760e11b815260040160405180910390fd5b6111123384612970565b611bb83a62011170613a65565b341015611bd85760405163390e190360e21b815260040160405180910390fd5b611be1886127b7565b6000888152600860209081526040808320548084526007909252918290206002548154935163079cc67960e41b81523360048201526001600160801b039094166024850152919290916001600160a01b0316906379cc6790906044016020604051808303816000875af1158015611c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c809190613aac565b508054600160801b900460ff168714611cab5760405162461bcd60e51b81526004016113c490613ac9565b6003546040516389af610760e01b81526001600160a01b03909116906389af610790611cdf9033908c908c90600401613b00565b6020604051808303816000875af1158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d229190613aac565b506003821115611dcf578054600160901b900460ff168314611d565760405162461bcd60e51b81526004016113c490613ac9565b6005546040516389af610760e01b81526001600160a01b03909116906389af610790611d8a90339088908890600401613b00565b6020604051808303816000875af1158015611da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dcd9190613aac565b505b888015611ddc5750600582105b15611e83578054600160881b900460ff168514611e0b5760405162461bcd60e51b81526004016113c490613ac9565b600480546040516389af610760e01b81526001600160a01b03909116916389af610791611e3e9133918b918b9101613b00565b6020604051808303816000875af1158015611e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e819190613aac565b505b600680547fb91d6783977d09daa34b132816a8bfab318f4b737c017b4700770afd4aa095b6916000611eb483613b4a565b91905055338c8c604051611ecb9493929190613b63565b60405180910390a150505050505050505050565b600d8054611172906138b8565b6060611ef782612672565b611f5b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016113c4565b6000611f6561298a565b90506000815111611f855760405180602001604052806000815250611fc5565b80611f97611f9285610da8565b612999565b611fa085612999565b600d604051602001611fb59493929190613b89565b6040516020818303038152906040525b9392505050565b611fd46126ae565b60008054911515600160b01b0260ff60b01b19909216919091179055565b611ffa6126ae565b600d6111568282613961565b61200e6126ae565b8281146120535760405162461bcd60e51b8152602060048201526013602482015272098aa748adce8e4d2cae6409ad2e6dac2e8c6d606b1b60448201526064016113c4565b6000805b8481101561208d5783838281811061207157612071613a20565b90506020020135826120839190613908565b9150600101612057565b5080612097612948565b6120a19190613908565b60015410156120c35760405163393ff8f760e21b815260040160405180910390fd5b60005b848110156110c6576121168686838181106120e3576120e3613a20565b90506020020160208101906120f8919061303a565b85858481811061210a5761210a613a20565b90506020020135612970565b6001016120c6565b6121266126ae565b8015612153576001600160a01b0382166000908152600960205260409020805460ff191660011790555050565b506001600160a01b03166000908152600960205260409020805460ff19169055565b600061217f61264e565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6121ba6126ae565b600082815260076020526040902081906121d48282613c78565b905050817f8cf6ad90b5900afe15d010e6f9c68fcd8ca868c6c31e0b8f8f2e00d5a4dd66f9826040516122079190613dec565b60405180910390a25050565b61221b6126ae565b601293909355600f91909155601055601155565b6000858152600a602052604090205460ff16151560010361226357604051634b4d870760e11b815260040160405180910390fd5b61226b612a2b565b836001600160a01b031661227e8461115a565b6001600160a01b0316146122a557604051631022318760e21b815260040160405180910390fd5b6000858152600a60209081526040808320805460ff19166001179055858352600882528083205480845260079092529091208380156122e45750600582105b156124c2576122f7633b9aca0084613ebf565b8154600160981b900463ffffffff1611156124005761232161231a836001613908565b6006612a60565b600086815260086020526040812091909155815460649061235990600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6123639190613efb565b825461237c9190600160981b900463ffffffff16613f1e565b825463ffffffff918216925061239b918391600160b81b900416612a76565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906123f2908a908a908a90600190613b63565b60405180910390a1506125cd565b805460009060649061242990600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6124339190613efb565b825461244c9190600160981b900463ffffffff16613f3b565b825463ffffffff918216925061246b918391600160d81b900416612a60565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906123f2908a908a908a90600090613b63565b6124d0633b9aca0084613ebf565b8154600160981b900463ffffffff1611156124f35761232161231a836001613908565b6000858152600860205260408120819055815460649061252a90600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6125349190613efb565b825461254d9190600160981b900463ffffffff16613f3b565b825463ffffffff918216925061256c918391600160d81b900416612a60565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906125c3908a908a908a90600090613b63565b60405180910390a1505b50505050505050565b806125df612948565b6125e99190613908565b600154101561260b5760405163393ff8f760e21b815260040160405180910390fd5b60005b828110156114055761264684848381811061262b5761262b613a20565b9050602002016020810190612640919061303a565b83612970565b60010161260e565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600061267c61264e565b5482108015610c0c5750600160e01b61269361264e565b60008481526004919091016020526040902054161592915050565b6000546201000090046001600160a01b031633146127015760405162461bcd60e51b815260206004820152601060248201526f262a9d24b73b30b634b21027bbb732b960811b60448201526064016113c4565b565b60008161270e61264e565b5481101561277657600061272061264e565b600083815260049190910160205260408120549150600160e01b82169003612774575b80600003611fc55761275361264e565b60001990920160008181526004939093016020526040909220549050612743565b505b604051636f96cda160e11b815260040160405180910390fd5b600080600061279c61264e565b60009485526006016020525050604090912080549092909150565b336127c18261115a565b6001600160a01b03161461112957604051631022318760e21b815260040160405180910390fd5b611129816000612a85565b60008051602061402783398151915254610100900460ff166128275760405162461bcd60e51b81526004016113c490613f58565b6111568282612beb565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612866903390899088908890600401613fac565b6020604051808303816000875af19250505080156128a1575060408051601f3d908101601f1916820190925261289e91810190613fe9565b60015b6128ff573d8080156128cf576040519150601f19603f3d011682016040523d82523d6000602084013e6128d4565b606091505b5080516000036128f7576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600054600160b01b900460ff16156127015760405163ab35696f60e01b815260040160405180910390fd5b600061295261264e565b54919050565b600082612966868685612c5e565b1495945050505050565b611156828260405180602001604052806000815250612caa565b6060600c8054610c2a906138b8565b606060006129a683612d27565b60010190506000816001600160401b038111156129c5576129c56130ef565b6040519080825280601f01601f1916602001820160405280156129ef576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846129f957509392505050565b3360009081526009602052604090205460ff1615156001146127015760405163690c5a0560e01b815260040160405180910390fd5b6000818310612a6f5781611fc5565b5090919050565b6000818311612a6f5781611fc5565b6000612a9083612703565b905080600080612a9f8661278f565b915091508415612adf57612ab4818433610f43565b612adf57612ac28333612175565b612adf57604051632ce44b5f60e11b815260040160405180910390fd5b8015612aea57600082555b6001600160801b03612afa61264e565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b17600360e01b17612b3361264e565b60008881526004919091016020526040812091909155600160e11b85169003612ba95760018601612b6261264e565b600082815260049190910160205260408120549003612ba757612b8361264e565b548114612ba75784612b9361264e565b600083815260049190910160205260409020555b505b60405186906000906001600160a01b03861690600080516020614007833981519152908390a4612bd761264e565b600190810180549091019055505050505050565b60008051602061402783398151915254610100900460ff16612c1f5760405162461bcd60e51b81526004016113c490613f58565b81612c2861264e565b60020190612c369082613961565b5080612c4061264e565b60030190612c4e9082613961565b506000612c5961264e565b555050565b600081815b84811015612ca157612c8d82878784818110612c8157612c81613a20565b90506020020135612dff565b915080612c9981613b4a565b915050612c63565b50949350505050565b612cb48383612e2e565b6001600160a01b0383163b15611112576000612cce61264e565b5490508281035b612ce86000868380600101945086612831565b612d05576040516368d2bf6b60e11b815260040160405180910390fd5b818110612cd55781612d1561264e565b5414612d2057600080fd5b5050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d665772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612d92576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612db057662386f26fc10000830492506010015b6305f5e1008310612dc8576305f5e100830492506008015b6127108310612ddc57612710830492506004015b60648310612dee576064830492506002015b600a8310610c0c5760010192915050565b6000818310612e1b576000828152602084905260409020611fc5565b6000838152602083905260409020611fc5565b6000612e3861264e565b5490506000829003612e5d5760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202612e7161264e565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612eac61264e565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083906000805160206140078339815191528180a4600183015b818114612f125780836000600080516020614007833981519152600080a4600101612eec565b5081600003612f3357604051622e076360e81b815260040160405180910390fd5b80612f3c61264e565b55506111129050565b6001600160e01b03198116811461112957600080fd5b600060208284031215612f6d57600080fd5b8135611fc581612f45565b600060208284031215612f8a57600080fd5b5035919050565b60005b83811015612fac578181015183820152602001612f94565b50506000910152565b60008151808452612fcd816020860160208601612f91565b601f01601f19169290920160200192915050565b602081526000611fc56020830184612fb5565b80356001600160a01b038116811461300b57600080fd5b919050565b6000806040838503121561302357600080fd5b61302c83612ff4565b946020939093013593505050565b60006020828403121561304c57600080fd5b611fc582612ff4565b60008060006060848603121561306a57600080fd5b61307384612ff4565b925061308160208501612ff4565b9150604084013590509250925092565b600080600080608085870312156130a757600080fd5b5050823594602084013594506040840135936060013592509050565b6000806000606084860312156130d857600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715613128576131286130ef565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613156576131566130ef565b604052919050565b60006001600160401b03831115613177576131776130ef565b61318a601f8401601f191660200161312e565b905082815283838301111561319e57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126131c657600080fd5b611fc58383356020850161315e565b6000602082840312156131e757600080fd5b81356001600160401b038111156131fd57600080fd5b612915848285016131b5565b60006001600160401b03821115613222576132226130ef565b5060051b60200190565b60008060006060848603121561324157600080fd5b61324a84612ff4565b92506020613259818601612ff4565b925060408501356001600160401b0381111561327457600080fd5b8501601f8101871361328557600080fd5b803561329861329382613209565b61312e565b81815260059190911b820183019083810190898311156132b757600080fd5b928401925b828410156132d5578335825292840192908401906132bc565b80955050505050509250925092565b801515811461112957600080fd5b6000806040838503121561330557600080fd5b61330e83612ff4565b9150602083013561331e816132e4565b809150509250929050565b6001600160801b038116811461112957600080fd5b60ff8116811461112957600080fd5b803561300b8161333e565b63ffffffff8116811461112957600080fd5b803561300b81613358565b600082601f83011261338657600080fd5b8135602061339661329383613209565b82815260089290921b840181019181810190868411156133b557600080fd5b8286015b8481101561346c5761010081890312156133d35760008081fd5b6133db613105565b81356133e681613329565b81526133f382860161334d565b85820152604061340481840161334d565b90820152606061341583820161334d565b90820152608061342683820161336a565b9082015260a061343783820161336a565b9082015260c061344883820161336a565b9082015260e061345983820161334d565b90820152835291830191610100016133b9565b509695505050505050565b600080600080600080600060e0888a03121561349257600080fd5b61349b88612ff4565b96506020880135955060408801356001600160401b03808211156134be57600080fd5b6134ca8b838c01613375565b965060608a01359150808211156134e057600080fd5b6134ec8b838c016131b5565b955060808a013591508082111561350257600080fd5b61350e8b838c016131b5565b945060a08a013591508082111561352457600080fd5b6135308b838c016131b5565b935060c08a013591508082111561354657600080fd5b506135538a828b016131b5565b91505092959891949750929550565b6000806000806080858703121561357857600080fd5b61358185612ff4565b935061358f60208601612ff4565b92506040850135915060608501356001600160401b038111156135b157600080fd5b8501601f810187136135c257600080fd5b6135d18782356020840161315e565b91505092959194509250565b60008083601f8401126135ef57600080fd5b5081356001600160401b0381111561360657600080fd5b6020830191508360208260051b850101111561362157600080fd5b9250929050565b60008060006040848603121561363d57600080fd5b8335925060208401356001600160401b0381111561365a57600080fd5b613666868287016135dd565b9497909650939450505050565b60008060008060008060008060a0898b03121561368f57600080fd5b8835975060208901356136a1816132e4565b965060408901356001600160401b03808211156136bd57600080fd5b6136c98c838d016135dd565b909850965060608b01359150808211156136e257600080fd5b6136ee8c838d016135dd565b909650945060808b013591508082111561370757600080fd5b506137148b828c016135dd565b999c989b5096995094979396929594505050565b60006020828403121561373a57600080fd5b8135611fc5816132e4565b6000806000806040858703121561375b57600080fd5b84356001600160401b038082111561377257600080fd5b61377e888389016135dd565b9096509450602087013591508082111561379757600080fd5b506137a4878288016135dd565b95989497509550505050565b600080604083850312156137c357600080fd5b6137cc83612ff4565b91506137da60208401612ff4565b90509250929050565b6000808284036101208112156137f857600080fd5b83359250610100601f198201121561380f57600080fd5b506020830190509250929050565b600080600080600060a0868803121561383557600080fd5b8535945061384560208701612ff4565b935060408601359250606086013561385c816132e4565b949793965091946080013592915050565b60008060006040848603121561388257600080fd5b83356001600160401b0381111561389857600080fd5b6138a4868287016135dd565b909790965060209590950135949350505050565b600181811c908216806138cc57607f821691505b6020821081036138ec57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c0c57610c0c6138f2565b601f82111561111257600081815260208120601f850160051c810160208610156139425750805b601f850160051c820191505b818110156110c65782815560010161394e565b81516001600160401b0381111561397a5761397a6130ef565b61398e8161398884546138b8565b8461391b565b602080601f8311600181146139c357600084156139ab5750858301515b600019600386901b1c1916600185901b1785556110c6565b600085815260208120601f198616915b828110156139f2578886015182559484019460019091019084016139d3565b5085821015613a105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60208082526015908201527413154e88135a5b9d08131a5b5a5d08115e18d95959605a1b604082015260600190565b8082028115828204841417610c0c57610c0c6138f2565b6020808252601690820152751315480e88125b9cdd59999a58da595b9d08119d5b9960521b604082015260600190565b600060208284031215613abe57600080fd5b8151611fc5816132e4565b60208082526018908201527f4c553a20556e7375636365737366756c20557067726164650000000000000000604082015260600190565b6001600160a01b0384168152604060208201819052810182905260006001600160fb1b03831115613b3057600080fd5b8260051b8085606085013791909101606001949350505050565b600060018201613b5c57613b5c6138f2565b5060010190565b9384526001600160a01b0392909216602084015260408301521515606082015260800190565b600085516020613b9c8285838b01612f91565b8184019150602f60f81b80835260018851613bbc81838701868d01612f91565b8085019450508181850152600291508751613bdc81848701868c01612f91565b8754940193600090613bed816138b8565b8184168015613c035760018114613c1c57613c4c565b60ff198316888701528115158202880186019350613c4c565b8a6000528660002060005b83811015613c425781548a8201890152908601908801613c27565b5050858289010193505b50919c9b505050505050505050505050565b60008135610c0c8161333e565b60008135610c0c81613358565b8135613c8381613329565b6001600160801b03811690508154816001600160801b031982161783556020840135613cae8161333e565b6001600160881b03199190911690911760809190911b60ff60801b161781556040820135613cdb8161333e565b815460ff60881b1916608882901b60ff60881b1617825550613d20613d0260608401613c5e565b82805460ff60901b191660909290921b60ff60901b16919091179055565b613d53613d2f60808401613c6b565b82805463ffffffff60981b191660989290921b63ffffffff60981b16919091179055565b613d86613d6260a08401613c6b565b82805463ffffffff60b81b191660b89290921b63ffffffff60b81b16919091179055565b613db9613d9560c08401613c6b565b82805463ffffffff60d81b191660d89290921b63ffffffff60d81b16919091179055565b611156613dc860e08401613c5e565b8280546001600160f81b031660f89290921b6001600160f81b031916919091179055565b61010081018235613dfc81613329565b6001600160801b031682526020830135613e158161333e565b60ff1660208301526040830135613e2b8161333e565b60ff166040830152613e3f6060840161334d565b60ff166060830152613e536080840161336a565b63ffffffff166080830152613e6a60a0840161336a565b63ffffffff1660a0830152613e8160c0840161336a565b63ffffffff1660c0830152613e9860e0840161334d565b60ff811660e08401525b5092915050565b634e487b7160e01b600052601260045260246000fd5b600082613ece57613ece613ea9565b500690565b63ffffffff818116838216028082169190828114613ef357613ef36138f2565b505092915050565b600063ffffffff80841680613f1257613f12613ea9565b92169190910492915050565b63ffffffff828116828216039080821115613ea257613ea26138f2565b63ffffffff818116838216019080821115613ea257613ea26138f2565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613fdf90830184612fb5565b9695505050505050565b600060208284031215613ffb57600080fd5b8151611fc581612f4556feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212208c09e584166afda6c0ec7ec578cce0f309d0535589bb9247756d0f20ee27713264736f6c63430008110033

Deployed Bytecode

0x6080604052600436106103ac5760003560e01c806372dc731b116101e7578063ba41b0c61161010d578063e02b7ad1116100a0578063eb1528351161006f578063eb15283514610a86578063edf501ad14610aa6578063f0b0799f14610b80578063f73db56714610ba057600080fd5b8063e02b7ad114610a10578063e65a1c2b14610a30578063e985e9c514610a46578063e9e77b1014610a6657600080fd5b8063c87b56dd116100dc578063c87b56dd14610990578063d8b5685a146109b0578063da3ef23f146109d0578063def44aea146109f057600080fd5b8063ba41b0c61461093f578063bf6bbbe414610952578063c1401d3314610965578063c66828621461097b57600080fd5b80639a8eb94811610185578063aba62e1d11610154578063aba62e1d146108d3578063affed0e0146108e9578063b0f809e1146108ff578063b88d4fde1461091f57600080fd5b80639a8eb948146108535780639ae69ad514610873578063a22cb46514610893578063a98f10d2146108b357600080fd5b80637bdd39af116101c15780637bdd39af146107d85780638d6cc56d146107f85780638da5cb5b1461081857806395d89b411461083e57600080fd5b806372dc731b146107955780637501f741146107ac57806378e97925146107c257600080fd5b806336fd69a4116102d757806359e7b58c1161026a5780636817c76c116102395780636817c76c146107345780636c0360eb1461074a5780636e8b0b9f1461075f57806370a082311461077557600080fd5b806359e7b58c146106bd5780635a707823146106dd5780635c975abb146106f35780636352211e1461071457600080fd5b806342966c68116102a657806342966c68146106475780634f435c5514610667578063546529d31461068757806355f804b31461069d57600080fd5b806336fd69a4146105b75780633e40e8d9146105e7578063419238311461060757806342842e0e1461062757600080fd5b80630f0b7a731161034f57806318160ddd1161031e57806318160ddd1461054257806321efa6601461055757806323b872dd146105775780632911da911461059757600080fd5b80630f0b7a73146104cc57806311200d70146104e257806313af403514610502578063155dd5ee1461052257600080fd5b806306fdde031161038b57806306fdde031461043a578063081812fc1461045c578063095ea7b3146104945780630d56f285146104b657600080fd5b8062456379146103b157806301ffc9a7146103da578063022c890e1461040a575b600080fd5b3480156103bd57600080fd5b506103c760015481565b6040519081526020015b60405180910390f35b3480156103e657600080fd5b506103fa6103f5366004612f5b565b610bc0565b60405190151581526020016103d1565b34801561041657600080fd5b506103fa610425366004612f78565b600a6020526000908152604090205460ff1681565b34801561044657600080fd5b5061044f610c12565b6040516103d19190612fe1565b34801561046857600080fd5b5061047c610477366004612f78565b610cad565b6040516001600160a01b0390911681526020016103d1565b3480156104a057600080fd5b506104b46104af366004613010565b610cfa565b005b3480156104c257600080fd5b506103c760105481565b3480156104d857600080fd5b506103c760145481565b3480156104ee57600080fd5b506103c76104fd366004612f78565b610da8565b34801561050e57600080fd5b506104b461051d36600461303a565b610dc2565b34801561052e57600080fd5b506104b461053d366004612f78565b610e34565b34801561054e57600080fd5b506103c7610eca565b34801561056357600080fd5b5060055461047c906001600160a01b031681565b34801561058357600080fd5b506104b4610592366004613055565b610ee9565b3480156105a357600080fd5b506104b46105b2366004613091565b6110ce565b3480156105c357600080fd5b506103fa6105d236600461303a565b60096020526000908152604090205460ff1681565b3480156105f357600080fd5b506104b4610602366004612f78565b6110ea565b34801561061357600080fd5b5060045461047c906001600160a01b031681565b34801561063357600080fd5b506104b4610642366004613055565b6110f7565b34801561065357600080fd5b506104b4610662366004612f78565b611117565b34801561067357600080fd5b506104b46106823660046130c3565b61112c565b34801561069357600080fd5b506103c760115481565b3480156106a957600080fd5b506104b46106b83660046131d5565b611142565b3480156106c957600080fd5b5060025461047c906001600160a01b031681565b3480156106e957600080fd5b506103c760165481565b3480156106ff57600080fd5b506000546103fa90600160b01b900460ff1681565b34801561072057600080fd5b5061047c61072f366004612f78565b61115a565b34801561074057600080fd5b506103c760185481565b34801561075657600080fd5b5061044f611165565b34801561076b57600080fd5b506103c760125481565b34801561078157600080fd5b506103c761079036600461303a565b6111f3565b3480156107a157600080fd5b506103c76201117081565b3480156107b857600080fd5b506103c760175481565b3480156107ce57600080fd5b506103c7600e5481565b3480156107e457600080fd5b506104b46107f3366004613010565b61125b565b34801561080457600080fd5b506104b4610813366004612f78565b611320565b34801561082457600080fd5b5060005461047c906201000090046001600160a01b031681565b34801561084a57600080fd5b5061044f61135f565b34801561085f57600080fd5b5060035461047c906001600160a01b031681565b34801561087f57600080fd5b506104b461088e36600461322c565b611377565b34801561089f57600080fd5b506104b46108ae3660046132f2565b61140b565b3480156108bf57600080fd5b506103c76108ce366004613010565b611488565b3480156108df57600080fd5b506103c760155481565b3480156108f557600080fd5b506103c760065481565b34801561090b57600080fd5b506104b461091a366004613477565b6114ad565b34801561092b57600080fd5b506104b461093a366004613562565b611834565b6104b461094d366004613628565b611878565b6104b4610960366004613673565b611bab565b34801561097157600080fd5b506103c760135481565b34801561098757600080fd5b5061044f611edf565b34801561099c57600080fd5b5061044f6109ab366004612f78565b611eec565b3480156109bc57600080fd5b506104b46109cb366004613728565b611fcc565b3480156109dc57600080fd5b506104b46109eb3660046131d5565b611ff2565b3480156109fc57600080fd5b506104b4610a0b366004613745565b612006565b348015610a1c57600080fd5b506104b4610a2b3660046132f2565b61211e565b348015610a3c57600080fd5b506103c7600f5481565b348015610a5257600080fd5b506103fa610a613660046137b0565b612175565b348015610a7257600080fd5b506104b4610a813660046137e3565b6121b2565b348015610a9257600080fd5b506104b4610aa1366004613091565b612213565b348015610ab257600080fd5b50610b2a610ac1366004612f78565b6007602052600090815260409020546001600160801b0381169060ff600160801b8204811691600160881b8104821691600160901b820481169163ffffffff600160981b8204811692600160b81b8304821692600160d81b810490921691600160f81b90041688565b604080516001600160801b03909916895260ff97881660208a015295871695880195909552928516606087015263ffffffff9182166080870152811660a08601521660c08401521660e0820152610100016103d1565b348015610b8c57600080fd5b506104b4610b9b36600461381d565b61222f565b348015610bac57600080fd5b506104b4610bbb36600461386d565b6125d6565b60006301ffc9a760e01b6001600160e01b031983161480610bf157506380ac58cd60e01b6001600160e01b03198316145b80610c0c5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610c1c61264e565b6002018054610c2a906138b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610c56906138b8565b8015610ca35780601f10610c7857610100808354040283529160200191610ca3565b820191906000526020600020905b815481529060010190602001808311610c8657829003601f168201915b5050505050905090565b6000610cb882612672565b610cd5576040516333d1c03960e21b815260040160405180910390fd5b610cdd61264e565b60009283526006016020525060409020546001600160a01b031690565b6000610d058261115a565b9050336001600160a01b03821614610d3e57610d218133612175565b610d3e576040516367d9dca160e11b815260040160405180910390fd5b82610d4761264e565b6000848152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b600081815260086020526040812054610c0c906001613908565b610dca6126ae565b6000805462010000600160b01b031916620100006001600160a01b0384811682029290921792839055604080513381529190930490911660208201527fe2c7d1c4da37855e682bde14f17826d185497973b73fba7554daa6da467058d9910160405180910390a150565b610e3c6126ae565b600080546040516001600160a01b036201000090920491909116914780156108fc02929091818181858888f19350505050158015610e7e573d6000803e3d6000fd5b50600054604051828152620100009091046001600160a01b0316907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a250565b600080610ed561264e565b60010154610ee161264e565b540303919050565b6000610ef482612703565b9050836001600160a01b0316816001600160a01b031614610f275760405162a1148160e81b815260040160405180910390fd5b600080610f338461278f565b91509150610f588187610f433390565b6001600160a01b039081169116811491141790565b610f8357610f668633612175565b610f8357604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610faa57604051633a954ecd60e21b815260040160405180910390fd5b8015610fb557600082555b610fbd61264e565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610fe961264e565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761102061264e565b60008681526004919091016020526040812091909155600160e11b84169003611096576001840161104f61264e565b6000828152600491909101602052604081205490036110945761107061264e565b548114611094578361108061264e565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b031660008051602061400783398151915260405160405180910390a45b505050505050565b6110d66126ae565b601693909355601391909155601455601555565b6110f26126ae565b600155565b61111283838360405180602001604052806000815250611834565b505050565b611120816127b7565b611129816127e8565b50565b6111346126ae565b600e92909255601755601855565b61114a6126ae565b600c6111568282613961565b5050565b6000610c0c82612703565b600c8054611172906138b8565b80601f016020809104026020016040519081016040528092919081815260200182805461119e906138b8565b80156111eb5780601f106111c0576101008083540402835291602001916111eb565b820191906000526020600020905b8154815290600101906020018083116111ce57829003601f168201915b505050505081565b60006001600160a01b03821661121c576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b0361122c61264e565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b6112636126ae565b8060000361128c57600280546001600160a01b0384166001600160a01b03199091161790555050565b806001036112b557600380546001600160a01b0384166001600160a01b03199091161790555050565b806002036112de57600480546001600160a01b0384166001600160a01b03199091161790555050565b8060030361130757600580546001600160a01b0384166001600160a01b03199091161790555050565b604051632a71953160e01b815260040160405180910390fd5b6113286126ae565b601881905560405181815233907f64e6e7bd72b853c4e62fd6ceaca05a104700c70a4cb567c75c7f2242ba7f037c90602001610ebf565b606061136961264e565b6003018054610c2a906138b8565b80516000036113cd5760405162461bcd60e51b815260206004820152601960248201527f4c553a204c656e6774682063616e6e6f74206265207a65726f0000000000000060448201526064015b60405180910390fd5b60005b8151811015611405576113fd84848484815181106113f0576113f0613a20565b60200260200101516110f7565b6001016113d0565b50505050565b8061141461264e565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600b60205281600052604060002081600381106114a457600080fd5b01549150829050565b60008051602061402783398151915254610100900460ff166114e2576000805160206140278339815191525460ff16156114e6565b303b155b6115585760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016113c4565b60008051602061402783398151915254610100900460ff1615801561159457600080516020614027833981519152805461ffff19166101011790555b600054610100900460ff16158080156115b45750600054600160ff909116105b806115ce5750303b1580156115ce575060005460ff166001145b6116315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016113c4565b6000805460ff191660011790558015611654576000805461ff0019166101001790555b61165e85856127f3565b6000805462010000600160b01b031916620100006001600160a01b038c1602179055600c61168c8782613961565b506001889055600d61169e8482613961565b5060005b87518110156117c3578781815181106116bd576116bd613a20565b6020908102919091018101516000838152600783526040908190208251815494840151928401516060850151608086015160a087015160c088015160e0909801516001600160801b039095166001600160881b031990991698909817600160801b60ff978816021761ffff60881b1916600160881b9387169390930260ff60901b191692909217600160901b918616919091021767ffffffffffffffff60981b1916600160981b63ffffffff9283160263ffffffff60b81b191617600160b81b96821696909602959095176001600160d81b0316600160d81b95909416949094026001600160f81b031692909217600160f81b91909316029190911790556001016116a2565b50801561180a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50801561182a57600080516020614027833981519152805461ff00191690555b5050505050505050565b61183f848484610ee9565b6001600160a01b0383163b156114055761185b84848484612831565b611405576040516368d2bf6b60e11b815260040160405180910390fd5b61188061291d565b82611889612948565b6118939190613908565b60015410156118b55760405163393ff8f760e21b815260040160405180910390fd5b600e54421180156118c85750600f544211155b156119cf576012546040516bffffffffffffffffffffffff193360601b1660208201526119139184918491906034015b60405160208183030381529060405280519060200120612958565b1515600003611935576040516309bde33960e01b815260040160405180910390fd5b601054336000908152600b6020526040902054611953908590613908565b11156119715760405162461bcd60e51b81526004016113c490613a36565b60115461197e9084613a65565b341461199c5760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b60205260409020546119b7908490613908565b336000908152600b60205260408120905b0155611ba1565b600f54421180156119e257506013544211155b15611ad6576016546040516bffffffffffffffffffffffff193360601b166020820152611a169184918491906034016118f8565b1515600003611a38576040516309bde33960e01b815260040160405180910390fd5b601454336000908152600b6020526040902060010154611a59908590613908565b1115611a775760405162461bcd60e51b81526004016113c490613a36565b601554611a849084613a65565b3414611aa25760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b6020526040902060010154611ac0908490613908565b336000908152600b6020526040902060016119c8565b601354421115611b7e57601754336000908152600b6020526040902060020154611b01908590613908565b1115611b1f5760405162461bcd60e51b81526004016113c490613a36565b601854611b2c9084613a65565b3414611b4a5760405162461bcd60e51b81526004016113c490613a7c565b336000908152600b6020526040902060020154611b68908490613908565b336000908152600b6020526040902060026119c8565b600e54421015611ba1576040516316851a3760e11b815260040160405180910390fd5b6111123384612970565b611bb83a62011170613a65565b341015611bd85760405163390e190360e21b815260040160405180910390fd5b611be1886127b7565b6000888152600860209081526040808320548084526007909252918290206002548154935163079cc67960e41b81523360048201526001600160801b039094166024850152919290916001600160a01b0316906379cc6790906044016020604051808303816000875af1158015611c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c809190613aac565b508054600160801b900460ff168714611cab5760405162461bcd60e51b81526004016113c490613ac9565b6003546040516389af610760e01b81526001600160a01b03909116906389af610790611cdf9033908c908c90600401613b00565b6020604051808303816000875af1158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d229190613aac565b506003821115611dcf578054600160901b900460ff168314611d565760405162461bcd60e51b81526004016113c490613ac9565b6005546040516389af610760e01b81526001600160a01b03909116906389af610790611d8a90339088908890600401613b00565b6020604051808303816000875af1158015611da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dcd9190613aac565b505b888015611ddc5750600582105b15611e83578054600160881b900460ff168514611e0b5760405162461bcd60e51b81526004016113c490613ac9565b600480546040516389af610760e01b81526001600160a01b03909116916389af610791611e3e9133918b918b9101613b00565b6020604051808303816000875af1158015611e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e819190613aac565b505b600680547fb91d6783977d09daa34b132816a8bfab318f4b737c017b4700770afd4aa095b6916000611eb483613b4a565b91905055338c8c604051611ecb9493929190613b63565b60405180910390a150505050505050505050565b600d8054611172906138b8565b6060611ef782612672565b611f5b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016113c4565b6000611f6561298a565b90506000815111611f855760405180602001604052806000815250611fc5565b80611f97611f9285610da8565b612999565b611fa085612999565b600d604051602001611fb59493929190613b89565b6040516020818303038152906040525b9392505050565b611fd46126ae565b60008054911515600160b01b0260ff60b01b19909216919091179055565b611ffa6126ae565b600d6111568282613961565b61200e6126ae565b8281146120535760405162461bcd60e51b8152602060048201526013602482015272098aa748adce8e4d2cae6409ad2e6dac2e8c6d606b1b60448201526064016113c4565b6000805b8481101561208d5783838281811061207157612071613a20565b90506020020135826120839190613908565b9150600101612057565b5080612097612948565b6120a19190613908565b60015410156120c35760405163393ff8f760e21b815260040160405180910390fd5b60005b848110156110c6576121168686838181106120e3576120e3613a20565b90506020020160208101906120f8919061303a565b85858481811061210a5761210a613a20565b90506020020135612970565b6001016120c6565b6121266126ae565b8015612153576001600160a01b0382166000908152600960205260409020805460ff191660011790555050565b506001600160a01b03166000908152600960205260409020805460ff19169055565b600061217f61264e565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6121ba6126ae565b600082815260076020526040902081906121d48282613c78565b905050817f8cf6ad90b5900afe15d010e6f9c68fcd8ca868c6c31e0b8f8f2e00d5a4dd66f9826040516122079190613dec565b60405180910390a25050565b61221b6126ae565b601293909355600f91909155601055601155565b6000858152600a602052604090205460ff16151560010361226357604051634b4d870760e11b815260040160405180910390fd5b61226b612a2b565b836001600160a01b031661227e8461115a565b6001600160a01b0316146122a557604051631022318760e21b815260040160405180910390fd5b6000858152600a60209081526040808320805460ff19166001179055858352600882528083205480845260079092529091208380156122e45750600582105b156124c2576122f7633b9aca0084613ebf565b8154600160981b900463ffffffff1611156124005761232161231a836001613908565b6006612a60565b600086815260086020526040812091909155815460649061235990600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6123639190613efb565b825461237c9190600160981b900463ffffffff16613f1e565b825463ffffffff918216925061239b918391600160b81b900416612a76565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906123f2908a908a908a90600190613b63565b60405180910390a1506125cd565b805460009060649061242990600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6124339190613efb565b825461244c9190600160981b900463ffffffff16613f3b565b825463ffffffff918216925061246b918391600160d81b900416612a60565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906123f2908a908a908a90600090613b63565b6124d0633b9aca0084613ebf565b8154600160981b900463ffffffff1611156124f35761232161231a836001613908565b6000858152600860205260408120819055815460649061252a90600160f81b810460ff1690600160981b900463ffffffff16613ed3565b6125349190613efb565b825461254d9190600160981b900463ffffffff16613f3b565b825463ffffffff918216925061256c918391600160d81b900416612a60565b825463ffffffff91909116600160981b0263ffffffff60981b199091161782556040517f294c8b0f3b2873c1ffd30051d9308f425856ec412fb8c380f38b86662fbd837e906125c3908a908a908a90600090613b63565b60405180910390a1505b50505050505050565b806125df612948565b6125e99190613908565b600154101561260b5760405163393ff8f760e21b815260040160405180910390fd5b60005b828110156114055761264684848381811061262b5761262b613a20565b9050602002016020810190612640919061303a565b83612970565b60010161260e565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600061267c61264e565b5482108015610c0c5750600160e01b61269361264e565b60008481526004919091016020526040902054161592915050565b6000546201000090046001600160a01b031633146127015760405162461bcd60e51b815260206004820152601060248201526f262a9d24b73b30b634b21027bbb732b960811b60448201526064016113c4565b565b60008161270e61264e565b5481101561277657600061272061264e565b600083815260049190910160205260408120549150600160e01b82169003612774575b80600003611fc55761275361264e565b60001990920160008181526004939093016020526040909220549050612743565b505b604051636f96cda160e11b815260040160405180910390fd5b600080600061279c61264e565b60009485526006016020525050604090912080549092909150565b336127c18261115a565b6001600160a01b03161461112957604051631022318760e21b815260040160405180910390fd5b611129816000612a85565b60008051602061402783398151915254610100900460ff166128275760405162461bcd60e51b81526004016113c490613f58565b6111568282612beb565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612866903390899088908890600401613fac565b6020604051808303816000875af19250505080156128a1575060408051601f3d908101601f1916820190925261289e91810190613fe9565b60015b6128ff573d8080156128cf576040519150601f19603f3d011682016040523d82523d6000602084013e6128d4565b606091505b5080516000036128f7576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600054600160b01b900460ff16156127015760405163ab35696f60e01b815260040160405180910390fd5b600061295261264e565b54919050565b600082612966868685612c5e565b1495945050505050565b611156828260405180602001604052806000815250612caa565b6060600c8054610c2a906138b8565b606060006129a683612d27565b60010190506000816001600160401b038111156129c5576129c56130ef565b6040519080825280601f01601f1916602001820160405280156129ef576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846129f957509392505050565b3360009081526009602052604090205460ff1615156001146127015760405163690c5a0560e01b815260040160405180910390fd5b6000818310612a6f5781611fc5565b5090919050565b6000818311612a6f5781611fc5565b6000612a9083612703565b905080600080612a9f8661278f565b915091508415612adf57612ab4818433610f43565b612adf57612ac28333612175565b612adf57604051632ce44b5f60e11b815260040160405180910390fd5b8015612aea57600082555b6001600160801b03612afa61264e565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b17600360e01b17612b3361264e565b60008881526004919091016020526040812091909155600160e11b85169003612ba95760018601612b6261264e565b600082815260049190910160205260408120549003612ba757612b8361264e565b548114612ba75784612b9361264e565b600083815260049190910160205260409020555b505b60405186906000906001600160a01b03861690600080516020614007833981519152908390a4612bd761264e565b600190810180549091019055505050505050565b60008051602061402783398151915254610100900460ff16612c1f5760405162461bcd60e51b81526004016113c490613f58565b81612c2861264e565b60020190612c369082613961565b5080612c4061264e565b60030190612c4e9082613961565b506000612c5961264e565b555050565b600081815b84811015612ca157612c8d82878784818110612c8157612c81613a20565b90506020020135612dff565b915080612c9981613b4a565b915050612c63565b50949350505050565b612cb48383612e2e565b6001600160a01b0383163b15611112576000612cce61264e565b5490508281035b612ce86000868380600101945086612831565b612d05576040516368d2bf6b60e11b815260040160405180910390fd5b818110612cd55781612d1561264e565b5414612d2057600080fd5b5050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612d665772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612d92576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612db057662386f26fc10000830492506010015b6305f5e1008310612dc8576305f5e100830492506008015b6127108310612ddc57612710830492506004015b60648310612dee576064830492506002015b600a8310610c0c5760010192915050565b6000818310612e1b576000828152602084905260409020611fc5565b6000838152602083905260409020611fc5565b6000612e3861264e565b5490506000829003612e5d5760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202612e7161264e565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612eac61264e565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083906000805160206140078339815191528180a4600183015b818114612f125780836000600080516020614007833981519152600080a4600101612eec565b5081600003612f3357604051622e076360e81b815260040160405180910390fd5b80612f3c61264e565b55506111129050565b6001600160e01b03198116811461112957600080fd5b600060208284031215612f6d57600080fd5b8135611fc581612f45565b600060208284031215612f8a57600080fd5b5035919050565b60005b83811015612fac578181015183820152602001612f94565b50506000910152565b60008151808452612fcd816020860160208601612f91565b601f01601f19169290920160200192915050565b602081526000611fc56020830184612fb5565b80356001600160a01b038116811461300b57600080fd5b919050565b6000806040838503121561302357600080fd5b61302c83612ff4565b946020939093013593505050565b60006020828403121561304c57600080fd5b611fc582612ff4565b60008060006060848603121561306a57600080fd5b61307384612ff4565b925061308160208501612ff4565b9150604084013590509250925092565b600080600080608085870312156130a757600080fd5b5050823594602084013594506040840135936060013592509050565b6000806000606084860312156130d857600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b60405161010081016001600160401b0381118282101715613128576131286130ef565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613156576131566130ef565b604052919050565b60006001600160401b03831115613177576131776130ef565b61318a601f8401601f191660200161312e565b905082815283838301111561319e57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126131c657600080fd5b611fc58383356020850161315e565b6000602082840312156131e757600080fd5b81356001600160401b038111156131fd57600080fd5b612915848285016131b5565b60006001600160401b03821115613222576132226130ef565b5060051b60200190565b60008060006060848603121561324157600080fd5b61324a84612ff4565b92506020613259818601612ff4565b925060408501356001600160401b0381111561327457600080fd5b8501601f8101871361328557600080fd5b803561329861329382613209565b61312e565b81815260059190911b820183019083810190898311156132b757600080fd5b928401925b828410156132d5578335825292840192908401906132bc565b80955050505050509250925092565b801515811461112957600080fd5b6000806040838503121561330557600080fd5b61330e83612ff4565b9150602083013561331e816132e4565b809150509250929050565b6001600160801b038116811461112957600080fd5b60ff8116811461112957600080fd5b803561300b8161333e565b63ffffffff8116811461112957600080fd5b803561300b81613358565b600082601f83011261338657600080fd5b8135602061339661329383613209565b82815260089290921b840181019181810190868411156133b557600080fd5b8286015b8481101561346c5761010081890312156133d35760008081fd5b6133db613105565b81356133e681613329565b81526133f382860161334d565b85820152604061340481840161334d565b90820152606061341583820161334d565b90820152608061342683820161336a565b9082015260a061343783820161336a565b9082015260c061344883820161336a565b9082015260e061345983820161334d565b90820152835291830191610100016133b9565b509695505050505050565b600080600080600080600060e0888a03121561349257600080fd5b61349b88612ff4565b96506020880135955060408801356001600160401b03808211156134be57600080fd5b6134ca8b838c01613375565b965060608a01359150808211156134e057600080fd5b6134ec8b838c016131b5565b955060808a013591508082111561350257600080fd5b61350e8b838c016131b5565b945060a08a013591508082111561352457600080fd5b6135308b838c016131b5565b935060c08a013591508082111561354657600080fd5b506135538a828b016131b5565b91505092959891949750929550565b6000806000806080858703121561357857600080fd5b61358185612ff4565b935061358f60208601612ff4565b92506040850135915060608501356001600160401b038111156135b157600080fd5b8501601f810187136135c257600080fd5b6135d18782356020840161315e565b91505092959194509250565b60008083601f8401126135ef57600080fd5b5081356001600160401b0381111561360657600080fd5b6020830191508360208260051b850101111561362157600080fd5b9250929050565b60008060006040848603121561363d57600080fd5b8335925060208401356001600160401b0381111561365a57600080fd5b613666868287016135dd565b9497909650939450505050565b60008060008060008060008060a0898b03121561368f57600080fd5b8835975060208901356136a1816132e4565b965060408901356001600160401b03808211156136bd57600080fd5b6136c98c838d016135dd565b909850965060608b01359150808211156136e257600080fd5b6136ee8c838d016135dd565b909650945060808b013591508082111561370757600080fd5b506137148b828c016135dd565b999c989b5096995094979396929594505050565b60006020828403121561373a57600080fd5b8135611fc5816132e4565b6000806000806040858703121561375b57600080fd5b84356001600160401b038082111561377257600080fd5b61377e888389016135dd565b9096509450602087013591508082111561379757600080fd5b506137a4878288016135dd565b95989497509550505050565b600080604083850312156137c357600080fd5b6137cc83612ff4565b91506137da60208401612ff4565b90509250929050565b6000808284036101208112156137f857600080fd5b83359250610100601f198201121561380f57600080fd5b506020830190509250929050565b600080600080600060a0868803121561383557600080fd5b8535945061384560208701612ff4565b935060408601359250606086013561385c816132e4565b949793965091946080013592915050565b60008060006040848603121561388257600080fd5b83356001600160401b0381111561389857600080fd5b6138a4868287016135dd565b909790965060209590950135949350505050565b600181811c908216806138cc57607f821691505b6020821081036138ec57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c0c57610c0c6138f2565b601f82111561111257600081815260208120601f850160051c810160208610156139425750805b601f850160051c820191505b818110156110c65782815560010161394e565b81516001600160401b0381111561397a5761397a6130ef565b61398e8161398884546138b8565b8461391b565b602080601f8311600181146139c357600084156139ab5750858301515b600019600386901b1c1916600185901b1785556110c6565b600085815260208120601f198616915b828110156139f2578886015182559484019460019091019084016139d3565b5085821015613a105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60208082526015908201527413154e88135a5b9d08131a5b5a5d08115e18d95959605a1b604082015260600190565b8082028115828204841417610c0c57610c0c6138f2565b6020808252601690820152751315480e88125b9cdd59999a58da595b9d08119d5b9960521b604082015260600190565b600060208284031215613abe57600080fd5b8151611fc5816132e4565b60208082526018908201527f4c553a20556e7375636365737366756c20557067726164650000000000000000604082015260600190565b6001600160a01b0384168152604060208201819052810182905260006001600160fb1b03831115613b3057600080fd5b8260051b8085606085013791909101606001949350505050565b600060018201613b5c57613b5c6138f2565b5060010190565b9384526001600160a01b0392909216602084015260408301521515606082015260800190565b600085516020613b9c8285838b01612f91565b8184019150602f60f81b80835260018851613bbc81838701868d01612f91565b8085019450508181850152600291508751613bdc81848701868c01612f91565b8754940193600090613bed816138b8565b8184168015613c035760018114613c1c57613c4c565b60ff198316888701528115158202880186019350613c4c565b8a6000528660002060005b83811015613c425781548a8201890152908601908801613c27565b5050858289010193505b50919c9b505050505050505050505050565b60008135610c0c8161333e565b60008135610c0c81613358565b8135613c8381613329565b6001600160801b03811690508154816001600160801b031982161783556020840135613cae8161333e565b6001600160881b03199190911690911760809190911b60ff60801b161781556040820135613cdb8161333e565b815460ff60881b1916608882901b60ff60881b1617825550613d20613d0260608401613c5e565b82805460ff60901b191660909290921b60ff60901b16919091179055565b613d53613d2f60808401613c6b565b82805463ffffffff60981b191660989290921b63ffffffff60981b16919091179055565b613d86613d6260a08401613c6b565b82805463ffffffff60b81b191660b89290921b63ffffffff60b81b16919091179055565b613db9613d9560c08401613c6b565b82805463ffffffff60d81b191660d89290921b63ffffffff60d81b16919091179055565b611156613dc860e08401613c5e565b8280546001600160f81b031660f89290921b6001600160f81b031916919091179055565b61010081018235613dfc81613329565b6001600160801b031682526020830135613e158161333e565b60ff1660208301526040830135613e2b8161333e565b60ff166040830152613e3f6060840161334d565b60ff166060830152613e536080840161336a565b63ffffffff166080830152613e6a60a0840161336a565b63ffffffff1660a0830152613e8160c0840161336a565b63ffffffff1660c0830152613e9860e0840161334d565b60ff811660e08401525b5092915050565b634e487b7160e01b600052601260045260246000fd5b600082613ece57613ece613ea9565b500690565b63ffffffff818116838216028082169190828114613ef357613ef36138f2565b505092915050565b600063ffffffff80841680613f1257613f12613ea9565b92169190910492915050565b63ffffffff828116828216039080821115613ea257613ea26138f2565b63ffffffff818116838216019080821115613ea257613ea26138f2565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613fdf90830184612fb5565b9695505050505050565b600060208284031215613ffb57600080fd5b8151611fc581612f4556feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212208c09e584166afda6c0ec7ec578cce0f309d0535589bb9247756d0f20ee27713264736f6c63430008110033

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.