ETH Price: $4,016.97 (+1.12%)

Token

Acorne (ACORNE)
 

Overview

Max Total Supply

700 ACORNE

Holders

527

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 ACORNE
0x8bf9e9d9775b42de75A4Ef60c0C56f7Db877DF29
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:
Acorne

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 900 runs

Other Settings:
default evmVersion
File 1 of 33 : Acorne.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC721A, IERC721A, ERC721AQueryable} from "erc721a/contracts/extensions/ERC721AQueryable.sol";
import {ERC721ABurnable} from "erc721a/contracts/extensions/ERC721ABurnable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC2981, ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {ERC2771Context, Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import {FxBaseRootTunnel} from "./tunnel/FxBaseRootTunnel.sol";
import {IAcorneCommon} from "./interfaces/IAcorneCommon.sol";
import {IAcorneRenderer} from "./interfaces/IAcorneRenderer.sol";
import {NativeMetaTransaction} from "./common/NativeMetaTransaction.sol";

/**
 * @title Acorne
 * @custom:website www.acorne.io
 * @author @ThePlagueNFT
 * @notice Acorne E2E NFT. L2 Polygon based state sync protocol
 */
contract Acorne is
    DefaultOperatorFilterer,
    FxBaseRootTunnel,
    IAcorneCommon,
    ERC2981,
    ERC2771Context,
    NativeMetaTransaction,
    ERC721AQueryable,
    ERC721ABurnable,
    Ownable,
    ReentrancyGuard
{
    using Strings for uint256;

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

    /// @dev The FRG WL merkle root
    bytes32 public frgMerkleRoot;

    /// @dev The ETH WL merkle root
    bytes32 public ethMerkleRoot;

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

    /// @dev The total supply of the collection (n-1)
    uint256 public maxSupply = 701;

    /// @notice ETH mint price
    uint256 public price = 0.11 ether;

    /// @notice Mint live timestamp
    uint256 public liveAt = 1673100000;

    /// @notice Mint expires timestamp
    uint256 public expiresAt = 1673791200;

    /// @notice Public mint is open
    bool public isPublicOpen = false;

    /// @notice $FRG token address
    address public frgTokenAddress;

    /// @notice An address mapping mints
    mapping(address => bool) public addressToMinted;

    /// @notice A mapping from token id to commission structure
    mapping(uint256 => Commission) public commissions;

    /// @notice The rendering library contract
    IAcorneRenderer public renderer;

    constructor(
        address _checkpointManager,
        address _fxRoot,
        address _acorneRenderer,
        address _frgTokenAddress,
        address _trustedForwarder
    )
        FxBaseRootTunnel(_checkpointManager, _fxRoot)
        ERC2771Context(_trustedForwarder)
        ERC721A("Acorne", "ACORNE")
    {
        _mintERC2309(treasury, 1); // Placeholder mint
        _setDefaultRoyalty(treasury, 1000);
        renderer = IAcorneRenderer(_acorneRenderer);
        frgTokenAddress = _frgTokenAddress;
    }

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

    modifier canMintWhitelist(
        uint256 _amount,
        bytes32 _merkleRoot,
        bytes32[] calldata _proof
    ) {
        require(isLive(), "Mint is not active.");
        require(totalSupply() + _amount < maxSupply, "Max mint reached.");
        require(!addressToMinted[_msgSenderERC721A()], "Already minted.");
        bytes32 leaf = keccak256(abi.encodePacked(_msgSenderERC721A()));
        require(
            MerkleProof.verify(_proof, _merkleRoot, leaf),
            "Invalid proof."
        );
        _;
    }

    modifier canMintPublic(uint256 _amount) {
        require(isPublicOpen, "Public mint is not active.");
        require(totalSupply() + _amount < maxSupply, "Max mint reached.");
        _;
    }

    modifier isCorrectPrice(uint256 _amount, uint256 _price) {
        require(msg.value >= _amount * _price, "Not enough funds.");
        _;
    }

    /**************************************************************************
     * Minting
     *************************************************************************/

    /**
     * @dev Public mint function
     * @param _amount The amount to mint
     */
    function mint(
        uint256 _amount
    ) external payable isCorrectPrice(_amount, price) canMintPublic(_amount) {
        _mintSync(_msgSenderERC721A(), _amount);
    }

    /**
     * @dev Whitelist mint function
     * @param _proof The generated merkel proof
     */
    function whitelistMint(
        bytes32[] calldata _proof
    )
        external
        payable
        isCorrectPrice(1, price)
        canMintWhitelist(1, ethMerkleRoot, _proof)
    {
        _mintSync(_msgSenderERC721A(), 1);
    }

    /**
     * @dev Public FRG mint function that works based of whitelist and the ERC20 FRG token
     * @param _proof The generated merkel proof
     */
    function mintWithFRG(
        uint256 _frgAmount,
        bytes32[] calldata _proof
    ) external payable canMintWhitelist(1, frgMerkleRoot, _proof) {
        address owner = _msgSenderERC721A();
        IERC20(frgTokenAddress).transferFrom(owner, address(this), _frgAmount);
        _mintSync(owner, 1);
    }

    function claim(uint256 tokenId) external payable nonReentrant {
        address owner = ownerOf(tokenId);
        require(
            _msgSenderERC721A() == owner,
            "Operation restricted to token owner."
        );

        // Process commissions
        Commission storage instance = commissions[tokenId];
        uint256 commissionAmount = instance.value;
        require(commissionAmount > 0, "No commissions to claim.");

        // Process transfer
        (bool success, ) = payable(owner).call{value: commissionAmount}("");
        require(success, "Unable to claim rewards.");

        // Reset commission claim
        commissions[tokenId] = Commission({
            value: 0,
            lastClaimedAt: block.timestamp,
            lastClaimedAddress: owner
        });

        emit Claim(tokenId, owner, commissionAmount);
    }

    /**
     * @dev Internal helper function for minting and syncing to L2
     * @param _address The mint address
     * @param _amount The amount mint
     */
    function _mintSync(address _address, uint256 _amount) internal {
        uint256 tokenId = _nextTokenId();
        addressToMinted[_address] = true;
        _mint(_address, _amount);
        // Initialize commission claims
        for (uint256 i = 0; i < _amount; i++) {
            commissions[tokenId + i] = Commission({
                value: 0,
                lastClaimedAt: block.timestamp,
                lastClaimedAddress: _address
            });
            // Send message to child chain via portal
            _sendMessageToChild(
                abi.encode(MINTED, abi.encode(_address, tokenId))
            );
        }
    }

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

    /**
     * @notice Returns the current commission details for a token id
     * @param _tokenId The address
     */
    function getCommission(
        uint256 _tokenId
    ) external view returns (Commission memory) {
        return commissions[_tokenId];
    }

    /**
     * @notice Returns all commission details for a batch of token ids
     * @param _tokenIds The array of addresses
     */
    function getCommissions(
        uint256[] memory _tokenIds
    ) external view returns (Commission[] memory) {
        Commission[] memory allCommissions = new Commission[](_tokenIds.length);
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            allCommissions[i] = commissions[_tokenIds[i]];
        }
        return allCommissions;
    }

    /**
     * @notice Returns current mint state for a particular address
     * @param _address The address
     */
    function getMintState(
        address _address
    ) external view returns (MintState memory) {
        return
            MintState({
                isPublicOpen: isPublicOpen,
                liveAt: liveAt,
                expiresAt: expiresAt,
                frgMerkleRoot: frgMerkleRoot,
                ethMerkleRoot: ethMerkleRoot,
                maxSupply: maxSupply,
                totalSupply: totalSupply(),
                price: price,
                hasMinted: addressToMinted[_address]
            });
    }

    /**
     * @notice The token uri for a given tokenId, pulls in commission data
     * @param _tokenId the token id of NFT
     */
    function tokenURI(
        uint256 _tokenId
    ) public view override(IERC721A, ERC721A) returns (string memory) {
        require(_exists(_tokenId), "Token does not exist.");
        return renderer.tokenURI(_tokenId, commissions[_tokenId].value);
    }

    /**
     * @notice Deposit ERC20 tokens into contract
     * @param _tokenContract The token contract to transfer
     * @param _amount The amount of token to transfer
     */
    function depositERC20(
        address _tokenContract,
        uint256 _amount
    ) external payable {
        IERC20(_tokenContract).transferFrom(
            _msgSenderERC721A(),
            address(this),
            _amount
        );
        emit DepositERC20(
            _tokenContract,
            _msgSenderERC721A(),
            address(this),
            _amount
        );
    }

    /// @notice Deposit ETH funds into contract
    function deposit() external payable {
        emit Deposit(_msgSenderERC721A(), address(this), msg.value);
    }

    /**************************************************************************
     * Admin
     *************************************************************************/

    /**
     * @notice Sets the commission value for a particular token
     * @dev EMERGENCY fallback - renounce ownership to remove this control
     * @param _tokenId The token id
     * @param _amount The amount to set
     */
    function setCommissionValue(
        uint256 _tokenId,
        uint256 _amount
    ) external onlyOwner {
        commissions[_tokenId] = Commission({
            value: _amount,
            lastClaimedAt: block.timestamp,
            lastClaimedAddress: _msgSenderERC721A()
        });
        emit CommissionManuallySet(_msgSenderERC721A(), _tokenId, _amount);
    }

    /**
     * @notice Sets whether the public mint is open
     * @param _isPublicOpen true/false value of whether the public mint is open
     */
    function setIsPublicOpen(bool _isPublicOpen) external onlyOwner {
        isPublicOpen = _isPublicOpen;
    }

    /**
     * @notice Sets the collection max supply
     * @param _maxSupply The max supply of the collection
     */
    function setMaxSupply(uint256 _maxSupply) external onlyOwner {
        maxSupply = _maxSupply;
    }

    /**
     * @notice Sets eth price
     * @param _price The price in wei
     */
    function setPrice(uint256 _price) external onlyOwner {
        price = _price;
    }

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

    /**
     * @notice Sets the ETH merkle root for the mint
     * @param _ethMerkleRoot The merkle root to set
     */
    function setETHMerkleRoot(bytes32 _ethMerkleRoot) external onlyOwner {
        ethMerkleRoot = _ethMerkleRoot;
    }

    /**
     * @notice Sets the FRG merkle root for the mint
     * @param _frgMerkleRoot The merkle root to set
     */
    function setFRGMerkleRoot(bytes32 _frgMerkleRoot) external onlyOwner {
        frgMerkleRoot = _frgMerkleRoot;
    }

    /**
     * @notice Sets the FRG token address
     * @param _frgTokenAddress The FRG token address
     */
    function setFRGTokenAddress(address _frgTokenAddress) external onlyOwner {
        frgTokenAddress = _frgTokenAddress;
    }

    /**
     * @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 Changes the contract defined royalty
     * @param _receiver - The receiver of royalties
     * @param _feeNumerator - The numerator that represents a percent out of 10,000
     */
    function setDefaultRoyalty(
        address _receiver,
        uint96 _feeNumerator
    ) public onlyOwner {
        _setDefaultRoyalty(_receiver, _feeNumerator);
    }

    /**
     * @notice Sets the rendering library contract
     * @dev only owner call this function
     * @param _renderingAddress The new contract address
     */
    function setRenderingAddress(address _renderingAddress) external onlyOwner {
        renderer = IAcorneRenderer(_renderingAddress);
    }

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

    /*
     * @notice Withdraws a generic ERC20 token from contract
     * @param _to The address to withdraw FRG to
     */
    function withdrawERC20(
        address _tokenContract,
        address _to,
        uint256 _amount
    ) public onlyOwner {
        IERC20(_tokenContract).transfer(_to, _amount);
    }

    /*
     * @notice Withdraws FRG from contract to a specific address
     * @param _to The address to withdraw FRG to
     */
    function withdrawFRG(address _to) public onlyOwner {
        uint256 balance = IERC20(frgTokenAddress).balanceOf(address(this));
        withdrawERC20(frgTokenAddress, _to, balance);
    }

    /**
     * @dev Admin mint function
     * @param _to The address to mint to
     * @param _amount The amount to mint
     */
    function adminMint(address _to, uint256 _amount) external onlyOwner {
        require(totalSupply() + _amount < maxSupply, "Max mint reached.");
        _mintSync(_to, _amount);
    }

    /**************************************************************************
     * L2 State Sync
     *************************************************************************/

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

    /**
     * Adds commission value for a particular token id
     * @param _tokenId - The token id of the nft
     * @param _value - The value to add onto the commission in ETH
     */
    function _processCommissionClaim(
        uint256 _tokenId,
        uint256 _value
    ) internal {
        require(_value > 0, "Invalid value provided");
        commissions[_tokenId].value += _value;
        emit CommissionAdded(_tokenId, _value);
    }

    /**
     * Handles a message
     * @param _message - the message in bytes
     */
    function _handleMessage(bytes memory _message) internal {
        (bytes32 action, bytes memory data) = abi.decode(
            _message,
            (bytes32, bytes)
        );
        if (action == COMMISSION_CLAIM) {
            (uint256 tokenId, uint256 value) = abi.decode(
                data,
                (uint256, uint256)
            );
            _processCommissionClaim(tokenId, value);
        } else {
            revert("INVALID_ACTION_TYPE");
        }
    }

    /// @dev TEST
    //    function _processMessageFromChildTest(
    //        bytes memory message
    //    ) external onlyOwner {
    //        _handleMessage(message);
    //    }

    function _processMessageFromChild(bytes memory message) internal override {
        _handleMessage(message);
    }

    /**************************************************************************
     * Royalties
     *************************************************************************/

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(IERC721A, ERC721A, ERC2981) returns (bool) {
        return
            ERC721A.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId);
    }

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

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

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

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

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

    /**************************************************************************
     * Meta Transaction Integration
     *************************************************************************/

    function _msgSender()
        internal
        view
        virtual
        override(ERC2771Context, Context)
        returns (address)
    {
        return ERC2771Context._msgSender();
    }

    function _msgData()
        internal
        view
        virtual
        override(ERC2771Context, Context)
        returns (bytes calldata)
    {
        return ERC2771Context._msgData();
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions 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 3 of 33 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

File 4 of 33 : ERC2771Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)

pragma solidity ^0.8.9;

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

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract ERC2771Context is Context {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _trustedForwarder;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address trustedForwarder) {
        _trustedForwarder = trustedForwarder;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            /// @solidity memory-safe-assembly
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 20];
        } else {
            return super._msgData();
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

File 6 of 33 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

        return (royalty.receiver, royaltyAmount);
    }

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

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

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

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

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

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

File 7 of 33 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 8 of 33 : 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 9 of 33 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * 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.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 12 of 33 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 13 of 33 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 15 of 33 : EIP712Base.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.9;

import "./Initializable.sol";

contract EIP712Base is Initializable {
    struct EIP712Domain {
        string name;
        string version;
        address verifyingContract;
        bytes32 salt;
    }

    string public constant ERC712_VERSION = "1";

    bytes32 internal constant EIP712_DOMAIN_TYPEHASH =
        keccak256(
            bytes(
                "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"
            )
        );
    bytes32 internal domainSeperator;

    // supposed to be called once while initializing.
    // one of the contractsa that inherits this contract follows proxy pattern
    // so it is not possible to do this in a constructor
    function _initializeEIP712(string memory name) internal initializer {
        _setDomainSeperator(name);
    }

    function _setDomainSeperator(string memory name) internal {
        domainSeperator = keccak256(
            abi.encode(
                EIP712_DOMAIN_TYPEHASH,
                keccak256(bytes(name)),
                keccak256(bytes(ERC712_VERSION)),
                address(this),
                bytes32(getChainId())
            )
        );
    }

    function getDomainSeperator() public view returns (bytes32) {
        return domainSeperator;
    }

    function getChainId() public view returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    /**
     * Accept message hash and returns hash message in EIP712 compatible form
     * So that it can be used to recover signer from signature signed using EIP712 formatted data
     * https://eips.ethereum.org/EIPS/eip-712
     * "\\x19" makes the encoding deterministic
     * "\\x01" is the version byte to make it compatible to EIP-191
     */
    function toTypedMessageHash(bytes32 messageHash)
        internal
        view
        returns (bytes32)
    {
        return
            keccak256(
                abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash)
            );
    }
}

File 16 of 33 : Initializable.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.9;

contract Initializable {
    bool inited;

    modifier initializer() {
        require(!inited, "already inited");
        _;
        inited = true;
    }
}

File 17 of 33 : NativeMetaTransaction.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./EIP712Base.sol";

contract NativeMetaTransaction is EIP712Base {
    using SafeMath for uint256;
    bytes32 private constant META_TRANSACTION_TYPEHASH =
        keccak256(
            bytes(
                "MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
            )
        );
    event MetaTransactionExecuted(
        address userAddress,
        address payable relayerAddress,
        bytes functionSignature
    );
    mapping(address => uint256) nonces;

    /*
     * Meta transaction structure.
     * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas
     * He should call the desired function directly in that case.
     */
    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    function executeMetaTransaction(
        address userAddress,
        bytes memory functionSignature,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) public payable returns (bytes memory) {
        MetaTransaction memory metaTx = MetaTransaction({
            nonce: nonces[userAddress],
            from: userAddress,
            functionSignature: functionSignature
        });

        require(
            verify(userAddress, metaTx, sigR, sigS, sigV),
            "Signer and signature do not match"
        );

        // increase nonce for user (to avoid re-use)
        nonces[userAddress] = nonces[userAddress].add(1);

        emit MetaTransactionExecuted(
            userAddress,
            payable(msg.sender),
            functionSignature
        );

        // Append userAddress and relayer address at the end to extract it from calling context
        (bool success, bytes memory returnData) = address(this).call(
            abi.encodePacked(functionSignature, userAddress)
        );
        require(success, "Function call not successful");

        return returnData;
    }

    function hashMetaTransaction(MetaTransaction memory metaTx)
        internal
        pure
        returns (bytes32)
    {
        return
            keccak256(
                abi.encode(
                    META_TRANSACTION_TYPEHASH,
                    metaTx.nonce,
                    metaTx.from,
                    keccak256(metaTx.functionSignature)
                )
            );
    }

    function getNonce(address user) public view returns (uint256 nonce) {
        nonce = nonces[user];
    }

    function verify(
        address signer,
        MetaTransaction memory metaTx,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) internal view returns (bool) {
        require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
        return
            signer ==
            ecrecover(
                toTypedMessageHash(hashMetaTransaction(metaTx)),
                sigV,
                sigR,
                sigS
            );
    }
}

File 18 of 33 : IAcorneCommon.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IAcorneCommon {
    struct Acorne {
        string name;
        string description;
        uint256 commission;
    }

    struct Commission {
        uint256 value;
        uint256 lastClaimedAt;
        address lastClaimedAddress;
    }

    struct MintState {
        bool isPublicOpen;
        uint256 liveAt;
        uint256 expiresAt;
        bytes32 frgMerkleRoot;
        bytes32 ethMerkleRoot;
        uint256 maxSupply;
        uint256 totalSupply;
        uint256 price;
        bool hasMinted;
    }

    event Claim(uint256 tokenId, address owner, uint256 amount);

    event CommissionAdded(uint256 tokenId, uint256 value);

    event CommissionRemoved(uint256 tokenId, uint256 value);

    event CommissionVerified(uint256 tokenId, uint256 value);

    event CommissionManuallySet(address sender, uint256 tokenId, uint256 value);

    event DepositERC20(
        address tokenAddress,
        address from,
        address to,
        uint256 amount
    );

    event Deposit(address from, address to, uint256 amount);

    event Withdraw(address from, address to, uint256 amount);
}

File 19 of 33 : IAcorneRenderer.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

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

interface IAcorneRenderer is IAcorneCommon {
    function setBaseURI(string memory _baseURI) external;

    function setAnimationURI(string memory _animationURI) external;

    function tokenURI(
        uint256 _tokenId,
        uint256 _commission
    ) external view returns (string memory);
}

File 20 of 33 : ExitPayloadReader.sol
// SPDX-License-Identifier: MIT
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];
    }
}

File 21 of 33 : 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 22 of 33 : 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;
            }
        }
        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 23 of 33 : RLPReader.sol
// SPDX-License-Identifier: MIT
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 24 of 33 : 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 25 of 33 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return _tokenApprovals[tokenId].value;
    }

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.4;

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

/**
 * @title ERC721ABurnable.
 *
 * @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 27 of 33 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

/**
 * @title ERC721AQueryable.
 *
 * @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 virtual 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[] calldata tokenIds)
        external
        view
        virtual
        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 virtual 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 collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual 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 28 of 33 : IERC721ABurnable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721ABurnable.
 */
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 29 of 33 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
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`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

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

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

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

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

pragma solidity ^0.8.4;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

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

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

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 900
  },
  "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":"_acorneRenderer","type":"address"},{"internalType":"address","name":"_frgTokenAddress","type":"address"},{"internalType":"address","name":"_trustedForwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","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":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CommissionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CommissionManuallySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CommissionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CommissionVerified","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"COMMISSION_CLAIM","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTED","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"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":"addressToMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"commissions","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"lastClaimedAt","type":"uint256"},{"internalType":"address","name":"lastClaimedAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositERC20","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"ethMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","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":[],"name":"frgMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"frgTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getCommission","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"lastClaimedAt","type":"uint256"},{"internalType":"address","name":"lastClaimedAddress","type":"address"}],"internalType":"struct IAcorneCommon.Commission","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"getCommissions","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"lastClaimedAt","type":"uint256"},{"internalType":"address","name":"lastClaimedAddress","type":"address"}],"internalType":"struct IAcorneCommon.Commission[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getMintState","outputs":[{"components":[{"internalType":"bool","name":"isPublicOpen","type":"bool"},{"internalType":"uint256","name":"liveAt","type":"uint256"},{"internalType":"uint256","name":"expiresAt","type":"uint256"},{"internalType":"bytes32","name":"frgMerkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"ethMerkleRoot","type":"bytes32"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bool","name":"hasMinted","type":"bool"}],"internalType":"struct IAcorneCommon.MintState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","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":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_frgAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"mintWithFRG","outputs":[],"stateMutability":"payable","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":[],"name":"price","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":"renderer","outputs":[{"internalType":"contract IAcorneRenderer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setCommissionValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_ethMerkleRoot","type":"bytes32"}],"name":"setETHMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_frgMerkleRoot","type":"bytes32"}],"name":"setFRGMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_frgTokenAddress","type":"address"}],"name":"setFRGTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fxChildTunnel","type":"address"}],"name":"setFxChildTunnel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPublicOpen","type":"bool"}],"name":"setIsPublicOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","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":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_renderingAddress","type":"address"}],"name":"setRenderingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawFRG","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052601580546001600160a01b03191673b39af34781a55404803b1d087c113dc787e229ef1790556102bd601655670186cc6acd4b00006017556363b97ae06018556363c406e0601955601a805460ff191690553480156200006357600080fd5b506040516200674e3803806200674e8339810160408190526200008691620005e1565b6040518060400160405280600681526020016541636f726e6560d01b8152506040518060400160405280600681526020016541434f524e4560d01b815250828787733cc6cdda760b79bafa08df41ecfa224f810dceb6600160006daaeb6d7670e522a718067333cd4e6001600160a01b03163b11156200022f5780156200017d57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200015e57600080fd5b505af115801562000173573d6000803e3d6000fd5b505050506200022f565b6001600160a01b03821615620001ce5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000143565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200021557600080fd5b505af11580156200022a573d6000803e3d6000fd5b505050505b5050600180546001600160a01b03199081166001600160a01b03948516179091556000805490911691831691909117905516608052600b620002728382620006f5565b50600c620002818282620006f5565b50506001600955506200029d620002976200031c565b62000338565b60016012819055601554620002be916001600160a01b03909116906200038a565b601554620002d8906001600160a01b03166103e862000483565b50601d80546001600160a01b039384166001600160a01b0319909116179055601a80549190921661010002610100600160a81b031990911617905550620007c19050565b6000620003336200058860201b62002a6b1760201c565b905090565b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6009546001600160a01b038316620003b457604051622e076360e81b815260040160405180910390fd5b81600003620003d65760405163b562e8dd60e01b815260040160405180910390fd5b611388821115620003fa57604051633db1f9af60e01b815260040160405180910390fd5b6001600160a01b0383166000818152600e602090815260408083208054680100000000000000018802019055848352600d82528083206001871460e11b4260a01b17851790558051600019868801018152905185927fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d928290030190a48082016009555b505050565b6127106001600160601b0382161115620004f75760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b0382166200054f5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620004ee565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600455565b6080516000906001600160a01b03163303620005ab575060131936013560601c90565b62000333620005c060201b62002aaf1760201c565b3390565b80516001600160a01b0381168114620005dc57600080fd5b919050565b600080600080600060a08688031215620005fa57600080fd5b6200060586620005c4565b94506200061560208701620005c4565b93506200062560408701620005c4565b92506200063560608701620005c4565b91506200064560808701620005c4565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200067c57607f821691505b6020821081036200069d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200047e57600081815260208120601f850160051c81016020861015620006cc5750805b601f850160051c820191505b81811015620006ed57828155600101620006d8565b505050505050565b81516001600160401b0381111562000711576200071162000651565b620007298162000722845462000667565b84620006a3565b602080601f831160018114620007615760008415620007485750858301515b600019600386901b1c1916600185901b178555620006ed565b600085815260208120601f198616915b82811015620007925788860151825594840194600190910190840162000771565b5085821015620007b15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051615f6a620007e4600039600081816109cc0152612a6f0152615f6a6000f3fe6080604052600436106105075760003560e01c806370a0823111610294578063b88d4fde1161015e578063d188af54116100d6578063e985e9c51161008a578063f2fde38b1161006f578063f2fde38b14610f46578063f787859914610f66578063f953cec714610f7c57600080fd5b8063e985e9c514610edd578063f0f4426014610f2657600080fd5b8063de9b771f116100bb578063de9b771f14610e0c578063e58306f914610e2c578063e8c3960514610e4c57600080fd5b8063d188af5414610de0578063d5abeb0114610df657600080fd5b8063c87b56dd1161012d578063cd901d5111610112578063cd901d5114610d98578063ce5184ba14610db8578063d0e30db014610dd857600080fd5b8063c87b56dd14610d58578063c97d938714610d7857600080fd5b8063b88d4fde14610ce3578063b8f7a66514610cf6578063c0857ba014610d0b578063c23dc68f14610d2b57600080fd5b806391b7f5ed1161020c5780639ec00c95116101c0578063a0712d68116101a5578063a0712d6814610c90578063a22cb46514610ca3578063aea4e49e14610cc357600080fd5b80639ec00c9514610c4a578063a035b1fe14610c7a57600080fd5b8063972c4928116101f1578063972c492814610bf757806397feb92614610c1757806399a2557a14610c2a57600080fd5b806391b7f5ed14610bc257806395d89b4114610be257600080fd5b80638622a689116102635780638ada6b0f116102485780638ada6b0f14610b645780638cf18df914610b845780638da5cb5b14610ba457600080fd5b80638622a68914610b3b57806387495f2d14610b5157600080fd5b806370a0823114610ab9578063715018a614610ad957806382b7565e14610aee5780638462151c14610b0e57600080fd5b80633408e470116103d557806342966c681161034d5780635bbb21771161030157806361d027b3116102e657806361d027b314610a595780636352211e14610a795780636f8b44b014610a9957600080fd5b80635bbb2177146109fc578063607f2d4214610a2957600080fd5b806353f8bb9a1161033257806353f8bb9a14610979578063545f11dd1461098f578063572b6c05146109af57600080fd5b806342966c681461093957806344004cc11461095957600080fd5b80633ccfd60b116103a457806341abe2711161038957806341abe271146108e457806341f434341461090457806342842e0e1461092657600080fd5b80633ccfd60b1461089b5780633e9c7f69146108b057600080fd5b80633408e47014610835578063372f657c14610848578063379607f51461085b5780633c8bccd91461086e57600080fd5b806310195e6e1161048357806322b3a7c8116104375780632a55205a1161041c5780632a55205a1461078c5780632d0335ab146107cb5780632ef6e9cf1461080157600080fd5b806322b3a7c81461071057806323b872dd1461077957600080fd5b806318160ddd1161046857806318160ddd146106b157806320379ee5146106ce57806322591fc8146106e357600080fd5b806310195e6e1461067257806311c67efc1461069757600080fd5b8063095ea7b3116104da5780630e387de6116104bf5780630e387de6146105e35780630f7e5970146106255780630f8677511461065257600080fd5b8063095ea7b3146105bd5780630c53c51c146105d057600080fd5b806301ffc9a71461050c57806304634d8d1461054157806306fdde0314610563578063081812fc14610585575b600080fd5b34801561051857600080fd5b5061052c610527366004615285565b610f9c565b60405190151581526020015b60405180910390f35b34801561054d57600080fd5b5061056161055c3660046152b7565b610fbc565b005b34801561056f57600080fd5b50610578610fd2565b6040516105389190615351565b34801561059157600080fd5b506105a56105a0366004615364565b611064565b6040516001600160a01b039091168152602001610538565b6105616105cb36600461537d565b6110c1565b6105786105de36600461546e565b6110da565b3480156105ef57600080fd5b506106177f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03681565b604051908152602001610538565b34801561063157600080fd5b50610578604051806040016040528060018152602001603160f81b81525081565b34801561065e57600080fd5b5061056161066d3660046154ec565b6112c9565b34801561067e57600080fd5b50601a546105a59061010090046001600160a01b031681565b3480156106a357600080fd5b50601a5461052c9060ff1681565b3480156106bd57600080fd5b50600a546009540360001901610617565b3480156106da57600080fd5b50600754610617565b3480156106ef57600080fd5b506107036106fe36600461550e565b6112dc565b60405161053891906155a8565b34801561071c57600080fd5b5061075561072b366004615364565b601c602052600090815260409020805460018201546002909201549091906001600160a01b031683565b6040805193845260208401929092526001600160a01b031690820152606001610538565b610561610787366004615607565b6113fc565b34801561079857600080fd5b506107ac6107a73660046154ec565b611427565b604080516001600160a01b039093168352602083019190915201610538565b3480156107d757600080fd5b506106176107e6366004615648565b6001600160a01b031660009081526008602052604090205490565b34801561080d57600080fd5b506106177fac2461370e683d859a90bf5d877938417df2b2ca923bc1c4bcb2dc6a0d324be781565b34801561084157600080fd5b5046610617565b6105616108563660046156aa565b6114e4565b610561610869366004615364565b611718565b34801561087a57600080fd5b5061088e610889366004615364565b611953565b60405161053891906156ec565b3480156108a757600080fd5b506105616119c2565b3480156108bc57600080fd5b506106177f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae369025281565b3480156108f057600080fd5b506105616108ff366004615648565b611ac2565b34801561091057600080fd5b506105a56daaeb6d7670e522a718067333cd4e81565b610561610934366004615607565b611b74565b34801561094557600080fd5b50610561610954366004615364565b611b99565b34801561096557600080fd5b50610561610974366004615607565b611ba4565b34801561098557600080fd5b5061061760185481565b34801561099b57600080fd5b506105616109aa3660046154ec565b611c38565b3480156109bb57600080fd5b5061052c6109ca366004615648565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b348015610a0857600080fd5b50610a1c610a173660046156aa565b611cf0565b6040516105389190615716565b348015610a3557600080fd5b5061052c610a44366004615364565b60036020526000908152604090205460ff1681565b348015610a6557600080fd5b506015546105a5906001600160a01b031681565b348015610a8557600080fd5b506105a5610a94366004615364565b611dbc565b348015610aa557600080fd5b50610561610ab4366004615364565b611dc7565b348015610ac557600080fd5b50610617610ad4366004615648565b611dd4565b348015610ae557600080fd5b50610561611e3c565b348015610afa57600080fd5b50610561610b09366004615648565b611e50565b348015610b1a57600080fd5b50610b2e610b29366004615648565b611e97565b6040516105389190615793565b348015610b4757600080fd5b5061061760195481565b610561610b5f3660046157cb565b611f9b565b348015610b7057600080fd5b50601d546105a5906001600160a01b031681565b348015610b9057600080fd5b50610561610b9f366004615648565b612208565b348015610bb057600080fd5b506011546001600160a01b03166105a5565b348015610bce57600080fd5b50610561610bdd366004615364565b612232565b348015610bee57600080fd5b5061057861223f565b348015610c0357600080fd5b506002546105a5906001600160a01b031681565b610561610c2536600461537d565b61224e565b348015610c3657600080fd5b50610b2e610c45366004615817565b612325565b348015610c5657600080fd5b5061052c610c65366004615648565b601b6020526000908152604090205460ff1681565b348015610c8657600080fd5b5061061760175481565b610561610c9e366004615364565b6124c6565b348015610caf57600080fd5b50610561610cbe36600461585a565b6125de565b348015610ccf57600080fd5b50610561610cde366004615648565b6125f2565b610561610cf1366004615888565b61261c565b348015610d0257600080fd5b5061052c612649565b348015610d1757600080fd5b506001546105a5906001600160a01b031681565b348015610d3757600080fd5b50610d4b610d46366004615364565b612662565b60405161053891906158f4565b348015610d6457600080fd5b50610578610d73366004615364565b6126ea565b348015610d8457600080fd5b50610561610d93366004615939565b6127e3565b348015610da457600080fd5b50610561610db3366004615364565b6127fe565b348015610dc457600080fd5b50610561610dd3366004615364565b61280b565b610561612818565b348015610dec57600080fd5b5061061760135481565b348015610e0257600080fd5b5061061760165481565b348015610e1857600080fd5b506000546105a5906001600160a01b031681565b348015610e3857600080fd5b50610561610e4736600461537d565b612858565b348015610e5857600080fd5b50610e6c610e67366004615648565b6128c6565b60405161053891906000610120820190508251151582526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100808401511515818401525092915050565b348015610ee957600080fd5b5061052c610ef8366004615956565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b348015610f3257600080fd5b50610561610f41366004615648565b61299e565b348015610f5257600080fd5b50610561610f61366004615648565b6129c8565b348015610f7257600080fd5b5061061760145481565b348015610f8857600080fd5b50610561610f97366004615984565b612a55565b6000610fa782612ab3565b80610fb65750610fb682612b33565b92915050565b610fc4612b81565b610fce8282612bfa565b5050565b6060600b8054610fe1906159b9565b80601f016020809104026020016040519081016040528092919081815260200182805461100d906159b9565b801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b5050505050905090565b600061106f82612d14565b6110a5576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600f60205260409020546001600160a01b031690565b816110cb81612d49565b6110d58383612e34565b505050565b60408051606081810183526001600160a01b038816600081815260086020908152908590205484528301529181018690526111188782878787612eed565b6111735760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084015b60405180910390fd5b6001600160a01b038716600090815260086020526040902054611197906001612ff5565b6001600160a01b0388166000908152600860205260409081902091909155517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b906111e790899033908a906159ed565b60405180910390a1600080306001600160a01b0316888a60405160200161120f929190615a22565b60408051601f198184030181529082905261122991615a59565b6000604051808303816000865af19150503d8060008114611266576040519150601f19603f3d011682016040523d82523d6000602084013e61126b565b606091505b5091509150816112bd5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015260640161116a565b98975050505050505050565b6112d1612b81565b601891909155601955565b60606000825167ffffffffffffffff8111156112fa576112fa6153a9565b60405190808252806020026020018201604052801561135857816020015b6113456040518060600160405280600081526020016000815260200160006001600160a01b031681525090565b8152602001906001900390816113185790505b50905060005b83518110156113f557601c600085838151811061137d5761137d615a75565b6020908102919091018101518252818101929092526040908101600020815160608101835281548152600182015493810193909352600201546001600160a01b03169082015282518390839081106113d7576113d7615a75565b602002602001018190525080806113ed90615aa1565b91505061135e565b5092915050565b826001600160a01b03811633146114165761141633612d49565b611421848484613001565b50505050565b60008281526005602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff169282019290925282916114a65750604080518082019091526004546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b6020810151600090612710906114ca906bffffffffffffffffffffffff1687615aba565b6114d49190615ae7565b91519350909150505b9250929050565b6017546001906114f48183615aba565b3410156115435760405162461bcd60e51b815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015260640161116a565b60016014548585611552612649565b61159e5760405162461bcd60e51b815260206004820152601360248201527f4d696e74206973206e6f74206163746976652e00000000000000000000000000604482015260640161116a565b601654600a5460095486919003600019016115b99190615afb565b106115fa5760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b336000908152601b602052604090205460ff161561164c5760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9036b4b73a32b21760891b604482015260640161116a565b6040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506116c58383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508591506131d69050565b6117025760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b210383937b7b31760911b604482015260640161116a565b61170d3360016131ec565b505050505050505050565b611720613327565b600061172b82611dbc565b9050336001600160a01b038216146117aa5760405162461bcd60e51b8152602060048201526024808201527f4f7065726174696f6e207265737472696374656420746f20746f6b656e206f7760448201527f6e65722e00000000000000000000000000000000000000000000000000000000606482015260840161116a565b6000828152601c602052604090208054806118075760405162461bcd60e51b815260206004820152601860248201527f4e6f20636f6d6d697373696f6e7320746f20636c61696d2e0000000000000000604482015260640161116a565b6000836001600160a01b03168260405160006040518083038185875af1925050503d8060008114611854576040519150601f19603f3d011682016040523d82523d6000602084013e611859565b606091505b50509050806118aa5760405162461bcd60e51b815260206004820152601860248201527f556e61626c6520746f20636c61696d20726577617264732e0000000000000000604482015260640161116a565b604080516060808201835260008083524260208085019182526001600160a01b038a81168688018181528d8652601c84529488902096518755925160018701559251600290950180546001600160a01b03191695909316949094179091558351898152928301529181018490527f3ed1528b0fdc7c5207c1bf935e34a667e13656b9ed165260c522be0bc544f303910160405180910390a1505050506119506001601255565b50565b6119806040518060600160405280600081526020016000815260200160006001600160a01b031681525090565b506000908152601c6020908152604091829020825160608101845281548152600182015492810192909252600201546001600160a01b03169181019190915290565b6119ca612b81565b60155460405147916000916001600160a01b039091169083908381818185875af1925050503d8060008114611a1b576040519150601f19603f3d011682016040523d82523d6000602084013e611a20565b606091505b5050905080611a715760405162461bcd60e51b815260206004820152601660248201527f556e61626c6520746f2077697468647261772045544800000000000000000000604482015260640161116a565b601554604080513081526001600160a01b03909216602083015281018390527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb906060015b60405180910390a15050565b611aca612b81565b601a546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009161010090046001600160a01b0316906370a0823190602401602060405180830381865afa158015611b31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b559190615b0e565b601a54909150610fce9061010090046001600160a01b03168383611ba4565b826001600160a01b0381163314611b8e57611b8e33612d49565b611421848484613380565b61195081600161339b565b611bac612b81565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611c14573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190615b27565b611c40612b81565b6040518060600160405280828152602001428152602001611c5e3390565b6001600160a01b039081169091526000848152601c602090815260409182902084518155908401516001820155920151600290920180546001600160a01b031916929091169190911790557f44ad1d6fa16483bccc4ca776b1bf7ac614cb3bab63d0d763f5ca2e0e86630fa133604080516001600160a01b039092168252602082018590528101839052606001611ab6565b60608160008167ffffffffffffffff811115611d0e57611d0e6153a9565b604051908082528060200260200182016040528015611d6057816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181611d2c5790505b50905060005b828114611db357611d8e868683818110611d8257611d82615a75565b90506020020135612662565b828281518110611da057611da0615a75565b6020908102919091010152600101611d66565b50949350505050565b6000610fb6826134ff565b611dcf612b81565b601655565b60006001600160a01b038216611e16576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03166000908152600e602052604090205467ffffffffffffffff1690565b611e44612b81565b611e4e6000613587565b565b611e58612b81565b601a80546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b60606000806000611ea785611dd4565b905060008167ffffffffffffffff811115611ec457611ec46153a9565b604051908082528060200260200182016040528015611eed578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b838614611f8f57611f28816135d9565b91508160400151611f875781516001600160a01b031615611f4857815194505b876001600160a01b0316856001600160a01b031603611f875780838780600101985081518110611f7a57611f7a615a75565b6020026020010181815250505b600101611f18565b50909695505050505050565b60016013548383611faa612649565b611ff65760405162461bcd60e51b815260206004820152601360248201527f4d696e74206973206e6f74206163746976652e00000000000000000000000000604482015260640161116a565b601654600a5460095486919003600019016120119190615afb565b106120525760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b336000908152601b602052604090205460ff16156120a45760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9036b4b73a32b21760891b604482015260640161116a565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061211d8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508591506131d69050565b61215a5760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b210383937b7b31760911b604482015260640161116a565b600033601a546040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038084166004830152306024830152604482018d9052929350610100909104909116906323b872dd906064016020604051808303816000875af11580156121d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fc9190615b27565b5061170d8160016131ec565b612210612b81565b601d80546001600160a01b0319166001600160a01b0392909216919091179055565b61223a612b81565b601755565b6060600c8054610fe1906159b9565b6001600160a01b0382166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af11580156122b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d59190615b27565b50604080516001600160a01b03841681523360208201523091810191909152606081018290527f801a94bfaa839fe8aafeefa94d06f3f7e194d9719a6d4ee0df2ed8e9a33d239590608001611ab6565b6060818310612360576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061236c60095490565b9050600185101561237c57600194505b80841115612388578093505b600061239387611dd4565b9050848610156123b257858503818110156123ac578091505b506123b6565b5060005b60008167ffffffffffffffff8111156123d1576123d16153a9565b6040519080825280602002602001820160405280156123fa578160200160208202803683370190505b509050816000036124105793506124bf92505050565b600061241b88612662565b90506000816040015161242c575080515b885b88811415801561243e5750848714155b156124b35761244c816135d9565b925082604001516124ab5782516001600160a01b03161561246c57825191505b8a6001600160a01b0316826001600160a01b0316036124ab578084888060010199508151811061249e5761249e615a75565b6020026020010181815250505b60010161242e565b50505092835250909150505b9392505050565b60175481906124d58183615aba565b3410156125245760405162461bcd60e51b815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015260640161116a565b601a54839060ff166125785760405162461bcd60e51b815260206004820152601a60248201527f5075626c6963206d696e74206973206e6f74206163746976652e000000000000604482015260640161116a565b601654600a5460095483919003600019016125939190615afb565b106125d45760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b61142133856131ec565b816125e881612d49565b6110d58383613658565b6125fa612b81565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b836001600160a01b03811633146126365761263633612d49565b612642858585856136c4565b5050505050565b60006018544211801561265d575060195442105b905090565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806126bb57506009548310155b156126c65792915050565b6126cf836135d9565b90508060400151156126e15792915050565b6124bf83613708565b60606126f582612d14565b6127415760405162461bcd60e51b815260206004820152601560248201527f546f6b656e20646f6573206e6f742065786973742e0000000000000000000000604482015260640161116a565b601d546000838152601c6020526040908190205490517f92cb829d0000000000000000000000000000000000000000000000000000000081526004810185905260248101919091526001600160a01b03909116906392cb829d90604401600060405180830381865afa1580156127bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fb69190810190615b74565b6127eb612b81565b601a805460ff1916911515919091179055565b612806612b81565b601455565b612813612b81565b601355565b60408051338152306020820152348183015290517f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629181900360600190a1565b612860612b81565b601654600a54600954839190036000190161287b9190615afb565b106128bc5760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b610fce82826131ec565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091526040805161012081018252601a5460ff16151581526018546020820152601954918101919091526013546060820152601454608082015260165460a082015260c08101612965600a546009546000199190030190565b81526017546020808301919091526001600160a01b039094166000908152601b9094526040938490205460ff1615159301929092525090565b6129a6612b81565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6129d0612b81565b6001600160a01b038116612a4c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161116a565b61195081613587565b6000612a6082613780565b9050610fce81613ab1565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303612aaa575060131936013560601c90565b503390565b3390565b60006301ffc9a760e01b6001600160e01b031983161480612afd57507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b80610fb65750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610fb657506301ffc9a760e01b6001600160e01b0319831614610fb6565b612b89613aba565b6001600160a01b0316612ba46011546001600160a01b031690565b6001600160a01b031614611e4e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161116a565b6127106bffffffffffffffffffffffff82161115612c805760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c65507269636500000000000000000000000000000000000000000000606482015260840161116a565b6001600160a01b038216612cd65760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161116a565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600455565b600081600111158015612d28575060095482105b8015610fb65750506000908152600d6020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15611950576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df39190615b27565b611950576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260240161116a565b6000612e3f82611dbc565b9050336001600160a01b03821614612e9157612e5b8133610ef8565b612e91576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600f602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006001600160a01b038616612f6b5760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201527f49474e4552000000000000000000000000000000000000000000000000000000606482015260840161116a565b6001612f7e612f7987613ac4565b613b41565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015612fcc573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60006124bf8284615afb565b600061300c826134ff565b9050836001600160a01b0316816001600160a01b031614613059576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600f6020526040902080546130858187335b6001600160a01b039081169116811491141790565b6130b0576130938633610ef8565b6130b057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166130f0576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156130fb57600082555b6001600160a01b038681166000908152600e60205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b176000858152600d6020526040812091909155600160e11b8416900361318d57600184016000818152600d6020526040812054900361318b57600954811461318b576000818152600d602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000826131e38584613b8c565b14949350505050565b60006131f760095490565b6001600160a01b0384166000908152601b60205260409020805460ff1916600117905590506132268383613bd9565b60005b8281101561142157604051806060016040528060008152602001428152602001856001600160a01b0316815250601c600083856132669190615afb565b815260208082019290925260409081016000208351815583830151600182015592810151600290930180546001600160a01b0319166001600160a01b039485161790558051928716918301919091528101839052613315907f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae36902529060600160408051601f19818403018152908290526133019291602001615bbd565b604051602081830303815290604052613d0a565b8061331f81615aa1565b915050613229565b6002601254036133795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161116a565b6002601255565b6110d58383836040518060200160405280600081525061261c565b60006133a6836134ff565b9050806000806133c4866000908152600f6020526040902080549091565b915091508415613404576133d9818433613070565b613404576133e78333610ef8565b61340457604051632ce44b5f60e11b815260040160405180910390fd5b801561340f57600082555b6001600160a01b0383166000818152600e6020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b177c0300000000000000000000000000000000000000000000000000000000176000878152600d6020526040812091909155600160e11b851690036134b657600186016000818152600d602052604081205490036134b45760095481146134b4576000818152600d602052604090208590555b505b60405186906000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050600a8054600101905550505050565b6000818060011161355557600954811015613555576000818152600d602052604081205490600160e01b82169003613553575b806000036124bf5750600019016000818152600d6020526040902054613532565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600d6020526040902054610fb690604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b3360008181526010602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6136cf8484846113fc565b6001600160a01b0383163b15611421576136eb84848484613d87565b611421576040516368d2bf6b60e11b815260040160405180910390fd5b604080516080810182526000808252602082018190529181018290526060810191909152610fb6613738836134ff565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b6060600061378d83613e73565b9050600061379a82613ed2565b905060006137a783613efb565b90506000816137b584613f24565b6137be866140e2565b6040516020016137d093929190615bd6565b60408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561386d5760405162461bcd60e51b8152602060048201526024808201527f4678526f6f7454756e6e656c3a20455849545f414c52454144595f50524f434560448201527f5353454400000000000000000000000000000000000000000000000000000000606482015260840161116a565b6000818152600360205260408120805460ff1916600117905561388f856140fe565b9050600061389c82614248565b90506138a7816142d8565b6002546001600160a01b0390811691161461392a5760405162461bcd60e51b815260206004820152602560248201527f4678526f6f7454756e6e656c3a20494e56414c49445f46585f4348494c445f5460448201527f554e4e454c000000000000000000000000000000000000000000000000000000606482015260840161116a565b600061393587614301565b9050613955613945846020015190565b8761394f8a61431d565b84614339565b6139c75760405162461bcd60e51b815260206004820152602360248201527f4678526f6f7454756e6e656c3a20494e56414c49445f524543454950545f505260448201527f4f4f460000000000000000000000000000000000000000000000000000000000606482015260840161116a565b6139f5856139d4896145ee565b6139dd8a61460a565b846139e78c614626565b6139f08d614642565b61465e565b506000613a018361479d565b90507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036613a37613a328360006147d9565b614811565b14613a845760405162461bcd60e51b815260206004820152601f60248201527f4678526f6f7454756e6e656c3a20494e56414c49445f5349474e415455524500604482015260640161116a565b6000613a8f8461488a565b806020019051810190613aa29190615c23565b9b9a5050505050505050505050565b611950816148a6565b600061265d612a6b565b6000604051806080016040528060438152602001615ef26043913980516020918201208351848301516040808701518051908601209051613b24950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000613b4c60075490565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201613b24565b600081815b8451811015613bd157613bbd82868381518110613bb057613bb0615a75565b6020026020010151614955565b915080613bc981615aa1565b915050613b91565b509392505050565b6009546000829003613c17576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000818152600e602090815260408083208054680100000000000000018802019055848352600d90915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114613cc657808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613c8e565b5081600003613d01576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60095550505050565b6000546002546040517fb47204770000000000000000000000000000000000000000000000000000000081526001600160a01b039283169263b472047792613d59929116908590600401615c58565b600060405180830381600087803b158015613d7357600080fd5b505af1158015612642573d6000803e3d6000fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613dbc903390899088908890600401615c7a565b6020604051808303816000875af1925050508015613df7575060408051601f3d908101601f19168201909252613df491810190615cb6565b60015b613e55573d808015613e25576040519150601f19603f3d011682016040523d82523d6000602084013e613e2a565b606091505b508051600003613e4d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6040805160208101909152606081526000613ebd613eb88460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b614984565b60408051602081019091529081529392505050565b6060610fb68260000151600881518110613eee57613eee615a75565b6020026020010151614a9a565b6000610fb68260000151600281518110613f1757613f17615a75565b6020026020010151614811565b60408051602081019091526000815281516060919015610fb657600080613f4c600086614b37565b60f81c90506001811480613f6357508060ff166003145b1561400b57600185516002613f789190615aba565b613f829190615cd3565b67ffffffffffffffff811115613f9a57613f9a6153a9565b6040519080825280601f01601f191660200182016040528015613fc4576020820181803683370190505b5092506000613fd4600187614b37565b90508084600081518110613fea57613fea615a75565b60200101906001600160f81b031916908160001a905350600192505061406f565b60028551600261401b9190615aba565b6140259190615cd3565b67ffffffffffffffff81111561403d5761403d6153a9565b6040519080825280601f01601f191660200182016040528015614067576020820181803683370190505b509250600091505b60ff82165b83518110156140d95761409e61408d60ff851683615cd3565b614098906002615afb565b87614b37565b8482815181106140b0576140b0615a75565b60200101906001600160f81b031916908160001a905350806140d181615aa1565b915050614074565b50505092915050565b6000610fb68260000151600981518110613f1757613f17615a75565b61412260405180606001604052806060815260200160608152602001600081525090565b61413c8260000151600681518110613eee57613eee615a75565b60208281018290526040805180820182526000808252908301528051808201909152825181529181019082015261417281614bb8565b156141875761418081614984565b8252614234565b6020820151805160009061419d90600190615cd3565b67ffffffffffffffff8111156141b5576141b56153a9565b6040519080825280601f01601f1916602001820160405280156141df576020820181803683370190505b5090506000808360210191508260200190506141fd82828551614bf3565b60408051808201825260008082526020918201528151808301909252845182528085019082015261422d90614984565b8652505050505b61423d836140e2565b604083015250919050565b604080516080810182526000918101828152606080830193909352815260208101919091526000614296836000015160038151811061428957614289615a75565b6020026020010151614984565b8360400151815181106142ab576142ab615a75565b6020026020010151905060405180604001604052808281526020016142cf83614984565b90529392505050565b6000610fb682602001516000815181106142f4576142f4615a75565b6020026020010151614c71565b6000610fb68260000151600581518110613f1757613f17615a75565b6060610fb68260000151600781518110613eee57613eee615a75565b60008061436d8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b9050600061437a82614984565b90506060808560008061438c8b613f24565b905080516000036143a7576000975050505050505050613e6b565b60005b86518110156145db5781518311156143cd57600098505050505050505050613e6b565b6143ef8782815181106143e2576143e2615a75565b6020026020010151614c8b565b95508580519060200120841461441057600098505050505050505050613e6b565b61442587828151811061428957614289615a75565b945084516011036144f75781518303614484578c8051906020012061445686601081518110613eee57613eee615a75565b805190602001200361447357600198505050505050505050613e6b565b600098505050505050505050613e6b565b600082848151811061449857614498615a75565b016020015160f81c905060108111156144bd5760009950505050505050505050613e6b565b6144e2868260ff16815181106144d5576144d5615a75565b6020026020010151614d03565b94506144ef600185615afb565b9350506145c9565b845160020361447357600061452261451b87600081518110613eee57613eee615a75565b8486614d31565b83519091506145318286615afb565b03614584578d8051906020012061455487600181518110613eee57613eee615a75565b80519060200120036145725760019950505050505050505050613e6b565b60009950505050505050505050613e6b565b8060000361459e5760009950505050505050505050613e6b565b6145a88185615afb565b93506145c0866001815181106144d5576144d5615a75565b94506145c99050565b806145d381615aa1565b9150506143aa565b5060009c9b505050505050505050505050565b6000610fb68260000151600381518110613f1757613f17615a75565b6000610fb68260000151600481518110613f1757613f17615a75565b6000610fb68260000151600081518110613f1757613f17615a75565b6060610fb68260000151600181518110613eee57613eee615a75565b6001546040517f41539d4a000000000000000000000000000000000000000000000000000000008152600481018490526000918291829182916001600160a01b03909116906341539d4a9060240160a060405180830381865afa1580156146c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146ed9190615ce6565b5093505092509250614744828b6147049190615cd3565b6040805160208082018f90528183018e9052606082018d905260808083018d90528351808403909101815260a09092019092528051910120908588614e51565b6147905760405162461bcd60e51b815260206004820152601c60248201527f4678526f6f7454756e6e656c3a20494e56414c49445f48454144455200000000604482015260640161116a565b9998505050505050505050565b60408051602081019091526060815260405180602001604052806147d1846020015160018151811061428957614289615a75565b905292915050565b6040805180820190915260008082526020820152825180518390811061480157614801615a75565b6020026020010151905092915050565b80516000901580159061482657508151602110155b61482f57600080fd5b600061483e8360200151614fca565b905060008184600001516148529190615cd3565b90506000808386602001516148679190615afb565b9050805191506020831015611db357506020919091036101000a90049392505050565b6060610fb68260200151600281518110613eee57613eee615a75565b600080828060200190518101906148bd9190615d25565b915091507fac2461370e683d859a90bf5d877938417df2b2ca923bc1c4bcb2dc6a0d324be7820361490d57600080828060200190518101906148ff9190615d6c565b91509150612642828261504b565b60405162461bcd60e51b815260206004820152601360248201527f494e56414c49445f414354494f4e5f5459504500000000000000000000000000604482015260640161116a565b60008183106149715760008281526020849052604090206124bf565b60008381526020839052604090206124bf565b606061498f82614bb8565b61499857600080fd5b60006149a3836150f4565b905060008167ffffffffffffffff8111156149c0576149c06153a9565b604051908082528060200260200182016040528015614a0557816020015b60408051808201909152600080825260208201528152602001906001900390816149de5790505b5090506000614a178560200151614fca565b8560200151614a269190615afb565b90506000805b84811015614a8f57614a3d83615179565b9150604051806040016040528083815260200184815250848281518110614a6657614a66615a75565b6020908102919091010152614a7b8284615afb565b925080614a8781615aa1565b915050614a2c565b509195945050505050565b8051606090614aa857600080fd5b6000614ab78360200151614fca565b90506000818460000151614acb9190615cd3565b905060008167ffffffffffffffff811115614ae857614ae86153a9565b6040519080825280601f01601f191660200182016040528015614b12576020820181803683370190505b5090506000816020019050611db3848760200151614b309190615afb565b828561521d565b6000614b44600284615d90565b15614b7e57601082614b57600286615ae7565b81518110614b6757614b67615a75565b0160200151614b79919060f81c615da4565b614bae565b601082614b8c600286615ae7565b81518110614b9c57614b9c615a75565b0160200151614bae919060f81c615dc6565b60f81b9392505050565b80516000908103614bcb57506000919050565b6020820151805160001a9060c0821015614be9575060009392505050565b5060019392505050565b80600003614c0057505050565b60208110614c385782518252614c17602084615afb565b9250614c24602083615afb565b9150614c31602082615cd3565b9050614c00565b60006001614c47836020615cd3565b614c5390610100615ecc565b614c5d9190615cd3565b935183518516941916939093179091525050565b8051600090601514614c8257600080fd5b610fb682614811565b60606000826000015167ffffffffffffffff811115614cac57614cac6153a9565b6040519080825280601f01601f191660200182016040528015614cd6576020820181803683370190505b5090508051600003614ce85792915050565b60008160200190506113f5846020015182866000015161521d565b8051600090602114614d1457600080fd5b60008083602001516001614d289190615afb565b51949350505050565b60008080614d3e86613f24565b90506000815167ffffffffffffffff811115614d5c57614d5c6153a9565b6040519080825280601f01601f191660200182016040528015614d86576020820181803683370190505b509050845b8251614d979087615afb565b811015614e22576000878281518110614db257614db2615a75565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690508083614de78985615cd3565b81518110614df757614df7615a75565b60200101906001600160f81b031916908160001a905350508080614e1a90615aa1565b915050614d8b565b508080519060200120828051906020012003614e415781519250614e46565b600092505b509095945050505050565b600060208251614e619190615d90565b15614eae5760405162461bcd60e51b815260206004820152601460248201527f496e76616c69642070726f6f66206c656e677468000000000000000000000000604482015260640161116a565b600060208351614ebe9190615ae7565b9050614ecb816002615ecc565b8510614f195760405162461bcd60e51b815260206004820152601560248201527f4c65616620696e64657820697320746f6f206269670000000000000000000000604482015260640161116a565b60008660205b85518111614fbc57858101519250614f38600289615d90565b600003614f70576040805160208101849052908101849052606001604051602081830303815290604052805190602001209150614f9d565b60408051602081018590529081018390526060016040516020818303038152906040528051906020012091505b614fa8600289615ae7565b9750614fb5602082615afb565b9050614f1f565b509094149695505050505050565b8051600090811a6080811015614fe35750600092915050565b60b8811080614ffe575060c08110801590614ffe575060f881105b1561500c5750600192915050565b60c081101561503957615021600160b8615ed8565b61502e9060ff1682615cd3565b6124bf906001615afb565b615021600160f8615ed8565b50919050565b6000811161509b5760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642076616c75652070726f766964656400000000000000000000604482015260640161116a565b6000828152601c6020526040812080548392906150b9908490615afb565b909155505060408051838152602081018390527ff56fc20e631b06fb7eac7d1ce8a9cd01061f4f8b90259cea3bf54679c5272cfd9101611ab6565b8051600090810361510757506000919050565b6000806151178460200151614fca565b84602001516151269190615afb565b905060008460000151856020015161513e9190615afb565b90505b808210156151705761515282615179565b61515c9083615afb565b91508261516881615aa1565b935050615141565b50909392505050565b80516000908190811a608081101561519457600191506113f5565b60b88110156151ba576151a8608082615cd3565b6151b3906001615afb565b91506113f5565b60c08110156151e75760b78103600185019450806020036101000a855104600182018101935050506113f5565b60f88110156151fb576151a860c082615cd3565b60019390930151602084900360f7016101000a900490920160f5190192915050565b8060000361522a57505050565b602081106152625782518252615241602084615afb565b925061524e602083615afb565b915061525b602082615cd3565b905061522a565b80600003614c3857505050565b6001600160e01b03198116811461195057600080fd5b60006020828403121561529757600080fd5b81356124bf8161526f565b6001600160a01b038116811461195057600080fd5b600080604083850312156152ca57600080fd5b82356152d5816152a2565b915060208301356bffffffffffffffffffffffff811681146152f657600080fd5b809150509250929050565b60005b8381101561531c578181015183820152602001615304565b50506000910152565b6000815180845261533d816020860160208601615301565b601f01601f19169290920160200192915050565b6020815260006124bf6020830184615325565b60006020828403121561537657600080fd5b5035919050565b6000806040838503121561539057600080fd5b823561539b816152a2565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156153e8576153e86153a9565b604052919050565b600067ffffffffffffffff82111561540a5761540a6153a9565b50601f01601f191660200190565b600082601f83011261542957600080fd5b813561543c615437826153f0565b6153bf565b81815284602083860101111561545157600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561548657600080fd5b8535615491816152a2565b9450602086013567ffffffffffffffff8111156154ad57600080fd5b6154b988828901615418565b9450506040860135925060608601359150608086013560ff811681146154de57600080fd5b809150509295509295909350565b600080604083850312156154ff57600080fd5b50508035926020909101359150565b6000602080838503121561552157600080fd5b823567ffffffffffffffff8082111561553957600080fd5b818501915085601f83011261554d57600080fd5b81358181111561555f5761555f6153a9565b8060051b91506155708483016153bf565b818152918301840191848101908884111561558a57600080fd5b938501935b838510156112bd5784358252938501939085019061558f565b6020808252825182820181905260009190848201906040850190845b81811015611f8f576155f483855180518252602080820151908301526040908101516001600160a01b0316910152565b92840192606092909201916001016155c4565b60008060006060848603121561561c57600080fd5b8335615627816152a2565b92506020840135615637816152a2565b929592945050506040919091013590565b60006020828403121561565a57600080fd5b81356124bf816152a2565b60008083601f84011261567757600080fd5b50813567ffffffffffffffff81111561568f57600080fd5b6020830191508360208260051b85010111156114dd57600080fd5b600080602083850312156156bd57600080fd5b823567ffffffffffffffff8111156156d457600080fd5b6156e085828601615665565b90969095509350505050565b81518152602080830151908201526040808301516001600160a01b03169082015260608101610fb6565b6020808252825182820181905260009190848201906040850190845b81811015611f8f576157808385516001600160a01b03815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b9284019260809290920191600101615732565b6020808252825182820181905260009190848201906040850190845b81811015611f8f578351835292840192918401916001016157af565b6000806000604084860312156157e057600080fd5b83359250602084013567ffffffffffffffff8111156157fe57600080fd5b61580a86828701615665565b9497909650939450505050565b60008060006060848603121561582c57600080fd5b8335615837816152a2565b95602085013595506040909401359392505050565b801515811461195057600080fd5b6000806040838503121561586d57600080fd5b8235615878816152a2565b915060208301356152f68161584c565b6000806000806080858703121561589e57600080fd5b84356158a9816152a2565b935060208501356158b9816152a2565b925060408501359150606085013567ffffffffffffffff8111156158dc57600080fd5b6158e887828801615418565b91505092959194509250565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff169082015260808101610fb6565b60006020828403121561594b57600080fd5b81356124bf8161584c565b6000806040838503121561596957600080fd5b8235615974816152a2565b915060208301356152f6816152a2565b60006020828403121561599657600080fd5b813567ffffffffffffffff8111156159ad57600080fd5b613e6b84828501615418565b600181811c908216806159cd57607f821691505b60208210810361504557634e487b7160e01b600052602260045260246000fd5b60006001600160a01b03808616835280851660208401525060606040830152615a196060830184615325565b95945050505050565b60008351615a34818460208801615301565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b60008251615a6b818460208701615301565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201615ab357615ab3615a8b565b5060010190565b8082028115828204841417610fb657610fb6615a8b565b634e487b7160e01b600052601260045260246000fd5b600082615af657615af6615ad1565b500490565b80820180821115610fb657610fb6615a8b565b600060208284031215615b2057600080fd5b5051919050565b600060208284031215615b3957600080fd5b81516124bf8161584c565b6000615b52615437846153f0565b9050828152838383011115615b6657600080fd5b6124bf836020830184615301565b600060208284031215615b8657600080fd5b815167ffffffffffffffff811115615b9d57600080fd5b8201601f81018413615bae57600080fd5b613e6b84825160208401615b44565b828152604060208201526000613e6b6040830184615325565b83815260008351615bee816020850160208801615301565b60209201918201929092526040019392505050565b600082601f830112615c1457600080fd5b6124bf83835160208501615b44565b600060208284031215615c3557600080fd5b815167ffffffffffffffff811115615c4c57600080fd5b613e6b84828501615c03565b6001600160a01b0383168152604060208201526000613e6b6040830184615325565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615cac6080830184615325565b9695505050505050565b600060208284031215615cc857600080fd5b81516124bf8161526f565b81810381811115610fb657610fb6615a8b565b600080600080600060a08688031215615cfe57600080fd5b8551945060208601519350604086015192506060860151915060808601516154de816152a2565b60008060408385031215615d3857600080fd5b82519150602083015167ffffffffffffffff811115615d5657600080fd5b615d6285828601615c03565b9150509250929050565b60008060408385031215615d7f57600080fd5b505080516020909101519092909150565b600082615d9f57615d9f615ad1565b500690565b600060ff831680615db757615db7615ad1565b8060ff84160691505092915050565b600060ff831680615dd957615dd9615ad1565b8060ff84160491505092915050565b600181815b80851115615e23578160001904821115615e0957615e09615a8b565b80851615615e1657918102915b93841c9390800290615ded565b509250929050565b600082615e3a57506001610fb6565b81615e4757506000610fb6565b8160018114615e5d5760028114615e6757615e83565b6001915050610fb6565b60ff841115615e7857615e78615a8b565b50506001821b610fb6565b5060208310610133831016604e8410600b8410161715615ea6575081810a610fb6565b615eb08383615de8565b8060001904821115615ec457615ec4615a8b565b029392505050565b60006124bf8383615e2b565b60ff8281168282160390811115610fb657610fb6615a8b56fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220efc0456d59a90cf153a9e8e90a3e384c5be812864128c11c7e359608394d9f4564736f6c6343000811003300000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2000000000000000000000000187e9bd705264cf8e806d4aa692f802749511a98000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693

Deployed Bytecode

0x6080604052600436106105075760003560e01c806370a0823111610294578063b88d4fde1161015e578063d188af54116100d6578063e985e9c51161008a578063f2fde38b1161006f578063f2fde38b14610f46578063f787859914610f66578063f953cec714610f7c57600080fd5b8063e985e9c514610edd578063f0f4426014610f2657600080fd5b8063de9b771f116100bb578063de9b771f14610e0c578063e58306f914610e2c578063e8c3960514610e4c57600080fd5b8063d188af5414610de0578063d5abeb0114610df657600080fd5b8063c87b56dd1161012d578063cd901d5111610112578063cd901d5114610d98578063ce5184ba14610db8578063d0e30db014610dd857600080fd5b8063c87b56dd14610d58578063c97d938714610d7857600080fd5b8063b88d4fde14610ce3578063b8f7a66514610cf6578063c0857ba014610d0b578063c23dc68f14610d2b57600080fd5b806391b7f5ed1161020c5780639ec00c95116101c0578063a0712d68116101a5578063a0712d6814610c90578063a22cb46514610ca3578063aea4e49e14610cc357600080fd5b80639ec00c9514610c4a578063a035b1fe14610c7a57600080fd5b8063972c4928116101f1578063972c492814610bf757806397feb92614610c1757806399a2557a14610c2a57600080fd5b806391b7f5ed14610bc257806395d89b4114610be257600080fd5b80638622a689116102635780638ada6b0f116102485780638ada6b0f14610b645780638cf18df914610b845780638da5cb5b14610ba457600080fd5b80638622a68914610b3b57806387495f2d14610b5157600080fd5b806370a0823114610ab9578063715018a614610ad957806382b7565e14610aee5780638462151c14610b0e57600080fd5b80633408e470116103d557806342966c681161034d5780635bbb21771161030157806361d027b3116102e657806361d027b314610a595780636352211e14610a795780636f8b44b014610a9957600080fd5b80635bbb2177146109fc578063607f2d4214610a2957600080fd5b806353f8bb9a1161033257806353f8bb9a14610979578063545f11dd1461098f578063572b6c05146109af57600080fd5b806342966c681461093957806344004cc11461095957600080fd5b80633ccfd60b116103a457806341abe2711161038957806341abe271146108e457806341f434341461090457806342842e0e1461092657600080fd5b80633ccfd60b1461089b5780633e9c7f69146108b057600080fd5b80633408e47014610835578063372f657c14610848578063379607f51461085b5780633c8bccd91461086e57600080fd5b806310195e6e1161048357806322b3a7c8116104375780632a55205a1161041c5780632a55205a1461078c5780632d0335ab146107cb5780632ef6e9cf1461080157600080fd5b806322b3a7c81461071057806323b872dd1461077957600080fd5b806318160ddd1161046857806318160ddd146106b157806320379ee5146106ce57806322591fc8146106e357600080fd5b806310195e6e1461067257806311c67efc1461069757600080fd5b8063095ea7b3116104da5780630e387de6116104bf5780630e387de6146105e35780630f7e5970146106255780630f8677511461065257600080fd5b8063095ea7b3146105bd5780630c53c51c146105d057600080fd5b806301ffc9a71461050c57806304634d8d1461054157806306fdde0314610563578063081812fc14610585575b600080fd5b34801561051857600080fd5b5061052c610527366004615285565b610f9c565b60405190151581526020015b60405180910390f35b34801561054d57600080fd5b5061056161055c3660046152b7565b610fbc565b005b34801561056f57600080fd5b50610578610fd2565b6040516105389190615351565b34801561059157600080fd5b506105a56105a0366004615364565b611064565b6040516001600160a01b039091168152602001610538565b6105616105cb36600461537d565b6110c1565b6105786105de36600461546e565b6110da565b3480156105ef57600080fd5b506106177f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b03681565b604051908152602001610538565b34801561063157600080fd5b50610578604051806040016040528060018152602001603160f81b81525081565b34801561065e57600080fd5b5061056161066d3660046154ec565b6112c9565b34801561067e57600080fd5b50601a546105a59061010090046001600160a01b031681565b3480156106a357600080fd5b50601a5461052c9060ff1681565b3480156106bd57600080fd5b50600a546009540360001901610617565b3480156106da57600080fd5b50600754610617565b3480156106ef57600080fd5b506107036106fe36600461550e565b6112dc565b60405161053891906155a8565b34801561071c57600080fd5b5061075561072b366004615364565b601c602052600090815260409020805460018201546002909201549091906001600160a01b031683565b6040805193845260208401929092526001600160a01b031690820152606001610538565b610561610787366004615607565b6113fc565b34801561079857600080fd5b506107ac6107a73660046154ec565b611427565b604080516001600160a01b039093168352602083019190915201610538565b3480156107d757600080fd5b506106176107e6366004615648565b6001600160a01b031660009081526008602052604090205490565b34801561080d57600080fd5b506106177fac2461370e683d859a90bf5d877938417df2b2ca923bc1c4bcb2dc6a0d324be781565b34801561084157600080fd5b5046610617565b6105616108563660046156aa565b6114e4565b610561610869366004615364565b611718565b34801561087a57600080fd5b5061088e610889366004615364565b611953565b60405161053891906156ec565b3480156108a757600080fd5b506105616119c2565b3480156108bc57600080fd5b506106177f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae369025281565b3480156108f057600080fd5b506105616108ff366004615648565b611ac2565b34801561091057600080fd5b506105a56daaeb6d7670e522a718067333cd4e81565b610561610934366004615607565b611b74565b34801561094557600080fd5b50610561610954366004615364565b611b99565b34801561096557600080fd5b50610561610974366004615607565b611ba4565b34801561098557600080fd5b5061061760185481565b34801561099b57600080fd5b506105616109aa3660046154ec565b611c38565b3480156109bb57600080fd5b5061052c6109ca366004615648565b7f00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a86936001600160a01b0390811691161490565b348015610a0857600080fd5b50610a1c610a173660046156aa565b611cf0565b6040516105389190615716565b348015610a3557600080fd5b5061052c610a44366004615364565b60036020526000908152604090205460ff1681565b348015610a6557600080fd5b506015546105a5906001600160a01b031681565b348015610a8557600080fd5b506105a5610a94366004615364565b611dbc565b348015610aa557600080fd5b50610561610ab4366004615364565b611dc7565b348015610ac557600080fd5b50610617610ad4366004615648565b611dd4565b348015610ae557600080fd5b50610561611e3c565b348015610afa57600080fd5b50610561610b09366004615648565b611e50565b348015610b1a57600080fd5b50610b2e610b29366004615648565b611e97565b6040516105389190615793565b348015610b4757600080fd5b5061061760195481565b610561610b5f3660046157cb565b611f9b565b348015610b7057600080fd5b50601d546105a5906001600160a01b031681565b348015610b9057600080fd5b50610561610b9f366004615648565b612208565b348015610bb057600080fd5b506011546001600160a01b03166105a5565b348015610bce57600080fd5b50610561610bdd366004615364565b612232565b348015610bee57600080fd5b5061057861223f565b348015610c0357600080fd5b506002546105a5906001600160a01b031681565b610561610c2536600461537d565b61224e565b348015610c3657600080fd5b50610b2e610c45366004615817565b612325565b348015610c5657600080fd5b5061052c610c65366004615648565b601b6020526000908152604090205460ff1681565b348015610c8657600080fd5b5061061760175481565b610561610c9e366004615364565b6124c6565b348015610caf57600080fd5b50610561610cbe36600461585a565b6125de565b348015610ccf57600080fd5b50610561610cde366004615648565b6125f2565b610561610cf1366004615888565b61261c565b348015610d0257600080fd5b5061052c612649565b348015610d1757600080fd5b506001546105a5906001600160a01b031681565b348015610d3757600080fd5b50610d4b610d46366004615364565b612662565b60405161053891906158f4565b348015610d6457600080fd5b50610578610d73366004615364565b6126ea565b348015610d8457600080fd5b50610561610d93366004615939565b6127e3565b348015610da457600080fd5b50610561610db3366004615364565b6127fe565b348015610dc457600080fd5b50610561610dd3366004615364565b61280b565b610561612818565b348015610dec57600080fd5b5061061760135481565b348015610e0257600080fd5b5061061760165481565b348015610e1857600080fd5b506000546105a5906001600160a01b031681565b348015610e3857600080fd5b50610561610e4736600461537d565b612858565b348015610e5857600080fd5b50610e6c610e67366004615648565b6128c6565b60405161053891906000610120820190508251151582526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100808401511515818401525092915050565b348015610ee957600080fd5b5061052c610ef8366004615956565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b348015610f3257600080fd5b50610561610f41366004615648565b61299e565b348015610f5257600080fd5b50610561610f61366004615648565b6129c8565b348015610f7257600080fd5b5061061760145481565b348015610f8857600080fd5b50610561610f97366004615984565b612a55565b6000610fa782612ab3565b80610fb65750610fb682612b33565b92915050565b610fc4612b81565b610fce8282612bfa565b5050565b6060600b8054610fe1906159b9565b80601f016020809104026020016040519081016040528092919081815260200182805461100d906159b9565b801561105a5780601f1061102f5761010080835404028352916020019161105a565b820191906000526020600020905b81548152906001019060200180831161103d57829003601f168201915b5050505050905090565b600061106f82612d14565b6110a5576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600f60205260409020546001600160a01b031690565b816110cb81612d49565b6110d58383612e34565b505050565b60408051606081810183526001600160a01b038816600081815260086020908152908590205484528301529181018690526111188782878787612eed565b6111735760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084015b60405180910390fd5b6001600160a01b038716600090815260086020526040902054611197906001612ff5565b6001600160a01b0388166000908152600860205260409081902091909155517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b906111e790899033908a906159ed565b60405180910390a1600080306001600160a01b0316888a60405160200161120f929190615a22565b60408051601f198184030181529082905261122991615a59565b6000604051808303816000865af19150503d8060008114611266576040519150601f19603f3d011682016040523d82523d6000602084013e61126b565b606091505b5091509150816112bd5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c00000000604482015260640161116a565b98975050505050505050565b6112d1612b81565b601891909155601955565b60606000825167ffffffffffffffff8111156112fa576112fa6153a9565b60405190808252806020026020018201604052801561135857816020015b6113456040518060600160405280600081526020016000815260200160006001600160a01b031681525090565b8152602001906001900390816113185790505b50905060005b83518110156113f557601c600085838151811061137d5761137d615a75565b6020908102919091018101518252818101929092526040908101600020815160608101835281548152600182015493810193909352600201546001600160a01b03169082015282518390839081106113d7576113d7615a75565b602002602001018190525080806113ed90615aa1565b91505061135e565b5092915050565b826001600160a01b03811633146114165761141633612d49565b611421848484613001565b50505050565b60008281526005602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff169282019290925282916114a65750604080518082019091526004546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b6020810151600090612710906114ca906bffffffffffffffffffffffff1687615aba565b6114d49190615ae7565b91519350909150505b9250929050565b6017546001906114f48183615aba565b3410156115435760405162461bcd60e51b815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015260640161116a565b60016014548585611552612649565b61159e5760405162461bcd60e51b815260206004820152601360248201527f4d696e74206973206e6f74206163746976652e00000000000000000000000000604482015260640161116a565b601654600a5460095486919003600019016115b99190615afb565b106115fa5760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b336000908152601b602052604090205460ff161561164c5760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9036b4b73a32b21760891b604482015260640161116a565b6040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506116c58383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508591506131d69050565b6117025760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b210383937b7b31760911b604482015260640161116a565b61170d3360016131ec565b505050505050505050565b611720613327565b600061172b82611dbc565b9050336001600160a01b038216146117aa5760405162461bcd60e51b8152602060048201526024808201527f4f7065726174696f6e207265737472696374656420746f20746f6b656e206f7760448201527f6e65722e00000000000000000000000000000000000000000000000000000000606482015260840161116a565b6000828152601c602052604090208054806118075760405162461bcd60e51b815260206004820152601860248201527f4e6f20636f6d6d697373696f6e7320746f20636c61696d2e0000000000000000604482015260640161116a565b6000836001600160a01b03168260405160006040518083038185875af1925050503d8060008114611854576040519150601f19603f3d011682016040523d82523d6000602084013e611859565b606091505b50509050806118aa5760405162461bcd60e51b815260206004820152601860248201527f556e61626c6520746f20636c61696d20726577617264732e0000000000000000604482015260640161116a565b604080516060808201835260008083524260208085019182526001600160a01b038a81168688018181528d8652601c84529488902096518755925160018701559251600290950180546001600160a01b03191695909316949094179091558351898152928301529181018490527f3ed1528b0fdc7c5207c1bf935e34a667e13656b9ed165260c522be0bc544f303910160405180910390a1505050506119506001601255565b50565b6119806040518060600160405280600081526020016000815260200160006001600160a01b031681525090565b506000908152601c6020908152604091829020825160608101845281548152600182015492810192909252600201546001600160a01b03169181019190915290565b6119ca612b81565b60155460405147916000916001600160a01b039091169083908381818185875af1925050503d8060008114611a1b576040519150601f19603f3d011682016040523d82523d6000602084013e611a20565b606091505b5050905080611a715760405162461bcd60e51b815260206004820152601660248201527f556e61626c6520746f2077697468647261772045544800000000000000000000604482015260640161116a565b601554604080513081526001600160a01b03909216602083015281018390527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb906060015b60405180910390a15050565b611aca612b81565b601a546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009161010090046001600160a01b0316906370a0823190602401602060405180830381865afa158015611b31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b559190615b0e565b601a54909150610fce9061010090046001600160a01b03168383611ba4565b826001600160a01b0381163314611b8e57611b8e33612d49565b611421848484613380565b61195081600161339b565b611bac612b81565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611c14573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190615b27565b611c40612b81565b6040518060600160405280828152602001428152602001611c5e3390565b6001600160a01b039081169091526000848152601c602090815260409182902084518155908401516001820155920151600290920180546001600160a01b031916929091169190911790557f44ad1d6fa16483bccc4ca776b1bf7ac614cb3bab63d0d763f5ca2e0e86630fa133604080516001600160a01b039092168252602082018590528101839052606001611ab6565b60608160008167ffffffffffffffff811115611d0e57611d0e6153a9565b604051908082528060200260200182016040528015611d6057816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181611d2c5790505b50905060005b828114611db357611d8e868683818110611d8257611d82615a75565b90506020020135612662565b828281518110611da057611da0615a75565b6020908102919091010152600101611d66565b50949350505050565b6000610fb6826134ff565b611dcf612b81565b601655565b60006001600160a01b038216611e16576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03166000908152600e602052604090205467ffffffffffffffff1690565b611e44612b81565b611e4e6000613587565b565b611e58612b81565b601a80546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b60606000806000611ea785611dd4565b905060008167ffffffffffffffff811115611ec457611ec46153a9565b604051908082528060200260200182016040528015611eed578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b838614611f8f57611f28816135d9565b91508160400151611f875781516001600160a01b031615611f4857815194505b876001600160a01b0316856001600160a01b031603611f875780838780600101985081518110611f7a57611f7a615a75565b6020026020010181815250505b600101611f18565b50909695505050505050565b60016013548383611faa612649565b611ff65760405162461bcd60e51b815260206004820152601360248201527f4d696e74206973206e6f74206163746976652e00000000000000000000000000604482015260640161116a565b601654600a5460095486919003600019016120119190615afb565b106120525760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b336000908152601b602052604090205460ff16156120a45760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9036b4b73a32b21760891b604482015260640161116a565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061211d8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508892508591506131d69050565b61215a5760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b210383937b7b31760911b604482015260640161116a565b600033601a546040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038084166004830152306024830152604482018d9052929350610100909104909116906323b872dd906064016020604051808303816000875af11580156121d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fc9190615b27565b5061170d8160016131ec565b612210612b81565b601d80546001600160a01b0319166001600160a01b0392909216919091179055565b61223a612b81565b601755565b6060600c8054610fe1906159b9565b6001600160a01b0382166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af11580156122b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d59190615b27565b50604080516001600160a01b03841681523360208201523091810191909152606081018290527f801a94bfaa839fe8aafeefa94d06f3f7e194d9719a6d4ee0df2ed8e9a33d239590608001611ab6565b6060818310612360576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061236c60095490565b9050600185101561237c57600194505b80841115612388578093505b600061239387611dd4565b9050848610156123b257858503818110156123ac578091505b506123b6565b5060005b60008167ffffffffffffffff8111156123d1576123d16153a9565b6040519080825280602002602001820160405280156123fa578160200160208202803683370190505b509050816000036124105793506124bf92505050565b600061241b88612662565b90506000816040015161242c575080515b885b88811415801561243e5750848714155b156124b35761244c816135d9565b925082604001516124ab5782516001600160a01b03161561246c57825191505b8a6001600160a01b0316826001600160a01b0316036124ab578084888060010199508151811061249e5761249e615a75565b6020026020010181815250505b60010161242e565b50505092835250909150505b9392505050565b60175481906124d58183615aba565b3410156125245760405162461bcd60e51b815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015260640161116a565b601a54839060ff166125785760405162461bcd60e51b815260206004820152601a60248201527f5075626c6963206d696e74206973206e6f74206163746976652e000000000000604482015260640161116a565b601654600a5460095483919003600019016125939190615afb565b106125d45760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b61142133856131ec565b816125e881612d49565b6110d58383613658565b6125fa612b81565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b836001600160a01b03811633146126365761263633612d49565b612642858585856136c4565b5050505050565b60006018544211801561265d575060195442105b905090565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806126bb57506009548310155b156126c65792915050565b6126cf836135d9565b90508060400151156126e15792915050565b6124bf83613708565b60606126f582612d14565b6127415760405162461bcd60e51b815260206004820152601560248201527f546f6b656e20646f6573206e6f742065786973742e0000000000000000000000604482015260640161116a565b601d546000838152601c6020526040908190205490517f92cb829d0000000000000000000000000000000000000000000000000000000081526004810185905260248101919091526001600160a01b03909116906392cb829d90604401600060405180830381865afa1580156127bb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fb69190810190615b74565b6127eb612b81565b601a805460ff1916911515919091179055565b612806612b81565b601455565b612813612b81565b601355565b60408051338152306020820152348183015290517f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629181900360600190a1565b612860612b81565b601654600a54600954839190036000190161287b9190615afb565b106128bc5760405162461bcd60e51b815260206004820152601160248201527026b0bc1036b4b73a103932b0b1b432b21760791b604482015260640161116a565b610fce82826131ec565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091526040805161012081018252601a5460ff16151581526018546020820152601954918101919091526013546060820152601454608082015260165460a082015260c08101612965600a546009546000199190030190565b81526017546020808301919091526001600160a01b039094166000908152601b9094526040938490205460ff1615159301929092525090565b6129a6612b81565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6129d0612b81565b6001600160a01b038116612a4c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161116a565b61195081613587565b6000612a6082613780565b9050610fce81613ab1565b60007f00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a86936001600160a01b03163303612aaa575060131936013560601c90565b503390565b3390565b60006301ffc9a760e01b6001600160e01b031983161480612afd57507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b80610fb65750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610fb657506301ffc9a760e01b6001600160e01b0319831614610fb6565b612b89613aba565b6001600160a01b0316612ba46011546001600160a01b031690565b6001600160a01b031614611e4e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161116a565b6127106bffffffffffffffffffffffff82161115612c805760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c65507269636500000000000000000000000000000000000000000000606482015260840161116a565b6001600160a01b038216612cd65760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161116a565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600455565b600081600111158015612d28575060095482105b8015610fb65750506000908152600d6020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b15611950576040517fc61711340000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df39190615b27565b611950576040517fede71dcc0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260240161116a565b6000612e3f82611dbc565b9050336001600160a01b03821614612e9157612e5b8133610ef8565b612e91576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600f602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006001600160a01b038616612f6b5760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201527f49474e4552000000000000000000000000000000000000000000000000000000606482015260840161116a565b6001612f7e612f7987613ac4565b613b41565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015612fcc573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b60006124bf8284615afb565b600061300c826134ff565b9050836001600160a01b0316816001600160a01b031614613059576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600f6020526040902080546130858187335b6001600160a01b039081169116811491141790565b6130b0576130938633610ef8565b6130b057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166130f0576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156130fb57600082555b6001600160a01b038681166000908152600e60205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b176000858152600d6020526040812091909155600160e11b8416900361318d57600184016000818152600d6020526040812054900361318b57600954811461318b576000818152600d602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000826131e38584613b8c565b14949350505050565b60006131f760095490565b6001600160a01b0384166000908152601b60205260409020805460ff1916600117905590506132268383613bd9565b60005b8281101561142157604051806060016040528060008152602001428152602001856001600160a01b0316815250601c600083856132669190615afb565b815260208082019290925260409081016000208351815583830151600182015592810151600290930180546001600160a01b0319166001600160a01b039485161790558051928716918301919091528101839052613315907f5a1aa6b3e98d297b5b07a16097bb7f47aa9c559c07c644e033b9aa6ae36902529060600160408051601f19818403018152908290526133019291602001615bbd565b604051602081830303815290604052613d0a565b8061331f81615aa1565b915050613229565b6002601254036133795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161116a565b6002601255565b6110d58383836040518060200160405280600081525061261c565b60006133a6836134ff565b9050806000806133c4866000908152600f6020526040902080549091565b915091508415613404576133d9818433613070565b613404576133e78333610ef8565b61340457604051632ce44b5f60e11b815260040160405180910390fd5b801561340f57600082555b6001600160a01b0383166000818152600e6020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b177c0300000000000000000000000000000000000000000000000000000000176000878152600d6020526040812091909155600160e11b851690036134b657600186016000818152600d602052604081205490036134b45760095481146134b4576000818152600d602052604090208590555b505b60405186906000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050600a8054600101905550505050565b6000818060011161355557600954811015613555576000818152600d602052604081205490600160e01b82169003613553575b806000036124bf5750600019016000818152600d6020526040902054613532565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040805160808101825260008082526020820181905291810182905260608101919091526000828152600d6020526040902054610fb690604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b3360008181526010602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6136cf8484846113fc565b6001600160a01b0383163b15611421576136eb84848484613d87565b611421576040516368d2bf6b60e11b815260040160405180910390fd5b604080516080810182526000808252602082018190529181018290526060810191909152610fb6613738836134ff565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b6060600061378d83613e73565b9050600061379a82613ed2565b905060006137a783613efb565b90506000816137b584613f24565b6137be866140e2565b6040516020016137d093929190615bd6565b60408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561386d5760405162461bcd60e51b8152602060048201526024808201527f4678526f6f7454756e6e656c3a20455849545f414c52454144595f50524f434560448201527f5353454400000000000000000000000000000000000000000000000000000000606482015260840161116a565b6000818152600360205260408120805460ff1916600117905561388f856140fe565b9050600061389c82614248565b90506138a7816142d8565b6002546001600160a01b0390811691161461392a5760405162461bcd60e51b815260206004820152602560248201527f4678526f6f7454756e6e656c3a20494e56414c49445f46585f4348494c445f5460448201527f554e4e454c000000000000000000000000000000000000000000000000000000606482015260840161116a565b600061393587614301565b9050613955613945846020015190565b8761394f8a61431d565b84614339565b6139c75760405162461bcd60e51b815260206004820152602360248201527f4678526f6f7454756e6e656c3a20494e56414c49445f524543454950545f505260448201527f4f4f460000000000000000000000000000000000000000000000000000000000606482015260840161116a565b6139f5856139d4896145ee565b6139dd8a61460a565b846139e78c614626565b6139f08d614642565b61465e565b506000613a018361479d565b90507f8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036613a37613a328360006147d9565b614811565b14613a845760405162461bcd60e51b815260206004820152601f60248201527f4678526f6f7454756e6e656c3a20494e56414c49445f5349474e415455524500604482015260640161116a565b6000613a8f8461488a565b806020019051810190613aa29190615c23565b9b9a5050505050505050505050565b611950816148a6565b600061265d612a6b565b6000604051806080016040528060438152602001615ef26043913980516020918201208351848301516040808701518051908601209051613b24950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000613b4c60075490565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201613b24565b600081815b8451811015613bd157613bbd82868381518110613bb057613bb0615a75565b6020026020010151614955565b915080613bc981615aa1565b915050613b91565b509392505050565b6009546000829003613c17576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000818152600e602090815260408083208054680100000000000000018802019055848352600d90915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114613cc657808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613c8e565b5081600003613d01576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60095550505050565b6000546002546040517fb47204770000000000000000000000000000000000000000000000000000000081526001600160a01b039283169263b472047792613d59929116908590600401615c58565b600060405180830381600087803b158015613d7357600080fd5b505af1158015612642573d6000803e3d6000fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613dbc903390899088908890600401615c7a565b6020604051808303816000875af1925050508015613df7575060408051601f3d908101601f19168201909252613df491810190615cb6565b60015b613e55573d808015613e25576040519150601f19603f3d011682016040523d82523d6000602084013e613e2a565b606091505b508051600003613e4d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6040805160208101909152606081526000613ebd613eb88460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b614984565b60408051602081019091529081529392505050565b6060610fb68260000151600881518110613eee57613eee615a75565b6020026020010151614a9a565b6000610fb68260000151600281518110613f1757613f17615a75565b6020026020010151614811565b60408051602081019091526000815281516060919015610fb657600080613f4c600086614b37565b60f81c90506001811480613f6357508060ff166003145b1561400b57600185516002613f789190615aba565b613f829190615cd3565b67ffffffffffffffff811115613f9a57613f9a6153a9565b6040519080825280601f01601f191660200182016040528015613fc4576020820181803683370190505b5092506000613fd4600187614b37565b90508084600081518110613fea57613fea615a75565b60200101906001600160f81b031916908160001a905350600192505061406f565b60028551600261401b9190615aba565b6140259190615cd3565b67ffffffffffffffff81111561403d5761403d6153a9565b6040519080825280601f01601f191660200182016040528015614067576020820181803683370190505b509250600091505b60ff82165b83518110156140d95761409e61408d60ff851683615cd3565b614098906002615afb565b87614b37565b8482815181106140b0576140b0615a75565b60200101906001600160f81b031916908160001a905350806140d181615aa1565b915050614074565b50505092915050565b6000610fb68260000151600981518110613f1757613f17615a75565b61412260405180606001604052806060815260200160608152602001600081525090565b61413c8260000151600681518110613eee57613eee615a75565b60208281018290526040805180820182526000808252908301528051808201909152825181529181019082015261417281614bb8565b156141875761418081614984565b8252614234565b6020820151805160009061419d90600190615cd3565b67ffffffffffffffff8111156141b5576141b56153a9565b6040519080825280601f01601f1916602001820160405280156141df576020820181803683370190505b5090506000808360210191508260200190506141fd82828551614bf3565b60408051808201825260008082526020918201528151808301909252845182528085019082015261422d90614984565b8652505050505b61423d836140e2565b604083015250919050565b604080516080810182526000918101828152606080830193909352815260208101919091526000614296836000015160038151811061428957614289615a75565b6020026020010151614984565b8360400151815181106142ab576142ab615a75565b6020026020010151905060405180604001604052808281526020016142cf83614984565b90529392505050565b6000610fb682602001516000815181106142f4576142f4615a75565b6020026020010151614c71565b6000610fb68260000151600581518110613f1757613f17615a75565b6060610fb68260000151600781518110613eee57613eee615a75565b60008061436d8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b9050600061437a82614984565b90506060808560008061438c8b613f24565b905080516000036143a7576000975050505050505050613e6b565b60005b86518110156145db5781518311156143cd57600098505050505050505050613e6b565b6143ef8782815181106143e2576143e2615a75565b6020026020010151614c8b565b95508580519060200120841461441057600098505050505050505050613e6b565b61442587828151811061428957614289615a75565b945084516011036144f75781518303614484578c8051906020012061445686601081518110613eee57613eee615a75565b805190602001200361447357600198505050505050505050613e6b565b600098505050505050505050613e6b565b600082848151811061449857614498615a75565b016020015160f81c905060108111156144bd5760009950505050505050505050613e6b565b6144e2868260ff16815181106144d5576144d5615a75565b6020026020010151614d03565b94506144ef600185615afb565b9350506145c9565b845160020361447357600061452261451b87600081518110613eee57613eee615a75565b8486614d31565b83519091506145318286615afb565b03614584578d8051906020012061455487600181518110613eee57613eee615a75565b80519060200120036145725760019950505050505050505050613e6b565b60009950505050505050505050613e6b565b8060000361459e5760009950505050505050505050613e6b565b6145a88185615afb565b93506145c0866001815181106144d5576144d5615a75565b94506145c99050565b806145d381615aa1565b9150506143aa565b5060009c9b505050505050505050505050565b6000610fb68260000151600381518110613f1757613f17615a75565b6000610fb68260000151600481518110613f1757613f17615a75565b6000610fb68260000151600081518110613f1757613f17615a75565b6060610fb68260000151600181518110613eee57613eee615a75565b6001546040517f41539d4a000000000000000000000000000000000000000000000000000000008152600481018490526000918291829182916001600160a01b03909116906341539d4a9060240160a060405180830381865afa1580156146c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146ed9190615ce6565b5093505092509250614744828b6147049190615cd3565b6040805160208082018f90528183018e9052606082018d905260808083018d90528351808403909101815260a09092019092528051910120908588614e51565b6147905760405162461bcd60e51b815260206004820152601c60248201527f4678526f6f7454756e6e656c3a20494e56414c49445f48454144455200000000604482015260640161116a565b9998505050505050505050565b60408051602081019091526060815260405180602001604052806147d1846020015160018151811061428957614289615a75565b905292915050565b6040805180820190915260008082526020820152825180518390811061480157614801615a75565b6020026020010151905092915050565b80516000901580159061482657508151602110155b61482f57600080fd5b600061483e8360200151614fca565b905060008184600001516148529190615cd3565b90506000808386602001516148679190615afb565b9050805191506020831015611db357506020919091036101000a90049392505050565b6060610fb68260200151600281518110613eee57613eee615a75565b600080828060200190518101906148bd9190615d25565b915091507fac2461370e683d859a90bf5d877938417df2b2ca923bc1c4bcb2dc6a0d324be7820361490d57600080828060200190518101906148ff9190615d6c565b91509150612642828261504b565b60405162461bcd60e51b815260206004820152601360248201527f494e56414c49445f414354494f4e5f5459504500000000000000000000000000604482015260640161116a565b60008183106149715760008281526020849052604090206124bf565b60008381526020839052604090206124bf565b606061498f82614bb8565b61499857600080fd5b60006149a3836150f4565b905060008167ffffffffffffffff8111156149c0576149c06153a9565b604051908082528060200260200182016040528015614a0557816020015b60408051808201909152600080825260208201528152602001906001900390816149de5790505b5090506000614a178560200151614fca565b8560200151614a269190615afb565b90506000805b84811015614a8f57614a3d83615179565b9150604051806040016040528083815260200184815250848281518110614a6657614a66615a75565b6020908102919091010152614a7b8284615afb565b925080614a8781615aa1565b915050614a2c565b509195945050505050565b8051606090614aa857600080fd5b6000614ab78360200151614fca565b90506000818460000151614acb9190615cd3565b905060008167ffffffffffffffff811115614ae857614ae86153a9565b6040519080825280601f01601f191660200182016040528015614b12576020820181803683370190505b5090506000816020019050611db3848760200151614b309190615afb565b828561521d565b6000614b44600284615d90565b15614b7e57601082614b57600286615ae7565b81518110614b6757614b67615a75565b0160200151614b79919060f81c615da4565b614bae565b601082614b8c600286615ae7565b81518110614b9c57614b9c615a75565b0160200151614bae919060f81c615dc6565b60f81b9392505050565b80516000908103614bcb57506000919050565b6020820151805160001a9060c0821015614be9575060009392505050565b5060019392505050565b80600003614c0057505050565b60208110614c385782518252614c17602084615afb565b9250614c24602083615afb565b9150614c31602082615cd3565b9050614c00565b60006001614c47836020615cd3565b614c5390610100615ecc565b614c5d9190615cd3565b935183518516941916939093179091525050565b8051600090601514614c8257600080fd5b610fb682614811565b60606000826000015167ffffffffffffffff811115614cac57614cac6153a9565b6040519080825280601f01601f191660200182016040528015614cd6576020820181803683370190505b5090508051600003614ce85792915050565b60008160200190506113f5846020015182866000015161521d565b8051600090602114614d1457600080fd5b60008083602001516001614d289190615afb565b51949350505050565b60008080614d3e86613f24565b90506000815167ffffffffffffffff811115614d5c57614d5c6153a9565b6040519080825280601f01601f191660200182016040528015614d86576020820181803683370190505b509050845b8251614d979087615afb565b811015614e22576000878281518110614db257614db2615a75565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690508083614de78985615cd3565b81518110614df757614df7615a75565b60200101906001600160f81b031916908160001a905350508080614e1a90615aa1565b915050614d8b565b508080519060200120828051906020012003614e415781519250614e46565b600092505b509095945050505050565b600060208251614e619190615d90565b15614eae5760405162461bcd60e51b815260206004820152601460248201527f496e76616c69642070726f6f66206c656e677468000000000000000000000000604482015260640161116a565b600060208351614ebe9190615ae7565b9050614ecb816002615ecc565b8510614f195760405162461bcd60e51b815260206004820152601560248201527f4c65616620696e64657820697320746f6f206269670000000000000000000000604482015260640161116a565b60008660205b85518111614fbc57858101519250614f38600289615d90565b600003614f70576040805160208101849052908101849052606001604051602081830303815290604052805190602001209150614f9d565b60408051602081018590529081018390526060016040516020818303038152906040528051906020012091505b614fa8600289615ae7565b9750614fb5602082615afb565b9050614f1f565b509094149695505050505050565b8051600090811a6080811015614fe35750600092915050565b60b8811080614ffe575060c08110801590614ffe575060f881105b1561500c5750600192915050565b60c081101561503957615021600160b8615ed8565b61502e9060ff1682615cd3565b6124bf906001615afb565b615021600160f8615ed8565b50919050565b6000811161509b5760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642076616c75652070726f766964656400000000000000000000604482015260640161116a565b6000828152601c6020526040812080548392906150b9908490615afb565b909155505060408051838152602081018390527ff56fc20e631b06fb7eac7d1ce8a9cd01061f4f8b90259cea3bf54679c5272cfd9101611ab6565b8051600090810361510757506000919050565b6000806151178460200151614fca565b84602001516151269190615afb565b905060008460000151856020015161513e9190615afb565b90505b808210156151705761515282615179565b61515c9083615afb565b91508261516881615aa1565b935050615141565b50909392505050565b80516000908190811a608081101561519457600191506113f5565b60b88110156151ba576151a8608082615cd3565b6151b3906001615afb565b91506113f5565b60c08110156151e75760b78103600185019450806020036101000a855104600182018101935050506113f5565b60f88110156151fb576151a860c082615cd3565b60019390930151602084900360f7016101000a900490920160f5190192915050565b8060000361522a57505050565b602081106152625782518252615241602084615afb565b925061524e602083615afb565b915061525b602082615cd3565b905061522a565b80600003614c3857505050565b6001600160e01b03198116811461195057600080fd5b60006020828403121561529757600080fd5b81356124bf8161526f565b6001600160a01b038116811461195057600080fd5b600080604083850312156152ca57600080fd5b82356152d5816152a2565b915060208301356bffffffffffffffffffffffff811681146152f657600080fd5b809150509250929050565b60005b8381101561531c578181015183820152602001615304565b50506000910152565b6000815180845261533d816020860160208601615301565b601f01601f19169290920160200192915050565b6020815260006124bf6020830184615325565b60006020828403121561537657600080fd5b5035919050565b6000806040838503121561539057600080fd5b823561539b816152a2565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156153e8576153e86153a9565b604052919050565b600067ffffffffffffffff82111561540a5761540a6153a9565b50601f01601f191660200190565b600082601f83011261542957600080fd5b813561543c615437826153f0565b6153bf565b81815284602083860101111561545157600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561548657600080fd5b8535615491816152a2565b9450602086013567ffffffffffffffff8111156154ad57600080fd5b6154b988828901615418565b9450506040860135925060608601359150608086013560ff811681146154de57600080fd5b809150509295509295909350565b600080604083850312156154ff57600080fd5b50508035926020909101359150565b6000602080838503121561552157600080fd5b823567ffffffffffffffff8082111561553957600080fd5b818501915085601f83011261554d57600080fd5b81358181111561555f5761555f6153a9565b8060051b91506155708483016153bf565b818152918301840191848101908884111561558a57600080fd5b938501935b838510156112bd5784358252938501939085019061558f565b6020808252825182820181905260009190848201906040850190845b81811015611f8f576155f483855180518252602080820151908301526040908101516001600160a01b0316910152565b92840192606092909201916001016155c4565b60008060006060848603121561561c57600080fd5b8335615627816152a2565b92506020840135615637816152a2565b929592945050506040919091013590565b60006020828403121561565a57600080fd5b81356124bf816152a2565b60008083601f84011261567757600080fd5b50813567ffffffffffffffff81111561568f57600080fd5b6020830191508360208260051b85010111156114dd57600080fd5b600080602083850312156156bd57600080fd5b823567ffffffffffffffff8111156156d457600080fd5b6156e085828601615665565b90969095509350505050565b81518152602080830151908201526040808301516001600160a01b03169082015260608101610fb6565b6020808252825182820181905260009190848201906040850190845b81811015611f8f576157808385516001600160a01b03815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b9284019260809290920191600101615732565b6020808252825182820181905260009190848201906040850190845b81811015611f8f578351835292840192918401916001016157af565b6000806000604084860312156157e057600080fd5b83359250602084013567ffffffffffffffff8111156157fe57600080fd5b61580a86828701615665565b9497909650939450505050565b60008060006060848603121561582c57600080fd5b8335615837816152a2565b95602085013595506040909401359392505050565b801515811461195057600080fd5b6000806040838503121561586d57600080fd5b8235615878816152a2565b915060208301356152f68161584c565b6000806000806080858703121561589e57600080fd5b84356158a9816152a2565b935060208501356158b9816152a2565b925060408501359150606085013567ffffffffffffffff8111156158dc57600080fd5b6158e887828801615418565b91505092959194509250565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff169082015260808101610fb6565b60006020828403121561594b57600080fd5b81356124bf8161584c565b6000806040838503121561596957600080fd5b8235615974816152a2565b915060208301356152f6816152a2565b60006020828403121561599657600080fd5b813567ffffffffffffffff8111156159ad57600080fd5b613e6b84828501615418565b600181811c908216806159cd57607f821691505b60208210810361504557634e487b7160e01b600052602260045260246000fd5b60006001600160a01b03808616835280851660208401525060606040830152615a196060830184615325565b95945050505050565b60008351615a34818460208801615301565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b60008251615a6b818460208701615301565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201615ab357615ab3615a8b565b5060010190565b8082028115828204841417610fb657610fb6615a8b565b634e487b7160e01b600052601260045260246000fd5b600082615af657615af6615ad1565b500490565b80820180821115610fb657610fb6615a8b565b600060208284031215615b2057600080fd5b5051919050565b600060208284031215615b3957600080fd5b81516124bf8161584c565b6000615b52615437846153f0565b9050828152838383011115615b6657600080fd5b6124bf836020830184615301565b600060208284031215615b8657600080fd5b815167ffffffffffffffff811115615b9d57600080fd5b8201601f81018413615bae57600080fd5b613e6b84825160208401615b44565b828152604060208201526000613e6b6040830184615325565b83815260008351615bee816020850160208801615301565b60209201918201929092526040019392505050565b600082601f830112615c1457600080fd5b6124bf83835160208501615b44565b600060208284031215615c3557600080fd5b815167ffffffffffffffff811115615c4c57600080fd5b613e6b84828501615c03565b6001600160a01b0383168152604060208201526000613e6b6040830184615325565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615cac6080830184615325565b9695505050505050565b600060208284031215615cc857600080fd5b81516124bf8161526f565b81810381811115610fb657610fb6615a8b565b600080600080600060a08688031215615cfe57600080fd5b8551945060208601519350604086015192506060860151915060808601516154de816152a2565b60008060408385031215615d3857600080fd5b82519150602083015167ffffffffffffffff811115615d5657600080fd5b615d6285828601615c03565b9150509250929050565b60008060408385031215615d7f57600080fd5b505080516020909101519092909150565b600082615d9f57615d9f615ad1565b500690565b600060ff831680615db757615db7615ad1565b8060ff84160691505092915050565b600060ff831680615dd957615dd9615ad1565b8060ff84160491505092915050565b600181815b80851115615e23578160001904821115615e0957615e09615a8b565b80851615615e1657918102915b93841c9390800290615ded565b509250929050565b600082615e3a57506001610fb6565b81615e4757506000610fb6565b8160018114615e5d5760028114615e6757615e83565b6001915050610fb6565b60ff841115615e7857615e78615a8b565b50506001821b610fb6565b5060208310610133831016604e8410600b8410161715615ea6575081810a610fb6565b615eb08383615de8565b8060001904821115615ec457615ec4615a8b565b029392505050565b60006124bf8383615e2b565b60ff8281168282160390811115610fb657610fb6615a8b56fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220efc0456d59a90cf153a9e8e90a3e384c5be812864128c11c7e359608394d9f4564736f6c63430008110033

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

00000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2000000000000000000000000187e9bd705264cf8e806d4aa692f802749511a98000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693

-----Decoded View---------------
Arg [0] : _checkpointManager (address): 0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287
Arg [1] : _fxRoot (address): 0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2
Arg [2] : _acorneRenderer (address): 0x187e9BD705264cf8E806d4AA692f802749511A98
Arg [3] : _frgTokenAddress (address): 0x726516B20c4692a6beA3900971a37e0cCf7A6BFf
Arg [4] : _trustedForwarder (address): 0x84a0856b038eaAd1cC7E297cF34A7e72685A8693

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000086e4dc95c7fbdbf52e33d563bbdb00823894c287
Arg [1] : 000000000000000000000000fe5e5d361b2ad62c541bab87c45a0b9b018389a2
Arg [2] : 000000000000000000000000187e9bd705264cf8e806d4aa692f802749511a98
Arg [3] : 000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff
Arg [4] : 00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693


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.