ETH Price: $3,246.11 (+2.55%)
Gas: 2 Gwei

Token

Brawler Bearz Battle Pass (BBBP)
 

Overview

Max Total Supply

255 BBBP

Holders

175

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
2 BBBP
0x464132D57420c1b1fCc36F7979B1c5126a13A9C5
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BrawlerBearzBattlePass

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 550 runs

Other Settings:
default evmVersion
File 1 of 19 : BrawlerBearzBattlePass.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "erc721a/contracts/extensions/ERC721ABurnable.sol";
import {IBrawlerBearzDynamicItems} from "./interfaces/IBrawlerBearzDynamicItems.sol";
import "./tunnel/FxBaseRootTunnel.sol";

/*******************************************************************************
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|(@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|,|@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&@@@@@@@@@@@|,*|&@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%,**%@@@@@@@@%|******%&@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&##*****|||**,(%%%%%**|%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@***,#%%%%**#&@@@@@#**,|@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@*,(@@@@@@@@@@**,(&@@@@#**%@@@@@@||(%@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%|,****&@((@&***&@@@@@@%||||||||#%&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@&%#*****||||||**#%&@%%||||||||#@&%#(@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@&**,(&@@@@@%|||||*##&&&&##|||||(%@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@**,%@@@@@@@(|*|#%@@@@@@@@#||#%%@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@#||||#@@@@||*|%@@@@@@@@&|||%%&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@#,,,,,,*|**||%|||||||###&@@@@@@@#|||#%@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@&#||*|||||%%%@%%%#|||%@@@@@@@@&(|(%&@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&%%(||||@@@@@@&|||||(%&((||(#%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%%(||||||||||#%#(|||||%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@&%#######%%@@**||(#%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%##%%&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
********************************************************************************/

/**
 * @title BrawlerBearzBattlePass
 * @author @ScottMitchell18
 * @dev Battle pass public mint and L2 sync on mint, non-transferable, or sellable
 */
contract BrawlerBearzBattlePass is
    FxBaseRootTunnel,
    ERC721AQueryable,
    ERC721ABurnable,
    Ownable
{
    using Strings for uint256;

    /// @dev Sync actions
    bytes32 public constant MINTED = keccak256("MINTED");
    bytes32 public constant REWARDS_CLAIM = keccak256("REWARDS_CLAIM");

    /// @notice Vendor contract
    IBrawlerBearzDynamicItems public vendorContract;

    // @dev Base uri for the nft
    string private baseURI =
        "ipfs://bafybeigbadgbqqmajhdiqgh354pqqaf32daqlcddrf4xccvbo4vo6e2zfm/";

    // @dev The whitelist merkle root
    bytes32 public merkleRoot;

    /// @notice Free battle pass tier
    uint256 constant FREE_PASS = 1;

    /// @notice Pro battle pass tier
    uint256 constant PRO_PASS = 2;

    /// @notice Pro+ battle pass tier
    uint256 constant PRO_PLUS_PASS = 3;

    /// @notice Pro pass mint price
    uint256 public proPrice = 0.01 ether;

    /// @notice Pro plus pass mint price
    uint256 public proPlusPrice = 0.045 ether;

    // @dev Treasury
    address public treasury =
        payable(0x39bfA2b4319581bc885A2d4b9F0C90C2e1c24B87);

    /*
     * @notice All mints live ~ December 5th, 12PM EST
     * @dev Mints go live date
     */
    uint256 public liveAt = 1670259600;

    /*
     * @notice All mints expired ~ December 12th, 12PM EST
     * @dev Mints expire at
     */
    uint256 public expiresAt = 1670864400;

    /// @dev An address mapping for free pass minted
    mapping(address => bool) public addressToFreePassMinted;

    /// @dev A token mapping to battle pass type
    mapping(uint256 => uint256) public passes;

    /// @dev Thrown on approval
    error CannotApproveAll();

    /// @dev Thrown on transfer
    error Nontransferable();

    modifier whitelisted(bytes32[] calldata _proof) {
        bytes32 leaf = keccak256(abi.encodePacked(_msgSender()));
        require(MerkleProof.verify(_proof, merkleRoot, leaf), "Invalid proof.");
        _;
    }

    modifier mintIsActive() {
        require(
            block.timestamp > liveAt && block.timestamp < expiresAt,
            "Minting is not active."
        );
        _;
    }

    constructor(
        address _checkpointManager,
        address _fxRoot,
        address _vendorContractAddress
    )
        FxBaseRootTunnel(_checkpointManager, _fxRoot)
        ERC721A("Brawler Bearz Battle Pass", "BBBP")
    {
        vendorContract = IBrawlerBearzDynamicItems(_vendorContractAddress);
    }

    /**
     * @notice Free battle pass mint
     * @param _proof The bytes32 array proof to verify the merkle root
     */
    function freePassMint(bytes32[] calldata _proof)
        external
        mintIsActive
        whitelisted(_proof)
    {
        require(!addressToFreePassMinted[_msgSender()], "Already free minted");
        addressToFreePassMinted[_msgSender()] = true;
        _mintSync(_msgSender(), FREE_PASS);
    }

    /// @notice Pro pass mint
    function proPassMint() external payable mintIsActive {
        require(msg.value >= proPrice, "Not enough funds.");
        _mintSync(_msgSender(), PRO_PASS);
    }

    /// @notice Pro plus pass mint
    function proPlusPassMint() external payable mintIsActive {
        require(msg.value >= proPlusPrice, "Not enough funds.");
        _mintSync(_msgSender(), PRO_PLUS_PASS);
    }

    /**
     * @notice Returns the URI for a given token id
     * @param _tokenId A tokenId
     */
    function tokenURI(uint256 _tokenId)
        public
        view
        override
        returns (string memory)
    {
        if (!_exists(_tokenId)) revert OwnerQueryForNonexistentToken();
        // 1, 2, 3
        return
            string(
                abi.encodePacked(baseURI, Strings.toString(passes[_tokenId]))
            );
    }

    // @dev Check if mint is live
    function isLive() public view returns (bool) {
        return block.timestamp > liveAt && block.timestamp < expiresAt;
    }

    /**
     * @dev Check if wallet has minted
     * @param _address mint address lookup
     */
    function hasMintedFreePass(address _address) public view returns (bool) {
        return addressToFreePassMinted[_address];
    }

    // @dev Returns the starting token ID.
    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    /**
     * @notice Sets pro price
     * @param _proPrice A base uri
     */
    function setProPrice(uint256 _proPrice) external onlyOwner {
        proPrice = _proPrice;
    }

    /**
     * @notice Sets pro plus price
     * @param _proPlusPrice A base uri
     */
    function setProPlusPrice(uint256 _proPlusPrice) external onlyOwner {
        proPlusPrice = _proPlusPrice;
    }

    /**
     * @notice Sets the base URI of the NFT
     * @param _baseURI A base uri
     */
    function setBaseURI(string calldata _baseURI) external onlyOwner {
        baseURI = _baseURI;
    }

    /**
     * @notice Sets timestamps for live and expires timeframe
     * @param _liveAt A unix timestamp for live date
     * @param _expiresAt A unix timestamp for expiration date
     */
    function setMintWindow(uint256 _liveAt, uint256 _expiresAt)
        external
        onlyOwner
    {
        liveAt = _liveAt;
        expiresAt = _expiresAt;
    }

    /**
     * @notice Sets the treasury recipient
     * @param _treasury The treasury address
     */
    function setTreasury(address _treasury) public onlyOwner {
        treasury = payable(_treasury);
    }

    /**
     * @notice Sets the Whitelist merkle root for the mint
     * @param _merkleRoot The merkle root to set
     */
    function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
        merkleRoot = _merkleRoot;
    }

    /**
     * Set FxChildTunnel
     * @param _fxChildTunnel - the fxChildTunnel address
     */
    function setFxChildTunnel(address _fxChildTunnel)
        public
        override
        onlyOwner
    {
        fxChildTunnel = _fxChildTunnel;
    }

    /**
     * @notice Sets the bearz vendor item contract
     * @dev only owner call this function
     * @param _vendorContractAddress The new contract address
     */
    function setVendorContractAddress(address _vendorContractAddress)
        external
        onlyOwner
    {
        vendorContract = IBrawlerBearzDynamicItems(_vendorContractAddress);
    }

    /// @notice Withdraws funds from contract
    function withdraw() public onlyOwner {
        (bool success, ) = treasury.call{value: address(this).balance}("");
        require(success, "999");
    }

    /**
     * @dev Internal helper function for minting and syncing to L2
     * @param _address The amount of pro passes to mint
     * @param _passType The pass type (1,2,3)
     */
    function _mintSync(address _address, uint256 _passType) internal {
        uint256 tokenId = _nextTokenId();
        _mint(_address, 1);
        passes[tokenId] = _passType;
        _sendMessageToChild(
            abi.encode(MINTED, abi.encode(_address, tokenId, _passType))
        );
    }

    /// @dev Prevent approvals of token
    function setApprovalForAll(address, bool) public virtual override {
        revert CannotApproveAll();
    }

    /// @dev Prevent token transfer unless burning
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal override(ERC721A) {
        if (to != address(0) && from != address(0)) {
            revert Nontransferable();
        }
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    function _processRewardsClaim(bytes memory data) internal {
        (address to, uint256[] memory itemIds) = abi.decode(
            data,
            (address, uint256[])
        );
        vendorContract.dropItems(to, itemIds);
    }

    /// @dev TEST
    //    function _processMessageFromChildTest(bytes memory message)
    //        external
    //        onlyOwner
    //    {
    //        (bytes32 syncType, bytes memory syncData) = abi.decode(
    //            message,
    //            (bytes32, bytes)
    //        );
    //        if (syncType == REWARDS_CLAIM) {
    //            _processRewardsClaim(syncData);
    //        } else {
    //            revert("INVALID_SYNC_TYPE");
    //        }
    //    }

    function _processMessageFromChild(bytes memory message) internal override {
        (bytes32 syncType, bytes memory syncData) = abi.decode(
            message,
            (bytes32, bytes)
        );
        if (syncType == REWARDS_CLAIM) {
            _processRewardsClaim(syncData);
        } else {
            revert("INVALID_SYNC_TYPE");
        }
    }
}

File 2 of 19 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees 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 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++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 3 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 4 of 19 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 5 of 19 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AQueryable.sol';
import '../ERC721A.sol';

/**
 * @title ERC721A Queryable
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *   - `addr` = `address(0)`
     *   - `startTimestamp` = `0`
     *   - `burned` = `false`
     *   - `extraData` = `0`
     *
     * If the `tokenId` is burned:
     *   - `addr` = `<Address of owner before token was burned>`
     *   - `startTimestamp` = `<Timestamp when token was burned>`
     *   - `burned = `true`
     *   - `extraData` = `<Extra data when token was burned>`
     *
     * Otherwise:
     *   - `addr` = `<Address of owner>`
     *   - `startTimestamp` = `<Timestamp of start of ownership>`
     *   - `burned = `false`
     *   - `extraData` = `<Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
            return ownership;
        }
        ownership = _ownershipAt(tokenId);
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start` < `stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(totalSupply) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K pfp collections should be fine).
     */
    function tokensOfOwner(address owner) external view override returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 6 of 19 : ERC721ABurnable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721ABurnable.sol';
import '../ERC721A.sol';

/**
 * @title ERC721A Burnable Token
 * @dev ERC721A Token that can be irreversibly burned (destroyed).
 */
abstract contract ERC721ABurnable is ERC721A, IERC721ABurnable {
    /**
     * @dev Burns `tokenId`. See {ERC721A-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) public virtual override {
        _burn(tokenId, true);
    }
}

File 7 of 19 : IBrawlerBearzDynamicItems.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";

interface IBrawlerBearzDynamicItems is IERC1155Upgradeable {
    struct CustomMetadata {
        string typeOf;
        string name;
        uint256 xp; // Min XP required to equip
        string rarity; // LEGENDARY, SUPER_RARE, RARE, UNCOMMON, COMMON
        uint256 atk; // Correlated to Strength
        uint256 def; // Correlated to Endurance
        uint256 usageChance; // DEPRECATED
        string usageDuration; // PERSISTENT - equipable items, TEMPORARY - battles, ONE-TIME - buffs
        string description;
        uint256 intel; // Correlated to intellgience
        uint256 luck; // Correlated to luck
    }

    function getMetadata(uint256 tokenId)
        external
        view
        returns (CustomMetadata memory);

    function getMetadataBatch(uint256[] calldata tokenIds)
        external
        view
        returns (CustomMetadata[] memory);

    function getItemType(uint256 tokenId) external view returns (string memory);

    function getItemName(uint256 tokenId) external view returns (string memory);

    function getItemXPReq(uint256 tokenId) external view returns (uint256);

    function setItemMetadata(
        uint256 tokenId,
        string calldata typeOf,
        string calldata name,
        uint256 xp
    ) external;

    function setItemMetadataStruct(
        uint256 tokenId,
        CustomMetadata memory metadata
    ) external;

    function shopDrop(address _toAddress, uint256 _amount) external;

    function dropItems(address _toAddress, uint256[] calldata itemIds) external;

    function burnItemForOwnerAddress(
        uint256 _typeId,
        uint256 _quantity,
        address _materialOwnerAddress
    ) external;

    function mintItemToAddress(
        uint256 _typeId,
        uint256 _quantity,
        address _toAddress
    ) external;

    function mintBatchItemsToAddress(
        uint256[] memory _typeIds,
        uint256[] memory _quantities,
        address _toAddress
    ) external;

    function bulkSafeTransfer(
        uint256 _typeId,
        uint256 _quantityPerRecipient,
        address[] calldata recipients
    ) external;
}

File 8 of 19 : FxBaseRootTunnel.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {RLPReader} from "../lib/RLPReader.sol";
import {MerklePatriciaProof} from "../lib/MerklePatriciaProof.sol";
import {Merkle} from "../lib/Merkle.sol";
import "../lib/ExitPayloadReader.sol";

interface IFxStateSender {
    function sendMessageToChild(address _receiver, bytes calldata _data)
        external;
}

contract ICheckpointManager {
    struct HeaderBlock {
        bytes32 root;
        uint256 start;
        uint256 end;
        uint256 createdAt;
        address proposer;
    }

    /**
     * @notice mapping of checkpoint header numbers to block details
     * @dev These checkpoints are submited by plasma contracts
     */
    mapping(uint256 => HeaderBlock) public headerBlocks;
}

abstract contract FxBaseRootTunnel {
    using RLPReader for RLPReader.RLPItem;
    using Merkle for bytes32;
    using ExitPayloadReader for bytes;
    using ExitPayloadReader for ExitPayloadReader.ExitPayload;
    using ExitPayloadReader for ExitPayloadReader.Log;
    using ExitPayloadReader for ExitPayloadReader.LogTopics;
    using ExitPayloadReader for ExitPayloadReader.Receipt;

    // keccak256(MessageSent(bytes))
    bytes32 public constant SEND_MESSAGE_EVENT_SIG =
        0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036;

    // state sender contract
    IFxStateSender public fxRoot;
    // root chain manager
    ICheckpointManager public checkpointManager;
    // child tunnel contract which receives and sends messages
    address public fxChildTunnel;

    // storage to avoid duplicate exits
    mapping(bytes32 => bool) public processedExits;

    constructor(address _checkpointManager, address _fxRoot) {
        checkpointManager = ICheckpointManager(_checkpointManager);
        fxRoot = IFxStateSender(_fxRoot);
    }

    // set fxChildTunnel if not set already
    function setFxChildTunnel(address _fxChildTunnel) public virtual {
        require(
            fxChildTunnel == address(0x0),
            "FxBaseRootTunnel: CHILD_TUNNEL_ALREADY_SET"
        );
        fxChildTunnel = _fxChildTunnel;
    }

    /**
     * @notice Send bytes message to Child Tunnel
     * @param message bytes message that will be sent to Child Tunnel
     * some message examples -
     *   abi.encode(tokenId);
     *   abi.encode(tokenId, tokenMetadata);
     *   abi.encode(messageType, messageData);
     */
    function _sendMessageToChild(bytes memory message) internal {
        fxRoot.sendMessageToChild(fxChildTunnel, message);
    }

    function _validateAndExtractMessage(bytes memory inputData)
        internal
        returns (bytes memory)
    {
        ExitPayloadReader.ExitPayload memory payload = inputData
            .toExitPayload();

        bytes memory branchMaskBytes = payload.getBranchMaskAsBytes();
        uint256 blockNumber = payload.getBlockNumber();
        // checking if exit has already been processed
        // unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex)
        bytes32 exitHash = keccak256(
            abi.encodePacked(
                blockNumber,
                // first 2 nibbles are dropped while generating nibble array
                // this allows branch masks that are valid but bypass exitHash check (changing first 2 nibbles only)
                // so converting to nibble array and then hashing it
                MerklePatriciaProof._getNibbleArray(branchMaskBytes),
                payload.getReceiptLogIndex()
            )
        );
        require(
            processedExits[exitHash] == false,
            "FxRootTunnel: EXIT_ALREADY_PROCESSED"
        );
        processedExits[exitHash] = true;

        ExitPayloadReader.Receipt memory receipt = payload.getReceipt();
        ExitPayloadReader.Log memory log = receipt.getLog();

        // check child tunnel
        require(
            fxChildTunnel == log.getEmitter(),
            "FxRootTunnel: INVALID_FX_CHILD_TUNNEL"
        );

        bytes32 receiptRoot = payload.getReceiptRoot();
        // verify receipt inclusion
        require(
            MerklePatriciaProof.verify(
                receipt.toBytes(),
                branchMaskBytes,
                payload.getReceiptProof(),
                receiptRoot
            ),
            "FxRootTunnel: INVALID_RECEIPT_PROOF"
        );

        // verify checkpoint inclusion
        _checkBlockMembershipInCheckpoint(
            blockNumber,
            payload.getBlockTime(),
            payload.getTxRoot(),
            receiptRoot,
            payload.getHeaderNumber(),
            payload.getBlockProof()
        );

        ExitPayloadReader.LogTopics memory topics = log.getTopics();

        require(
            bytes32(topics.getField(0).toUint()) == SEND_MESSAGE_EVENT_SIG, // topic0 is event sig
            "FxRootTunnel: INVALID_SIGNATURE"
        );

        // received message data
        bytes memory message = abi.decode(log.getData(), (bytes)); // event decodes params again, so decoding bytes to get message
        return message;
    }

    function _checkBlockMembershipInCheckpoint(
        uint256 blockNumber,
        uint256 blockTime,
        bytes32 txRoot,
        bytes32 receiptRoot,
        uint256 headerNumber,
        bytes memory blockProof
    ) private view returns (uint256) {
        (
            bytes32 headerRoot,
            uint256 startBlock,
            ,
            uint256 createdAt,

        ) = checkpointManager.headerBlocks(headerNumber);

        require(
            keccak256(
                abi.encodePacked(blockNumber, blockTime, txRoot, receiptRoot)
            ).checkMembership(blockNumber - startBlock, headerRoot, blockProof),
            "FxRootTunnel: INVALID_HEADER"
        );
        return createdAt;
    }

    /**
     * @notice receive message from  L2 to L1, validated by proof
     * @dev This function verifies if the transaction actually happened on child chain
     *
     * @param inputData RLP encoded data of the reference tx containing following list of fields
     *  0 - headerNumber - Checkpoint header block number containing the reference tx
     *  1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root
     *  2 - blockNumber - Block number containing the reference tx on child chain
     *  3 - blockTime - Reference tx block time
     *  4 - txRoot - Transactions root of block
     *  5 - receiptRoot - Receipts root of block
     *  6 - receipt - Receipt of the reference transaction
     *  7 - receiptProof - Merkle proof of the reference receipt
     *  8 - branchMask - 32 bits denoting the path of receipt in merkle tree
     *  9 - receiptLogIndex - Log Index to read from the receipt
     */
    function receiveMessage(bytes memory inputData) public virtual {
        bytes memory message = _validateAndExtractMessage(inputData);
        _processMessageFromChild(message);
    }

    /**
     * @notice Process message received from Child Tunnel
     * @dev function needs to be implemented to handle message as per requirement
     * This is called by onStateReceive function.
     * Since it is called via a system call, any event will not be emitted during its execution.
     * @param message bytes message that was sent from Child Tunnel
     */
    function _processMessageFromChild(bytes memory message) internal virtual;
}

File 9 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 10 of 19 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of an ERC721AQueryable compliant contract.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

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

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

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

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

File 11 of 19 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

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

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard,
 * including the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at `_startTokenId()`
 * (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // 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 tokenId of the next token to be minted.
    uint256 private _currentIndex;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

    /**
     * @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 returns (uint256) {
        return _currentIndex;
    }

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

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

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

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    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: 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.
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;
    }

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

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

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

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

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

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an ownership that has an address and is not burned
                        // before an ownership that does not have an address and is not burned.
                        // Hence, curr will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed is zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

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

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

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

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

    /**
     * @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 See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    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 '';
    }

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ownerOf(tokenId);

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

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

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSenderERC721A()) revert ApproveToCaller();

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

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    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 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 (`_mint`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, 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 {
        _mint(to, quantity);

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

    /**
     * @dev 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 {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

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

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

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

            uint256 tokenId = startTokenId;
            uint256 end = startTokenId + quantity;
            do {
                emit Transfer(address(0), to, tokenId++);
            } while (tokenId < end);

            _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 {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

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

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

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

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

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

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals;
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`.
        assembly {
            // Compute the slot.
            mstore(0x00, tokenId)
            mstore(0x20, tokenApprovalsPtr.slot)
            approvedAddressSlot := keccak256(0x00, 0x40)
            // Load the slot's value from storage.
            approvedAddress := sload(approvedAddressSlot)
        }
    }

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * 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) = _getApprovedAddress(tokenId);

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

    /**
     * @dev Equivalent to `_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) = _getApprovedAddress(tokenId);

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @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 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 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 returns (string memory ptr) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit),
            // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
            // We will need 1 32-byte word to store the length,
            // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
            ptr := add(mload(0x40), 128)
            // Update the free memory pointer to allocate.
            mstore(0x40, ptr)

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

            // We write the string from the rightmost digit to the leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // Costs a bit more than early returning for the zero case,
            // but cheaper in terms of deployment and overall runtime costs.
            for {
                // Initialize and perform the first pass without check.
                let temp := value
                // Move the pointer 1 byte leftwards to point to an empty character slot.
                ptr := sub(ptr, 1)
                // Write the character to the pointer. 48 is the ASCII index of '0'.
                mstore8(ptr, add(48, mod(temp, 10)))
                temp := div(temp, 10)
            } temp {
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
            } {
                // Body of the for loop.
                ptr := sub(ptr, 1)
                mstore8(ptr, add(48, mod(temp, 10)))
            }

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

File 12 of 19 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of 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 through `_extraData`.
        uint24 extraData;
    }

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     *
     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

    /**
     * @dev 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 standard. See `_mintERC2309` for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 13 of 19 : IERC721ABurnable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of an ERC721ABurnable compliant contract.
 */
interface IERC721ABurnable is IERC721A {
    /**
     * @dev Burns `tokenId`. See {ERC721A-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burn(uint256 tokenId) external;
}

File 14 of 19 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155Upgradeable is IERC165Upgradeable {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

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

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

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

pragma solidity ^0.8.0;

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

File 16 of 19 : RLPReader.sol
/*
 * @author Hamdi Allam [email protected]
 * Please reach out with any questions or concerns
 */
pragma solidity ^0.8.0;

library RLPReader {
    uint8 constant STRING_SHORT_START = 0x80;
    uint8 constant STRING_LONG_START = 0xb8;
    uint8 constant LIST_SHORT_START = 0xc0;
    uint8 constant LIST_LONG_START = 0xf8;
    uint8 constant WORD_SIZE = 32;

    struct RLPItem {
        uint256 len;
        uint256 memPtr;
    }

    struct Iterator {
        RLPItem item; // Item that's being iterated over.
        uint256 nextPtr; // Position of the next item in the list.
    }

    /*
     * @dev Returns the next element in the iteration. Reverts if it has not next element.
     * @param self The iterator.
     * @return The next element in the iteration.
     */
    function next(Iterator memory self) internal pure returns (RLPItem memory) {
        require(hasNext(self));

        uint256 ptr = self.nextPtr;
        uint256 itemLength = _itemLength(ptr);
        self.nextPtr = ptr + itemLength;

        return RLPItem(itemLength, ptr);
    }

    /*
     * @dev Returns true if the iteration has more elements.
     * @param self The iterator.
     * @return true if the iteration has more elements.
     */
    function hasNext(Iterator memory self) internal pure returns (bool) {
        RLPItem memory item = self.item;
        return self.nextPtr < item.memPtr + item.len;
    }

    /*
     * @param item RLP encoded bytes
     */
    function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) {
        uint256 memPtr;
        assembly {
            memPtr := add(item, 0x20)
        }

        return RLPItem(item.length, memPtr);
    }

    /*
     * @dev Create an iterator. Reverts if item is not a list.
     * @param self The RLP item.
     * @return An 'Iterator' over the item.
     */
    function iterator(RLPItem memory self) internal pure returns (Iterator memory) {
        require(isList(self));

        uint256 ptr = self.memPtr + _payloadOffset(self.memPtr);
        return Iterator(self, ptr);
    }

    /*
     * @param item RLP encoded bytes
     */
    function rlpLen(RLPItem memory item) internal pure returns (uint256) {
        return item.len;
    }

    /*
     * @param item RLP encoded bytes
     */
    function payloadLen(RLPItem memory item) internal pure returns (uint256) {
        return item.len - _payloadOffset(item.memPtr);
    }

    /*
     * @param item RLP encoded list in bytes
     */
    function toList(RLPItem memory item) internal pure returns (RLPItem[] memory) {
        require(isList(item));

        uint256 items = numItems(item);
        RLPItem[] memory result = new RLPItem[](items);

        uint256 memPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint256 dataLen;
        for (uint256 i = 0; i < items; i++) {
            dataLen = _itemLength(memPtr);
            result[i] = RLPItem(dataLen, memPtr);
            memPtr = memPtr + dataLen;
        }

        return result;
    }

    // @return indicator whether encoded payload is a list. negate this function call for isData.
    function isList(RLPItem memory item) internal pure returns (bool) {
        if (item.len == 0) return false;

        uint8 byte0;
        uint256 memPtr = item.memPtr;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < LIST_SHORT_START) return false;
        return true;
    }

    /*
     * @dev A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory.
     * @return keccak256 hash of RLP encoded bytes.
     */
    function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) {
        uint256 ptr = item.memPtr;
        uint256 len = item.len;
        bytes32 result;
        assembly {
            result := keccak256(ptr, len)
        }
        return result;
    }

    function payloadLocation(RLPItem memory item) internal pure returns (uint256, uint256) {
        uint256 offset = _payloadOffset(item.memPtr);
        uint256 memPtr = item.memPtr + offset;
        uint256 len = item.len - offset; // data length
        return (memPtr, len);
    }

    /*
     * @dev A cheaper version of keccak256(toBytes(item)) that avoids copying memory.
     * @return keccak256 hash of the item payload.
     */
    function payloadKeccak256(RLPItem memory item) internal pure returns (bytes32) {
        (uint256 memPtr, uint256 len) = payloadLocation(item);
        bytes32 result;
        assembly {
            result := keccak256(memPtr, len)
        }
        return result;
    }

    /** RLPItem conversions into data types **/

    // @returns raw rlp encoding in bytes
    function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {
        bytes memory result = new bytes(item.len);
        if (result.length == 0) return result;

        uint256 ptr;
        assembly {
            ptr := add(0x20, result)
        }

        copy(item.memPtr, ptr, item.len);
        return result;
    }

    // any non-zero byte is considered true
    function toBoolean(RLPItem memory item) internal pure returns (bool) {
        require(item.len == 1);
        uint256 result;
        uint256 memPtr = item.memPtr;
        assembly {
            result := byte(0, mload(memPtr))
        }

        return result == 0 ? false : true;
    }

    function toAddress(RLPItem memory item) internal pure returns (address) {
        // 1 byte for the length prefix
        require(item.len == 21);

        return address(uint160(toUint(item)));
    }

    function toUint(RLPItem memory item) internal pure returns (uint256) {
        require(item.len > 0 && item.len <= 33);

        uint256 offset = _payloadOffset(item.memPtr);
        uint256 len = item.len - offset;

        uint256 result;
        uint256 memPtr = item.memPtr + offset;
        assembly {
            result := mload(memPtr)

            // shfit to the correct location if neccesary
            if lt(len, 32) {
                result := div(result, exp(256, sub(32, len)))
            }
        }

        return result;
    }

    // enforces 32 byte length
    function toUintStrict(RLPItem memory item) internal pure returns (uint256) {
        // one byte prefix
        require(item.len == 33);

        uint256 result;
        uint256 memPtr = item.memPtr + 1;
        assembly {
            result := mload(memPtr)
        }

        return result;
    }

    function toBytes(RLPItem memory item) internal pure returns (bytes memory) {
        require(item.len > 0);

        uint256 offset = _payloadOffset(item.memPtr);
        uint256 len = item.len - offset; // data length
        bytes memory result = new bytes(len);

        uint256 destPtr;
        assembly {
            destPtr := add(0x20, result)
        }

        copy(item.memPtr + offset, destPtr, len);
        return result;
    }

    /*
     * Private Helpers
     */

    // @return number of payload items inside an encoded list.
    function numItems(RLPItem memory item) private pure returns (uint256) {
        if (item.len == 0) return 0;

        uint256 count = 0;
        uint256 currPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint256 endPtr = item.memPtr + item.len;
        while (currPtr < endPtr) {
            currPtr = currPtr + _itemLength(currPtr); // skip over an item
            count++;
        }

        return count;
    }

    // @return entire rlp item byte length
    function _itemLength(uint256 memPtr) private pure returns (uint256) {
        uint256 itemLen;
        uint256 byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < STRING_SHORT_START) itemLen = 1;
        else if (byte0 < STRING_LONG_START) itemLen = byte0 - STRING_SHORT_START + 1;
        else if (byte0 < LIST_SHORT_START) {
            assembly {
                let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is
                memPtr := add(memPtr, 1) // skip over the first byte
                /* 32 byte word size */
                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to get the len
                itemLen := add(dataLen, add(byteLen, 1))
            }
        } else if (byte0 < LIST_LONG_START) {
            itemLen = byte0 - LIST_SHORT_START + 1;
        } else {
            assembly {
                let byteLen := sub(byte0, 0xf7)
                memPtr := add(memPtr, 1)

                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to the correct length
                itemLen := add(dataLen, add(byteLen, 1))
            }
        }

        return itemLen;
    }

    // @return number of bytes until the data
    function _payloadOffset(uint256 memPtr) private pure returns (uint256) {
        uint256 byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }

        if (byte0 < STRING_SHORT_START) return 0;
        else if (byte0 < STRING_LONG_START || (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START)) return 1;
        else if (byte0 < LIST_SHORT_START)
            // being explicit
            return byte0 - (STRING_LONG_START - 1) + 1;
        else return byte0 - (LIST_LONG_START - 1) + 1;
    }

    /*
     * @param src Pointer to source
     * @param dest Pointer to destination
     * @param len Amount of memory to copy from the source
     */
    function copy(
        uint256 src,
        uint256 dest,
        uint256 len
    ) private pure {
        if (len == 0) return;

        // copy as many word sizes as possible
        for (; len >= WORD_SIZE; len -= WORD_SIZE) {
            assembly {
                mstore(dest, mload(src))
            }

            src += WORD_SIZE;
            dest += WORD_SIZE;
        }

        if (len == 0) return;

        // left over bytes. Mask is used to remove unwanted bytes from the word
        uint256 mask = 256**(WORD_SIZE - len) - 1;

        assembly {
            let srcpart := and(mload(src), not(mask)) // zero out src
            let destpart := and(mload(dest), mask) // retrieve the bytes
            mstore(dest, or(destpart, srcpart))
        }
    }
}

File 17 of 19 : MerklePatriciaProof.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

library MerklePatriciaProof {
    /*
     * @dev Verifies a merkle patricia proof.
     * @param value The terminating value in the trie.
     * @param encodedPath The path in the trie leading to value.
     * @param rlpParentNodes The rlp encoded stack of nodes.
     * @param root The root hash of the trie.
     * @return The boolean validity of the proof.
     */
    function verify(
        bytes memory value,
        bytes memory encodedPath,
        bytes memory rlpParentNodes,
        bytes32 root
    ) internal pure returns (bool) {
        RLPReader.RLPItem memory item = RLPReader.toRlpItem(rlpParentNodes);
        RLPReader.RLPItem[] memory parentNodes = RLPReader.toList(item);

        bytes memory currentNode;
        RLPReader.RLPItem[] memory currentNodeList;

        bytes32 nodeKey = root;
        uint256 pathPtr = 0;

        bytes memory path = _getNibbleArray(encodedPath);
        if (path.length == 0) {
            return false;
        }

        for (uint256 i = 0; i < parentNodes.length; i++) {
            if (pathPtr > path.length) {
                return false;
            }

            currentNode = RLPReader.toRlpBytes(parentNodes[i]);
            if (nodeKey != keccak256(currentNode)) {
                return false;
            }
            currentNodeList = RLPReader.toList(parentNodes[i]);

            if (currentNodeList.length == 17) {
                if (pathPtr == path.length) {
                    if (keccak256(RLPReader.toBytes(currentNodeList[16])) == keccak256(value)) {
                        return true;
                    } else {
                        return false;
                    }
                }

                uint8 nextPathNibble = uint8(path[pathPtr]);
                if (nextPathNibble > 16) {
                    return false;
                }
                nodeKey = bytes32(RLPReader.toUintStrict(currentNodeList[nextPathNibble]));
                pathPtr += 1;
            } else if (currentNodeList.length == 2) {
                uint256 traversed = _nibblesToTraverse(RLPReader.toBytes(currentNodeList[0]), path, pathPtr);
                if (pathPtr + traversed == path.length) {
                    //leaf node
                    if (keccak256(RLPReader.toBytes(currentNodeList[1])) == keccak256(value)) {
                        return true;
                    } else {
                        return false;
                    }
                }

                //extension node
                if (traversed == 0) {
                    return false;
                }

                pathPtr += traversed;
                nodeKey = bytes32(RLPReader.toUintStrict(currentNodeList[1]));
            } else {
                return false;
            }
        }
    }

    function _nibblesToTraverse(
        bytes memory encodedPartialPath,
        bytes memory path,
        uint256 pathPtr
    ) private pure returns (uint256) {
        uint256 len = 0;
        // encodedPartialPath has elements that are each two hex characters (1 byte), but partialPath
        // and slicedPath have elements that are each one hex character (1 nibble)
        bytes memory partialPath = _getNibbleArray(encodedPartialPath);
        bytes memory slicedPath = new bytes(partialPath.length);

        // pathPtr counts nibbles in path
        // partialPath.length is a number of nibbles
        for (uint256 i = pathPtr; i < pathPtr + partialPath.length; i++) {
            bytes1 pathNibble = path[i];
            slicedPath[i - pathPtr] = pathNibble;
        }

        if (keccak256(partialPath) == keccak256(slicedPath)) {
            len = partialPath.length;
        } else {
            len = 0;
        }
        return len;
    }

    // bytes b must be hp encoded
    function _getNibbleArray(bytes memory b) internal pure returns (bytes memory) {
        bytes memory nibbles = "";
        if (b.length > 0) {
            uint8 offset;
            uint8 hpNibble = uint8(_getNthNibbleOfBytes(0, b));
            if (hpNibble == 1 || hpNibble == 3) {
                nibbles = new bytes(b.length * 2 - 1);
                bytes1 oddNibble = _getNthNibbleOfBytes(1, b);
                nibbles[0] = oddNibble;
                offset = 1;
            } else {
                nibbles = new bytes(b.length * 2 - 2);
                offset = 0;
            }

            for (uint256 i = offset; i < nibbles.length; i++) {
                nibbles[i] = _getNthNibbleOfBytes(i - offset + 2, b);
            }
        }
        return nibbles;
    }

    function _getNthNibbleOfBytes(uint256 n, bytes memory str) private pure returns (bytes1) {
        return bytes1(n % 2 == 0 ? uint8(str[n / 2]) / 0x10 : uint8(str[n / 2]) % 0x10);
    }
}

File 18 of 19 : Merkle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library Merkle {
    function checkMembership(
        bytes32 leaf,
        uint256 index,
        bytes32 rootHash,
        bytes memory proof
    ) internal pure returns (bool) {
        require(proof.length % 32 == 0, "Invalid proof length");
        uint256 proofHeight = proof.length / 32;
        // Proof of size n means, height of the tree is n+1.
        // In a tree of height n+1, max #leafs possible is 2 ^ n
        require(index < 2**proofHeight, "Leaf index is too big");

        bytes32 proofElement;
        bytes32 computedHash = leaf;
        for (uint256 i = 32; i <= proof.length; i += 32) {
            assembly {
                proofElement := mload(add(proof, i))
            }

            if (index % 2 == 0) {
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }

            index = index / 2;
        }
        return computedHash == rootHash;
    }
}

File 19 of 19 : ExitPayloadReader.sol
pragma solidity ^0.8.0;

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

library ExitPayloadReader {
    using RLPReader for bytes;
    using RLPReader for RLPReader.RLPItem;

    uint8 constant WORD_SIZE = 32;

    struct ExitPayload {
        RLPReader.RLPItem[] data;
    }

    struct Receipt {
        RLPReader.RLPItem[] data;
        bytes raw;
        uint256 logIndex;
    }

    struct Log {
        RLPReader.RLPItem data;
        RLPReader.RLPItem[] list;
    }

    struct LogTopics {
        RLPReader.RLPItem[] data;
    }

    // copy paste of private copy() from RLPReader to avoid changing of existing contracts
    function copy(
        uint256 src,
        uint256 dest,
        uint256 len
    ) private pure {
        if (len == 0) return;

        // copy as many word sizes as possible
        for (; len >= WORD_SIZE; len -= WORD_SIZE) {
            assembly {
                mstore(dest, mload(src))
            }

            src += WORD_SIZE;
            dest += WORD_SIZE;
        }

        // left over bytes. Mask is used to remove unwanted bytes from the word
        uint256 mask = 256**(WORD_SIZE - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask)) // zero out src
            let destpart := and(mload(dest), mask) // retrieve the bytes
            mstore(dest, or(destpart, srcpart))
        }
    }

    function toExitPayload(bytes memory data) internal pure returns (ExitPayload memory) {
        RLPReader.RLPItem[] memory payloadData = data.toRlpItem().toList();

        return ExitPayload(payloadData);
    }

    function getHeaderNumber(ExitPayload memory payload) internal pure returns (uint256) {
        return payload.data[0].toUint();
    }

    function getBlockProof(ExitPayload memory payload) internal pure returns (bytes memory) {
        return payload.data[1].toBytes();
    }

    function getBlockNumber(ExitPayload memory payload) internal pure returns (uint256) {
        return payload.data[2].toUint();
    }

    function getBlockTime(ExitPayload memory payload) internal pure returns (uint256) {
        return payload.data[3].toUint();
    }

    function getTxRoot(ExitPayload memory payload) internal pure returns (bytes32) {
        return bytes32(payload.data[4].toUint());
    }

    function getReceiptRoot(ExitPayload memory payload) internal pure returns (bytes32) {
        return bytes32(payload.data[5].toUint());
    }

    function getReceipt(ExitPayload memory payload) internal pure returns (Receipt memory receipt) {
        receipt.raw = payload.data[6].toBytes();
        RLPReader.RLPItem memory receiptItem = receipt.raw.toRlpItem();

        if (receiptItem.isList()) {
            // legacy tx
            receipt.data = receiptItem.toList();
        } else {
            // pop first byte before parsting receipt
            bytes memory typedBytes = receipt.raw;
            bytes memory result = new bytes(typedBytes.length - 1);
            uint256 srcPtr;
            uint256 destPtr;
            assembly {
                srcPtr := add(33, typedBytes)
                destPtr := add(0x20, result)
            }

            copy(srcPtr, destPtr, result.length);
            receipt.data = result.toRlpItem().toList();
        }

        receipt.logIndex = getReceiptLogIndex(payload);
        return receipt;
    }

    function getReceiptProof(ExitPayload memory payload) internal pure returns (bytes memory) {
        return payload.data[7].toBytes();
    }

    function getBranchMaskAsBytes(ExitPayload memory payload) internal pure returns (bytes memory) {
        return payload.data[8].toBytes();
    }

    function getBranchMaskAsUint(ExitPayload memory payload) internal pure returns (uint256) {
        return payload.data[8].toUint();
    }

    function getReceiptLogIndex(ExitPayload memory payload) internal pure returns (uint256) {
        return payload.data[9].toUint();
    }

    // Receipt methods
    function toBytes(Receipt memory receipt) internal pure returns (bytes memory) {
        return receipt.raw;
    }

    function getLog(Receipt memory receipt) internal pure returns (Log memory) {
        RLPReader.RLPItem memory logData = receipt.data[3].toList()[receipt.logIndex];
        return Log(logData, logData.toList());
    }

    // Log methods
    function getEmitter(Log memory log) internal pure returns (address) {
        return RLPReader.toAddress(log.list[0]);
    }

    function getTopics(Log memory log) internal pure returns (LogTopics memory) {
        return LogTopics(log.list[1].toList());
    }

    function getData(Log memory log) internal pure returns (bytes memory) {
        return log.list[2].toBytes();
    }

    function toRlpBytes(Log memory log) internal pure returns (bytes memory) {
        return log.data.toRlpBytes();
    }

    // LogTopics methods
    function getField(LogTopics memory topics, uint256 index) internal pure returns (RLPReader.RLPItem memory) {
        return topics.data[index];
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 550,
    "details": {
      "yul": false
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_checkpointManager","type":"address"},{"internalType":"address","name":"_fxRoot","type":"address"},{"internalType":"address","name":"_vendorContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CannotApproveAll","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"Nontransferable","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MINTED","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARDS_CLAIM","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND_MESSAGE_EVENT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressToFreePassMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkpointManager","outputs":[{"internalType":"contract ICheckpointManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"expiresAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"freePassMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fxChildTunnel","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fxRoot","outputs":[{"internalType":"contract IFxStateSender","name":"","type":"address"}],"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":"_address","type":"address"}],"name":"hasMintedFreePass","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liveAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"passes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proPassMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"proPlusPassMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"proPlusPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"processedExits","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"inputData","type":"bytes"}],"name":"receiveMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fxChildTunnel","type":"address"}],"name":"setFxChildTunnel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liveAt","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"}],"name":"setMintWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proPlusPrice","type":"uint256"}],"name":"setProPlusPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proPrice","type":"uint256"}],"name":"setProPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vendorContractAddress","type":"address"}],"name":"setVendorContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vendorContract","outputs":[{"internalType":"contract IBrawlerBearzDynamicItems","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100604052604360808181529062004c8a60a03980516200002a91600e91602090910190620001dc565b50662386f26fc10000601055669fdf42f6e48000601155601280546001600160a01b0319167339bfa2b4319581bc885a2d4b9f0c90c2e1c24b8717905563638e23906013556363975e106014553480156200008457600080fd5b5060405162004ccd38038062004ccd833981016040819052620000a791620002bc565b604080518082018252601981527f427261776c657220426561727a20426174746c652050617373000000000000006020808301918252835180850190945260048452630424242560e41b90840152600180546001600160a01b038089166001600160a01b031992831617909255600080549288169290911691909117905581519192916200013891600691620001dc565b5080516200014e906007906020840190620001dc565b505060016004555062000161336200018a565b600d80546001600160a01b0319166001600160a01b0392909216919091179055506200035b9050565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001ea906200032a565b90600052602060002090601f0160209004810192826200020e576000855562000259565b82601f106200022957805160ff191683800117855562000259565b8280016001018555821562000259579182015b82811115620002595782518255916020019190600101906200023c565b50620002679291506200026b565b5090565b5b808211156200026757600081556001016200026c565b60006001600160a01b0382165b92915050565b620002a08162000282565b8114620002ac57600080fd5b50565b80516200028f8162000295565b600080600060608486031215620002d657620002d6600080fd5b6000620002e48686620002af565b9350506020620002f786828701620002af565b92505060406200030a86828701620002af565b9150509250925092565b634e487b7160e01b600052602260045260246000fd5b6002810460018216806200033f57607f821691505b6020821081141562000355576200035562000314565b50919050565b61491f806200036b6000396000f3fe60806040526004361061034a5760003560e01c8063715018a6116101bb578063b88d4fde116100f7578063d629c86d11610095578063ea07e68a1161006f578063ea07e68a146109ef578063f0f4426014610a0f578063f2fde38b14610a2f578063f953cec714610a4f57600080fd5b8063d629c86d14610970578063de9b771f14610986578063e985e9c5146109a657600080fd5b8063c23dc68f116100d1578063c23dc68f146108cf578063c3b2ec49146108fc578063c87b56dd14610930578063cde9627a1461095057600080fd5b8063b88d4fde1461086d578063b8f7a6651461088d578063c0857ba0146108a257600080fd5b8063972c492811610164578063a4aab5f21161013e578063a4aab5f2146107ec578063a90b775514610825578063a9cdd60d1461082d578063aea4e49e1461084d57600080fd5b8063972c49281461078c57806399a2557a146107ac578063a22cb465146107cc57600080fd5b80638622a689116101955780638622a689146107435780638da5cb5b1461075957806395d89b411461077757600080fd5b8063715018a6146106e15780637cb64759146106f65780638462151c1461071657600080fd5b80633e9c7f691161028a5780635bbb2177116102335780636255c3ac1161020d5780636255c3ac146106545780636352211e146106745780636e321ce41461069457806370a08231146106c157600080fd5b80635bbb2177146105d7578063607f2d421461060457806361d027b31461063457600080fd5b806353b0e17d1161026457806353b0e17d1461058b57806353f8bb9a146105a157806355f804b3146105b757600080fd5b80633e9c7f691461051757806342842e0e1461054b57806342966c681461056b57600080fd5b80630e387de6116102f75780631b888657116102d15780631b888657146104ac57806323b872dd146104cc5780632eb4a7ab146104ec5780633ccfd60b1461050257600080fd5b80630e387de61461042e5780630f8677511461046f57806318160ddd1461048f57600080fd5b8063081812fc11610328578063081812fc146103b1578063095ea7b3146103de5780630ca80c15146103fe57600080fd5b806301ffc9a71461034f5780630245b80f1461038557806306fdde031461038f575b600080fd5b34801561035b57600080fd5b5061036f61036a3660046135f9565b610a6f565b60405161037c9190613624565b60405180910390f35b61038d610ac1565b005b34801561039b57600080fd5b506103a4610b27565b60405161037c9190613690565b3480156103bd57600080fd5b506103d16103cc3660046136b2565b610bb9565b60405161037c91906136ed565b3480156103ea57600080fd5b5061038d6103f936600461370f565b610bfd565b34801561040a57600080fd5b5061036f61041936600461374c565b60156020526000908152604090205460ff1681565b34801561043a57600080fd5b506104627f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03681565b60405161037c9190613773565b34801561047b57600080fd5b5061038d61048a366004613781565b610cba565b34801561049b57600080fd5b506005546004540360001901610462565b3480156104b857600080fd5b5061038d6104c73660046136b2565b610cef565b3480156104d857600080fd5b5061038d6104e73660046137a3565b610d1e565b3480156104f857600080fd5b50610462600f5481565b34801561050e57600080fd5b5061038d610ee3565b34801561052357600080fd5b506104627f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae369025281565b34801561055757600080fd5b5061038d6105663660046137a3565b610f91565b34801561057757600080fd5b5061038d6105863660046136b2565b610fb1565b34801561059757600080fd5b5061046260105481565b3480156105ad57600080fd5b5061046260135481565b3480156105c357600080fd5b5061038d6105d2366004613845565b610fbc565b3480156105e357600080fd5b506105f76105f2366004613994565b610ff2565b60405161037c9190613a91565b34801561061057600080fd5b5061036f61061f3660046136b2565b60036020526000908152604090205460ff1681565b34801561064057600080fd5b506012546103d1906001600160a01b031681565b34801561066057600080fd5b5061038d61066f3660046136b2565b6110c0565b34801561068057600080fd5b506103d161068f3660046136b2565b6110ef565b3480156106a057600080fd5b506104626106af3660046136b2565b60166020526000908152604090205481565b3480156106cd57600080fd5b506104626106dc36600461374c565b6110fa565b3480156106ed57600080fd5b5061038d611149565b34801561070257600080fd5b5061038d6107113660046136b2565b61117d565b34801561072257600080fd5b5061073661073136600461374c565b6111ac565b60405161037c9190613af4565b34801561074f57600080fd5b5061046260145481565b34801561076557600080fd5b50600c546001600160a01b03166103d1565b34801561078357600080fd5b506103a46112b7565b34801561079857600080fd5b506002546103d1906001600160a01b031681565b3480156107b857600080fd5b506107366107c7366004613b05565b6112c6565b3480156107d857600080fd5b5061038d6107e7366004613b4d565b611452565b3480156107f857600080fd5b5061036f61080736600461374c565b6001600160a01b031660009081526015602052604090205460ff1690565b61038d61146b565b34801561083957600080fd5b5061038d61084836600461374c565b6114c6565b34801561085957600080fd5b5061038d61086836600461374c565b611512565b34801561087957600080fd5b5061038d610888366004613c0f565b61155e565b34801561089957600080fd5b5061036f6115a8565b3480156108ae57600080fd5b506001546108c2906001600160a01b031681565b60405161037c9190613cad565b3480156108db57600080fd5b506108ef6108ea3660046136b2565b6115c1565b60405161037c9190613cbb565b34801561090857600080fd5b506104627f306c27fde4d30e93105afde87f5773b4557f5fcbd91b3f18aedef29a5e80fd2881565b34801561093c57600080fd5b506103a461094b3660046136b2565b611649565b34801561095c57600080fd5b5061038d61096b366004613d14565b6116b3565b34801561097c57600080fd5b5061046260115481565b34801561099257600080fd5b506000546108c2906001600160a01b031681565b3480156109b257600080fd5b5061036f6109c1366004613d50565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205460ff1690565b3480156109fb57600080fd5b50600d546108c2906001600160a01b031681565b348015610a1b57600080fd5b5061038d610a2a36600461374c565b6117c9565b348015610a3b57600080fd5b5061038d610a4a36600461374c565b611815565b348015610a5b57600080fd5b5061038d610a6a366004613d83565b61186e565b60006301ffc9a760e01b6001600160e01b031983161480610aa057506380ac58cd60e01b6001600160e01b03198316145b80610abb5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60135442118015610ad3575060145442105b610af85760405162461bcd60e51b8152600401610aef90613df5565b60405180910390fd5b601154341015610b1a5760405162461bcd60e51b8152600401610aef90613e39565b610b25336003611888565b565b606060068054610b3690613e5f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6290613e5f565b8015610baf5780601f10610b8457610100808354040283529160200191610baf565b820191906000526020600020905b815481529060010190602001808311610b9257829003601f168201915b5050505050905090565b6000610bc48261191f565b610be1576040516333d1c03960e21b815260040160405180910390fd5b506000908152600a60205260409020546001600160a01b031690565b6000610c08826110ef565b9050336001600160a01b03821614610c5e576001600160a01b0381166000908152600b6020908152604080832033845290915290205460ff16610c5e576040516367d9dca160e11b815260040160405180910390fd5b6000828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600c546001600160a01b03163314610ce45760405162461bcd60e51b8152600401610aef90613eb8565b601391909155601455565b600c546001600160a01b03163314610d195760405162461bcd60e51b8152600401610aef90613eb8565b601155565b6000610d2982611954565b9050836001600160a01b0316816001600160a01b031614610d5c5760405162a1148160e81b815260040160405180910390fd5b6000828152600a602052604090208054610d888187335b6001600160a01b039081169116811491141790565b610dd0576001600160a01b0386166000908152600b6020908152604080832033845290915290205460ff16610dd057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610df757604051633a954ecd60e21b815260040160405180910390fd5b610e0486868660016119bd565b8015610e0f57600082555b6001600160a01b038681166000908152600960205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260086020526040902055600160e11b8316610e9a5760018401600081815260086020526040902054610e98576004548114610e985760008181526008602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b600c546001600160a01b03163314610f0d5760405162461bcd60e51b8152600401610aef90613eb8565b6012546040516000916001600160a01b0316904790610f2b90613ec8565b60006040518083038185875af1925050503d8060008114610f68576040519150601f19603f3d011682016040523d82523d6000602084013e610f6d565b606091505b5050905080610f8e5760405162461bcd60e51b8152600401610aef90613eea565b50565b610fac8383836040518060200160405280600081525061155e565b505050565b610f8e816001611a00565b600c546001600160a01b03163314610fe65760405162461bcd60e51b8152600401610aef90613eb8565b610fac600e838361353e565b805160609060008167ffffffffffffffff8111156110125761101261388d565b60405190808252806020026020018201604052801561106457816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816110305790505b50905060005b8281146110b85761109385828151811061108657611086613efa565b60200260200101516115c1565b8282815181106110a5576110a5613efa565b602090810291909101015260010161106a565b509392505050565b600c546001600160a01b031633146110ea5760405162461bcd60e51b8152600401610aef90613eb8565b601055565b6000610abb82611954565b60006001600160a01b038216611123576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526009602052604090205467ffffffffffffffff1690565b600c546001600160a01b031633146111735760405162461bcd60e51b8152600401610aef90613eb8565b610b256000611b6f565b600c546001600160a01b031633146111a75760405162461bcd60e51b8152600401610aef90613eb8565b600f55565b606060008060006111bc856110fa565b905060008167ffffffffffffffff8111156111d9576111d961388d565b604051908082528060200260200182016040528015611202578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b8386146112ab5761123d81611bc1565b915081604001511561124e576112a3565b81516001600160a01b03161561126357815194505b876001600160a01b0316856001600160a01b031614156112a3578083878060010198508151811061129657611296613efa565b6020026020010181815250505b60010161122d565b50909695505050505050565b606060078054610b3690613e5f565b60608183106112e857604051631960ccad60e11b815260040160405180910390fd5b6000806112f460045490565b9050600185101561130457600194505b80841115611310578093505b600061131b876110fa565b90508486101561133a5785850381811015611334578091505b5061133e565b5060005b60008167ffffffffffffffff8111156113595761135961388d565b604051908082528060200260200182016040528015611382578160200160208202803683370190505b5090508161139557935061144b92505050565b60006113a0886115c1565b9050600081604001516113b1575080515b885b8881141580156113c35750848714155b1561143f576113d181611bc1565b92508260400151156113e257611437565b82516001600160a01b0316156113f757825191505b8a6001600160a01b0316826001600160a01b03161415611437578084888060010199508151811061142a5761142a613efa565b6020026020010181815250505b6001016113b3565b50505092835250909150505b9392505050565b6040516301473cbb60e71b815260040160405180910390fd5b6013544211801561147d575060145442105b6114995760405162461bcd60e51b8152600401610aef90613df5565b6010543410156114bb5760405162461bcd60e51b8152600401610aef90613e39565b610b25336002611888565b600c546001600160a01b031633146114f05760405162461bcd60e51b8152600401610aef90613eb8565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b0316331461153c5760405162461bcd60e51b8152600401610aef90613eb8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b611569848484610d1e565b6001600160a01b0383163b156115a25761158584848484611c40565b6115a2576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000601354421180156115bc575060145442105b905090565b604080516080810182526000808252602082018190529181018290526060810191909152604080516080810182526000808252602082018190529181018290526060810191909152600183108061161a57506004548310155b156116255792915050565b61162e83611bc1565b90508060400151156116405792915050565b61144b83611d38565b60606116548261191f565b61167157604051636f96cda160e11b815260040160405180910390fd5b600082815260166020526040902054600e9061168c90611db0565b60405160200161169d929190613f9d565b6040516020818303038152906040529050919050565b601354421180156116c5575060145442105b6116e15760405162461bcd60e51b8152600401610aef90613df5565b81816000336040516020016116f69190613fdd565b60405160208183030381529060405280519060200120905061174f83838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600f549150849050611eae565b61176b5760405162461bcd60e51b8152600401610aef90614026565b3360009081526015602052604090205460ff161561179b5760405162461bcd60e51b8152600401610aef9061406a565b336000818152601560205260409020805460ff191660019081179091556117c29190611888565b5050505050565b600c546001600160a01b031633146117f35760405162461bcd60e51b8152600401610aef90613eb8565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b0316331461183f5760405162461bcd60e51b8152600401610aef90613eb8565b6001600160a01b0381166118655760405162461bcd60e51b8152600401610aef906140c0565b610f8e81611b6f565b600061187982611ec4565b9050611884816120c4565b5050565b600061189360045490565b90506118a0836001612128565b6000818152601660209081526040918290208490559051610fac917f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae3690252916118ed91879186918891016140d0565b60408051601f198184030181529082905261190b92916020016140f8565b604051602081830303815290604052612212565b600081600111158015611933575060045482105b8015610abb575050600090815260086020526040902054600160e01b161590565b600081806001116119a4576004548110156119a457600081815260086020526040902054600160e01b81166119a2575b8061144b575060001901600081815260086020526040902054611984565b505b604051636f96cda160e11b815260040160405180910390fd5b6001600160a01b038316158015906119dd57506001600160a01b03841615155b156119fb5760405163399f41e760e01b815260040160405180910390fd5b6115a2565b6000611a0b83611954565b905080600080611a29866000908152600a6020526040902080549091565b915091508415611a8657611a3e818433610d73565b611a86576001600160a01b0383166000908152600b6020908152604080832033845290915290205460ff16611a8657604051632ce44b5f60e11b815260040160405180910390fd5b611a948360008860016119bd565b8015611a9f57600082555b6001600160a01b038316600081815260096020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260086020526040902055600160e11b8416611b265760018601600081815260086020526040902054611b24576004548114611b245760008181526008602052604090208590555b505b60405186906000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060058054600101905550505050565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260086020526040902054610abb90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611c75903390899088908890600401614118565b602060405180830381600087803b158015611c8f57600080fd5b505af1925050508015611cbf575060408051601f3d908101601f19168201909252611cbc91810190614167565b60015b611d1a573d808015611ced576040519150601f19603f3d011682016040523d82523d6000602084013e611cf2565b606091505b508051611d12576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610abb611d6883611954565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b606081611dd45750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611dfe5780611de88161419e565b9150611df79050600a836141cf565b9150611dd8565b60008167ffffffffffffffff811115611e1957611e1961388d565b6040519080825280601f01601f191660200182016040528015611e43576020820181803683370190505b5090505b8415611d3057611e586001836141e7565b9150611e65600a86614202565b611e7090603061421a565b60f81b818381518110611e8557611e85613efa565b60200101906001600160f81b031916908160001a905350611ea7600a866141cf565b9450611e47565b600082611ebb8584612276565b14949350505050565b60606000611ed1836122e2565b90506000611ede82612341565b90506000611eeb8361236a565b9050600081611ef984612393565b611f0286612551565b604051602001611f1493929190614232565b60408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff1615611f5c5760405162461bcd60e51b8152600401610aef906142a6565b6000818152600360205260408120805460ff19166001179055611f7e8561256d565b90506000611f8b826126b7565b9050611f9681612747565b6002546001600160a01b03908116911614611fc35760405162461bcd60e51b8152600401610aef906142f8565b6000611fce87612770565b9050611fee611fde846020015190565b87611fe88a61278c565b846127a8565b61200a5760405162461bcd60e51b8152600401610aef90614348565b6120388561201789612a5e565b6120208a612a7a565b8461202a8c612a96565b6120338d612ab2565b612ace565b50600061204483612bd6565b90507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03661207a612075836000612c12565b612c4a565b146120975760405162461bcd60e51b8152600401610aef9061438c565b60006120a284612cc5565b8060200190518101906120b591906143f4565b9b9a5050505050505050505050565b600080828060200190518101906120db919061443a565b915091507f306c27fde4d30e93105afde87f5773b4557f5fcbd91b3f18aedef29a5e80fd2882141561211057610fac81612ce1565b60405162461bcd60e51b8152600401610aef906144bc565b6004546001600160a01b03831661215157604051622e076360e81b815260040160405180910390fd5b8161216f5760405163b562e8dd60e01b815260040160405180910390fd5b61217c60008483856119bd565b6001600160a01b038316600081815260096020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260086020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106121c65760045550505050565b60005460025460405163b472047760e01b81526001600160a01b039283169263b4720477926122489291169085906004016144cc565b600060405180830381600087803b15801561226257600080fd5b505af11580156117c2573d6000803e3d6000fd5b600081815b84518110156110b857600085828151811061229857612298613efa565b602002602001015190508083116122be57600083815260208290526040902092506122cf565b600081815260208490526040902092505b50806122da8161419e565b91505061227b565b604080516020810190915260608152600061232c6123278460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b612d65565b60408051602081019091529081529392505050565b6060610abb826000015160088151811061235d5761235d613efa565b6020026020010151612e7b565b6000610abb826000015160028151811061238657612386613efa565b6020026020010151612c4a565b60408051602081019091526000815281516060919015610abb576000806123bb600086612f18565b60f81c905060018114806123d257508060ff166003145b1561247a576001855160026123e791906144da565b6123f191906141e7565b67ffffffffffffffff8111156124095761240961388d565b6040519080825280601f01601f191660200182016040528015612433576020820181803683370190505b5092506000612443600187612f18565b9050808460008151811061245957612459613efa565b60200101906001600160f81b031916908160001a90535060019250506124de565b60028551600261248a91906144da565b61249491906141e7565b67ffffffffffffffff8111156124ac576124ac61388d565b6040519080825280601f01601f1916602001820160405280156124d6576020820181803683370190505b509250600091505b60ff82165b83518110156125485761250d6124fc60ff8516836141e7565b61250790600261421a565b87612f18565b84828151811061251f5761251f613efa565b60200101906001600160f81b031916908160001a905350806125408161419e565b9150506124e3565b50505092915050565b6000610abb826000015160098151811061238657612386613efa565b61259160405180606001604052806060815260200160608152602001600081525090565b6125ab826000015160068151811061235d5761235d613efa565b6020828101829052604080518082018252600080825290830152805180820190915282518152918101908201526125e181612f99565b156125f6576125ef81612d65565b82526126a3565b6020820151805160009061260c906001906141e7565b67ffffffffffffffff8111156126245761262461388d565b6040519080825280601f01601f19166020018201604052801561264e576020820181803683370190505b50905060008083602101915082602001905061266c82828551612fd2565b60408051808201825260008082526020918201528151808301909252845182528085019082015261269c90612d65565b8652505050505b6126ac83612551565b604083015250919050565b60408051608081018252600091810182815260608083019390935281526020810191909152600061270583600001516003815181106126f8576126f8613efa565b6020026020010151612d65565b83604001518151811061271a5761271a613efa565b60200260200101519050604051806040016040528082815260200161273e83612d65565b90529392505050565b6000610abb826020015160008151811061276357612763613efa565b602002602001015161304d565b6000610abb826000015160058151811061238657612386613efa565b6060610abb826000015160078151811061235d5761235d613efa565b6000806127dc8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b905060006127e982612d65565b9050606080856000806127fb8b612393565b9050805160001415612817576000975050505050505050611d30565b60005b8651811015612a4e57815183111561283d57600098505050505050505050611d30565b61285f87828151811061285257612852613efa565b6020026020010151613067565b95508580519060200120841461288057600098505050505050505050611d30565b6128958782815181106126f8576126f8613efa565b945084516011141561296a5781518314156128f7578c805190602001206128c88660108151811061235d5761235d613efa565b8051906020012014156128e657600198505050505050505050611d30565b600098505050505050505050611d30565b600082848151811061290b5761290b613efa565b016020015160f81c905060108111156129305760009950505050505050505050611d30565b612955868260ff168151811061294857612948613efa565b60200260200101516130e7565b945061296260018561421a565b935050612a3c565b8451600214156128e657600061299661298f8760008151811061235d5761235d613efa565b8486613115565b83519091506129a5828661421a565b14156129fa578d805190602001206129c98760018151811061235d5761235d613efa565b8051906020012014156129e85760019950505050505050505050611d30565b60009950505050505050505050611d30565b80612a115760009950505050505050505050611d30565b612a1b818561421a565b9350612a338660018151811061294857612948613efa565b9450612a3c9050565b80612a468161419e565b91505061281a565b5050505050505050949350505050565b6000610abb826000015160038151811061238657612386613efa565b6000610abb826000015160048151811061238657612386613efa565b6000610abb826000015160008151811061238657612386613efa565b6060610abb826000015160018151811061235d5761235d613efa565b6001546040516320a9cea560e11b81526000918291829182916001600160a01b03909116906341539d4a90612b07908990600401613773565b60a06040518083038186803b158015612b1f57600080fd5b505afa158015612b33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b579190614504565b5093505092509250612bad828b612b6e91906141e7565b84878d8d8d8d604051602001612b87949392919061457c565b60405160208183030381529060405280519060200120613236909392919063ffffffff16565b612bc95760405162461bcd60e51b8152600401610aef906145f8565b9998505050505050505050565b6040805160208101909152606081526040518060200160405280612c0a84602001516001815181106126f8576126f8613efa565b905292915050565b60408051808201909152600080825260208201528251805183908110612c3a57612c3a613efa565b6020026020010151905092915050565b805160009015801590612c5f57508151602110155b612c6857600080fd5b6000612c77836020015161334a565b90506000818460000151612c8b91906141e7565b9050600080838660200151612ca0919061421a565b9050805191506020831015612cbc57826020036101000a820491505b50949350505050565b6060610abb826020015160028151811061235d5761235d613efa565b60008082806020019051810190612cf8919061467d565b600d546040516311b211c160e31b81529294509092506001600160a01b031690638d908e0890612d2e90859085906004016146cb565b600060405180830381600087803b158015612d4857600080fd5b505af1158015612d5c573d6000803e3d6000fd5b50505050505050565b6060612d7082612f99565b612d7957600080fd5b6000612d84836133cb565b905060008167ffffffffffffffff811115612da157612da161388d565b604051908082528060200260200182016040528015612de657816020015b6040805180820190915260008082526020820152815260200190600190039081612dbf5790505b5090506000612df8856020015161334a565b8560200151612e07919061421a565b90506000805b84811015612e7057612e1e8361344e565b9150604051806040016040528083815260200184815250848281518110612e4757612e47613efa565b6020908102919091010152612e5c828461421a565b925080612e688161419e565b915050612e0d565b509195945050505050565b8051606090612e8957600080fd5b6000612e98836020015161334a565b90506000818460000151612eac91906141e7565b905060008167ffffffffffffffff811115612ec957612ec961388d565b6040519080825280601f01601f191660200182016040528015612ef3576020820181803683370190505b5090506000816020019050612cbc848760200151612f11919061421a565b82856134f2565b6000612f25600284614202565b15612f5f57601082612f386002866141cf565b81518110612f4857612f48613efa565b0160200151612f5a919060f81c6146eb565b612f8f565b601082612f6d6002866141cf565b81518110612f7d57612f7d613efa565b0160200151612f8f919060f81c6146fc565b60f81b9392505050565b8051600090612faa57506000919050565b6020820151805160001a9060c0821015612fc8575060009392505050565b5060019392505050565b80612fdc57505050565b602081106130145782518252612ff360208461421a565b925061300060208361421a565b915061300d6020826141e7565b9050612fdc565b600060016130238360206141e7565b61302f9061010061481b565b61303991906141e7565b935183518516941916939093179091525050565b805160009060151461305e57600080fd5b610abb82612c4a565b60606000826000015167ffffffffffffffff8111156130885761308861388d565b6040519080825280601f01601f1916602001820160405280156130b2576020820181803683370190505b5090508051600014156130c55792915050565b60008160200190506130e084602001518286600001516134f2565b5092915050565b80516000906021146130f857600080fd5b6000808360200151600161310c919061421a565b51949350505050565b6000808061312286612393565b90506000815167ffffffffffffffff8111156131405761314061388d565b6040519080825280601f01601f19166020018201604052801561316a576020820181803683370190505b509050845b825161317b908761421a565b81101561320657600087828151811061319657613196613efa565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016905080836131cb89856141e7565b815181106131db576131db613efa565b60200101906001600160f81b031916908160001a9053505080806131fe9061419e565b91505061316f565b50808051906020012082805190602001201415613226578151925061322b565b600092505b509095945050505050565b6000602082516132469190614202565b156132635760405162461bcd60e51b8152600401610aef9061485e565b60006020835161327391906141cf565b905061328081600261481b565b851061329e5760405162461bcd60e51b8152600401610aef906148a2565b60008660205b8551811161333c578581015192506132bd600289614202565b6132f15781836040516020016132d49291906148b2565b60405160208183030381529060405280519060200120915061331d565b82826040516020016133049291906148b2565b6040516020818303038152906040528051906020012091505b6133286002896141cf565b975061333560208261421a565b90506132a4565b509094149695505050505050565b8051600090811a60808110156133635750600092915050565b60b881108061337e575060c0811080159061337e575060f881105b1561338c5750600192915050565b60c08110156133b9576133a1600160b86148d8565b6133ae9060ff16826141e7565b61144b90600161421a565b6133a1600160f86148d8565b50919050565b80516000906133dc57506000919050565b6000806133ec846020015161334a565b84602001516133fb919061421a565b9050600084600001518560200151613413919061421a565b90505b80821015613445576134278261344e565b613431908361421a565b91508261343d8161419e565b935050613416565b50909392505050565b80516000908190811a608081101561346957600191506130e0565b60b881101561348f5761347d6080826141e7565b61348890600161421a565b91506130e0565b60c08110156134bc5760b78103600185019450806020036101000a855104600182018101935050506130e0565b60f88110156134d05761347d60c0826141e7565b60019390930151602084900360f7016101000a900490920160f5190192915050565b806134fc57505050565b60208110613534578251825261351360208461421a565b925061352060208361421a565b915061352d6020826141e7565b90506134fc565b8061301457505050565b82805461354a90613e5f565b90600052602060002090601f01602090048101928261356c57600085556135b2565b82601f106135855782800160ff198235161785556135b2565b828001600101855582156135b2579182015b828111156135b2578235825591602001919060010190613597565b506135be9291506135c2565b5090565b5b808211156135be57600081556001016135c3565b6001600160e01b031981165b8114610f8e57600080fd5b8035610abb816135d7565b60006020828403121561360e5761360e600080fd5b6000611d3084846135ee565b8015155b82525050565b60208101610abb828461361a565b60005b8381101561364d578181015183820152602001613635565b838111156115a25750506000910152565b6000613668825190565b80845260208401935061367f818560208601613632565b601f01601f19169290920192915050565b6020808252810161144b818461365e565b806135e3565b8035610abb816136a1565b6000602082840312156136c7576136c7600080fd5b6000611d3084846136a7565b60006001600160a01b038216610abb565b61361e816136d3565b60208101610abb82846136e4565b6135e3816136d3565b8035610abb816136fb565b6000806040838503121561372557613725600080fd5b60006137318585613704565b9250506020613742858286016136a7565b9150509250929050565b60006020828403121561376157613761600080fd5b6000611d308484613704565b8061361e565b60208101610abb828461376d565b6000806040838503121561379757613797600080fd5b600061373185856136a7565b6000806000606084860312156137bb576137bb600080fd5b60006137c78686613704565b93505060206137d886828701613704565b92505060406137e9868287016136a7565b9150509250925092565b60008083601f84011261380857613808600080fd5b50813567ffffffffffffffff81111561382357613823600080fd5b60208301915083600182028301111561383e5761383e600080fd5b9250929050565b6000806020838503121561385b5761385b600080fd5b823567ffffffffffffffff81111561387557613875600080fd5b613881858286016137f3565b92509250509250929050565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156138c9576138c961388d565b6040525050565b60006138db60405190565b90506138e782826138a3565b919050565b600067ffffffffffffffff8211156139065761390661388d565b5060209081020190565b600061392361391e846138ec565b6138d0565b8381529050602080820190840283018581111561394257613942600080fd5b835b81811015613966578061395788826136a7565b84525060209283019201613944565b5050509392505050565b600082601f83011261398457613984600080fd5b8135611d30848260208601613910565b6000602082840312156139a9576139a9600080fd5b813567ffffffffffffffff8111156139c3576139c3600080fd5b611d3084828501613970565b67ffffffffffffffff811661361e565b62ffffff811661361e565b805160808301906139fb84826136e4565b506020820151613a0e60208501826139cf565b506040820151613a21604085018261361a565b5060608201516115a260608501826139df565b6000613a4083836139ea565b505060800190565b6000613a52825190565b80845260209384019383018060005b83811015613a86578151613a758882613a34565b975060208301925050600101613a61565b509495945050505050565b6020808252810161144b8184613a48565b6000613aae838361376d565b505060200190565b6000613ac0825190565b80845260209384019383018060005b83811015613a86578151613ae38882613aa2565b975060208301925050600101613acf565b6020808252810161144b8184613ab6565b600080600060608486031215613b1d57613b1d600080fd5b6000613b298686613704565b93505060206137d8868287016136a7565b8015156135e3565b8035610abb81613b3a565b60008060408385031215613b6357613b63600080fd5b6000613b6f8585613704565b925050602061374285828601613b42565b600067ffffffffffffffff821115613b9a57613b9a61388d565b601f19601f83011660200192915050565b82818337506000910152565b6000613bc561391e84613b80565b905082815260208101848484011115613be057613be0600080fd5b6110b8848285613bab565b600082601f830112613bff57613bff600080fd5b8135611d30848260208601613bb7565b60008060008060808587031215613c2857613c28600080fd5b6000613c348787613704565b9450506020613c4587828801613704565b9350506040613c56878288016136a7565b925050606085013567ffffffffffffffff811115613c7657613c76600080fd5b613c8287828801613beb565b91505092959194509250565b6000610abb826136d3565b6000610abb82613c8e565b61361e81613c99565b60208101610abb8284613ca4565b60808101610abb82846139ea565b60008083601f840112613cde57613cde600080fd5b50813567ffffffffffffffff811115613cf957613cf9600080fd5b60208301915083602082028301111561383e5761383e600080fd5b60008060208385031215613d2a57613d2a600080fd5b823567ffffffffffffffff811115613d4457613d44600080fd5b61388185828601613cc9565b60008060408385031215613d6657613d66600080fd5b6000613d728585613704565b925050602061374285828601613704565b600060208284031215613d9857613d98600080fd5b813567ffffffffffffffff811115613db257613db2600080fd5b611d3084828501613beb565b601681526000602082017f4d696e74696e67206973206e6f74206163746976652e00000000000000000000815291505b5060200190565b60208082528101610abb81613dbe565b601181526000602082017f4e6f7420656e6f7567682066756e64732e00000000000000000000000000000081529150613dee565b60208082528101610abb81613e05565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613e7357607f821691505b602082108114156133c5576133c5613e49565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081526000613dee565b60208082528101610abb81613e86565b600081610abb565b600381526000602082016239393960e81b81529150613dee565b60208082528101610abb81613ed0565b634e487b7160e01b600052603260045260246000fd5b60008154613f1d81613e5f565b600182168015613f345760018114613f4557612548565b60ff19831686528186019350612548565b60008581526020902060005b83811015613f6d57815488820152600190910190602001613f51565b505050939093019392505050565b6000613f85825190565b613f93818560208601613632565b9290920192915050565b6000613fa98285613f10565b9150611d308284613f7b565b6000610abb8260601b90565b6000610abb82613fb5565b61361e613fd8826136d3565b613fc1565b6000613fe98284613fcc565b50601401919050565b600e81526000602082017f496e76616c69642070726f6f662e00000000000000000000000000000000000081529150613dee565b60208082528101610abb81613ff2565b601381526000602082017f416c72656164792066726565206d696e7465640000000000000000000000000081529150613dee565b60208082528101610abb81614036565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015291505b5060400190565b60208082528101610abb8161407a565b606081016140de82866136e4565b6140eb602083018561376d565b611d30604083018461376d565b60408101614106828561376d565b8181036020830152611d30818461365e565b6080810161412682876136e4565b61413360208301866136e4565b614140604083018561376d565b8181036060830152614152818461365e565b9695505050505050565b8051610abb816135d7565b60006020828403121561417c5761417c600080fd5b6000611d30848461415c565b634e487b7160e01b600052601160045260246000fd5b60006000198214156141b2576141b2614188565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000825b9250826141e2576141e26141b9565b500490565b6000825b9250828210156141fd576141fd614188565b500390565b6000825b925082614215576142156141b9565b500690565b6000821982111561422d5761422d614188565b500190565b600061423e828661376d565b60208201915061424e8285613f7b565b915061425a828461376d565b506020019392505050565b602481526000602082017f4678526f6f7454756e6e656c3a20455849545f414c52454144595f50524f434581526314d4d15160e21b602082015291506140b9565b60208082528101610abb81614265565b602581526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f46585f4348494c445f54815264155393915360da1b602082015291506140b9565b60208082528101610abb816142b6565b602381526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f524543454950545f505281526227a7a360e91b602082015291506140b9565b60208082528101610abb81614308565b601f81526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f5349474e41545552450081529150613dee565b60208082528101610abb81614358565b60006143aa61391e84613b80565b9050828152602081018484840111156143c5576143c5600080fd5b6110b8848285613632565b600082601f8301126143e4576143e4600080fd5b8151611d3084826020860161439c565b60006020828403121561440957614409600080fd5b815167ffffffffffffffff81111561442357614423600080fd5b611d30848285016143d0565b8051610abb816136a1565b6000806040838503121561445057614450600080fd5b600061445c858561442f565b925050602083015167ffffffffffffffff81111561447c5761447c600080fd5b613742858286016143d0565b601181526000602082017f494e56414c49445f53594e435f5459504500000000000000000000000000000081529150613dee565b60208082528101610abb81614488565b6040810161410682856136e4565b60008160001904831182151516156144f4576144f4614188565b500290565b8051610abb816136fb565b600080600080600060a0868803121561451f5761451f600080fd5b600061452b888861442f565b955050602061453c8882890161442f565b945050604061454d8882890161442f565b935050606061455e8882890161442f565b925050608061456f888289016144f9565b9150509295509295909350565b6000614588828761376d565b602082019150614598828661376d565b6020820191506145a8828561376d565b6020820191506145b8828461376d565b50602001949350505050565b601c81526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f4845414445520000000081529150613dee565b60208082528101610abb816145c4565b600061461661391e846138ec565b8381529050602080820190840283018581111561463557614635600080fd5b835b81811015613966578061464a888261442f565b84525060209283019201614637565b600082601f83011261466d5761466d600080fd5b8151611d30848260208601614608565b6000806040838503121561469357614693600080fd5b600061469f85856144f9565b925050602083015167ffffffffffffffff8111156146bf576146bf600080fd5b61374285828601614659565b604081016146d982856136e4565b8181036020830152611d308184613ab6565b600060ff8216915060ff8316614206565b600060ff8216915060ff83166141d3565b80825b600185111561474c5780860481111561472b5761472b614188565b600185161561473957908102905b80026147458560011c90565b9450614710565b94509492505050565b6000826147645750600161144b565b816147715750600061144b565b81600181146147875760028114614791576147be565b600191505061144b565b60ff8411156147a2576147a2614188565b8360020a9150848211156147b8576147b8614188565b5061144b565b5060208310610133831016604e8410600b84101617156147f1575081810a838111156147ec576147ec614188565b61144b565b6147fe848484600161470d565b9250905081840481111561481457614814614188565b0292915050565b600061144b6000198484614755565b601481526000602082017f496e76616c69642070726f6f66206c656e67746800000000000000000000000081529150613dee565b60208082528101610abb8161482a565b601581526000602082017f4c65616620696e64657820697320746f6f20626967000000000000000000000081529150613dee565b60208082528101610abb8161486e565b60006148be828561376d565b6020820191506148ce828461376d565b5060200192915050565b600060ff8216915060ff83166141eb56fea264697066735822122070ac08b7d3f07368804367f3a40b60772976b761d69fb7fb20680dad8a5189c364736f6c63430008090033697066733a2f2f6261667962656967626164676271716d616a686469716768333534707171616633326461716c63646472663478636376626f34766f3665327a666d2f00000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2000000000000000000000000bd24a76f4135f930f5c49f6c30e0e30a61b97537

Deployed Bytecode

0x60806040526004361061034a5760003560e01c8063715018a6116101bb578063b88d4fde116100f7578063d629c86d11610095578063ea07e68a1161006f578063ea07e68a146109ef578063f0f4426014610a0f578063f2fde38b14610a2f578063f953cec714610a4f57600080fd5b8063d629c86d14610970578063de9b771f14610986578063e985e9c5146109a657600080fd5b8063c23dc68f116100d1578063c23dc68f146108cf578063c3b2ec49146108fc578063c87b56dd14610930578063cde9627a1461095057600080fd5b8063b88d4fde1461086d578063b8f7a6651461088d578063c0857ba0146108a257600080fd5b8063972c492811610164578063a4aab5f21161013e578063a4aab5f2146107ec578063a90b775514610825578063a9cdd60d1461082d578063aea4e49e1461084d57600080fd5b8063972c49281461078c57806399a2557a146107ac578063a22cb465146107cc57600080fd5b80638622a689116101955780638622a689146107435780638da5cb5b1461075957806395d89b411461077757600080fd5b8063715018a6146106e15780637cb64759146106f65780638462151c1461071657600080fd5b80633e9c7f691161028a5780635bbb2177116102335780636255c3ac1161020d5780636255c3ac146106545780636352211e146106745780636e321ce41461069457806370a08231146106c157600080fd5b80635bbb2177146105d7578063607f2d421461060457806361d027b31461063457600080fd5b806353b0e17d1161026457806353b0e17d1461058b57806353f8bb9a146105a157806355f804b3146105b757600080fd5b80633e9c7f691461051757806342842e0e1461054b57806342966c681461056b57600080fd5b80630e387de6116102f75780631b888657116102d15780631b888657146104ac57806323b872dd146104cc5780632eb4a7ab146104ec5780633ccfd60b1461050257600080fd5b80630e387de61461042e5780630f8677511461046f57806318160ddd1461048f57600080fd5b8063081812fc11610328578063081812fc146103b1578063095ea7b3146103de5780630ca80c15146103fe57600080fd5b806301ffc9a71461034f5780630245b80f1461038557806306fdde031461038f575b600080fd5b34801561035b57600080fd5b5061036f61036a3660046135f9565b610a6f565b60405161037c9190613624565b60405180910390f35b61038d610ac1565b005b34801561039b57600080fd5b506103a4610b27565b60405161037c9190613690565b3480156103bd57600080fd5b506103d16103cc3660046136b2565b610bb9565b60405161037c91906136ed565b3480156103ea57600080fd5b5061038d6103f936600461370f565b610bfd565b34801561040a57600080fd5b5061036f61041936600461374c565b60156020526000908152604090205460ff1681565b34801561043a57600080fd5b506104627f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03681565b60405161037c9190613773565b34801561047b57600080fd5b5061038d61048a366004613781565b610cba565b34801561049b57600080fd5b506005546004540360001901610462565b3480156104b857600080fd5b5061038d6104c73660046136b2565b610cef565b3480156104d857600080fd5b5061038d6104e73660046137a3565b610d1e565b3480156104f857600080fd5b50610462600f5481565b34801561050e57600080fd5b5061038d610ee3565b34801561052357600080fd5b506104627f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae369025281565b34801561055757600080fd5b5061038d6105663660046137a3565b610f91565b34801561057757600080fd5b5061038d6105863660046136b2565b610fb1565b34801561059757600080fd5b5061046260105481565b3480156105ad57600080fd5b5061046260135481565b3480156105c357600080fd5b5061038d6105d2366004613845565b610fbc565b3480156105e357600080fd5b506105f76105f2366004613994565b610ff2565b60405161037c9190613a91565b34801561061057600080fd5b5061036f61061f3660046136b2565b60036020526000908152604090205460ff1681565b34801561064057600080fd5b506012546103d1906001600160a01b031681565b34801561066057600080fd5b5061038d61066f3660046136b2565b6110c0565b34801561068057600080fd5b506103d161068f3660046136b2565b6110ef565b3480156106a057600080fd5b506104626106af3660046136b2565b60166020526000908152604090205481565b3480156106cd57600080fd5b506104626106dc36600461374c565b6110fa565b3480156106ed57600080fd5b5061038d611149565b34801561070257600080fd5b5061038d6107113660046136b2565b61117d565b34801561072257600080fd5b5061073661073136600461374c565b6111ac565b60405161037c9190613af4565b34801561074f57600080fd5b5061046260145481565b34801561076557600080fd5b50600c546001600160a01b03166103d1565b34801561078357600080fd5b506103a46112b7565b34801561079857600080fd5b506002546103d1906001600160a01b031681565b3480156107b857600080fd5b506107366107c7366004613b05565b6112c6565b3480156107d857600080fd5b5061038d6107e7366004613b4d565b611452565b3480156107f857600080fd5b5061036f61080736600461374c565b6001600160a01b031660009081526015602052604090205460ff1690565b61038d61146b565b34801561083957600080fd5b5061038d61084836600461374c565b6114c6565b34801561085957600080fd5b5061038d61086836600461374c565b611512565b34801561087957600080fd5b5061038d610888366004613c0f565b61155e565b34801561089957600080fd5b5061036f6115a8565b3480156108ae57600080fd5b506001546108c2906001600160a01b031681565b60405161037c9190613cad565b3480156108db57600080fd5b506108ef6108ea3660046136b2565b6115c1565b60405161037c9190613cbb565b34801561090857600080fd5b506104627f306c27fde4d30e93105afde87f5773b4557f5fcbd91b3f18aedef29a5e80fd2881565b34801561093c57600080fd5b506103a461094b3660046136b2565b611649565b34801561095c57600080fd5b5061038d61096b366004613d14565b6116b3565b34801561097c57600080fd5b5061046260115481565b34801561099257600080fd5b506000546108c2906001600160a01b031681565b3480156109b257600080fd5b5061036f6109c1366004613d50565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205460ff1690565b3480156109fb57600080fd5b50600d546108c2906001600160a01b031681565b348015610a1b57600080fd5b5061038d610a2a36600461374c565b6117c9565b348015610a3b57600080fd5b5061038d610a4a36600461374c565b611815565b348015610a5b57600080fd5b5061038d610a6a366004613d83565b61186e565b60006301ffc9a760e01b6001600160e01b031983161480610aa057506380ac58cd60e01b6001600160e01b03198316145b80610abb5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60135442118015610ad3575060145442105b610af85760405162461bcd60e51b8152600401610aef90613df5565b60405180910390fd5b601154341015610b1a5760405162461bcd60e51b8152600401610aef90613e39565b610b25336003611888565b565b606060068054610b3690613e5f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6290613e5f565b8015610baf5780601f10610b8457610100808354040283529160200191610baf565b820191906000526020600020905b815481529060010190602001808311610b9257829003601f168201915b5050505050905090565b6000610bc48261191f565b610be1576040516333d1c03960e21b815260040160405180910390fd5b506000908152600a60205260409020546001600160a01b031690565b6000610c08826110ef565b9050336001600160a01b03821614610c5e576001600160a01b0381166000908152600b6020908152604080832033845290915290205460ff16610c5e576040516367d9dca160e11b815260040160405180910390fd5b6000828152600a602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600c546001600160a01b03163314610ce45760405162461bcd60e51b8152600401610aef90613eb8565b601391909155601455565b600c546001600160a01b03163314610d195760405162461bcd60e51b8152600401610aef90613eb8565b601155565b6000610d2982611954565b9050836001600160a01b0316816001600160a01b031614610d5c5760405162a1148160e81b815260040160405180910390fd5b6000828152600a602052604090208054610d888187335b6001600160a01b039081169116811491141790565b610dd0576001600160a01b0386166000908152600b6020908152604080832033845290915290205460ff16610dd057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610df757604051633a954ecd60e21b815260040160405180910390fd5b610e0486868660016119bd565b8015610e0f57600082555b6001600160a01b038681166000908152600960205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260086020526040902055600160e11b8316610e9a5760018401600081815260086020526040902054610e98576004548114610e985760008181526008602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b600c546001600160a01b03163314610f0d5760405162461bcd60e51b8152600401610aef90613eb8565b6012546040516000916001600160a01b0316904790610f2b90613ec8565b60006040518083038185875af1925050503d8060008114610f68576040519150601f19603f3d011682016040523d82523d6000602084013e610f6d565b606091505b5050905080610f8e5760405162461bcd60e51b8152600401610aef90613eea565b50565b610fac8383836040518060200160405280600081525061155e565b505050565b610f8e816001611a00565b600c546001600160a01b03163314610fe65760405162461bcd60e51b8152600401610aef90613eb8565b610fac600e838361353e565b805160609060008167ffffffffffffffff8111156110125761101261388d565b60405190808252806020026020018201604052801561106457816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816110305790505b50905060005b8281146110b85761109385828151811061108657611086613efa565b60200260200101516115c1565b8282815181106110a5576110a5613efa565b602090810291909101015260010161106a565b509392505050565b600c546001600160a01b031633146110ea5760405162461bcd60e51b8152600401610aef90613eb8565b601055565b6000610abb82611954565b60006001600160a01b038216611123576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526009602052604090205467ffffffffffffffff1690565b600c546001600160a01b031633146111735760405162461bcd60e51b8152600401610aef90613eb8565b610b256000611b6f565b600c546001600160a01b031633146111a75760405162461bcd60e51b8152600401610aef90613eb8565b600f55565b606060008060006111bc856110fa565b905060008167ffffffffffffffff8111156111d9576111d961388d565b604051908082528060200260200182016040528015611202578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b8386146112ab5761123d81611bc1565b915081604001511561124e576112a3565b81516001600160a01b03161561126357815194505b876001600160a01b0316856001600160a01b031614156112a3578083878060010198508151811061129657611296613efa565b6020026020010181815250505b60010161122d565b50909695505050505050565b606060078054610b3690613e5f565b60608183106112e857604051631960ccad60e11b815260040160405180910390fd5b6000806112f460045490565b9050600185101561130457600194505b80841115611310578093505b600061131b876110fa565b90508486101561133a5785850381811015611334578091505b5061133e565b5060005b60008167ffffffffffffffff8111156113595761135961388d565b604051908082528060200260200182016040528015611382578160200160208202803683370190505b5090508161139557935061144b92505050565b60006113a0886115c1565b9050600081604001516113b1575080515b885b8881141580156113c35750848714155b1561143f576113d181611bc1565b92508260400151156113e257611437565b82516001600160a01b0316156113f757825191505b8a6001600160a01b0316826001600160a01b03161415611437578084888060010199508151811061142a5761142a613efa565b6020026020010181815250505b6001016113b3565b50505092835250909150505b9392505050565b6040516301473cbb60e71b815260040160405180910390fd5b6013544211801561147d575060145442105b6114995760405162461bcd60e51b8152600401610aef90613df5565b6010543410156114bb5760405162461bcd60e51b8152600401610aef90613e39565b610b25336002611888565b600c546001600160a01b031633146114f05760405162461bcd60e51b8152600401610aef90613eb8565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b0316331461153c5760405162461bcd60e51b8152600401610aef90613eb8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b611569848484610d1e565b6001600160a01b0383163b156115a25761158584848484611c40565b6115a2576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000601354421180156115bc575060145442105b905090565b604080516080810182526000808252602082018190529181018290526060810191909152604080516080810182526000808252602082018190529181018290526060810191909152600183108061161a57506004548310155b156116255792915050565b61162e83611bc1565b90508060400151156116405792915050565b61144b83611d38565b60606116548261191f565b61167157604051636f96cda160e11b815260040160405180910390fd5b600082815260166020526040902054600e9061168c90611db0565b60405160200161169d929190613f9d565b6040516020818303038152906040529050919050565b601354421180156116c5575060145442105b6116e15760405162461bcd60e51b8152600401610aef90613df5565b81816000336040516020016116f69190613fdd565b60405160208183030381529060405280519060200120905061174f83838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600f549150849050611eae565b61176b5760405162461bcd60e51b8152600401610aef90614026565b3360009081526015602052604090205460ff161561179b5760405162461bcd60e51b8152600401610aef9061406a565b336000818152601560205260409020805460ff191660019081179091556117c29190611888565b5050505050565b600c546001600160a01b031633146117f35760405162461bcd60e51b8152600401610aef90613eb8565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b0316331461183f5760405162461bcd60e51b8152600401610aef90613eb8565b6001600160a01b0381166118655760405162461bcd60e51b8152600401610aef906140c0565b610f8e81611b6f565b600061187982611ec4565b9050611884816120c4565b5050565b600061189360045490565b90506118a0836001612128565b6000818152601660209081526040918290208490559051610fac917f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae3690252916118ed91879186918891016140d0565b60408051601f198184030181529082905261190b92916020016140f8565b604051602081830303815290604052612212565b600081600111158015611933575060045482105b8015610abb575050600090815260086020526040902054600160e01b161590565b600081806001116119a4576004548110156119a457600081815260086020526040902054600160e01b81166119a2575b8061144b575060001901600081815260086020526040902054611984565b505b604051636f96cda160e11b815260040160405180910390fd5b6001600160a01b038316158015906119dd57506001600160a01b03841615155b156119fb5760405163399f41e760e01b815260040160405180910390fd5b6115a2565b6000611a0b83611954565b905080600080611a29866000908152600a6020526040902080549091565b915091508415611a8657611a3e818433610d73565b611a86576001600160a01b0383166000908152600b6020908152604080832033845290915290205460ff16611a8657604051632ce44b5f60e11b815260040160405180910390fd5b611a948360008860016119bd565b8015611a9f57600082555b6001600160a01b038316600081815260096020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b17600087815260086020526040902055600160e11b8416611b265760018601600081815260086020526040902054611b24576004548114611b245760008181526008602052604090208590555b505b60405186906000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060058054600101905550505050565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260086020526040902054610abb90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611c75903390899088908890600401614118565b602060405180830381600087803b158015611c8f57600080fd5b505af1925050508015611cbf575060408051601f3d908101601f19168201909252611cbc91810190614167565b60015b611d1a573d808015611ced576040519150601f19603f3d011682016040523d82523d6000602084013e611cf2565b606091505b508051611d12576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610abb611d6883611954565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b606081611dd45750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611dfe5780611de88161419e565b9150611df79050600a836141cf565b9150611dd8565b60008167ffffffffffffffff811115611e1957611e1961388d565b6040519080825280601f01601f191660200182016040528015611e43576020820181803683370190505b5090505b8415611d3057611e586001836141e7565b9150611e65600a86614202565b611e7090603061421a565b60f81b818381518110611e8557611e85613efa565b60200101906001600160f81b031916908160001a905350611ea7600a866141cf565b9450611e47565b600082611ebb8584612276565b14949350505050565b60606000611ed1836122e2565b90506000611ede82612341565b90506000611eeb8361236a565b9050600081611ef984612393565b611f0286612551565b604051602001611f1493929190614232565b60408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff1615611f5c5760405162461bcd60e51b8152600401610aef906142a6565b6000818152600360205260408120805460ff19166001179055611f7e8561256d565b90506000611f8b826126b7565b9050611f9681612747565b6002546001600160a01b03908116911614611fc35760405162461bcd60e51b8152600401610aef906142f8565b6000611fce87612770565b9050611fee611fde846020015190565b87611fe88a61278c565b846127a8565b61200a5760405162461bcd60e51b8152600401610aef90614348565b6120388561201789612a5e565b6120208a612a7a565b8461202a8c612a96565b6120338d612ab2565b612ace565b50600061204483612bd6565b90507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03661207a612075836000612c12565b612c4a565b146120975760405162461bcd60e51b8152600401610aef9061438c565b60006120a284612cc5565b8060200190518101906120b591906143f4565b9b9a5050505050505050505050565b600080828060200190518101906120db919061443a565b915091507f306c27fde4d30e93105afde87f5773b4557f5fcbd91b3f18aedef29a5e80fd2882141561211057610fac81612ce1565b60405162461bcd60e51b8152600401610aef906144bc565b6004546001600160a01b03831661215157604051622e076360e81b815260040160405180910390fd5b8161216f5760405163b562e8dd60e01b815260040160405180910390fd5b61217c60008483856119bd565b6001600160a01b038316600081815260096020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260086020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106121c65760045550505050565b60005460025460405163b472047760e01b81526001600160a01b039283169263b4720477926122489291169085906004016144cc565b600060405180830381600087803b15801561226257600080fd5b505af11580156117c2573d6000803e3d6000fd5b600081815b84518110156110b857600085828151811061229857612298613efa565b602002602001015190508083116122be57600083815260208290526040902092506122cf565b600081815260208490526040902092505b50806122da8161419e565b91505061227b565b604080516020810190915260608152600061232c6123278460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b612d65565b60408051602081019091529081529392505050565b6060610abb826000015160088151811061235d5761235d613efa565b6020026020010151612e7b565b6000610abb826000015160028151811061238657612386613efa565b6020026020010151612c4a565b60408051602081019091526000815281516060919015610abb576000806123bb600086612f18565b60f81c905060018114806123d257508060ff166003145b1561247a576001855160026123e791906144da565b6123f191906141e7565b67ffffffffffffffff8111156124095761240961388d565b6040519080825280601f01601f191660200182016040528015612433576020820181803683370190505b5092506000612443600187612f18565b9050808460008151811061245957612459613efa565b60200101906001600160f81b031916908160001a90535060019250506124de565b60028551600261248a91906144da565b61249491906141e7565b67ffffffffffffffff8111156124ac576124ac61388d565b6040519080825280601f01601f1916602001820160405280156124d6576020820181803683370190505b509250600091505b60ff82165b83518110156125485761250d6124fc60ff8516836141e7565b61250790600261421a565b87612f18565b84828151811061251f5761251f613efa565b60200101906001600160f81b031916908160001a905350806125408161419e565b9150506124e3565b50505092915050565b6000610abb826000015160098151811061238657612386613efa565b61259160405180606001604052806060815260200160608152602001600081525090565b6125ab826000015160068151811061235d5761235d613efa565b6020828101829052604080518082018252600080825290830152805180820190915282518152918101908201526125e181612f99565b156125f6576125ef81612d65565b82526126a3565b6020820151805160009061260c906001906141e7565b67ffffffffffffffff8111156126245761262461388d565b6040519080825280601f01601f19166020018201604052801561264e576020820181803683370190505b50905060008083602101915082602001905061266c82828551612fd2565b60408051808201825260008082526020918201528151808301909252845182528085019082015261269c90612d65565b8652505050505b6126ac83612551565b604083015250919050565b60408051608081018252600091810182815260608083019390935281526020810191909152600061270583600001516003815181106126f8576126f8613efa565b6020026020010151612d65565b83604001518151811061271a5761271a613efa565b60200260200101519050604051806040016040528082815260200161273e83612d65565b90529392505050565b6000610abb826020015160008151811061276357612763613efa565b602002602001015161304d565b6000610abb826000015160058151811061238657612386613efa565b6060610abb826000015160078151811061235d5761235d613efa565b6000806127dc8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b905060006127e982612d65565b9050606080856000806127fb8b612393565b9050805160001415612817576000975050505050505050611d30565b60005b8651811015612a4e57815183111561283d57600098505050505050505050611d30565b61285f87828151811061285257612852613efa565b6020026020010151613067565b95508580519060200120841461288057600098505050505050505050611d30565b6128958782815181106126f8576126f8613efa565b945084516011141561296a5781518314156128f7578c805190602001206128c88660108151811061235d5761235d613efa565b8051906020012014156128e657600198505050505050505050611d30565b600098505050505050505050611d30565b600082848151811061290b5761290b613efa565b016020015160f81c905060108111156129305760009950505050505050505050611d30565b612955868260ff168151811061294857612948613efa565b60200260200101516130e7565b945061296260018561421a565b935050612a3c565b8451600214156128e657600061299661298f8760008151811061235d5761235d613efa565b8486613115565b83519091506129a5828661421a565b14156129fa578d805190602001206129c98760018151811061235d5761235d613efa565b8051906020012014156129e85760019950505050505050505050611d30565b60009950505050505050505050611d30565b80612a115760009950505050505050505050611d30565b612a1b818561421a565b9350612a338660018151811061294857612948613efa565b9450612a3c9050565b80612a468161419e565b91505061281a565b5050505050505050949350505050565b6000610abb826000015160038151811061238657612386613efa565b6000610abb826000015160048151811061238657612386613efa565b6000610abb826000015160008151811061238657612386613efa565b6060610abb826000015160018151811061235d5761235d613efa565b6001546040516320a9cea560e11b81526000918291829182916001600160a01b03909116906341539d4a90612b07908990600401613773565b60a06040518083038186803b158015612b1f57600080fd5b505afa158015612b33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b579190614504565b5093505092509250612bad828b612b6e91906141e7565b84878d8d8d8d604051602001612b87949392919061457c565b60405160208183030381529060405280519060200120613236909392919063ffffffff16565b612bc95760405162461bcd60e51b8152600401610aef906145f8565b9998505050505050505050565b6040805160208101909152606081526040518060200160405280612c0a84602001516001815181106126f8576126f8613efa565b905292915050565b60408051808201909152600080825260208201528251805183908110612c3a57612c3a613efa565b6020026020010151905092915050565b805160009015801590612c5f57508151602110155b612c6857600080fd5b6000612c77836020015161334a565b90506000818460000151612c8b91906141e7565b9050600080838660200151612ca0919061421a565b9050805191506020831015612cbc57826020036101000a820491505b50949350505050565b6060610abb826020015160028151811061235d5761235d613efa565b60008082806020019051810190612cf8919061467d565b600d546040516311b211c160e31b81529294509092506001600160a01b031690638d908e0890612d2e90859085906004016146cb565b600060405180830381600087803b158015612d4857600080fd5b505af1158015612d5c573d6000803e3d6000fd5b50505050505050565b6060612d7082612f99565b612d7957600080fd5b6000612d84836133cb565b905060008167ffffffffffffffff811115612da157612da161388d565b604051908082528060200260200182016040528015612de657816020015b6040805180820190915260008082526020820152815260200190600190039081612dbf5790505b5090506000612df8856020015161334a565b8560200151612e07919061421a565b90506000805b84811015612e7057612e1e8361344e565b9150604051806040016040528083815260200184815250848281518110612e4757612e47613efa565b6020908102919091010152612e5c828461421a565b925080612e688161419e565b915050612e0d565b509195945050505050565b8051606090612e8957600080fd5b6000612e98836020015161334a565b90506000818460000151612eac91906141e7565b905060008167ffffffffffffffff811115612ec957612ec961388d565b6040519080825280601f01601f191660200182016040528015612ef3576020820181803683370190505b5090506000816020019050612cbc848760200151612f11919061421a565b82856134f2565b6000612f25600284614202565b15612f5f57601082612f386002866141cf565b81518110612f4857612f48613efa565b0160200151612f5a919060f81c6146eb565b612f8f565b601082612f6d6002866141cf565b81518110612f7d57612f7d613efa565b0160200151612f8f919060f81c6146fc565b60f81b9392505050565b8051600090612faa57506000919050565b6020820151805160001a9060c0821015612fc8575060009392505050565b5060019392505050565b80612fdc57505050565b602081106130145782518252612ff360208461421a565b925061300060208361421a565b915061300d6020826141e7565b9050612fdc565b600060016130238360206141e7565b61302f9061010061481b565b61303991906141e7565b935183518516941916939093179091525050565b805160009060151461305e57600080fd5b610abb82612c4a565b60606000826000015167ffffffffffffffff8111156130885761308861388d565b6040519080825280601f01601f1916602001820160405280156130b2576020820181803683370190505b5090508051600014156130c55792915050565b60008160200190506130e084602001518286600001516134f2565b5092915050565b80516000906021146130f857600080fd5b6000808360200151600161310c919061421a565b51949350505050565b6000808061312286612393565b90506000815167ffffffffffffffff8111156131405761314061388d565b6040519080825280601f01601f19166020018201604052801561316a576020820181803683370190505b509050845b825161317b908761421a565b81101561320657600087828151811061319657613196613efa565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016905080836131cb89856141e7565b815181106131db576131db613efa565b60200101906001600160f81b031916908160001a9053505080806131fe9061419e565b91505061316f565b50808051906020012082805190602001201415613226578151925061322b565b600092505b509095945050505050565b6000602082516132469190614202565b156132635760405162461bcd60e51b8152600401610aef9061485e565b60006020835161327391906141cf565b905061328081600261481b565b851061329e5760405162461bcd60e51b8152600401610aef906148a2565b60008660205b8551811161333c578581015192506132bd600289614202565b6132f15781836040516020016132d49291906148b2565b60405160208183030381529060405280519060200120915061331d565b82826040516020016133049291906148b2565b6040516020818303038152906040528051906020012091505b6133286002896141cf565b975061333560208261421a565b90506132a4565b509094149695505050505050565b8051600090811a60808110156133635750600092915050565b60b881108061337e575060c0811080159061337e575060f881105b1561338c5750600192915050565b60c08110156133b9576133a1600160b86148d8565b6133ae9060ff16826141e7565b61144b90600161421a565b6133a1600160f86148d8565b50919050565b80516000906133dc57506000919050565b6000806133ec846020015161334a565b84602001516133fb919061421a565b9050600084600001518560200151613413919061421a565b90505b80821015613445576134278261344e565b613431908361421a565b91508261343d8161419e565b935050613416565b50909392505050565b80516000908190811a608081101561346957600191506130e0565b60b881101561348f5761347d6080826141e7565b61348890600161421a565b91506130e0565b60c08110156134bc5760b78103600185019450806020036101000a855104600182018101935050506130e0565b60f88110156134d05761347d60c0826141e7565b60019390930151602084900360f7016101000a900490920160f5190192915050565b806134fc57505050565b60208110613534578251825261351360208461421a565b925061352060208361421a565b915061352d6020826141e7565b90506134fc565b8061301457505050565b82805461354a90613e5f565b90600052602060002090601f01602090048101928261356c57600085556135b2565b82601f106135855782800160ff198235161785556135b2565b828001600101855582156135b2579182015b828111156135b2578235825591602001919060010190613597565b506135be9291506135c2565b5090565b5b808211156135be57600081556001016135c3565b6001600160e01b031981165b8114610f8e57600080fd5b8035610abb816135d7565b60006020828403121561360e5761360e600080fd5b6000611d3084846135ee565b8015155b82525050565b60208101610abb828461361a565b60005b8381101561364d578181015183820152602001613635565b838111156115a25750506000910152565b6000613668825190565b80845260208401935061367f818560208601613632565b601f01601f19169290920192915050565b6020808252810161144b818461365e565b806135e3565b8035610abb816136a1565b6000602082840312156136c7576136c7600080fd5b6000611d3084846136a7565b60006001600160a01b038216610abb565b61361e816136d3565b60208101610abb82846136e4565b6135e3816136d3565b8035610abb816136fb565b6000806040838503121561372557613725600080fd5b60006137318585613704565b9250506020613742858286016136a7565b9150509250929050565b60006020828403121561376157613761600080fd5b6000611d308484613704565b8061361e565b60208101610abb828461376d565b6000806040838503121561379757613797600080fd5b600061373185856136a7565b6000806000606084860312156137bb576137bb600080fd5b60006137c78686613704565b93505060206137d886828701613704565b92505060406137e9868287016136a7565b9150509250925092565b60008083601f84011261380857613808600080fd5b50813567ffffffffffffffff81111561382357613823600080fd5b60208301915083600182028301111561383e5761383e600080fd5b9250929050565b6000806020838503121561385b5761385b600080fd5b823567ffffffffffffffff81111561387557613875600080fd5b613881858286016137f3565b92509250509250929050565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156138c9576138c961388d565b6040525050565b60006138db60405190565b90506138e782826138a3565b919050565b600067ffffffffffffffff8211156139065761390661388d565b5060209081020190565b600061392361391e846138ec565b6138d0565b8381529050602080820190840283018581111561394257613942600080fd5b835b81811015613966578061395788826136a7565b84525060209283019201613944565b5050509392505050565b600082601f83011261398457613984600080fd5b8135611d30848260208601613910565b6000602082840312156139a9576139a9600080fd5b813567ffffffffffffffff8111156139c3576139c3600080fd5b611d3084828501613970565b67ffffffffffffffff811661361e565b62ffffff811661361e565b805160808301906139fb84826136e4565b506020820151613a0e60208501826139cf565b506040820151613a21604085018261361a565b5060608201516115a260608501826139df565b6000613a4083836139ea565b505060800190565b6000613a52825190565b80845260209384019383018060005b83811015613a86578151613a758882613a34565b975060208301925050600101613a61565b509495945050505050565b6020808252810161144b8184613a48565b6000613aae838361376d565b505060200190565b6000613ac0825190565b80845260209384019383018060005b83811015613a86578151613ae38882613aa2565b975060208301925050600101613acf565b6020808252810161144b8184613ab6565b600080600060608486031215613b1d57613b1d600080fd5b6000613b298686613704565b93505060206137d8868287016136a7565b8015156135e3565b8035610abb81613b3a565b60008060408385031215613b6357613b63600080fd5b6000613b6f8585613704565b925050602061374285828601613b42565b600067ffffffffffffffff821115613b9a57613b9a61388d565b601f19601f83011660200192915050565b82818337506000910152565b6000613bc561391e84613b80565b905082815260208101848484011115613be057613be0600080fd5b6110b8848285613bab565b600082601f830112613bff57613bff600080fd5b8135611d30848260208601613bb7565b60008060008060808587031215613c2857613c28600080fd5b6000613c348787613704565b9450506020613c4587828801613704565b9350506040613c56878288016136a7565b925050606085013567ffffffffffffffff811115613c7657613c76600080fd5b613c8287828801613beb565b91505092959194509250565b6000610abb826136d3565b6000610abb82613c8e565b61361e81613c99565b60208101610abb8284613ca4565b60808101610abb82846139ea565b60008083601f840112613cde57613cde600080fd5b50813567ffffffffffffffff811115613cf957613cf9600080fd5b60208301915083602082028301111561383e5761383e600080fd5b60008060208385031215613d2a57613d2a600080fd5b823567ffffffffffffffff811115613d4457613d44600080fd5b61388185828601613cc9565b60008060408385031215613d6657613d66600080fd5b6000613d728585613704565b925050602061374285828601613704565b600060208284031215613d9857613d98600080fd5b813567ffffffffffffffff811115613db257613db2600080fd5b611d3084828501613beb565b601681526000602082017f4d696e74696e67206973206e6f74206163746976652e00000000000000000000815291505b5060200190565b60208082528101610abb81613dbe565b601181526000602082017f4e6f7420656e6f7567682066756e64732e00000000000000000000000000000081529150613dee565b60208082528101610abb81613e05565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613e7357607f821691505b602082108114156133c5576133c5613e49565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081526000613dee565b60208082528101610abb81613e86565b600081610abb565b600381526000602082016239393960e81b81529150613dee565b60208082528101610abb81613ed0565b634e487b7160e01b600052603260045260246000fd5b60008154613f1d81613e5f565b600182168015613f345760018114613f4557612548565b60ff19831686528186019350612548565b60008581526020902060005b83811015613f6d57815488820152600190910190602001613f51565b505050939093019392505050565b6000613f85825190565b613f93818560208601613632565b9290920192915050565b6000613fa98285613f10565b9150611d308284613f7b565b6000610abb8260601b90565b6000610abb82613fb5565b61361e613fd8826136d3565b613fc1565b6000613fe98284613fcc565b50601401919050565b600e81526000602082017f496e76616c69642070726f6f662e00000000000000000000000000000000000081529150613dee565b60208082528101610abb81613ff2565b601381526000602082017f416c72656164792066726565206d696e7465640000000000000000000000000081529150613dee565b60208082528101610abb81614036565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015291505b5060400190565b60208082528101610abb8161407a565b606081016140de82866136e4565b6140eb602083018561376d565b611d30604083018461376d565b60408101614106828561376d565b8181036020830152611d30818461365e565b6080810161412682876136e4565b61413360208301866136e4565b614140604083018561376d565b8181036060830152614152818461365e565b9695505050505050565b8051610abb816135d7565b60006020828403121561417c5761417c600080fd5b6000611d30848461415c565b634e487b7160e01b600052601160045260246000fd5b60006000198214156141b2576141b2614188565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000825b9250826141e2576141e26141b9565b500490565b6000825b9250828210156141fd576141fd614188565b500390565b6000825b925082614215576142156141b9565b500690565b6000821982111561422d5761422d614188565b500190565b600061423e828661376d565b60208201915061424e8285613f7b565b915061425a828461376d565b506020019392505050565b602481526000602082017f4678526f6f7454756e6e656c3a20455849545f414c52454144595f50524f434581526314d4d15160e21b602082015291506140b9565b60208082528101610abb81614265565b602581526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f46585f4348494c445f54815264155393915360da1b602082015291506140b9565b60208082528101610abb816142b6565b602381526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f524543454950545f505281526227a7a360e91b602082015291506140b9565b60208082528101610abb81614308565b601f81526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f5349474e41545552450081529150613dee565b60208082528101610abb81614358565b60006143aa61391e84613b80565b9050828152602081018484840111156143c5576143c5600080fd5b6110b8848285613632565b600082601f8301126143e4576143e4600080fd5b8151611d3084826020860161439c565b60006020828403121561440957614409600080fd5b815167ffffffffffffffff81111561442357614423600080fd5b611d30848285016143d0565b8051610abb816136a1565b6000806040838503121561445057614450600080fd5b600061445c858561442f565b925050602083015167ffffffffffffffff81111561447c5761447c600080fd5b613742858286016143d0565b601181526000602082017f494e56414c49445f53594e435f5459504500000000000000000000000000000081529150613dee565b60208082528101610abb81614488565b6040810161410682856136e4565b60008160001904831182151516156144f4576144f4614188565b500290565b8051610abb816136fb565b600080600080600060a0868803121561451f5761451f600080fd5b600061452b888861442f565b955050602061453c8882890161442f565b945050604061454d8882890161442f565b935050606061455e8882890161442f565b925050608061456f888289016144f9565b9150509295509295909350565b6000614588828761376d565b602082019150614598828661376d565b6020820191506145a8828561376d565b6020820191506145b8828461376d565b50602001949350505050565b601c81526000602082017f4678526f6f7454756e6e656c3a20494e56414c49445f4845414445520000000081529150613dee565b60208082528101610abb816145c4565b600061461661391e846138ec565b8381529050602080820190840283018581111561463557614635600080fd5b835b81811015613966578061464a888261442f565b84525060209283019201614637565b600082601f83011261466d5761466d600080fd5b8151611d30848260208601614608565b6000806040838503121561469357614693600080fd5b600061469f85856144f9565b925050602083015167ffffffffffffffff8111156146bf576146bf600080fd5b61374285828601614659565b604081016146d982856136e4565b8181036020830152611d308184613ab6565b600060ff8216915060ff8316614206565b600060ff8216915060ff83166141d3565b80825b600185111561474c5780860481111561472b5761472b614188565b600185161561473957908102905b80026147458560011c90565b9450614710565b94509492505050565b6000826147645750600161144b565b816147715750600061144b565b81600181146147875760028114614791576147be565b600191505061144b565b60ff8411156147a2576147a2614188565b8360020a9150848211156147b8576147b8614188565b5061144b565b5060208310610133831016604e8410600b84101617156147f1575081810a838111156147ec576147ec614188565b61144b565b6147fe848484600161470d565b9250905081840481111561481457614814614188565b0292915050565b600061144b6000198484614755565b601481526000602082017f496e76616c69642070726f6f66206c656e67746800000000000000000000000081529150613dee565b60208082528101610abb8161482a565b601581526000602082017f4c65616620696e64657820697320746f6f20626967000000000000000000000081529150613dee565b60208082528101610abb8161486e565b60006148be828561376d565b6020820191506148ce828461376d565b5060200192915050565b600060ff8216915060ff83166141eb56fea264697066735822122070ac08b7d3f07368804367f3a40b60772976b761d69fb7fb20680dad8a5189c364736f6c63430008090033

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

00000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2000000000000000000000000bd24a76f4135f930f5c49f6c30e0e30a61b97537

-----Decoded View---------------
Arg [0] : _checkpointManager (address): 0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287
Arg [1] : _fxRoot (address): 0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2
Arg [2] : _vendorContractAddress (address): 0xbd24A76F4135F930F5c49f6c30e0E30A61b97537

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287
Arg [1] : 000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2
Arg [2] : 000000000000000000000000bd24a76f4135f930f5c49f6c30e0e30a61b97537


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.