ETH Price: $3,497.61 (+2.98%)
Gas: 4.2 Gwei

Contract

0x9ceBA66215276558F084DC24a53634A114DdB825
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ShellzOrbV3

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 37 : ShellzOrbV3.sol
// SPDX-License-Identifier: MIT
// Built for Shellz Orb by megsdevs
pragma solidity 0.8.17;

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

/**
 * @title  ShellzOrbV3
 * @author megsdevs
 * @notice ShellzOrbV3 is the Shellz Orb NFT V3 contract that contains methods
 *         to interact with SeaDrop.
 */
contract ShellzOrbV3 is 
    ShellzOrbSeadropUpgradeable
{
    
    /**
     *  @notice disable initialization of the implementation contract so connot bypass the proxy.
    */  
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /**
     *  @notice reinitializer allows initialisation on upgrade, in this case for version 2.
    */ 
    function initializeV3(
        address[] memory allowedSeaDrop
    ) public reinitializer(3) {
        __ERC721SeaDrop_init(name(), symbol(), allowedSeaDrop);
    }

}

File 2 of 37 : ERC721Retreatable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

contract ERC721Retreatable {
    /// @dev The Retreating base contract is implemented with the diamond storage pattern to prevent
    /// data overlapping, so it can be added and removed during upgrades without affecting other data.
    bytes32 private constant storagePosition =
        keccak256("diamond.storage.ERC721Retreatable");

    error AlreadyInRetreating();
    error NotInRetreating();
    error RetreatingDisabled();
    error NotAllowed();
    error NotAuthorized();

    struct ERC721RetreatableStorage {
        mapping(uint256 => TokenParameter) tokenParam;
        bool enableRetreating;
        mapping(address => bool) operatorAddress;
    }

    /// @dev pack token related parameters into a single storage slot to reduce gas consumption.
    struct TokenParameter {
        uint64 retreatingStartTime;
        uint64 totalRetreatingTime;
    }

    modifier onlyTokenOwner(uint256 tokenId) {
        if (IERC721(address(this)).ownerOf(tokenId) != msg.sender) {
            revert NotAuthorized();
        }
        _;
    }

    modifier onlyTokensOwner(uint256[] memory tokenId) {
        for (uint256 i; i < tokenId.length; i++) {
            if (IERC721(address(this)).ownerOf(tokenId[i]) != msg.sender) {
                revert NotAuthorized();
            }
        }
        _;
    }

    modifier onlyOperator() {
        if (_retriveOperator(msg.sender) != true) {
            revert NotAuthorized();
        }
        _;
    }

    function _retriveERC721Storage()
        private
        pure
        returns (ERC721RetreatableStorage storage ds)
    {
        bytes32 storagePosition_ = storagePosition;
        assembly {
            ds.slot := storagePosition_
        }
    }

    function _retriveTokenParam(uint256 tokenId)
        private
        view
        returns (TokenParameter storage)
    {
        return _retriveERC721Storage().tokenParam[tokenId];
    }

    function _retriveOperator(address operator) private view returns (bool) {
        return _retriveERC721Storage().operatorAddress[operator];
    }

    function isRetreating(uint256 tokenId) public view returns (bool) {
        return _retriveTokenParam(tokenId).retreatingStartTime > 0;
    }

    function retreatingTime(uint256 tokenId) public view returns (uint256 t) {
        t = _retriveTokenParam(tokenId).totalRetreatingTime;
        if (isRetreating(tokenId)) {
            t +=
                uint64(block.timestamp) -
                _retriveTokenParam(tokenId).retreatingStartTime;
        }
    }

    function enterRetreating(uint256 tokenId) external onlyTokenOwner(tokenId) {
        _enterRetreating(tokenId);
    }

    function exitRetreating(uint256 tokenId) external onlyTokenOwner(tokenId) {
        _exitRetreating(tokenId);
    }

    function enterRetreatingMulti(uint256[] calldata tokenId)
        external
        onlyTokensOwner(tokenId)
    {
        for (uint256 i; i < tokenId.length; i++) {
            _enterRetreating(tokenId[i]);
        }
    }

    function exitRetreatingMulti(uint256[] calldata tokenId)
        external
        onlyTokensOwner(tokenId)
    {
        for (uint256 i; i < tokenId.length; i++) {
            _exitRetreating(tokenId[i]);
        }
    }

    function _enterRetreating(uint256 tokenId) internal {
        if (isRetreating(tokenId)) {
            revert AlreadyInRetreating();
        }

        if (!_retriveERC721Storage().enableRetreating) {
            revert RetreatingDisabled();
        }

        _retriveTokenParam(tokenId).retreatingStartTime = uint64(
            block.timestamp
        );
    }

    function _exitRetreating(uint256 tokenId) internal {
        if (!isRetreating(tokenId)) {
            revert NotInRetreating();
        }

        _retriveTokenParam(tokenId).totalRetreatingTime +=
            uint64(block.timestamp) -
            _retriveTokenParam(tokenId).retreatingStartTime;
        _retriveTokenParam(tokenId).retreatingStartTime = 0;
    }

    function _setRetreatingEnable(bool enableRetreating) internal {
        _retriveERC721Storage().enableRetreating = enableRetreating;
    }

    function _swapOperator(address operator) internal {
        _retriveERC721Storage().operatorAddress[
            operator
        ] = !_retriveERC721Storage().operatorAddress[operator];
    }

    function _kickRetreating(uint256 tokenId) internal onlyOperator {
        _exitRetreating(tokenId);
    }

    function isRetreatingEnabled() public view returns (bool) {
        return _retriveERC721Storage().enableRetreating;
    }

    /// @dev Insert this fuctions to the token transfer hook
    function _transferCheck(uint256 tokenId) internal view {
        if (isRetreating(tokenId)) {
            revert NotAllowed();
        }
    }
}

File 3 of 37 : ERC721SeaDropStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


library ERC721SeaDropStorage {
    struct Layout {
        /// @notice Track the allowed SeaDrop addresses.
        mapping(address => bool) _allowedSeaDrop;
        /// @notice Track the enumerated allowed SeaDrop addresses.
        address[] _enumeratedAllowedSeaDrop;
    }

    bytes32 internal constant STORAGE_SLOT =
        keccak256("openzepplin.contracts.storage.ERC721SeaDrop");

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

File 4 of 37 : ShellzOrb.sol
// SPDX-License-Identifier: MIT
// Built for Shellz Orb by Pagzi / NFTApi
pragma solidity ^0.8.16;

import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "erc721psi/contracts/ERC721PsiUpgradeable.sol";
import "./interfaces/ILaunchpadNFT.sol";
import "./ERC721Retreatable.sol";

contract ShellzOrb is
    ILaunchpadNFT,
    ERC2981Upgradeable,
    OwnableUpgradeable,
    ERC721PsiUpgradeable,
    ERC721Retreatable
{
    error Ended();
    error NotStarted();
    error NotEOA();
    error MintTooManyAtOnce();
    error InvalidSignature();
    error ZeroQuantity();
    error ExceedMaxSupply();
    error ExceedAllowedQuantity();
    error NotEnoughETH();
    error TicketUsed();
    error ApprovalNotEnabled();

    mapping(address => uint256) public userMinted;
    mapping(address => bool) public operatorProxies;

    /* within a single storage slot */
    address public launchpad; //1-20
    uint32 public launchpadQuantity; // 21-24
    address public signer; //1-20
    uint256 public saleQuantity; // 21-24
    address public payoutWallet; //1-20
    uint32 constant LAUNCHPAD_MAX_SUPPLY = 1000; // 21-24
    uint256 public publicPrice;

    modifier onlyLaunchpad() {
        require(launchpad != address(0), "launchpad address must set");
        require(msg.sender == launchpad, "must call by launchpad");
        _;
    }

    modifier onlySigner() {
        require(msg.sender == signer, "must call by signer");
        _;
    }

    modifier onlyEOA() {
        if (msg.sender != tx.origin) {
            revert NotEOA();
        }
        _;
    }

    function initialize() public initializer {
        __ERC2981_init();
        __ERC721Psi_init("Shellz Orb", "SHELLZ");
        __Ownable_init();

        _setDefaultRoyalty(
            address(0x4393DC2e19dAa06935deD20376965b667ABA4a6F),
            500
        );

        signer = address(0xDe1736B2F811a1e43EF92f6A707b198B6C09FAa8);
        saleQuantity = 8000;
        publicPrice = 0.089 ether;
        payoutWallet = address(0x3A7606611c643bfBbc75f8BcE0cc9927Dd980Fb5); // Payout wallet
        launchpad = address(0xa2833c0fDeacfD2510243222f6FeA7881e8E6c68); // Launchpad wallet
        launchpadQuantity = LAUNCHPAD_MAX_SUPPLY;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return "https://shellzorb.nftapi.art/meta/";
    }

    /**
    
        Retreating related functions.

     */
    function setRetreatingEnable(bool enableRetreating) external onlyOwner {
        _setRetreatingEnable(enableRetreating);
    }

    function kickFromRetreat(uint256 tokenId) external onlyOwner {
        _kickRetreating(tokenId);
    }

    function swapRetreatOperator(address operator) external onlyOwner {
        _swapOperator(operator);
    }

    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override {
        for (
            uint256 tokenId = startTokenId;
            tokenId < startTokenId + quantity;
            tokenId++
        ) {
            _transferCheck(tokenId);
        }
        super._beforeTokenTransfers(from, to, startTokenId, quantity);
    }

    /**
    
        Retreating-based approval control: The users cannot approve their token if it is retreating.

     */

    function approve(address to, uint256 tokenId) public virtual override {
        _transferCheck(tokenId);
        super.approve(to, tokenId);
    }

    /**
    
        Operator control and auto approvals.

     */
    function isApprovedForAll(address _owner, address operator)
        public
        view
        override(ERC721PsiUpgradeable)
        returns (bool)
    {
        if (operatorProxies[operator]) return true;
        return super.isApprovedForAll(_owner, operator);
    }

    function swapOperatorProxies(address _proxyAddress) public onlyOwner {
        operatorProxies[_proxyAddress] = !operatorProxies[_proxyAddress];
    }

    /*

    1000 NFTs are reserved for Binance NFT launchpad with the mintTo function.

     */

    function getMaxLaunchpadSupply() external pure override returns (uint256) {
        return LAUNCHPAD_MAX_SUPPLY;
    }

    function getLaunchpadSupply() external view override returns (uint256) {
        return LAUNCHPAD_MAX_SUPPLY - launchpadQuantity;
    }

    function mintTo(address to, uint256 size) external override onlyLaunchpad {
        require(to != address(0), "can't mint to empty address");
        require(size > 0, "size must greater than zero");
        require(size <= launchpadQuantity, "max supply reached");

        launchpadQuantity -= uint32(size);
        _mint(to, size);
    }

    // devMint for vault and team minting.
    function devMint(address to, uint32 quantity) external virtual onlyOwner {
        if (quantity > saleQuantity) {
            revert ExceedMaxSupply();
        }
        saleQuantity -= quantity;
        _mint(to, quantity);
    }

    /// @param quantity Amount of NFT to be minted.
    /// @param allowedQuantity Maximum allowed NFTs to be minted from a given amount.
    /// @param startTime The start time of the mint.
    /// @param endTime The end time of the mint.
    /// @param signature The NFT can only be minted with the valid signature.
    function mint(
        uint256 quantity,
        uint256 allowedQuantity,
        uint256 startTime,
        uint256 endTime,
        bytes calldata signature
    ) external payable onlyEOA {
        // quantity check
        if (quantity == 0) {
            revert ZeroQuantity();
        }

        if (quantity + userMinted[msg.sender] > allowedQuantity) {
            revert ExceedAllowedQuantity();
        }

        if (quantity > saleQuantity) {
            revert ExceedMaxSupply();
        }

        // timestamp check
        if (block.timestamp < startTime) {
            revert NotStarted();
        }
        if (block.timestamp >= endTime) {
            revert Ended();
        }

        // price check
        if (msg.value < quantity * publicPrice) {
            revert NotEnoughETH();
        }

        // signature check
        // The address of the contract is specified in the signature. This prevents the replay attact accross contracts.
        bytes32 hash = ECDSAUpgradeable.toEthSignedMessageHash(
            keccak256(
                abi.encodePacked(
                    msg.sender,
                    allowedQuantity,
                    startTime,
                    endTime,
                    address(this)
                )
            )
        );

        if (ECDSAUpgradeable.recover(hash, signature) != signer) {
            revert InvalidSignature();
        }

        userMinted[msg.sender] += quantity;
        saleQuantity -= quantity;

        // mint
        _mint(msg.sender, quantity);
    }

    function setLaunchpad(address launchpad_) external onlyOwner {
        launchpad = launchpad_;
    }

    function setPayoutWallet(address _payoutWallet) external onlyOwner {
        payoutWallet = _payoutWallet;
    }

    function setLaunchpadSupply(uint32 launchpad_supply) external onlyOwner {
        launchpadQuantity = launchpad_supply;
    }

    function setSigner(address signer_) external onlyOwner {
        signer = signer_;
    }

    function setMintPrice(uint256 newPrice_) external onlyOwner {
        publicPrice = newPrice_;
    }

    function setDefaultRoyalty(address receiver, uint96 feeNumerator)
        external
        onlyOwner
    {
        _setDefaultRoyalty(receiver, feeNumerator);
    }

    function withdraw() external onlyOwner {
        payable(payoutWallet).transfer(address(this).balance);
    }

    /**
    
        Operator control and auto approvals.

     */
    function getHash(
        address buyer,
        uint256 allowedQuantity,
        uint256 startTime,
        uint256 endTime
    ) external view onlySigner returns (bytes32) {
        // Hash Generation for Backend
        // toEthSignedMessageHash adds Ethereum headers to signed message.
        bytes32 hash = keccak256(
            abi.encodePacked(
                buyer, // 20
                allowedQuantity, // 4
                startTime, // 32
                endTime, // 32
                address(this) // 20
            )
        );
        return hash;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721PsiUpgradeable, ERC2981Upgradeable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

File 5 of 37 : ShellzOrbSeadropUpgradeable.sol
// SPDX-License-Identifier: MIT
// adapted from seadrop/src-upgradeable/src/ERC721SeaDropUpgradable.sol to be compatible with Shellz Orb NFT
pragma solidity 0.8.17;

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

import {
    INonFungibleSeaDropTokenUpgradeable
} from "./interfaces/INonFungibleSeaDropTokenUpgradeable.sol";

import { ISeaDropUpgradeable } from "./interfaces/ISeaDropUpgradeable.sol";

import {
    AllowListData,
    PublicDrop,
    TokenGatedDropStage,
    SignedMintValidationParams
} from "./lib/SeaDropStructsUpgradeable.sol";

import {
    ERC721SeaDropStructsErrorsAndEventsUpgradeable
} from "./lib/ERC721SeaDropStructsErrorsAndEventsUpgradeable.sol";

import {
    ReentrancyGuardUpgradeable
} from "../lib/solmate/src/utils/ReentrancyGuardUpgradeable.sol";

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

/**
 * @title  ERC721SeaDrop
 * @author James Wenzel (emo.eth)
 * @author Ryan Ghods (ralxz.eth)
 * @author Stephan Min (stephanm.eth)
 * @author megsdevs
 * @notice ERC721SeaDrop is a token contract that contains methods
 *         to properly interact with SeaDrop.
 */
contract ShellzOrbSeadropUpgradeable is 
    ShellzOrbV2,
    ReentrancyGuardUpgradeable,
    ERC721SeaDropStructsErrorsAndEventsUpgradeable, 
    INonFungibleSeaDropTokenUpgradeable  
{
    using ERC721SeaDropStorage for ERC721SeaDropStorage.Layout;
    uint64 internal _maxSupply;

    /**
     * @notice Throw if the max supply exceeds uint64
     */
    error CannotExceedMaxSupplyOfUint64(uint256 newMaxSupply);


    error MaxSupplyCannotBeBelowTotalSupply(uint256 newMaxSupply);

    /**
     * @dev Emit an event when the max token supply is updated.
     */
    event MaxSupplyUpdated(uint256 newMaxSupply);

    // devMint for vault and team minting.
    function devMint(address to, uint32 quantity) external override onlyOwner {
        if (_minted + quantity > _maxSupply) {
            revert ExceedMaxSupply();
        }
        _mint(to, quantity);
    }

    /**
     * @dev Reverts if not an allowed SeaDrop contract.
     *      This function is inlined instead of being a modifier
     *      to save contract space from being inlined N times.
     *
     * @param seaDrop The SeaDrop address to check if allowed.
     */
    function _onlyAllowedSeaDrop(address seaDrop) internal view {
        if (ERC721SeaDropStorage.layout()._allowedSeaDrop[seaDrop] != true) {
            revert OnlyAllowedSeaDrop();
        }
    }

    /**
     * @notice Deploy the token contract with its name, symbol,
     *         and allowed SeaDrop addresses.
     */
    function __ERC721SeaDrop_init(
        string memory name,
        string memory symbol,
        address[] memory allowedSeaDrop
    ) internal onlyInitializing {
        ReentrancyGuardUpgradeable.__ReentrancyGuard_init_unchained();
        __ERC721SeaDrop_init_unchained(name, symbol, allowedSeaDrop);
        _maxSupply = 9000;
        launchpadQuantity = 0;
    }

    function __ERC721SeaDrop_init_unchained(
        string memory,
        string memory,
        address[] memory allowedSeaDrop
    ) internal onlyInitializing {
        // Put the length on the stack for more efficient access.
        uint256 allowedSeaDropLength = allowedSeaDrop.length;

        // Set the mapping for allowed SeaDrop contracts.
        for (uint256 i = 0; i < allowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                allowedSeaDrop[i]
            ] = true;

            unchecked {
                ++i;
            }
        }

        // Set the enumeration.
        ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop = allowedSeaDrop;

        // Emit an event noting the contract deployment.
        emit SeaDropTokenDeployed();
    }

    /**
     * @notice Update the allowed SeaDrop contracts.
     *         Only the owner or administrator can use this function.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function updateAllowedSeaDrop(
        address[] calldata allowedSeaDrop
    ) external virtual override onlyOwner {
        _updateAllowedSeaDrop(allowedSeaDrop);
    }

    /**
     * @notice Internal function to update the allowed SeaDrop contracts.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function _updateAllowedSeaDrop(address[] calldata allowedSeaDrop) internal {
        // Put the length on the stack for more efficient access.
        uint256 enumeratedAllowedSeaDropLength = ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop
            .length;

        uint256 allowedSeaDropLength = allowedSeaDrop.length;

        // Reset the old mapping.
        for (uint256 i = 0; i < enumeratedAllowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                ERC721SeaDropStorage.layout()._enumeratedAllowedSeaDrop[i]
            ] = false;

            unchecked {
                ++i;
            }
        }

        // Set the new mapping for allowed SeaDrop contracts.
        for (uint256 i = 0; i < allowedSeaDropLength; ) {
            ERC721SeaDropStorage.layout()._allowedSeaDrop[
                allowedSeaDrop[i]
            ] = true;

            unchecked {
                ++i;
            }
        }

        // Set the enumeration.
        ERC721SeaDropStorage
            .layout()
            ._enumeratedAllowedSeaDrop = allowedSeaDrop;

        // Emit an event for the update.
        emit AllowedSeaDropUpdated(allowedSeaDrop);
    }

    /**
     * @notice Returns the max token supply.
     */
    function maxSupply() public view returns (uint256) {
        return _maxSupply;
    }

    /**
     * @notice Sets the max token supply and emits an event.
     *
     * @param newMaxSupply The new max supply to set.
     */
    function setMaxSupply(uint256 newMaxSupply) external onlyOwner {

        // Ensure the max supply does not exceed the maximum value of uint64.
        if (newMaxSupply > 2 ** 64 - 1) {
            revert CannotExceedMaxSupplyOfUint64(newMaxSupply);
        }

        // Ensure the max supply is below totalSupply.
        if (newMaxSupply < _minted) {
            revert MaxSupplyCannotBeBelowTotalSupply(newMaxSupply);
        }

        // Set the new max supply.
        _maxSupply = uint64(newMaxSupply);

        // Emit an event with the update.
        emit MaxSupplyUpdated(newMaxSupply);
    }

    /**
     * @notice Mint tokens, restricted to the SeaDrop contract.
     *
     * @dev    NOTE: If a token registers itself with multiple SeaDrop
     *         contracts, the implementation of this function should guard
     *         against reentrancy. If the implementing token uses
     *         _safeMint(), or a feeRecipient with a malicious receive() hook
     *         is specified, the token or fee recipients may be able to execute
     *         another mint in the same transaction via a separate SeaDrop
     *         contract.
     *         This is dangerous if an implementing token does not correctly
     *         update the minterNumMinted and currentTotalSupply values before
     *         transferring minted tokens, as SeaDrop references these values
     *         to enforce token limits on a per-wallet and per-stage basis.
     *
     *         ERC721A tracks these values automatically, but this note and
     *         nonReentrant modifier are left here to encourage best-practices
     *         when referencing this contract.
     *
     * @param minter   The address to mint to.
     * @param quantity The number of tokens to mint.
     */
    function mintSeaDrop(
        address minter,
        uint256 quantity
    ) external payable virtual override ReentrancyGuardUpgradeable.nonReentrant {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(msg.sender);

        // Extra safety check to ensure the max supply is not exceeded.
        if (_minted + quantity > maxSupply()) {
            revert MintQuantityExceedsMaxSupply(
                _minted + quantity,
                maxSupply()
            );
        }
        // Mint the quantity of tokens to the minter.
        _safeMint(minter, quantity);
    }

    /**
     * @notice Update the public drop data for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param publicDrop  The public drop data.
     */
    function updatePublicDrop(
        address seaDropImpl,
        PublicDrop calldata publicDrop
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the public drop data on SeaDrop.
        ISeaDropUpgradeable(seaDropImpl).updatePublicDrop(publicDrop);
    }   

    /**
     * @notice Update the allow list data for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param allowListData The allow list data.
     */
    function updateAllowList(
        address seaDropImpl,
        AllowListData calldata allowListData
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the allow list on SeaDrop.
        ISeaDropUpgradeable(seaDropImpl).updateAllowList(allowListData);
    }

    /**
     * @notice Update the token gated drop stage data for this nft contract
     *         on SeaDrop.
     *         Only the owner can use this function.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing
     *         simultaneous token gated drop promotions for each other,
     *         they can be minted by the same actor until
     *         `maxTokenSupplyForStage` is reached. Please ensure the
     *         `allowedNftToken` is not running an active drop during the
     *         `dropStage` time period.
     *
     * @param seaDropImpl     The allowed SeaDrop contract.
     * @param allowedNftToken The allowed nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address seaDropImpl,
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the token gated drop stage.
        ISeaDropUpgradeable(seaDropImpl).updateTokenGatedDrop(
            allowedNftToken,
            dropStage
        );
    }

    /**
     * @notice Update the drop URI for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param dropURI     The new drop URI.
     */
    function updateDropURI(
        address seaDropImpl,
        string calldata dropURI
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the drop URI.
        ISeaDropUpgradeable(seaDropImpl).updateDropURI(dropURI);
    }

    /**
     * @notice Update the creator payout address for this nft contract on SeaDrop.
     *         Only the owner can set the creator payout address.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param payoutAddress The new payout address.
     */
    function updateCreatorPayoutAddress(
        address seaDropImpl,
        address payoutAddress
    ) external onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the creator payout address.
        ISeaDropUpgradeable(seaDropImpl).updateCreatorPayoutAddress(
            payoutAddress
        );
    }

    /**
     * @notice Update the allowed fee recipient for this nft contract
     *         on SeaDrop.
     *         Only the owner can set the allowed fee recipient.
     *
     * @param seaDropImpl  The allowed SeaDrop contract.
     * @param feeRecipient The new fee recipient.
     * @param allowed      If the fee recipient is allowed.
     */
    function updateAllowedFeeRecipient(
        address seaDropImpl,
        address feeRecipient,
        bool allowed
    ) external virtual onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the allowed fee recipient.
        ISeaDropUpgradeable(seaDropImpl).updateAllowedFeeRecipient(
            feeRecipient,
            allowed
        );
    }

    /**
     * @notice Update the server-side signers for this nft contract
     *         on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl                The allowed SeaDrop contract.
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters to
     *                                   enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address seaDropImpl,
        address signer,
        SignedMintValidationParams memory signedMintValidationParams
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the signer.
        ISeaDropUpgradeable(seaDropImpl).updateSignedMintValidationParams(
            signer,
            signedMintValidationParams
        );
    }

    /**
     * @notice Update the allowed payers for this nft contract on SeaDrop.
     *         Only the owner can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param payer       The payer to update.
     * @param allowed     Whether the payer is allowed.
     */
    function updatePayer(
        address seaDropImpl,
        address payer,
        bool allowed
    ) external virtual override onlyOwner {
        // Ensure the SeaDrop is allowed.
        _onlyAllowedSeaDrop(seaDropImpl);

        // Update the payer.
        ISeaDropUpgradeable(seaDropImpl).updatePayer(payer, allowed);
    }

    /**
     * @notice Returns a set of mint stats for the address.
     *         This assists SeaDrop in enforcing maxSupply,
     *         maxTotalMintableByWallet, and maxTokenSupplyForStage checks.
     *
     * @dev    NOTE: Implementing contracts should always update these numbers
     *         before transferring any tokens with _safeMint() to mitigate
     *         consequences of malicious onERC721Received() hooks.
     *
     * @param minter The minter address.
     */
    function getMintStats(
        address minter
    )
        external
        view
        override
        returns (
            uint256 minterNumMinted,
            uint256 currentTotalSupply,
            uint256 maxSupply_
        )
    {
        minterNumMinted = userMinted[minter];  // number minted includes tokens outside of seadrop
        currentTotalSupply = _minted;
        maxSupply_ = maxSupply();
    }

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

}

File 6 of 37 : ShellzOrbV2.sol
// SPDX-License-Identifier: MIT
// Built for Shellz Orb by megsdevs
pragma solidity ^0.8.16;

import "operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol";
import "operator-filter-registry/src/IOperatorFilterRegistry.sol";
import "./ShellzOrb.sol";


contract ShellzOrbV2 is ShellzOrb, DefaultOperatorFiltererUpgradeable {

    /**
     *  @notice disable initialization of the implementation contract so connot bypass the proxy.
    */  
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /**
     *  @notice reinitializer allows initialisation on upgrade, in this case for version 2.
     */ 
    function initializeV2() public reinitializer(2) {
        __DefaultOperatorFilterer_init();
    }

    /**
     *  @notice Operator filterer requires exchanges to enforce creator royalties to not be blacklisted 
     *          for approve and transfer functions.
     *          https://github.com/ProjectOpenSea/operator-filter-registry
     */   
    function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
        super.setApprovalForAll(operator, approved);
    }

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

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

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

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

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

}

File 7 of 37 : ILaunchpadNFT.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;

interface ILaunchpadNFT {
    // return max supply config for launchpad, if no reserved will be collection's max supply
    function getMaxLaunchpadSupply() external view returns (uint256);

    // return current launchpad supply
    function getLaunchpadSupply() external view returns (uint256);

    // this function need to restrict mint permission to launchpad contract
    function mintTo(address to, uint256 size) external;
}

File 8 of 37 : INonFungibleSeaDropTokenUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

// import {
//     ISeaDropTokenContractMetadataUpgradeable
// } from "../interfaces/ISeaDropTokenContractMetadataUpgradeable.sol";

import {
    AllowListData,
    PublicDrop,
    TokenGatedDropStage,
    SignedMintValidationParams
} from "../lib/SeaDropStructsUpgradeable.sol";

interface INonFungibleSeaDropTokenUpgradeable // is ISeaDropTokenContractMetadataUpgradeable
{


    /**
     * @dev Revert with an error if a contract is not an allowed
     *      SeaDrop address.
     */
    error OnlyAllowedSeaDrop();

    /**
     * @dev Emit an event when allowed SeaDrop contracts are updated.
     */
    event AllowedSeaDropUpdated(address[] allowedSeaDrop);

    /**
     * @notice Update the allowed SeaDrop contracts.
     *         Only the owner or administrator can use this function.
     *
     * @param allowedSeaDrop The allowed SeaDrop addresses.
     */
    function updateAllowedSeaDrop(address[] calldata allowedSeaDrop) external;

    /**
     * @notice Mint tokens, restricted to the SeaDrop contract.
     *
     * @dev    NOTE: If a token registers itself with multiple SeaDrop
     *         contracts, the implementation of this function should guard
     *         against reentrancy. If the implementing token uses
     *         _safeMint(), or a feeRecipient with a malicious receive() hook
     *         is specified, the token or fee recipients may be able to execute
     *         another mint in the same transaction via a separate SeaDrop
     *         contract.
     *         This is dangerous if an implementing token does not correctly
     *         update the minterNumMinted and currentTotalSupply values before
     *         transferring minted tokens, as SeaDrop references these values
     *         to enforce token limits on a per-wallet and per-stage basis.
     *
     * @param minter   The address to mint to.
     * @param quantity The number of tokens to mint.
     */
    function mintSeaDrop(address minter, uint256 quantity) external payable;

    /**
     * @notice Returns a set of mint stats for the address.
     *         This assists SeaDrop in enforcing maxSupply,
     *         maxTotalMintableByWallet, and maxTokenSupplyForStage checks.
     *
     * @dev    NOTE: Implementing contracts should always update these numbers
     *         before transferring any tokens with _safeMint() to mitigate
     *         consequences of malicious onERC721Received() hooks.
     *
     * @param minter The minter address.
     */
    function getMintStats(address minter)
        external
        view
        returns (
            uint256 minterNumMinted,
            uint256 currentTotalSupply,
            uint256 maxSupply
        );

    /**
     * @notice Update the public drop data for this nft contract on
     *         SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator can only update `feeBps`.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param publicDrop  The public drop data.
     */
    function updatePublicDrop(
        address seaDropImpl,
        PublicDrop calldata publicDrop
    ) external;

    /**
     * @notice Update the allow list data for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param allowListData The allow list data.
     */
    function updateAllowList(
        address seaDropImpl,
        AllowListData calldata allowListData
    ) external;

    /**
     * @notice Update the token gated drop stage data for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     *         The administrator, when present, must first set `feeBps`.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing
     *         simultaneous token gated drop promotions for each other,
     *         they can be minted by the same actor until
     *         `maxTokenSupplyForStage` is reached. Please ensure the
     *         `allowedNftToken` is not running an active drop during the
     *         `dropStage` time period.
     *
     *
     * @param seaDropImpl     The allowed SeaDrop contract.
     * @param allowedNftToken The allowed nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address seaDropImpl,
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external;

    /**
     * @notice Update the drop URI for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param dropURI     The new drop URI.
     */
    function updateDropURI(address seaDropImpl, string calldata dropURI)
        external;

    /**
     * @notice Update the creator payout address for this nft contract on SeaDrop.
     *         Only the owner can set the creator payout address.
     *
     * @param seaDropImpl   The allowed SeaDrop contract.
     * @param payoutAddress The new payout address.
     */
    function updateCreatorPayoutAddress(
        address seaDropImpl,
        address payoutAddress
    ) external;

    /**
     * @notice Update the allowed fee recipient for this nft contract
     *         on SeaDrop.
     *         Only the administrator can set the allowed fee recipient.
     *
     * @param seaDropImpl  The allowed SeaDrop contract.
     * @param feeRecipient The new fee recipient.
     */
    function updateAllowedFeeRecipient(
        address seaDropImpl,
        address feeRecipient,
        bool allowed
    ) external;

    /**
     * @notice Update the server-side signers for this nft contract
     *         on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl                The allowed SeaDrop contract.
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters
     *                                   to enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address seaDropImpl,
        address signer,
        SignedMintValidationParams memory signedMintValidationParams
    ) external;

    /**
     * @notice Update the allowed payers for this nft contract on SeaDrop.
     *         Only the owner or administrator can use this function.
     *
     * @param seaDropImpl The allowed SeaDrop contract.
     * @param payer       The payer to update.
     * @param allowed     Whether the payer is allowed.
     */
    function updatePayer(
        address seaDropImpl,
        address payer,
        bool allowed
    ) external;
}

File 9 of 37 : ISeaDropUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
    AllowListData,
    MintParams,
    PublicDrop,
    TokenGatedDropStage,
    TokenGatedMintParams,
    SignedMintValidationParams
} from "../lib/SeaDropStructsUpgradeable.sol";

import {
    SeaDropErrorsAndEventsUpgradeable
} from "../lib/SeaDropErrorsAndEventsUpgradeable.sol";

interface ISeaDropUpgradeable is SeaDropErrorsAndEventsUpgradeable {
    /**
     * @notice Mint a public drop.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     */
    function mintPublic(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity
    ) external payable;

    /**
     * @notice Mint from an allow list.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     * @param mintParams       The mint parameters.
     * @param proof            The proof for the leaf of the allow list.
     */
    function mintAllowList(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity,
        MintParams calldata mintParams,
        bytes32[] calldata proof
    ) external payable;

    /**
     * @notice Mint with a server-side signature.
     *         Note that a signature can only be used once.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param quantity         The number of tokens to mint.
     * @param mintParams       The mint parameters.
     * @param salt             The sale for the signed mint.
     * @param signature        The server-side signature, must be an allowed
     *                         signer.
     */
    function mintSigned(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        uint256 quantity,
        MintParams calldata mintParams,
        uint256 salt,
        bytes calldata signature
    ) external payable;

    /**
     * @notice Mint as an allowed token holder.
     *         This will mark the token id as redeemed and will revert if the
     *         same token id is attempted to be redeemed twice.
     *
     * @param nftContract      The nft contract to mint.
     * @param feeRecipient     The fee recipient.
     * @param minterIfNotPayer The mint recipient if different than the payer.
     * @param mintParams       The token gated mint params.
     */
    function mintAllowedTokenHolder(
        address nftContract,
        address feeRecipient,
        address minterIfNotPayer,
        TokenGatedMintParams calldata mintParams
    ) external payable;

    /**
     * @notice Returns the public drop data for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getPublicDrop(address nftContract)
        external
        view
        returns (PublicDrop memory);

    /**
     * @notice Returns the creator payout address for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getCreatorPayoutAddress(address nftContract)
        external
        view
        returns (address);

    /**
     * @notice Returns the allow list merkle root for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getAllowListMerkleRoot(address nftContract)
        external
        view
        returns (bytes32);

    /**
     * @notice Returns if the specified fee recipient is allowed
     *         for the nft contract.
     *
     * @param nftContract  The nft contract.
     * @param feeRecipient The fee recipient.
     */
    function getFeeRecipientIsAllowed(address nftContract, address feeRecipient)
        external
        view
        returns (bool);

    /**
     * @notice Returns an enumeration of allowed fee recipients for an
     *         nft contract when fee recipients are enforced
     *
     * @param nftContract The nft contract.
     */
    function getAllowedFeeRecipients(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the server-side signers for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getSigners(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the struct of SignedMintValidationParams for a signer.
     *
     * @param nftContract The nft contract.
     * @param signer      The signer.
     */
    function getSignedMintValidationParams(address nftContract, address signer)
        external
        view
        returns (SignedMintValidationParams memory);

    /**
     * @notice Returns the payers for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getPayers(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns if the specified payer is allowed
     *         for the nft contract.
     *
     * @param nftContract The nft contract.
     * @param payer       The payer.
     */
    function getPayerIsAllowed(address nftContract, address payer)
        external
        view
        returns (bool);

    /**
     * @notice Returns the allowed token gated drop tokens for the nft contract.
     *
     * @param nftContract The nft contract.
     */
    function getTokenGatedAllowedTokens(address nftContract)
        external
        view
        returns (address[] memory);

    /**
     * @notice Returns the token gated drop data for the nft contract
     *         and token gated nft.
     *
     * @param nftContract     The nft contract.
     * @param allowedNftToken The token gated nft token.
     */
    function getTokenGatedDrop(address nftContract, address allowedNftToken)
        external
        view
        returns (TokenGatedDropStage memory);

    /**
     * @notice Returns whether the token id for a token gated drop has been
     *         redeemed.
     *
     * @param nftContract       The nft contract.
     * @param allowedNftToken   The token gated nft token.
     * @param allowedNftTokenId The token gated nft token id to check.
     */
    function getAllowedNftTokenIdIsRedeemed(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    ) external view returns (bool);

    /**
     * The following methods assume msg.sender is an nft contract
     * and its ERC165 interface id matches INonFungibleSeaDropToken.
     */

    /**
     * @notice Emits an event to notify update of the drop URI.
     *
     * @param dropURI The new drop URI.
     */
    function updateDropURI(string calldata dropURI) external;

    /**
     * @notice Updates the public drop data for the nft contract
     *         and emits an event.
     *
     * @param publicDrop The public drop data.
     */
    function updatePublicDrop(PublicDrop calldata publicDrop) external;

    /**
     * @notice Updates the allow list merkle root for the nft contract
     *         and emits an event.
     *
     *         Note: Be sure only authorized users can call this from
     *         token contracts that implement INonFungibleSeaDropToken.
     *
     * @param allowListData The allow list data.
     */
    function updateAllowList(AllowListData calldata allowListData) external;

    /**
     * @notice Updates the token gated drop stage for the nft contract
     *         and emits an event.
     *
     *         Note: If two INonFungibleSeaDropToken tokens are doing simultaneous
     *         token gated drop promotions for each other, they can be
     *         minted by the same actor until `maxTokenSupplyForStage`
     *         is reached. Please ensure the `allowedNftToken` is not
     *         running an active drop during the `dropStage` time period.
     *
     * @param allowedNftToken The token gated nft token.
     * @param dropStage       The token gated drop stage data.
     */
    function updateTokenGatedDrop(
        address allowedNftToken,
        TokenGatedDropStage calldata dropStage
    ) external;

    /**
     * @notice Updates the creator payout address and emits an event.
     *
     * @param payoutAddress The creator payout address.
     */
    function updateCreatorPayoutAddress(address payoutAddress) external;

    /**
     * @notice Updates the allowed fee recipient and emits an event.
     *
     * @param feeRecipient The fee recipient.
     * @param allowed      If the fee recipient is allowed.
     */
    function updateAllowedFeeRecipient(address feeRecipient, bool allowed)
        external;

    /**
     * @notice Updates the allowed server-side signers and emits an event.
     *
     * @param signer                     The signer to update.
     * @param signedMintValidationParams Minimum and maximum parameters
     *                                   to enforce for signed mints.
     */
    function updateSignedMintValidationParams(
        address signer,
        SignedMintValidationParams calldata signedMintValidationParams
    ) external;

    /**
     * @notice Updates the allowed payer and emits an event.
     *
     * @param payer   The payer to add or remove.
     * @param allowed Whether to add or remove the payer.
     */
    function updatePayer(address payer, bool allowed) external;
}

File 10 of 37 : ERC721SeaDropStructsErrorsAndEventsUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {
  AllowListData,
  PublicDrop,
  SignedMintValidationParams,
  TokenGatedDropStage
} from "./SeaDropStructsUpgradeable.sol";

interface ERC721SeaDropStructsErrorsAndEventsUpgradeable {
  /**
   * @notice Revert with an error if mint exceeds the max supply.
   */
  error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);

  /**
   * @notice Revert with an error if the number of token gated 
   *         allowedNftTokens doesn't match the length of supplied
   *         drop stages.
   */
  error TokenGatedMismatch();

  /**
   *  @notice Revert with an error if the number of signers doesn't match
   *          the length of supplied signedMintValidationParams
   */
  error SignersMismatch();

  /**
   * @notice An event to signify that a SeaDrop token contract was deployed.
   */
  event SeaDropTokenDeployed();

  /**
   * @notice A struct to configure multiple contract options at a time.
   */
  struct MultiConfigureStruct {
    uint256 maxSupply;
    string baseURI;
    string contractURI;
    address seaDropImpl;
    PublicDrop publicDrop;
    string dropURI;
    AllowListData allowListData;
    address creatorPayoutAddress;
    bytes32 provenanceHash;

    address[] allowedFeeRecipients;
    address[] disallowedFeeRecipients;

    address[] allowedPayers;
    address[] disallowedPayers;

    // Token-gated
    address[] tokenGatedAllowedNftTokens;
    TokenGatedDropStage[] tokenGatedDropStages;
    address[] disallowedTokenGatedAllowedNftTokens;

    // Server-signed
    address[] signers;
    SignedMintValidationParams[] signedMintValidationParams;
    address[] disallowedSigners;
  }
}

File 11 of 37 : SeaDropErrorsAndEventsUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import { PublicDrop, TokenGatedDropStage, SignedMintValidationParams } from "./SeaDropStructsUpgradeable.sol";

interface SeaDropErrorsAndEventsUpgradeable {
    /**
     * @dev Revert with an error if the drop stage is not active.
     */
    error NotActive(
        uint256 currentTimestamp,
        uint256 startTimestamp,
        uint256 endTimestamp
    );

    /**
     * @dev Revert with an error if the mint quantity is zero.
     */
    error MintQuantityCannotBeZero();

    /**
     * @dev Revert with an error if the mint quantity exceeds the max allowed
     *      to be minted per wallet.
     */
    error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);

    /**
     * @dev Revert with an error if the mint quantity exceeds the max token
     *      supply.
     */
    error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);

    /**
     * @dev Revert with an error if the mint quantity exceeds the max token
     *      supply for the stage.
     *      Note: The `maxTokenSupplyForStage` for public mint is
     *      always `type(uint).max`.
     */
    error MintQuantityExceedsMaxTokenSupplyForStage(
        uint256 total, 
        uint256 maxTokenSupplyForStage
    );
    
    /**
     * @dev Revert if the fee recipient is the zero address.
     */
    error FeeRecipientCannotBeZeroAddress();

    /**
     * @dev Revert if the fee recipient is not already included.
     */
    error FeeRecipientNotPresent();

    /**
     * @dev Revert if the fee basis points is greater than 10_000.
     */
     error InvalidFeeBps(uint256 feeBps);

    /**
     * @dev Revert if the fee recipient is already included.
     */
    error DuplicateFeeRecipient();

    /**
     * @dev Revert if the fee recipient is restricted and not allowed.
     */
    error FeeRecipientNotAllowed();

    /**
     * @dev Revert if the creator payout address is the zero address.
     */
    error CreatorPayoutAddressCannotBeZeroAddress();

    /**
     * @dev Revert with an error if the received payment is incorrect.
     */
    error IncorrectPayment(uint256 got, uint256 want);

    /**
     * @dev Revert with an error if the allow list proof is invalid.
     */
    error InvalidProof();

    /**
     * @dev Revert if a supplied signer address is the zero address.
     */
    error SignerCannotBeZeroAddress();

    /**
     * @dev Revert with an error if signer's signature is invalid.
     */
    error InvalidSignature(address recoveredSigner);

    /**
     * @dev Revert with an error if a signer is not included in
     *      the enumeration when removing.
     */
    error SignerNotPresent();

    /**
     * @dev Revert with an error if a payer is not included in
     *      the enumeration when removing.
     */
    error PayerNotPresent();

    /**
     * @dev Revert with an error if a payer is already included in mapping
     *      when adding.
     *      Note: only applies when adding a single payer, as duplicates in
     *      enumeration can be removed with updatePayer.
     */
    error DuplicatePayer();

    /**
     * @dev Revert with an error if the payer is not allowed. The minter must
     *      pay for their own mint.
     */
    error PayerNotAllowed();

    /**
     * @dev Revert if a supplied payer address is the zero address.
     */
    error PayerCannotBeZeroAddress();

    /**
     * @dev Revert with an error if the sender does not
     *      match the INonFungibleSeaDropToken interface.
     */
    error OnlyINonFungibleSeaDropToken(address sender);

    /**
     * @dev Revert with an error if the sender of a token gated supplied
     *      drop stage redeem is not the owner of the token.
     */
    error TokenGatedNotTokenOwner(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    );

    /**
     * @dev Revert with an error if the token id has already been used to
     *      redeem a token gated drop stage.
     */
    error TokenGatedTokenIdAlreadyRedeemed(
        address nftContract,
        address allowedNftToken,
        uint256 allowedNftTokenId
    );

    /**
     * @dev Revert with an error if an empty TokenGatedDropStage is provided
     *      for an already-empty TokenGatedDropStage.
     */
     error TokenGatedDropStageNotPresent();

    /**
     * @dev Revert with an error if an allowedNftToken is set to
     *      the zero address.
     */
     error TokenGatedDropAllowedNftTokenCannotBeZeroAddress();

    /**
     * @dev Revert with an error if an allowedNftToken is set to
     *      the drop token itself.
     */
     error TokenGatedDropAllowedNftTokenCannotBeDropToken();


    /**
     * @dev Revert with an error if supplied signed mint price is less than
     *      the minimum specified.
     */
    error InvalidSignedMintPrice(uint256 got, uint256 minimum);

    /**
     * @dev Revert with an error if supplied signed maxTotalMintableByWallet
     *      is greater than the maximum specified.
     */
    error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);

    /**
     * @dev Revert with an error if supplied signed start time is less than
     *      the minimum specified.
     */
    error InvalidSignedStartTime(uint256 got, uint256 minimum);
    
    /**
     * @dev Revert with an error if supplied signed end time is greater than
     *      the maximum specified.
     */
    error InvalidSignedEndTime(uint256 got, uint256 maximum);

    /**
     * @dev Revert with an error if supplied signed maxTokenSupplyForStage
     *      is greater than the maximum specified.
     */
     error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);
    
     /**
     * @dev Revert with an error if supplied signed feeBps is greater than
     *      the maximum specified, or less than the minimum.
     */
    error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);

    /**
     * @dev Revert with an error if signed mint did not specify to restrict
     *      fee recipients.
     */
    error SignedMintsMustRestrictFeeRecipients();

    /**
     * @dev Revert with an error if a signature for a signed mint has already
     *      been used.
     */
    error SignatureAlreadyUsed();

    /**
     * @dev An event with details of a SeaDrop mint, for analytical purposes.
     * 
     * @param nftContract    The nft contract.
     * @param minter         The mint recipient.
     * @param feeRecipient   The fee recipient.
     * @param payer          The address who payed for the tx.
     * @param quantityMinted The number of tokens minted.
     * @param unitMintPrice  The amount paid for each token.
     * @param feeBps         The fee out of 10_000 basis points collected.
     * @param dropStageIndex The drop stage index. Items minted
     *                       through mintPublic() have
     *                       dropStageIndex of 0.
     */
    event SeaDropMint(
        address indexed nftContract,
        address indexed minter,
        address indexed feeRecipient,
        address payer,
        uint256 quantityMinted,
        uint256 unitMintPrice,
        uint256 feeBps,
        uint256 dropStageIndex
    );

    /**
     * @dev An event with updated public drop data for an nft contract.
     */
    event PublicDropUpdated(
        address indexed nftContract,
        PublicDrop publicDrop
    );

    /**
     * @dev An event with updated token gated drop stage data
     *      for an nft contract.
     */
    event TokenGatedDropStageUpdated(
        address indexed nftContract,
        address indexed allowedNftToken,
        TokenGatedDropStage dropStage
    );

    /**
     * @dev An event with updated allow list data for an nft contract.
     * 
     * @param nftContract        The nft contract.
     * @param previousMerkleRoot The previous allow list merkle root.
     * @param newMerkleRoot      The new allow list merkle root.
     * @param publicKeyURI       If the allow list is encrypted, the public key
     *                           URIs that can decrypt the list.
     *                           Empty if unencrypted.
     * @param allowListURI       The URI for the allow list.
     */
    event AllowListUpdated(
        address indexed nftContract,
        bytes32 indexed previousMerkleRoot,
        bytes32 indexed newMerkleRoot,
        string[] publicKeyURI,
        string allowListURI
    );

    /**
     * @dev An event with updated drop URI for an nft contract.
     */
    event DropURIUpdated(address indexed nftContract, string newDropURI);

    /**
     * @dev An event with the updated creator payout address for an nft
     *      contract.
     */
    event CreatorPayoutAddressUpdated(
        address indexed nftContract,
        address indexed newPayoutAddress
    );

    /**
     * @dev An event with the updated allowed fee recipient for an nft
     *      contract.
     */
    event AllowedFeeRecipientUpdated(
        address indexed nftContract,
        address indexed feeRecipient,
        bool indexed allowed
    );

    /**
     * @dev An event with the updated validation parameters for server-side
     *      signers.
     */
    event SignedMintValidationParamsUpdated(
        address indexed nftContract,
        address indexed signer,
        SignedMintValidationParams signedMintValidationParams
    );   

    /**
     * @dev An event with the updated payer for an nft contract.
     */
    event PayerUpdated(
        address indexed nftContract,
        address indexed payer,
        bool indexed allowed
    );
}

File 12 of 37 : SeaDropStructsUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

/**
 * @notice A struct defining public drop data.
 *         Designed to fit efficiently in one storage slot.
 * 
 * @param mintPrice                The mint price per token. (Up to 1.2m
 *                                 of native token, e.g. ETH, MATIC)
 * @param startTime                The start time, ensure this is not zero.
 * @param endTIme                  The end time, ensure this is not zero.
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed. (The limit for this field is
 *                                 2^16 - 1)
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct PublicDrop {
    uint80 mintPrice; // 80/256 bits
    uint48 startTime; // 128/256 bits
    uint48 endTime; // 176/256 bits
    uint16 maxTotalMintableByWallet; // 224/256 bits
    uint16 feeBps; // 240/256 bits
    bool restrictFeeRecipients; // 248/256 bits
}

/**
 * @notice A struct defining token gated drop stage data.
 *         Designed to fit efficiently in one storage slot.
 * 
 * @param mintPrice                The mint price per token. (Up to 1.2m 
 *                                 of native token, e.g.: ETH, MATIC)
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed. (The limit for this field is
 *                                 2^16 - 1)
 * @param startTime                The start time, ensure this is not zero.
 * @param endTime                  The end time, ensure this is not zero.
 * @param dropStageIndex           The drop stage index to emit with the event
 *                                 for analytical purposes. This should be 
 *                                 non-zero since the public mint emits
 *                                 with index zero.
 * @param maxTokenSupplyForStage   The limit of token supply this stage can
 *                                 mint within. (The limit for this field is
 *                                 2^16 - 1)
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct TokenGatedDropStage {
    uint80 mintPrice; // 80/256 bits
    uint16 maxTotalMintableByWallet; // 96/256 bits
    uint48 startTime; // 144/256 bits
    uint48 endTime; // 192/256 bits
    uint8 dropStageIndex; // non-zero. 200/256 bits
    uint32 maxTokenSupplyForStage; // 232/256 bits
    uint16 feeBps; // 248/256 bits
    bool restrictFeeRecipients; // 256/256 bits
}

/**
 * @notice A struct defining mint params for an allow list.
 *         An allow list leaf will be composed of `msg.sender` and
 *         the following params.
 * 
 *         Note: Since feeBps is encoded in the leaf, backend should ensure
 *         that feeBps is acceptable before generating a proof.
 * 
 * @param mintPrice                The mint price per token.
 * @param maxTotalMintableByWallet Maximum total number of mints a user is
 *                                 allowed.
 * @param startTime                The start time, ensure this is not zero.
 * @param endTime                  The end time, ensure this is not zero.
 * @param dropStageIndex           The drop stage index to emit with the event
 *                                 for analytical purposes. This should be
 *                                 non-zero since the public mint emits with
 *                                 index zero.
 * @param maxTokenSupplyForStage   The limit of token supply this stage can
 *                                 mint within.
 * @param feeBps                   Fee out of 10_000 basis points to be
 *                                 collected.
 * @param restrictFeeRecipients    If false, allow any fee recipient;
 *                                 if true, check fee recipient is allowed.
 */
struct MintParams {
    uint256 mintPrice; 
    uint256 maxTotalMintableByWallet;
    uint256 startTime;
    uint256 endTime;
    uint256 dropStageIndex; // non-zero
    uint256 maxTokenSupplyForStage;
    uint256 feeBps;
    bool restrictFeeRecipients;
}

/**
 * @notice A struct defining token gated mint params.
 * 
 * @param allowedNftToken    The allowed nft token contract address.
 * @param allowedNftTokenIds The token ids to redeem.
 */
struct TokenGatedMintParams {
    address allowedNftToken;
    uint256[] allowedNftTokenIds;
}

/**
 * @notice A struct defining allow list data (for minting an allow list).
 * 
 * @param merkleRoot    The merkle root for the allow list.
 * @param publicKeyURIs If the allowListURI is encrypted, a list of URIs
 *                      pointing to the public keys. Empty if unencrypted.
 * @param allowListURI  The URI for the allow list.
 */
struct AllowListData {
    bytes32 merkleRoot;
    string[] publicKeyURIs;
    string allowListURI;
}

/**
 * @notice A struct defining minimum and maximum parameters to validate for 
 *         signed mints, to minimize negative effects of a compromised signer.
 *
 * @param minMintPrice                The minimum mint price allowed.
 * @param maxMaxTotalMintableByWallet The maximum total number of mints allowed
 *                                    by a wallet.
 * @param minStartTime                The minimum start time allowed.
 * @param maxEndTime                  The maximum end time allowed.
 * @param maxMaxTokenSupplyForStage   The maximum token supply allowed.
 * @param minFeeBps                   The minimum fee allowed.
 * @param maxFeeBps                   The maximum fee allowed.
 */
struct SignedMintValidationParams {
    uint80 minMintPrice; // 80/256 bits
    uint24 maxMaxTotalMintableByWallet; // 104/256 bits
    uint40 minStartTime; // 144/256 bits
    uint40 maxEndTime; // 184/256 bits
    uint40 maxMaxTokenSupplyForStage; // 224/256 bits
    uint16 minFeeBps; // 240/256 bits
    uint16 maxFeeBps; // 256/256 bits
}

File 13 of 37 : ReentrancyGuardStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


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

library ReentrancyGuardStorage {

  struct Layout {
    uint256 locked;
  
  }
  
  bytes32 internal constant STORAGE_SLOT = keccak256('openzepplin.contracts.storage.ReentrancyGuard');

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

File 14 of 37 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import { ReentrancyGuardStorage } from "./ReentrancyGuardStorage.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuardUpgradeable is Initializable {
    using ReentrancyGuardStorage for ReentrancyGuardStorage.Layout;
    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        ReentrancyGuardStorage.layout().locked = 1;
    }

    modifier nonReentrant() virtual {
        require(ReentrancyGuardStorage.layout().locked == 1, "REENTRANCY");

        ReentrancyGuardStorage.layout().locked = 2;

        _;

        ReentrancyGuardStorage.layout().locked = 1;
    }
}

File 15 of 37 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 17 of 37 : 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 18 of 37 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

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

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

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

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

File 19 of 37 : IERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165Upgradeable.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 IERC2981Upgradeable is IERC165Upgradeable {
    /**
     * @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 20 of 37 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

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

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

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

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

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

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

File 21 of 37 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 22 of 37 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 23 of 37 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @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);
}

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

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981Upgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable {
    function __ERC2981_init() internal onlyInitializing {
    }

    function __ERC2981_init_unchained() internal onlyInitializing {
    }
    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(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
        return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @inheritdoc IERC2981Upgradeable
     */
    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];
    }

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 = MathUpgradeable.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, MathUpgradeable.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 28 of 37 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

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

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

pragma solidity ^0.8.0;

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

File 31 of 37 : MathUpgradeable.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 MathUpgradeable {
    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 32 of 37 : ERC721PsiUpgradeable.sol
// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   
                                              
                                            
 */

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "solidity-bits/contracts/BitMaps.sol";


contract ERC721PsiUpgradeable is Initializable, ContextUpgradeable, 
    ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable, IERC721EnumerableUpgradeable {
    
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;

    string private _name;
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) internal _owners;
    uint256 internal _minted;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721Psi_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721Psi_init_unchained(name_, symbol_);
    }

    function __ERC721Psi_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        require(owner != address(0), "ERC721Psi: balance query for the zero address");

        uint count;
        for( uint i; i < _minted; ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token");

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

    /**
     * @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, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }


    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721Psi: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721Psi: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721Psi: approve to caller");

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, 1,_data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _minted;
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        virtual
        returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @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.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 startTokenId = _minted;
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, startTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 tokenIdBatchHead = _minted;
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        _minted += quantity;
        _owners[tokenIdBatchHead] = to;
        _batchHead.set(tokenIdBatchHead);
        _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        
        // Emit events
        for(uint256 tokenId=tokenIdBatchHead;tokenId < tokenIdBatchHead + quantity; tokenId++){
            emit Transfer(address(0), to, tokenId);
        } 
    }


    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);

        require(
            owner == from,
            "ERC721Psi: transfer of token that is not own"
        );
        require(to != address(0), "ERC721Psi: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);   

        uint256 nextTokenId = tokenId + 1;

        if(!_batchHead.get(nextTokenId) &&  
            nextTokenId < _minted
        ) {
            _owners[nextTokenId] = from;
            _batchHead.set(nextTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        emit Transfer(from, to, tokenId);

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

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param startTokenId uint256 the first ID of the tokens to be transferred
     * @param quantity uint256 amount of the tokens to be transfered.
     * @param _data bytes optional data to send along with the call
     * @return r bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity,
        bytes memory _data
    ) private returns (bool r) {
        if (to.isContract()) {
            r = true;
            for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){
                try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                    r = r && retval == IERC721Receiver.onERC721Received.selector;
                } catch (bytes memory reason) {
                    if (reason.length == 0) {
                        revert("ERC721Psi: transfer to non ERC721Receiver implementer");
                    } else {
                        assembly {
                            revert(add(32, reason), mload(reason))
                        }
                    }
                }
            }
            return r;
        } else {
            return true;
        }
    }

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _minted;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256 tokenId) {
        require(index < totalSupply(), "ERC721Psi: global index out of bounds");
        
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i)){
                if(count == index) return i;
                else count++;
            }
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i) && owner == ownerOf(i)){
                if(count == index) return i;
                else count++;
            }
        }

        revert("ERC721Psi: owner index out of bounds");
    }


    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * 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`.
     */
    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.
     *
     * 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` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 33 of 37 : 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 34 of 37 : DefaultOperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    function __DefaultOperatorFilterer_init() internal onlyInitializing {
        OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true);
    }
}

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

import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

abstract contract OperatorFiltererUpgradeable is Initializable {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant operatorFilterRegistry =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe)
        internal
        onlyInitializing
    {
        // 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(operatorFilterRegistry).code.length > 0) {
            if (!operatorFilterRegistry.isRegistered(address(this))) {
                if (subscribe) {
                    operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    if (subscriptionOrRegistrantToCopy != address(0)) {
                        operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                    } else {
                        operatorFilterRegistry.register(address(this));
                    }
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            // 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) {
                _;
                return;
            }
            if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
        _;
    }
}

File 36 of 37 : BitMaps.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
pragma solidity ^0.8.0;

import "./BitScan.sol";

/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library.
 * Functions of finding the index of the closest set bit from a given index are added.
 * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 * The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

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

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

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

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


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

File 37 of 37 : BitScan.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

Settings
{
  "remappings": [
    "@chainlink/=node_modules/@chainlink/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc721psi/=node_modules/erc721psi/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=node_modules/hardhat/",
    "operator-filter-registry/=node_modules/operator-filter-registry/",
    "solidity-bits/=node_modules/solidity-bits/",
    "solmate/=node_modules/solmate/",
    "truffle/=node_modules/truffle/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInRetreating","type":"error"},{"inputs":[],"name":"ApprovalNotEnabled","type":"error"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"CannotExceedMaxSupplyOfUint64","type":"error"},{"inputs":[],"name":"Ended","type":"error"},{"inputs":[],"name":"ExceedAllowedQuantity","type":"error"},{"inputs":[],"name":"ExceedMaxSupply","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"MaxSupplyCannotBeBelowTotalSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"MintQuantityExceedsMaxSupply","type":"error"},{"inputs":[],"name":"MintTooManyAtOnce","type":"error"},{"inputs":[],"name":"NotAllowed","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotEOA","type":"error"},{"inputs":[],"name":"NotEnoughETH","type":"error"},{"inputs":[],"name":"NotInRetreating","type":"error"},{"inputs":[],"name":"NotStarted","type":"error"},{"inputs":[],"name":"OnlyAllowedSeaDrop","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"RetreatingDisabled","type":"error"},{"inputs":[],"name":"SignersMismatch","type":"error"},{"inputs":[],"name":"TicketUsed","type":"error"},{"inputs":[],"name":"TokenGatedMismatch","type":"error"},{"inputs":[],"name":"ZeroQuantity","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"AllowedSeaDropUpdated","type":"event"},{"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":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"MaxSupplyUpdated","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":[],"name":"SeaDropTokenDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"quantity","type":"uint32"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"enterRetreating","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"enterRetreatingMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exitRetreating","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"exitRetreatingMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"buyer","type":"address"},{"internalType":"uint256","name":"allowedQuantity","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"getHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLaunchpadSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxLaunchpadSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"getMintStats","outputs":[{"internalType":"uint256","name":"minterNumMinted","type":"uint256"},{"internalType":"uint256","name":"currentTotalSupply","type":"uint256"},{"internalType":"uint256","name":"maxSupply_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"initializeV3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isRetreating","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRetreatingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"kickFromRetreat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launchpad","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadQuantity","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"allowedQuantity","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintSeaDrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operatorProxies","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payoutWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"retreatingTime","outputs":[{"internalType":"uint256","name":"t","type":"uint256"}],"stateMutability":"view","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleQuantity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"launchpad_","type":"address"}],"name":"setLaunchpad","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"launchpad_supply","type":"uint32"}],"name":"setLaunchpadSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice_","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_payoutWallet","type":"address"}],"name":"setPayoutWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enableRetreating","type":"bool"}],"name":"setRetreatingEnable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_proxyAddress","type":"address"}],"name":"swapOperatorProxies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"swapRetreatOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"components":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string[]","name":"publicKeyURIs","type":"string[]"},{"internalType":"string","name":"allowListURI","type":"string"}],"internalType":"struct AllowListData","name":"allowListData","type":"tuple"}],"name":"updateAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updateAllowedFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"allowedSeaDrop","type":"address[]"}],"name":"updateAllowedSeaDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"payoutAddress","type":"address"}],"name":"updateCreatorPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"string","name":"dropURI","type":"string"}],"name":"updateDropURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"payer","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"updatePayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"components":[{"internalType":"uint80","name":"mintPrice","type":"uint80"},{"internalType":"uint48","name":"startTime","type":"uint48"},{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint16","name":"maxTotalMintableByWallet","type":"uint16"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct PublicDrop","name":"publicDrop","type":"tuple"}],"name":"updatePublicDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint80","name":"minMintPrice","type":"uint80"},{"internalType":"uint24","name":"maxMaxTotalMintableByWallet","type":"uint24"},{"internalType":"uint40","name":"minStartTime","type":"uint40"},{"internalType":"uint40","name":"maxEndTime","type":"uint40"},{"internalType":"uint40","name":"maxMaxTokenSupplyForStage","type":"uint40"},{"internalType":"uint16","name":"minFeeBps","type":"uint16"},{"internalType":"uint16","name":"maxFeeBps","type":"uint16"}],"internalType":"struct SignedMintValidationParams","name":"signedMintValidationParams","type":"tuple"}],"name":"updateSignedMintValidationParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seaDropImpl","type":"address"},{"internalType":"address","name":"allowedNftToken","type":"address"},{"components":[{"internalType":"uint80","name":"mintPrice","type":"uint80"},{"internalType":"uint16","name":"maxTotalMintableByWallet","type":"uint16"},{"internalType":"uint48","name":"startTime","type":"uint48"},{"internalType":"uint48","name":"endTime","type":"uint48"},{"internalType":"uint8","name":"dropStageIndex","type":"uint8"},{"internalType":"uint32","name":"maxTokenSupplyForStage","type":"uint32"},{"internalType":"uint16","name":"feeBps","type":"uint16"},{"internalType":"bool","name":"restrictFeeRecipients","type":"bool"}],"internalType":"struct TokenGatedDropStage","name":"dropStage","type":"tuple"}],"name":"updateTokenGatedDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506200001c6200002c565b620000266200002c565b620000ee565b600054610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000ec576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61568780620000fe6000396000f3fe6080604052600436106103ef5760003560e01c806370a0823111610208578063bf95f47611610118578063e985e9c5116100ab578063f4a0a5281161007a578063f4a0a52814610bff578063f8ea8f1614610c1f578063fbf0dfc014610c32578063fbf7b5a414610c52578063fe9877a114610c8b57600080fd5b8063e985e9c514610b8a578063ed5a6ea414610baa578063eebb28b214610bca578063f2fde38b14610bdf57600080fd5b8063d5abeb01116100e7578063d5abeb0114610b06578063e336e01d14610b24578063e88d60b214610b3a578063e8f0905514610b5a57600080fd5b8063bf95f47614610a70578063c87b56dd14610a90578063cb743ba814610ab0578063d3ff4a9114610ad057600080fd5b80638da5cb5b1161019b578063a22cb4651161016a578063a22cb465146109da578063a553e45b146109fa578063a945bf8014610a1a578063b68fc0dc14610a30578063b88d4fde14610a5057600080fd5b80638da5cb5b146109675780638ebac11b1461098557806395d89b41146109a55780639a308a5c146109ba57600080fd5b80637c17678f116101d75780637c17678f146108d75780638129fc1c146108f7578063840e15d41461090c5780638488bb4e1461094757600080fd5b806370a0823114610862578063715018a6146108825780637a05bc82146108975780637bc2be76146108b757600080fd5b80633680620d116103035780635b43bba11161029657806364869dad1161026557806364869dad146107cf57806366251b69146107e25780636b8f9c43146108025780636c19e783146108225780636f8b44b01461084257600080fd5b80635b43bba1146107655780635cd8a76b1461077a57806360c308b61461078f5780636352211e146107af57600080fd5b8063449a52f8116102d2578063449a52f8146106e557806348a4c101146107055780634f6ccce714610725578063511aa6441461074557600080fd5b80633680620d1461067057806336f4c0eb146106905780633ccfd60b146106b057806342842e0e146106c557600080fd5b806317a5aced11610386578063238ac93311610355578063238ac933146105b157806323b872dd146105d15780632a55205a146105f15780632f745c59146106305780632fdf37091461065057600080fd5b806317a5aced1461052557806318160ddd146105455780631aa5e872146105645780631b73593c1461059157600080fd5b806306fdde03116103c257806306fdde03146104a3578063081812fc146104c5578063095ea7b3146104e55780630af0f7001461050557600080fd5b806301ffc9a7146103f457806302669b521461042957806304634d8d14610461578063064dd73714610483575b600080fd5b34801561040057600080fd5b5061041461040f366004614404565b610cab565b60405190151581526020015b60405180910390f35b34801561043557600080fd5b5060d254610449906001600160a01b031681565b6040516001600160a01b039091168152602001610420565b34801561046d57600080fd5b5061048161047c366004614436565b610cf1565b005b34801561048f57600080fd5b5061048161049e3660046144bf565b610d07565b3480156104af57600080fd5b506104b8610e54565b6040516104209190614550565b3480156104d157600080fd5b506104496104e0366004614563565b610ee6565b3480156104f157600080fd5b5061048161050036600461457c565b610f78565b34801561051157600080fd5b50610481610520366004614616565b611041565b34801561053157600080fd5b506104816105403660046146db565b6110f1565b34801561055157600080fd5b5060cd545b604051908152602001610420565b34801561057057600080fd5b5061055661057f366004614710565b60d06020526000908152604090205481565b34801561059d57600080fd5b506104816105ac36600461472d565b61114b565b3480156105bd57600080fd5b5060d354610449906001600160a01b031681565b3480156105dd57600080fd5b506104816105ec36600461476e565b6111be565b3480156105fd57600080fd5b5061061161060c3660046147af565b611291565b604080516001600160a01b039093168352602083019190915201610420565b34801561063c57600080fd5b5061055661064b36600461457c565b61133f565b34801561065c57600080fd5b5061048161066b366004614563565b611409565b34801561067c57600080fd5b5061048161068b3660046147d1565b61149d565b34801561069c57600080fd5b506104816106ab366004614710565b6114da565b3480156106bc57600080fd5b50610481611504565b3480156106d157600080fd5b506104816106e036600461476e565b611548565b3480156106f157600080fd5b5061048161070036600461457c565b611616565b34801561071157600080fd5b50610481610720366004614835565b611804565b34801561073157600080fd5b50610556610740366004614563565b61187e565b34801561075157600080fd5b506104816107603660046148c1565b611938565b34801561077157600080fd5b506103e8610556565b34801561078657600080fd5b50610481611977565b34801561079b57600080fd5b506104816107aa3660046144bf565b611a16565b3480156107bb57600080fd5b506104496107ca366004614563565b611a28565b6104816107dd36600461457c565b611a3c565b3480156107ee57600080fd5b506104816107fd36600461499a565b611b1f565b34801561080e57600080fd5b5061048161081d366004614710565b611b5e565b34801561082e57600080fd5b5061048161083d366004614710565b611b88565b34801561084e57600080fd5b5061048161085d366004614563565b611bb2565b34801561086e57600080fd5b5061055661087d366004614710565b611c57565b34801561088e57600080fd5b50610481611d27565b3480156108a357600080fd5b506104816108b2366004614a09565b611d3b565b3480156108c357600080fd5b506104816108d2366004614a5d565b611d7a565b3480156108e357600080fd5b506104816108f23660046144bf565b611db9565b34801561090357600080fd5b50610481611f00565b34801561091857600080fd5b5061092c610927366004614710565b6120b9565b60408051938452602084019290925290820152606001610420565b34801561095357600080fd5b5060d554610449906001600160a01b031681565b34801561097357600080fd5b506097546001600160a01b0316610449565b34801561099157600080fd5b506105566109a0366004614ab2565b6120f1565b3480156109b157600080fd5b506104b8612181565b3480156109c657600080fd5b506104816109d5366004614563565b612190565b3480156109e657600080fd5b506104816109f5366004614aed565b612224565b348015610a0657600080fd5b50610481610a15366004614b1b565b6122e8565b348015610a2657600080fd5b5061055660d65481565b348015610a3c57600080fd5b50610481610a4b366004614563565b61231f565b348015610a5c57600080fd5b50610481610a6b366004614b38565b612330565b348015610a7c57600080fd5b50610481610a8b366004614bfb565b61240c565b348015610a9c57600080fd5b506104b8610aab366004614563565b61243a565b348015610abc57600080fd5b50610481610acb366004614835565b612502565b348015610adc57600080fd5b507e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210885460ff16610414565b348015610b1257600080fd5b5060d7546001600160401b0316610556565b348015610b3057600080fd5b5061055660d45481565b348015610b4657600080fd5b50610481610b55366004614710565b612549565b348015610b6657600080fd5b50610414610b75366004614710565b60d16020526000908152604090205460ff1681565b348015610b9657600080fd5b50610414610ba536600461499a565b61259c565b348015610bb657600080fd5b50610481610bc5366004614710565b6125f3565b348015610bd657600080fd5b50610556612624565b348015610beb57600080fd5b50610481610bfa366004614710565b61264e565b348015610c0b57600080fd5b50610481610c1a366004614563565b6126c4565b610481610c2d366004614c16565b6126d1565b348015610c3e57600080fd5b50610556610c4d366004614563565b61291d565b348015610c5e57600080fd5b5060d254610c7690600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610420565b348015610c9757600080fd5b50610414610ca6366004614563565b61297e565b60006001600160e01b0319821663c7cd5c6560e01b1480610cdc57506001600160e01b03198216630c487f4760e11b145b80610ceb5750610ceb8261299b565b92915050565b610cf96129c0565b610d038282612a1a565b5050565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250925050505b8151811015610e0f57336001600160a01b0316306001600160a01b0316636352211e848481518110610d6f57610d6f614c7f565b60200260200101516040518263ffffffff1660e01b8152600401610d9591815260200190565b602060405180830381865afa158015610db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd69190614c95565b6001600160a01b031614610dfd5760405163ea8e4eb560e01b815260040160405180910390fd5b80610e0781614cc8565b915050610d3b565b5060005b82811015610e4e57610e3c848483818110610e3057610e30614c7f565b90506020020135612b17565b80610e4681614cc8565b915050610e13565b50505050565b606060ca8054610e6390614ce1565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8f90614ce1565b8015610edc5780601f10610eb157610100808354040283529160200191610edc565b820191906000526020600020905b815481529060010190602001808311610ebf57829003601f168201915b5050505050905090565b6000610ef38260cd541190565b610f5c5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b50600090815260ce60205260409020546001600160a01b031690565b816daaeb6d7670e522a718067333cd4e3b1561103257604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100a9190614d1b565b61103257604051633b79c77360e21b81526001600160a01b0382166004820152602401610f53565b61103c8383612bd4565b505050565b600054600390610100900460ff16158015611063575060005460ff8083169116105b61107f5760405162461bcd60e51b8152600401610f5390614d38565b6000805461ffff191660ff8316176101001790556110ac61109e610e54565b6110a6612181565b84612be7565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6110f96129c0565b60d75460cd546001600160401b039091169061111c9063ffffffff841690614d86565b111561113b57604051630f0c37b960e11b815260040160405180910390fd5b610d03828263ffffffff16612c4b565b6111536129c0565b61115c82612dbe565b6040516301308e6560e01b81526001600160a01b038316906301308e6590611188908490600401614daf565b600060405180830381600087803b1580156111a257600080fd5b505af11580156111b6573d6000803e3d6000fd5b505050505050565b826daaeb6d7670e522a718067333cd4e3b1561128657336001600160a01b038216036111f4576111ef848484612e09565b610e4e565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611243573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112679190614d1b565b61128657604051633b79c77360e21b8152336004820152602401610f53565b610e4e848484612e09565b60008281526066602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113065750604080518082019091526065546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611325906001600160601b031687614e43565b61132f9190614e5a565b91519350909150505b9250929050565b60008060005b60cd548110156113b45761135a8160cd541190565b801561137f575061136a81611a28565b6001600160a01b0316856001600160a01b0316145b156113a257838203611394579150610ceb9050565b8161139e81614cc8565b9250505b806113ac81614cc8565b915050611345565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610f53565b6040516331a9108f60e11b815260048101829052819033903090636352211e90602401602060405180830381865afa158015611449573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146d9190614c95565b6001600160a01b0316146114945760405163ea8e4eb560e01b815260040160405180910390fd5b610d0382612b17565b6114a56129c0565b6114ae82612dbe565b60405163ebb4a55f60e01b81526001600160a01b0383169063ebb4a55f90611188908490600401614f47565b6114e26129c0565b60d280546001600160a01b0319166001600160a01b0392909216919091179055565b61150c6129c0565b60d5546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611545573d6000803e3d6000fd5b50565b826daaeb6d7670e522a718067333cd4e3b1561160b57336001600160a01b03821603611579576111ef848484612e3a565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156115c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ec9190614d1b565b61160b57604051633b79c77360e21b8152336004820152602401610f53565b610e4e848484612e3a565b60d2546001600160a01b031661166e5760405162461bcd60e51b815260206004820152601a60248201527f6c61756e63687061642061646472657373206d757374207365740000000000006044820152606401610f53565b60d2546001600160a01b031633146116c15760405162461bcd60e51b81526020600482015260166024820152751b5d5cdd0818d85b1b08189e481b185d5b98da1c185960521b6044820152606401610f53565b6001600160a01b0382166117175760405162461bcd60e51b815260206004820152601b60248201527f63616e2774206d696e7420746f20656d707479206164647265737300000000006044820152606401610f53565b600081116117675760405162461bcd60e51b815260206004820152601b60248201527f73697a65206d7573742067726561746572207468616e207a65726f00000000006044820152606401610f53565b60d254600160a01b900463ffffffff168111156117bb5760405162461bcd60e51b81526020600482015260126024820152711b585e081cdd5c1c1b1e481c995858da195960721b6044820152606401610f53565b8060d260148282829054906101000a900463ffffffff166117dc9190614fdf565b92506101000a81548163ffffffff021916908363ffffffff160217905550610d038282612c4b565b61180c6129c0565b61181583612dbe565b604051638e7d1e4360e01b81526001600160a01b0383811660048301528215156024830152841690638e7d1e43906044015b600060405180830381600087803b15801561186157600080fd5b505af1158015611875573d6000803e3d6000fd5b50505050505050565b600061188960cd5490565b82106118e55760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610f53565b6000805b60cd54811015611931576118fe8160cd541190565b1561191f57838203611911579392505050565b8161191b81614cc8565b9250505b8061192981614cc8565b9150506118e9565b5050919050565b6119406129c0565b61194983612dbe565b6040516309a7002f60e31b81526001600160a01b03841690634d380178906118479085908590600401614ffc565b600054600290610100900460ff16158015611999575060005460ff8083169116105b6119b55760405162461bcd60e51b8152600401610f5390614d38565b6000805461ffff191660ff8316176101001790556119d1612e55565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b611a1e6129c0565b610d038282612e9b565b600080611a348361301d565b509392505050565b6000805160206154f083398151915254600114611a885760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b6044820152606401610f53565b60026000805160206154f083398151915255611aa333612dbe565b60d7546001600160401b03168160cd54611abd9190614d86565b1115611aff578060cd54611ad19190614d86565b60d7546001600160401b031660405163384b48c560e21b815260048101929092526024820152604401610f53565b611b0982826130b6565b60016000805160206154f0833981519152555050565b611b276129c0565b611b3082612dbe565b60405163024e71b760e31b81526001600160a01b0382811660048301528316906312738db890602401611188565b611b666129c0565b60d580546001600160a01b0319166001600160a01b0392909216919091179055565b611b906129c0565b60d380546001600160a01b0319166001600160a01b0392909216919091179055565b611bba6129c0565b6001600160401b03811115611be55760405163b43e913760e01b815260048101829052602401610f53565b60cd54811015611c0b576040516347f7c0cb60e11b815260048101829052602401610f53565b60d7805467ffffffffffffffff19166001600160401b0383161790556040518181527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c90602001611a0b565b60006001600160a01b038216611cc55760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610f53565b6000805b60cd54811015611d2057611cde8160cd541190565b15611d1057611cec81611a28565b6001600160a01b0316846001600160a01b031603611d1057611d0d82614cc8565b91505b611d1981614cc8565b9050611cc9565b5092915050565b611d2f6129c0565b611d3960006130d0565b565b611d436129c0565b611d4c83612dbe565b60405163b957d0cb60e01b81526001600160a01b0384169063b957d0cb906118479085908590600401615089565b611d826129c0565b611d8b83612dbe565b604051637ecd591560e11b81526001600160a01b0384169063fd9ab22a9061184790859085906004016150ae565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250925050505b8151811015611ec157336001600160a01b0316306001600160a01b0316636352211e848481518110611e2157611e21614c7f565b60200260200101516040518263ffffffff1660e01b8152600401611e4791815260200190565b602060405180830381865afa158015611e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e889190614c95565b6001600160a01b031614611eaf5760405163ea8e4eb560e01b815260040160405180910390fd5b80611eb981614cc8565b915050611ded565b5060005b82811015610e4e57611eee848483818110611ee257611ee2614c7f565b90506020020135613122565b80611ef881614cc8565b915050611ec5565b600054610100900460ff1615808015611f205750600054600160ff909116105b80611f3a5750303b158015611f3a575060005460ff166001145b611f565760405162461bcd60e51b8152600401610f5390614d38565b6000805460ff191660011790558015611f79576000805461ff0019166101001790555b611f81613194565b611fcb6040518060400160405280600a81526020016929b432b6363d1027b93160b11b8152506040518060400160405280600681526020016529a422a6262d60d11b8152506131bb565b611fd36131ec565b611ff3734393dc2e19daa06935ded20376965b667aba4a6f6101f4612a1a565b60d380546001600160a01b031990811673de1736b2f811a1e43ef92f6a707b198b6c09faa817909155611f4060d45567013c31074902800060d65560d58054909116733a7606611c643bfbbc75f8bce0cc9927dd980fb517905560d280547503e8a2833c0fdeacfd2510243222f6fea7881e8e6c686001600160c01b03199091161790558015611545576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001611a0b565b6001600160a01b038116600090815260d0602052604081205460cd5490916120e960d7546001600160401b031690565b929491935050565b60d3546000906001600160a01b031633146121445760405162461bcd60e51b815260206004820152601360248201527236bab9ba1031b0b63610313c9039b4b3b732b960691b6044820152606401610f53565b6000858585853060405160200161215f959493929190615182565b60408051808303601f1901815291905280516020909101209695505050505050565b606060cb8054610e6390614ce1565b6040516331a9108f60e11b815260048101829052819033903090636352211e90602401602060405180830381865afa1580156121d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f49190614c95565b6001600160a01b03161461221b5760405163ea8e4eb560e01b815260040160405180910390fd5b610d0382613122565b816daaeb6d7670e522a718067333cd4e3b156122de57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b69190614d1b565b6122de57604051633b79c77360e21b81526001600160a01b0382166004820152602401610f53565b61103c838361321b565b6122f06129c0565b7e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b1621088805460ff191682151517905550565b6123276129c0565b611545816132df565b836daaeb6d7670e522a718067333cd4e3b156123f957336001600160a01b03821603612367576123628585858561333b565b612405565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156123b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123da9190614d1b565b6123f957604051633b79c77360e21b8152336004820152602401610f53565b6124058585858561333b565b5050505050565b6124146129c0565b60d2805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b60606124478260cd541190565b6124a65760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610f53565b60006124b061336d565b905060008151116124d057604051806020016040528060008152506124fb565b806124da8461338d565b6040516020016124eb9291906151c0565b6040516020818303038152906040525b9392505050565b61250a6129c0565b61251383612dbe565b604051633f952e6560e11b81526001600160a01b0383811660048301528215156024830152841690637f2a5cca90604401611847565b6125516129c0565b611545816001600160a01b031660009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b162108960205260409020805460ff19811660ff90911615179055565b6001600160a01b038116600090815260d1602052604081205460ff16156125c557506001610ceb565b6001600160a01b03808416600090815260cf602090815260408083209386168352929052205460ff166124fb565b6125fb6129c0565b6001600160a01b0316600090815260d160205260409020805460ff19811660ff90911615179055565b60d25460009061264390600160a01b900463ffffffff166103e8614fdf565b63ffffffff16905090565b6126566129c0565b6001600160a01b0381166126bb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f53565b611545816130d0565b6126cc6129c0565b60d655565b3332146126f157604051635d04968b60e11b815260040160405180910390fd5b856000036127125760405163f4f5b73360e01b815260040160405180910390fd5b33600090815260d06020526040902054859061272e9088614d86565b111561274d576040516359b5807560e11b815260040160405180910390fd5b60d45486111561277057604051630f0c37b960e11b815260040160405180910390fd5b8342101561279157604051636f312cbd60e01b815260040160405180910390fd5b8242106127b15760405163477383f360e01b815260040160405180910390fd5b60d6546127be9087614e43565b3410156127de57604051632c1d501360e11b815260040160405180910390fd5b600061285c33878787306040516020016127fc959493929190615182565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b60d354604080516020601f87018190048102820181019092528581529293506001600160a01b03909116916128ae91849190879087908190840183828082843760009201919091525061341f92505050565b6001600160a01b0316146128d557604051638baa579f60e01b815260040160405180910390fd5b33600090815260d06020526040812080548992906128f4908490614d86565b925050819055508660d4600082825461290d91906151ef565b9091555061187590503388612c4b565b60006129288261343b565b54600160401b90046001600160401b031690506129448261297e565b15612979576129528261343b565b54612966906001600160401b031642615202565b610ceb906001600160401b031682614d86565b919050565b60008061298a8361343b565b546001600160401b03161192915050565b60006001600160e01b03198216633acdc73b60e11b1480610ceb5750610ceb8261346a565b6097546001600160a01b03163314611d395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f53565b6127106001600160601b0382161115612a885760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610f53565b6001600160a01b038216612ade5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610f53565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217606555565b612b208161297e565b612b3d576040516301e4846960e11b815260040160405180910390fd5b612b468161343b565b54612b5a906001600160401b031642615202565b612b638261343b565b8054600890612b83908490600160401b90046001600160401b0316615222565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506000612bb28261343b565b805467ffffffffffffffff19166001600160401b039290921691909117905550565b612bdd81613475565b610d03828261349c565b600054610100900460ff16612c0e5760405162461bcd60e51b8152600401610f5390615242565b612c166135ae565b612c218383836135e9565b505060d7805467ffffffffffffffff19166123281790555060d2805463ffffffff60a01b19169055565b60cd5481612ca95760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610f53565b6001600160a01b038316612d0b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610f53565b612d1860008483856136e2565b8160cd6000828254612d2a9190614d86565b9091555050600081815260cc6020526040902080546001600160a01b0319166001600160a01b038516179055612d6160c982613716565b805b612d6d8383614d86565b811015610e4e5760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480612db681614cc8565b915050612d63565b6001600160a01b0381166000908152600080516020615510833981519152602052604090205460ff161515600114611545576040516315e26ff360e01b815260040160405180910390fd5b612e133382613742565b612e2f5760405162461bcd60e51b8152600401610f539061528d565b61103c838383613811565b61103c83838360405180602001604052806000815250612330565b600054610100900460ff16612e7c5760405162461bcd60e51b8152600401610f5390615242565b611d39733cc6cdda760b79bafa08df41ecfa224f810dceb66001613a08565b7ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4548160005b82811015612f3b57600060008051602061551083398151915260006000805160206155108339815191526001018481548110612eff57612eff614c7f565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612ec1565b5060005b81811015612fb15760016000805160206155108339815191526000878785818110612f6c57612f6c614c7f565b9050602002016020810190612f819190614710565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600101612f3f565b50612fdd7ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f48585614321565b507fbbd3b69c138de4d317d0bc4290282c4e1cbd1e58b579a5b4f114b598c237454d848460405161300f9291906152e1565b60405180910390a150505050565b60008061302b8360cd541190565b61308c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610f53565b61309583613b7d565b600081815260cc60205260409020546001600160a01b031694909350915050565b610d03828260405180602001604052806000815250613b8a565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61312b8161297e565b15613149576040516360c8091960e11b815260040160405180910390fd5b7e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210885460ff1661318a57604051635174aee160e01b815260040160405180910390fd5b42612bb28261343b565b600054610100900460ff16611d395760405162461bcd60e51b8152600401610f5390615242565b600054610100900460ff166131e25760405162461bcd60e51b8152600401610f5390615242565b610d038282613bc1565b600054610100900460ff166132135760405162461bcd60e51b8152600401610f5390615242565b611d39613c01565b336001600160a01b038316036132735760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610f53565b33600081815260cf602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b1621089602052604090205460ff1615156001146133325760405163ea8e4eb560e01b815260040160405180910390fd5b61154581612b17565b6133453383613742565b6133615760405162461bcd60e51b8152600401610f539061528d565b610e4e84848484613c31565b606060405180606001604052806022815260200161553060229139905090565b6060600061339a83613c4a565b60010190506000816001600160401b038111156133b9576133b96145a8565b6040519080825280601f01601f1916602001820160405280156133e3576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846133ed57509392505050565b600080600061342e8585613d22565b91509150611a3481613d64565b60009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210876020526040902090565b6000610ceb82613eae565b61347e8161297e565b1561154557604051631eb49d6d60e11b815260040160405180910390fd5b60006134a782611a28565b9050806001600160a01b0316836001600160a01b0316036135165760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610f53565b336001600160a01b03821614806135325750613532813361259c565b6135a45760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610f53565b61103c8383613f09565b600054610100900460ff166135d55760405162461bcd60e51b8152600401610f5390615242565b60016000805160206154f083398151915255565b600054610100900460ff166136105760405162461bcd60e51b8152600401610f5390615242565b805160005b8181101561367f576001600080516020615510833981519152600001600085848151811061364557613645614c7f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101613615565b5081516136b2907ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4906020850190614384565b506040517fd7aca75208b9be5ffc04c6a01922020ffd62b55e68e502e317f5344960279af890600090a150505050565b815b6136ee8284614d86565b811015613710576136fe81613475565b8061370881614cc8565b9150506136e4565b50610e4e565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b600061374f8260cd541190565b6137b35760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610f53565b60006137be83611a28565b9050806001600160a01b0316846001600160a01b031614806137f95750836001600160a01b03166137ee84610ee6565b6001600160a01b0316145b806138095750613809818561259c565b949350505050565b60008061381d8361301d565b91509150846001600160a01b0316826001600160a01b0316146138975760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610f53565b6001600160a01b0384166138fd5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610f53565b61390a85858560016136e2565b613915600084613f09565b6000613922846001614d86565b600881901c600090815260c96020526040902054909150600160ff1b60ff83161c16158015613952575060cd5481105b1561398957600081815260cc6020526040902080546001600160a01b0319166001600160a01b03881617905561398960c982613716565b600084815260cc6020526040902080546001600160a01b0319166001600160a01b0387161790558184146139c2576139c260c985613716565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46111b6565b600054610100900460ff16613a2f5760405162461bcd60e51b8152600401610f5390615242565b6daaeb6d7670e522a718067333cd4e3b15610d035760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab39190614d1b565b610d03578015613afd57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe90604401611188565b6001600160a01b03821615613b4c5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611188565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611188565b6000610ceb60c983613f77565b60cd54613b978484612c4b565b613ba560008583868661406f565b610e4e5760405162461bcd60e51b8152600401610f539061532f565b600054610100900460ff16613be85760405162461bcd60e51b8152600401610f5390615242565b60ca613bf483826153ca565b5060cb61103c82826153ca565b600054610100900460ff16613c285760405162461bcd60e51b8152600401610f5390615242565b611d39336130d0565b613c3c848484613811565b613ba584848460018561406f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613c895772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613cb5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613cd357662386f26fc10000830492506010015b6305f5e1008310613ceb576305f5e100830492506008015b6127108310613cff57612710830492506004015b60648310613d11576064830492506002015b600a8310610ceb5760010192915050565b6000808251604103613d585760208301516040840151606085015160001a613d4c878285856141a6565b94509450505050611338565b50600090506002611338565b6000816004811115613d7857613d78615489565b03613d805750565b6001816004811115613d9457613d94615489565b03613de15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f53565b6002816004811115613df557613df5615489565b03613e425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f53565b6003816004811115613e5657613e56615489565b036115455760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f53565b60006001600160e01b031982166380ac58cd60e01b1480613edf57506001600160e01b03198216635b5e139f60e01b145b80613efa57506001600160e01b0319821663780e9d6360e01b145b80610ceb5750610ceb8261426a565b600081815260ce6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613f3e82611a28565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613fb957613fa78161429f565b60ff168203600884901b179350614066565b600083116140265760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610f53565b5060001990910160008181526020869052604090205490919080156140615761404e8161429f565b60ff0360ff16600884901b179350614066565b613fb9565b50505092915050565b60006001600160a01b0385163b1561419957506001835b6140908486614d86565b81101561419357604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906140c99033908b908690899060040161549f565b6020604051808303816000875af1925050508015614104575060408051601f3d908101601f19168201909252614101918101906154d2565b60015b614161573d808015614132576040519150601f19603f3d011682016040523d82523d6000602084013e614137565b606091505b5080516000036141595760405162461bcd60e51b8152600401610f539061532f565b805181602001fd5b82801561417e57506001600160e01b03198116630a85bd0160e11b145b9250508061418b81614cc8565b915050614086565b5061419d565b5060015b95945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156141dd5750600090506003614261565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614231573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661425a57600060019250925050614261565b9150600090505b94509492505050565b60006001600160e01b0319821663152a902d60e11b1480610ceb57506301ffc9a760e01b6001600160e01b0319831614610ceb565b60006040518061012001604052806101008152602001615552610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6142e885614309565b02901c815181106142fb576142fb614c7f565b016020015160f81c92915050565b600080821161431757600080fd5b5060008190031690565b828054828255906000526020600020908101928215614374579160200282015b828111156143745781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614341565b506143809291506143d9565b5090565b828054828255906000526020600020908101928215614374579160200282015b8281111561437457825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906143a4565b5b8082111561438057600081556001016143da565b6001600160e01b03198116811461154557600080fd5b60006020828403121561441657600080fd5b81356124fb816143ee565b6001600160a01b038116811461154557600080fd5b6000806040838503121561444957600080fd5b823561445481614421565b915060208301356001600160601b038116811461447057600080fd5b809150509250929050565b60008083601f84011261448d57600080fd5b5081356001600160401b038111156144a457600080fd5b6020830191508360208260051b850101111561133857600080fd5b600080602083850312156144d257600080fd5b82356001600160401b038111156144e857600080fd5b6144f48582860161447b565b90969095509350505050565b60005b8381101561451b578181015183820152602001614503565b50506000910152565b6000815180845261453c816020860160208601614500565b601f01601f19169290920160200192915050565b6020815260006124fb6020830184614524565b60006020828403121561457557600080fd5b5035919050565b6000806040838503121561458f57600080fd5b823561459a81614421565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156145e0576145e06145a8565b60405290565b604051601f8201601f191681016001600160401b038111828210171561460e5761460e6145a8565b604052919050565b6000602080838503121561462957600080fd5b82356001600160401b038082111561464057600080fd5b818501915085601f83011261465457600080fd5b813581811115614666576146666145a8565b8060051b91506146778483016145e6565b818152918301840191848101908884111561469157600080fd5b938501935b838510156146bb57843592506146ab83614421565b8282529385019390850190614696565b98975050505050505050565b803563ffffffff8116811461297957600080fd5b600080604083850312156146ee57600080fd5b82356146f981614421565b9150614707602084016146c7565b90509250929050565b60006020828403121561472257600080fd5b81356124fb81614421565b60008082840360e081121561474157600080fd5b833561474c81614421565b925060c0601f198201121561476057600080fd5b506020830190509250929050565b60008060006060848603121561478357600080fd5b833561478e81614421565b9250602084013561479e81614421565b929592945050506040919091013590565b600080604083850312156147c257600080fd5b50508035926020909101359150565b600080604083850312156147e457600080fd5b82356147ef81614421565b915060208301356001600160401b0381111561480a57600080fd5b83016060818603121561447057600080fd5b801515811461154557600080fd5b80356129798161481c565b60008060006060848603121561484a57600080fd5b833561485581614421565b9250602084013561486581614421565b915060408401356148758161481c565b809150509250925092565b803569ffffffffffffffffffff8116811461297957600080fd5b803564ffffffffff8116811461297957600080fd5b803561ffff8116811461297957600080fd5b60008060008385036101208112156148d857600080fd5b84356148e381614421565b935060208501356148f381614421565b925060e0603f198201121561490757600080fd5b506149106145be565b61491c60408601614880565b8152606085013562ffffff8116811461493457600080fd5b60208201526149456080860161489a565b604082015261495660a0860161489a565b606082015261496760c0860161489a565b608082015261497860e086016148af565b60a082015261498a61010086016148af565b60c0820152809150509250925092565b600080604083850312156149ad57600080fd5b82356149b881614421565b9150602083013561447081614421565b60008083601f8401126149da57600080fd5b5081356001600160401b038111156149f157600080fd5b60208301915083602082850101111561133857600080fd5b600080600060408486031215614a1e57600080fd5b8335614a2981614421565b925060208401356001600160401b03811115614a4457600080fd5b614a50868287016149c8565b9497909650939450505050565b6000806000838503610140811215614a7457600080fd5b8435614a7f81614421565b93506020850135614a8f81614421565b9250610100603f1982011215614aa457600080fd5b506040840190509250925092565b60008060008060808587031215614ac857600080fd5b8435614ad381614421565b966020860135965060408601359560600135945092505050565b60008060408385031215614b0057600080fd5b8235614b0b81614421565b915060208301356144708161481c565b600060208284031215614b2d57600080fd5b81356124fb8161481c565b60008060008060808587031215614b4e57600080fd5b8435614b5981614421565b9350602085810135614b6a81614421565b93506040860135925060608601356001600160401b0380821115614b8d57600080fd5b818801915088601f830112614ba157600080fd5b813581811115614bb357614bb36145a8565b614bc5601f8201601f191685016145e6565b91508082528984828501011115614bdb57600080fd5b808484018584013760008482840101525080935050505092959194509250565b600060208284031215614c0d57600080fd5b6124fb826146c7565b60008060008060008060a08789031215614c2f57600080fd5b8635955060208701359450604087013593506060870135925060808701356001600160401b03811115614c6157600080fd5b614c6d89828a016149c8565b979a9699509497509295939492505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215614ca757600080fd5b81516124fb81614421565b634e487b7160e01b600052601160045260246000fd5b600060018201614cda57614cda614cb2565b5060010190565b600181811c90821680614cf557607f821691505b602082108103614d1557634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215614d2d57600080fd5b81516124fb8161481c565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b80820180821115610ceb57610ceb614cb2565b803565ffffffffffff8116811461297957600080fd5b60c0810169ffffffffffffffffffff614dc784614880565b168252614dd660208401614d99565b65ffffffffffff808216602085015280614df260408701614d99565b1660408501525050614e06606084016148af565b61ffff808216606085015280614e1e608087016148af565b166080850152505060a0830135614e348161481c565b80151560a08401525092915050565b8082028115828204841417610ceb57610ceb614cb2565b600082614e7757634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e19843603018112614ebc57600080fd5b83016020810192503590506001600160401b03811115614edb57600080fd5b80360382131561133857600080fd5b81835260006020808501808196508560051b810191508460005b87811015614f3a578284038952614f1b8288614ea5565b614f26868284614e7c565b9a87019a9550505090840190600101614f04565b5091979650505050505050565b602081528135602082015260006020830135601e19843603018112614f6b57600080fd5b83016020810190356001600160401b03811115614f8757600080fd5b8060051b3603821315614f9957600080fd5b60606040850152614fae608085018284614eea565b915050614fbe6040850185614ea5565b848303601f19016060860152614fd5838284614e7c565b9695505050505050565b63ffffffff828116828216039080821115611d2057611d20614cb2565b60006101008201905060018060a01b038416825269ffffffffffffffffffff835116602083015262ffffff6020840151166040830152604083015164ffffffffff80821660608501528060608601511660808501528060808601511660a0850152505060a083015161507460c084018261ffff169052565b5060c083015161ffff811660e0840152611a34565b602081526000613809602083018486614e7c565b803560ff8116811461297957600080fd5b6001600160a01b0383168152610120810169ffffffffffffffffffff6150d384614880565b16602083015261ffff6150e8602085016148af565b16604083015265ffffffffffff61510160408501614d99565b16606083015261511360608401614d99565b65ffffffffffff811660808401525061512e6080840161509d565b60ff811660a08401525061514460a084016146c7565b63ffffffff811660c08401525061515d60c084016148af565b61ffff811660e08401525061517460e0840161482a565b801515610100840152611a34565b6bffffffffffffffffffffffff19606096871b8116825260148201959095526034810193909352605483019190915290921b16607482015260880190565b600083516151d2818460208801614500565b8351908301906151e6818360208801614500565b01949350505050565b81810381811115610ceb57610ceb614cb2565b6001600160401b03828116828216039080821115611d2057611d20614cb2565b6001600160401b03818116838216019080821115611d2057611d20614cb2565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b60208082528181018390526000908460408401835b8681101561532457823561530981614421565b6001600160a01b0316825291830191908301906001016152f6565b509695505050505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b601f82111561103c57600081815260208120601f850160051c810160208610156153ab5750805b601f850160051c820191505b818110156111b6578281556001016153b7565b81516001600160401b038111156153e3576153e36145a8565b6153f7816153f18454614ce1565b84615384565b602080601f83116001811461542c57600084156154145750858301515b600019600386901b1c1916600185901b1785556111b6565b600085815260208120601f198616915b8281101561545b5788860151825594840194600190910190840161543c565b50858210156154795787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614fd590830184614524565b6000602082840312156154e457600080fd5b81516124fb816143ee56fed59f8a8c0d1463371c77782499276e5cbe466fd192ada543ceaea0a36604c1f2f268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f368747470733a2f2f7368656c6c7a6f72622e6e66746170692e6172742f6d6574612f0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212206f16b61ef288e957e3ceab3d9301c197881f3206eedb99fc448d7dad1b9ef76464736f6c63430008110033

Deployed Bytecode

0x6080604052600436106103ef5760003560e01c806370a0823111610208578063bf95f47611610118578063e985e9c5116100ab578063f4a0a5281161007a578063f4a0a52814610bff578063f8ea8f1614610c1f578063fbf0dfc014610c32578063fbf7b5a414610c52578063fe9877a114610c8b57600080fd5b8063e985e9c514610b8a578063ed5a6ea414610baa578063eebb28b214610bca578063f2fde38b14610bdf57600080fd5b8063d5abeb01116100e7578063d5abeb0114610b06578063e336e01d14610b24578063e88d60b214610b3a578063e8f0905514610b5a57600080fd5b8063bf95f47614610a70578063c87b56dd14610a90578063cb743ba814610ab0578063d3ff4a9114610ad057600080fd5b80638da5cb5b1161019b578063a22cb4651161016a578063a22cb465146109da578063a553e45b146109fa578063a945bf8014610a1a578063b68fc0dc14610a30578063b88d4fde14610a5057600080fd5b80638da5cb5b146109675780638ebac11b1461098557806395d89b41146109a55780639a308a5c146109ba57600080fd5b80637c17678f116101d75780637c17678f146108d75780638129fc1c146108f7578063840e15d41461090c5780638488bb4e1461094757600080fd5b806370a0823114610862578063715018a6146108825780637a05bc82146108975780637bc2be76146108b757600080fd5b80633680620d116103035780635b43bba11161029657806364869dad1161026557806364869dad146107cf57806366251b69146107e25780636b8f9c43146108025780636c19e783146108225780636f8b44b01461084257600080fd5b80635b43bba1146107655780635cd8a76b1461077a57806360c308b61461078f5780636352211e146107af57600080fd5b8063449a52f8116102d2578063449a52f8146106e557806348a4c101146107055780634f6ccce714610725578063511aa6441461074557600080fd5b80633680620d1461067057806336f4c0eb146106905780633ccfd60b146106b057806342842e0e146106c557600080fd5b806317a5aced11610386578063238ac93311610355578063238ac933146105b157806323b872dd146105d15780632a55205a146105f15780632f745c59146106305780632fdf37091461065057600080fd5b806317a5aced1461052557806318160ddd146105455780631aa5e872146105645780631b73593c1461059157600080fd5b806306fdde03116103c257806306fdde03146104a3578063081812fc146104c5578063095ea7b3146104e55780630af0f7001461050557600080fd5b806301ffc9a7146103f457806302669b521461042957806304634d8d14610461578063064dd73714610483575b600080fd5b34801561040057600080fd5b5061041461040f366004614404565b610cab565b60405190151581526020015b60405180910390f35b34801561043557600080fd5b5060d254610449906001600160a01b031681565b6040516001600160a01b039091168152602001610420565b34801561046d57600080fd5b5061048161047c366004614436565b610cf1565b005b34801561048f57600080fd5b5061048161049e3660046144bf565b610d07565b3480156104af57600080fd5b506104b8610e54565b6040516104209190614550565b3480156104d157600080fd5b506104496104e0366004614563565b610ee6565b3480156104f157600080fd5b5061048161050036600461457c565b610f78565b34801561051157600080fd5b50610481610520366004614616565b611041565b34801561053157600080fd5b506104816105403660046146db565b6110f1565b34801561055157600080fd5b5060cd545b604051908152602001610420565b34801561057057600080fd5b5061055661057f366004614710565b60d06020526000908152604090205481565b34801561059d57600080fd5b506104816105ac36600461472d565b61114b565b3480156105bd57600080fd5b5060d354610449906001600160a01b031681565b3480156105dd57600080fd5b506104816105ec36600461476e565b6111be565b3480156105fd57600080fd5b5061061161060c3660046147af565b611291565b604080516001600160a01b039093168352602083019190915201610420565b34801561063c57600080fd5b5061055661064b36600461457c565b61133f565b34801561065c57600080fd5b5061048161066b366004614563565b611409565b34801561067c57600080fd5b5061048161068b3660046147d1565b61149d565b34801561069c57600080fd5b506104816106ab366004614710565b6114da565b3480156106bc57600080fd5b50610481611504565b3480156106d157600080fd5b506104816106e036600461476e565b611548565b3480156106f157600080fd5b5061048161070036600461457c565b611616565b34801561071157600080fd5b50610481610720366004614835565b611804565b34801561073157600080fd5b50610556610740366004614563565b61187e565b34801561075157600080fd5b506104816107603660046148c1565b611938565b34801561077157600080fd5b506103e8610556565b34801561078657600080fd5b50610481611977565b34801561079b57600080fd5b506104816107aa3660046144bf565b611a16565b3480156107bb57600080fd5b506104496107ca366004614563565b611a28565b6104816107dd36600461457c565b611a3c565b3480156107ee57600080fd5b506104816107fd36600461499a565b611b1f565b34801561080e57600080fd5b5061048161081d366004614710565b611b5e565b34801561082e57600080fd5b5061048161083d366004614710565b611b88565b34801561084e57600080fd5b5061048161085d366004614563565b611bb2565b34801561086e57600080fd5b5061055661087d366004614710565b611c57565b34801561088e57600080fd5b50610481611d27565b3480156108a357600080fd5b506104816108b2366004614a09565b611d3b565b3480156108c357600080fd5b506104816108d2366004614a5d565b611d7a565b3480156108e357600080fd5b506104816108f23660046144bf565b611db9565b34801561090357600080fd5b50610481611f00565b34801561091857600080fd5b5061092c610927366004614710565b6120b9565b60408051938452602084019290925290820152606001610420565b34801561095357600080fd5b5060d554610449906001600160a01b031681565b34801561097357600080fd5b506097546001600160a01b0316610449565b34801561099157600080fd5b506105566109a0366004614ab2565b6120f1565b3480156109b157600080fd5b506104b8612181565b3480156109c657600080fd5b506104816109d5366004614563565b612190565b3480156109e657600080fd5b506104816109f5366004614aed565b612224565b348015610a0657600080fd5b50610481610a15366004614b1b565b6122e8565b348015610a2657600080fd5b5061055660d65481565b348015610a3c57600080fd5b50610481610a4b366004614563565b61231f565b348015610a5c57600080fd5b50610481610a6b366004614b38565b612330565b348015610a7c57600080fd5b50610481610a8b366004614bfb565b61240c565b348015610a9c57600080fd5b506104b8610aab366004614563565b61243a565b348015610abc57600080fd5b50610481610acb366004614835565b612502565b348015610adc57600080fd5b507e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210885460ff16610414565b348015610b1257600080fd5b5060d7546001600160401b0316610556565b348015610b3057600080fd5b5061055660d45481565b348015610b4657600080fd5b50610481610b55366004614710565b612549565b348015610b6657600080fd5b50610414610b75366004614710565b60d16020526000908152604090205460ff1681565b348015610b9657600080fd5b50610414610ba536600461499a565b61259c565b348015610bb657600080fd5b50610481610bc5366004614710565b6125f3565b348015610bd657600080fd5b50610556612624565b348015610beb57600080fd5b50610481610bfa366004614710565b61264e565b348015610c0b57600080fd5b50610481610c1a366004614563565b6126c4565b610481610c2d366004614c16565b6126d1565b348015610c3e57600080fd5b50610556610c4d366004614563565b61291d565b348015610c5e57600080fd5b5060d254610c7690600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610420565b348015610c9757600080fd5b50610414610ca6366004614563565b61297e565b60006001600160e01b0319821663c7cd5c6560e01b1480610cdc57506001600160e01b03198216630c487f4760e11b145b80610ceb5750610ceb8261299b565b92915050565b610cf96129c0565b610d038282612a1a565b5050565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250925050505b8151811015610e0f57336001600160a01b0316306001600160a01b0316636352211e848481518110610d6f57610d6f614c7f565b60200260200101516040518263ffffffff1660e01b8152600401610d9591815260200190565b602060405180830381865afa158015610db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd69190614c95565b6001600160a01b031614610dfd5760405163ea8e4eb560e01b815260040160405180910390fd5b80610e0781614cc8565b915050610d3b565b5060005b82811015610e4e57610e3c848483818110610e3057610e30614c7f565b90506020020135612b17565b80610e4681614cc8565b915050610e13565b50505050565b606060ca8054610e6390614ce1565b80601f0160208091040260200160405190810160405280929190818152602001828054610e8f90614ce1565b8015610edc5780601f10610eb157610100808354040283529160200191610edc565b820191906000526020600020905b815481529060010190602001808311610ebf57829003601f168201915b5050505050905090565b6000610ef38260cd541190565b610f5c5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b50600090815260ce60205260409020546001600160a01b031690565b816daaeb6d7670e522a718067333cd4e3b1561103257604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100a9190614d1b565b61103257604051633b79c77360e21b81526001600160a01b0382166004820152602401610f53565b61103c8383612bd4565b505050565b600054600390610100900460ff16158015611063575060005460ff8083169116105b61107f5760405162461bcd60e51b8152600401610f5390614d38565b6000805461ffff191660ff8316176101001790556110ac61109e610e54565b6110a6612181565b84612be7565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6110f96129c0565b60d75460cd546001600160401b039091169061111c9063ffffffff841690614d86565b111561113b57604051630f0c37b960e11b815260040160405180910390fd5b610d03828263ffffffff16612c4b565b6111536129c0565b61115c82612dbe565b6040516301308e6560e01b81526001600160a01b038316906301308e6590611188908490600401614daf565b600060405180830381600087803b1580156111a257600080fd5b505af11580156111b6573d6000803e3d6000fd5b505050505050565b826daaeb6d7670e522a718067333cd4e3b1561128657336001600160a01b038216036111f4576111ef848484612e09565b610e4e565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611243573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112679190614d1b565b61128657604051633b79c77360e21b8152336004820152602401610f53565b610e4e848484612e09565b60008281526066602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113065750604080518082019091526065546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090611325906001600160601b031687614e43565b61132f9190614e5a565b91519350909150505b9250929050565b60008060005b60cd548110156113b45761135a8160cd541190565b801561137f575061136a81611a28565b6001600160a01b0316856001600160a01b0316145b156113a257838203611394579150610ceb9050565b8161139e81614cc8565b9250505b806113ac81614cc8565b915050611345565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610f53565b6040516331a9108f60e11b815260048101829052819033903090636352211e90602401602060405180830381865afa158015611449573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146d9190614c95565b6001600160a01b0316146114945760405163ea8e4eb560e01b815260040160405180910390fd5b610d0382612b17565b6114a56129c0565b6114ae82612dbe565b60405163ebb4a55f60e01b81526001600160a01b0383169063ebb4a55f90611188908490600401614f47565b6114e26129c0565b60d280546001600160a01b0319166001600160a01b0392909216919091179055565b61150c6129c0565b60d5546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611545573d6000803e3d6000fd5b50565b826daaeb6d7670e522a718067333cd4e3b1561160b57336001600160a01b03821603611579576111ef848484612e3a565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156115c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ec9190614d1b565b61160b57604051633b79c77360e21b8152336004820152602401610f53565b610e4e848484612e3a565b60d2546001600160a01b031661166e5760405162461bcd60e51b815260206004820152601a60248201527f6c61756e63687061642061646472657373206d757374207365740000000000006044820152606401610f53565b60d2546001600160a01b031633146116c15760405162461bcd60e51b81526020600482015260166024820152751b5d5cdd0818d85b1b08189e481b185d5b98da1c185960521b6044820152606401610f53565b6001600160a01b0382166117175760405162461bcd60e51b815260206004820152601b60248201527f63616e2774206d696e7420746f20656d707479206164647265737300000000006044820152606401610f53565b600081116117675760405162461bcd60e51b815260206004820152601b60248201527f73697a65206d7573742067726561746572207468616e207a65726f00000000006044820152606401610f53565b60d254600160a01b900463ffffffff168111156117bb5760405162461bcd60e51b81526020600482015260126024820152711b585e081cdd5c1c1b1e481c995858da195960721b6044820152606401610f53565b8060d260148282829054906101000a900463ffffffff166117dc9190614fdf565b92506101000a81548163ffffffff021916908363ffffffff160217905550610d038282612c4b565b61180c6129c0565b61181583612dbe565b604051638e7d1e4360e01b81526001600160a01b0383811660048301528215156024830152841690638e7d1e43906044015b600060405180830381600087803b15801561186157600080fd5b505af1158015611875573d6000803e3d6000fd5b50505050505050565b600061188960cd5490565b82106118e55760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610f53565b6000805b60cd54811015611931576118fe8160cd541190565b1561191f57838203611911579392505050565b8161191b81614cc8565b9250505b8061192981614cc8565b9150506118e9565b5050919050565b6119406129c0565b61194983612dbe565b6040516309a7002f60e31b81526001600160a01b03841690634d380178906118479085908590600401614ffc565b600054600290610100900460ff16158015611999575060005460ff8083169116105b6119b55760405162461bcd60e51b8152600401610f5390614d38565b6000805461ffff191660ff8316176101001790556119d1612e55565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b611a1e6129c0565b610d038282612e9b565b600080611a348361301d565b509392505050565b6000805160206154f083398151915254600114611a885760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b6044820152606401610f53565b60026000805160206154f083398151915255611aa333612dbe565b60d7546001600160401b03168160cd54611abd9190614d86565b1115611aff578060cd54611ad19190614d86565b60d7546001600160401b031660405163384b48c560e21b815260048101929092526024820152604401610f53565b611b0982826130b6565b60016000805160206154f0833981519152555050565b611b276129c0565b611b3082612dbe565b60405163024e71b760e31b81526001600160a01b0382811660048301528316906312738db890602401611188565b611b666129c0565b60d580546001600160a01b0319166001600160a01b0392909216919091179055565b611b906129c0565b60d380546001600160a01b0319166001600160a01b0392909216919091179055565b611bba6129c0565b6001600160401b03811115611be55760405163b43e913760e01b815260048101829052602401610f53565b60cd54811015611c0b576040516347f7c0cb60e11b815260048101829052602401610f53565b60d7805467ffffffffffffffff19166001600160401b0383161790556040518181527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c90602001611a0b565b60006001600160a01b038216611cc55760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610f53565b6000805b60cd54811015611d2057611cde8160cd541190565b15611d1057611cec81611a28565b6001600160a01b0316846001600160a01b031603611d1057611d0d82614cc8565b91505b611d1981614cc8565b9050611cc9565b5092915050565b611d2f6129c0565b611d3960006130d0565b565b611d436129c0565b611d4c83612dbe565b60405163b957d0cb60e01b81526001600160a01b0384169063b957d0cb906118479085908590600401615089565b611d826129c0565b611d8b83612dbe565b604051637ecd591560e11b81526001600160a01b0384169063fd9ab22a9061184790859085906004016150ae565b8181808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250925050505b8151811015611ec157336001600160a01b0316306001600160a01b0316636352211e848481518110611e2157611e21614c7f565b60200260200101516040518263ffffffff1660e01b8152600401611e4791815260200190565b602060405180830381865afa158015611e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e889190614c95565b6001600160a01b031614611eaf5760405163ea8e4eb560e01b815260040160405180910390fd5b80611eb981614cc8565b915050611ded565b5060005b82811015610e4e57611eee848483818110611ee257611ee2614c7f565b90506020020135613122565b80611ef881614cc8565b915050611ec5565b600054610100900460ff1615808015611f205750600054600160ff909116105b80611f3a5750303b158015611f3a575060005460ff166001145b611f565760405162461bcd60e51b8152600401610f5390614d38565b6000805460ff191660011790558015611f79576000805461ff0019166101001790555b611f81613194565b611fcb6040518060400160405280600a81526020016929b432b6363d1027b93160b11b8152506040518060400160405280600681526020016529a422a6262d60d11b8152506131bb565b611fd36131ec565b611ff3734393dc2e19daa06935ded20376965b667aba4a6f6101f4612a1a565b60d380546001600160a01b031990811673de1736b2f811a1e43ef92f6a707b198b6c09faa817909155611f4060d45567013c31074902800060d65560d58054909116733a7606611c643bfbbc75f8bce0cc9927dd980fb517905560d280547503e8a2833c0fdeacfd2510243222f6fea7881e8e6c686001600160c01b03199091161790558015611545576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001611a0b565b6001600160a01b038116600090815260d0602052604081205460cd5490916120e960d7546001600160401b031690565b929491935050565b60d3546000906001600160a01b031633146121445760405162461bcd60e51b815260206004820152601360248201527236bab9ba1031b0b63610313c9039b4b3b732b960691b6044820152606401610f53565b6000858585853060405160200161215f959493929190615182565b60408051808303601f1901815291905280516020909101209695505050505050565b606060cb8054610e6390614ce1565b6040516331a9108f60e11b815260048101829052819033903090636352211e90602401602060405180830381865afa1580156121d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f49190614c95565b6001600160a01b03161461221b5760405163ea8e4eb560e01b815260040160405180910390fd5b610d0382613122565b816daaeb6d7670e522a718067333cd4e3b156122de57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b69190614d1b565b6122de57604051633b79c77360e21b81526001600160a01b0382166004820152602401610f53565b61103c838361321b565b6122f06129c0565b7e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b1621088805460ff191682151517905550565b6123276129c0565b611545816132df565b836daaeb6d7670e522a718067333cd4e3b156123f957336001600160a01b03821603612367576123628585858561333b565b612405565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156123b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123da9190614d1b565b6123f957604051633b79c77360e21b8152336004820152602401610f53565b6124058585858561333b565b5050505050565b6124146129c0565b60d2805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b60606124478260cd541190565b6124a65760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610f53565b60006124b061336d565b905060008151116124d057604051806020016040528060008152506124fb565b806124da8461338d565b6040516020016124eb9291906151c0565b6040516020818303038152906040525b9392505050565b61250a6129c0565b61251383612dbe565b604051633f952e6560e11b81526001600160a01b0383811660048301528215156024830152841690637f2a5cca90604401611847565b6125516129c0565b611545816001600160a01b031660009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b162108960205260409020805460ff19811660ff90911615179055565b6001600160a01b038116600090815260d1602052604081205460ff16156125c557506001610ceb565b6001600160a01b03808416600090815260cf602090815260408083209386168352929052205460ff166124fb565b6125fb6129c0565b6001600160a01b0316600090815260d160205260409020805460ff19811660ff90911615179055565b60d25460009061264390600160a01b900463ffffffff166103e8614fdf565b63ffffffff16905090565b6126566129c0565b6001600160a01b0381166126bb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f53565b611545816130d0565b6126cc6129c0565b60d655565b3332146126f157604051635d04968b60e11b815260040160405180910390fd5b856000036127125760405163f4f5b73360e01b815260040160405180910390fd5b33600090815260d06020526040902054859061272e9088614d86565b111561274d576040516359b5807560e11b815260040160405180910390fd5b60d45486111561277057604051630f0c37b960e11b815260040160405180910390fd5b8342101561279157604051636f312cbd60e01b815260040160405180910390fd5b8242106127b15760405163477383f360e01b815260040160405180910390fd5b60d6546127be9087614e43565b3410156127de57604051632c1d501360e11b815260040160405180910390fd5b600061285c33878787306040516020016127fc959493929190615182565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b60d354604080516020601f87018190048102820181019092528581529293506001600160a01b03909116916128ae91849190879087908190840183828082843760009201919091525061341f92505050565b6001600160a01b0316146128d557604051638baa579f60e01b815260040160405180910390fd5b33600090815260d06020526040812080548992906128f4908490614d86565b925050819055508660d4600082825461290d91906151ef565b9091555061187590503388612c4b565b60006129288261343b565b54600160401b90046001600160401b031690506129448261297e565b15612979576129528261343b565b54612966906001600160401b031642615202565b610ceb906001600160401b031682614d86565b919050565b60008061298a8361343b565b546001600160401b03161192915050565b60006001600160e01b03198216633acdc73b60e11b1480610ceb5750610ceb8261346a565b6097546001600160a01b03163314611d395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f53565b6127106001600160601b0382161115612a885760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610f53565b6001600160a01b038216612ade5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610f53565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217606555565b612b208161297e565b612b3d576040516301e4846960e11b815260040160405180910390fd5b612b468161343b565b54612b5a906001600160401b031642615202565b612b638261343b565b8054600890612b83908490600160401b90046001600160401b0316615222565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506000612bb28261343b565b805467ffffffffffffffff19166001600160401b039290921691909117905550565b612bdd81613475565b610d03828261349c565b600054610100900460ff16612c0e5760405162461bcd60e51b8152600401610f5390615242565b612c166135ae565b612c218383836135e9565b505060d7805467ffffffffffffffff19166123281790555060d2805463ffffffff60a01b19169055565b60cd5481612ca95760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610f53565b6001600160a01b038316612d0b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610f53565b612d1860008483856136e2565b8160cd6000828254612d2a9190614d86565b9091555050600081815260cc6020526040902080546001600160a01b0319166001600160a01b038516179055612d6160c982613716565b805b612d6d8383614d86565b811015610e4e5760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480612db681614cc8565b915050612d63565b6001600160a01b0381166000908152600080516020615510833981519152602052604090205460ff161515600114611545576040516315e26ff360e01b815260040160405180910390fd5b612e133382613742565b612e2f5760405162461bcd60e51b8152600401610f539061528d565b61103c838383613811565b61103c83838360405180602001604052806000815250612330565b600054610100900460ff16612e7c5760405162461bcd60e51b8152600401610f5390615242565b611d39733cc6cdda760b79bafa08df41ecfa224f810dceb66001613a08565b7ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4548160005b82811015612f3b57600060008051602061551083398151915260006000805160206155108339815191526001018481548110612eff57612eff614c7f565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff1916911515919091179055600101612ec1565b5060005b81811015612fb15760016000805160206155108339815191526000878785818110612f6c57612f6c614c7f565b9050602002016020810190612f819190614710565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600101612f3f565b50612fdd7ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f48585614321565b507fbbd3b69c138de4d317d0bc4290282c4e1cbd1e58b579a5b4f114b598c237454d848460405161300f9291906152e1565b60405180910390a150505050565b60008061302b8360cd541190565b61308c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610f53565b61309583613b7d565b600081815260cc60205260409020546001600160a01b031694909350915050565b610d03828260405180602001604052806000815250613b8a565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61312b8161297e565b15613149576040516360c8091960e11b815260040160405180910390fd5b7e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210885460ff1661318a57604051635174aee160e01b815260040160405180910390fd5b42612bb28261343b565b600054610100900460ff16611d395760405162461bcd60e51b8152600401610f5390615242565b600054610100900460ff166131e25760405162461bcd60e51b8152600401610f5390615242565b610d038282613bc1565b600054610100900460ff166132135760405162461bcd60e51b8152600401610f5390615242565b611d39613c01565b336001600160a01b038316036132735760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610f53565b33600081815260cf602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b1621089602052604090205460ff1615156001146133325760405163ea8e4eb560e01b815260040160405180910390fd5b61154581612b17565b6133453383613742565b6133615760405162461bcd60e51b8152600401610f539061528d565b610e4e84848484613c31565b606060405180606001604052806022815260200161553060229139905090565b6060600061339a83613c4a565b60010190506000816001600160401b038111156133b9576133b96145a8565b6040519080825280601f01601f1916602001820160405280156133e3576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846133ed57509392505050565b600080600061342e8585613d22565b91509150611a3481613d64565b60009081527e189a975947f9bb7cf5ddec70fbf14b37d6256f2ca73d67bee9dd73b16210876020526040902090565b6000610ceb82613eae565b61347e8161297e565b1561154557604051631eb49d6d60e11b815260040160405180910390fd5b60006134a782611a28565b9050806001600160a01b0316836001600160a01b0316036135165760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610f53565b336001600160a01b03821614806135325750613532813361259c565b6135a45760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610f53565b61103c8383613f09565b600054610100900460ff166135d55760405162461bcd60e51b8152600401610f5390615242565b60016000805160206154f083398151915255565b600054610100900460ff166136105760405162461bcd60e51b8152600401610f5390615242565b805160005b8181101561367f576001600080516020615510833981519152600001600085848151811061364557613645614c7f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101613615565b5081516136b2907ff268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f4906020850190614384565b506040517fd7aca75208b9be5ffc04c6a01922020ffd62b55e68e502e317f5344960279af890600090a150505050565b815b6136ee8284614d86565b811015613710576136fe81613475565b8061370881614cc8565b9150506136e4565b50610e4e565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b600061374f8260cd541190565b6137b35760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610f53565b60006137be83611a28565b9050806001600160a01b0316846001600160a01b031614806137f95750836001600160a01b03166137ee84610ee6565b6001600160a01b0316145b806138095750613809818561259c565b949350505050565b60008061381d8361301d565b91509150846001600160a01b0316826001600160a01b0316146138975760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610f53565b6001600160a01b0384166138fd5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610f53565b61390a85858560016136e2565b613915600084613f09565b6000613922846001614d86565b600881901c600090815260c96020526040902054909150600160ff1b60ff83161c16158015613952575060cd5481105b1561398957600081815260cc6020526040902080546001600160a01b0319166001600160a01b03881617905561398960c982613716565b600084815260cc6020526040902080546001600160a01b0319166001600160a01b0387161790558184146139c2576139c260c985613716565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46111b6565b600054610100900460ff16613a2f5760405162461bcd60e51b8152600401610f5390615242565b6daaeb6d7670e522a718067333cd4e3b15610d035760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab39190614d1b565b610d03578015613afd57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe90604401611188565b6001600160a01b03821615613b4c5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611188565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611188565b6000610ceb60c983613f77565b60cd54613b978484612c4b565b613ba560008583868661406f565b610e4e5760405162461bcd60e51b8152600401610f539061532f565b600054610100900460ff16613be85760405162461bcd60e51b8152600401610f5390615242565b60ca613bf483826153ca565b5060cb61103c82826153ca565b600054610100900460ff16613c285760405162461bcd60e51b8152600401610f5390615242565b611d39336130d0565b613c3c848484613811565b613ba584848460018561406f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613c895772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613cb5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613cd357662386f26fc10000830492506010015b6305f5e1008310613ceb576305f5e100830492506008015b6127108310613cff57612710830492506004015b60648310613d11576064830492506002015b600a8310610ceb5760010192915050565b6000808251604103613d585760208301516040840151606085015160001a613d4c878285856141a6565b94509450505050611338565b50600090506002611338565b6000816004811115613d7857613d78615489565b03613d805750565b6001816004811115613d9457613d94615489565b03613de15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f53565b6002816004811115613df557613df5615489565b03613e425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f53565b6003816004811115613e5657613e56615489565b036115455760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f53565b60006001600160e01b031982166380ac58cd60e01b1480613edf57506001600160e01b03198216635b5e139f60e01b145b80613efa57506001600160e01b0319821663780e9d6360e01b145b80610ceb5750610ceb8261426a565b600081815260ce6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613f3e82611a28565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613fb957613fa78161429f565b60ff168203600884901b179350614066565b600083116140265760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610f53565b5060001990910160008181526020869052604090205490919080156140615761404e8161429f565b60ff0360ff16600884901b179350614066565b613fb9565b50505092915050565b60006001600160a01b0385163b1561419957506001835b6140908486614d86565b81101561419357604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906140c99033908b908690899060040161549f565b6020604051808303816000875af1925050508015614104575060408051601f3d908101601f19168201909252614101918101906154d2565b60015b614161573d808015614132576040519150601f19603f3d011682016040523d82523d6000602084013e614137565b606091505b5080516000036141595760405162461bcd60e51b8152600401610f539061532f565b805181602001fd5b82801561417e57506001600160e01b03198116630a85bd0160e11b145b9250508061418b81614cc8565b915050614086565b5061419d565b5060015b95945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156141dd5750600090506003614261565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614231573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661425a57600060019250925050614261565b9150600090505b94509492505050565b60006001600160e01b0319821663152a902d60e11b1480610ceb57506301ffc9a760e01b6001600160e01b0319831614610ceb565b60006040518061012001604052806101008152602001615552610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6142e885614309565b02901c815181106142fb576142fb614c7f565b016020015160f81c92915050565b600080821161431757600080fd5b5060008190031690565b828054828255906000526020600020908101928215614374579160200282015b828111156143745781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614341565b506143809291506143d9565b5090565b828054828255906000526020600020908101928215614374579160200282015b8281111561437457825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906143a4565b5b8082111561438057600081556001016143da565b6001600160e01b03198116811461154557600080fd5b60006020828403121561441657600080fd5b81356124fb816143ee565b6001600160a01b038116811461154557600080fd5b6000806040838503121561444957600080fd5b823561445481614421565b915060208301356001600160601b038116811461447057600080fd5b809150509250929050565b60008083601f84011261448d57600080fd5b5081356001600160401b038111156144a457600080fd5b6020830191508360208260051b850101111561133857600080fd5b600080602083850312156144d257600080fd5b82356001600160401b038111156144e857600080fd5b6144f48582860161447b565b90969095509350505050565b60005b8381101561451b578181015183820152602001614503565b50506000910152565b6000815180845261453c816020860160208601614500565b601f01601f19169290920160200192915050565b6020815260006124fb6020830184614524565b60006020828403121561457557600080fd5b5035919050565b6000806040838503121561458f57600080fd5b823561459a81614421565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156145e0576145e06145a8565b60405290565b604051601f8201601f191681016001600160401b038111828210171561460e5761460e6145a8565b604052919050565b6000602080838503121561462957600080fd5b82356001600160401b038082111561464057600080fd5b818501915085601f83011261465457600080fd5b813581811115614666576146666145a8565b8060051b91506146778483016145e6565b818152918301840191848101908884111561469157600080fd5b938501935b838510156146bb57843592506146ab83614421565b8282529385019390850190614696565b98975050505050505050565b803563ffffffff8116811461297957600080fd5b600080604083850312156146ee57600080fd5b82356146f981614421565b9150614707602084016146c7565b90509250929050565b60006020828403121561472257600080fd5b81356124fb81614421565b60008082840360e081121561474157600080fd5b833561474c81614421565b925060c0601f198201121561476057600080fd5b506020830190509250929050565b60008060006060848603121561478357600080fd5b833561478e81614421565b9250602084013561479e81614421565b929592945050506040919091013590565b600080604083850312156147c257600080fd5b50508035926020909101359150565b600080604083850312156147e457600080fd5b82356147ef81614421565b915060208301356001600160401b0381111561480a57600080fd5b83016060818603121561447057600080fd5b801515811461154557600080fd5b80356129798161481c565b60008060006060848603121561484a57600080fd5b833561485581614421565b9250602084013561486581614421565b915060408401356148758161481c565b809150509250925092565b803569ffffffffffffffffffff8116811461297957600080fd5b803564ffffffffff8116811461297957600080fd5b803561ffff8116811461297957600080fd5b60008060008385036101208112156148d857600080fd5b84356148e381614421565b935060208501356148f381614421565b925060e0603f198201121561490757600080fd5b506149106145be565b61491c60408601614880565b8152606085013562ffffff8116811461493457600080fd5b60208201526149456080860161489a565b604082015261495660a0860161489a565b606082015261496760c0860161489a565b608082015261497860e086016148af565b60a082015261498a61010086016148af565b60c0820152809150509250925092565b600080604083850312156149ad57600080fd5b82356149b881614421565b9150602083013561447081614421565b60008083601f8401126149da57600080fd5b5081356001600160401b038111156149f157600080fd5b60208301915083602082850101111561133857600080fd5b600080600060408486031215614a1e57600080fd5b8335614a2981614421565b925060208401356001600160401b03811115614a4457600080fd5b614a50868287016149c8565b9497909650939450505050565b6000806000838503610140811215614a7457600080fd5b8435614a7f81614421565b93506020850135614a8f81614421565b9250610100603f1982011215614aa457600080fd5b506040840190509250925092565b60008060008060808587031215614ac857600080fd5b8435614ad381614421565b966020860135965060408601359560600135945092505050565b60008060408385031215614b0057600080fd5b8235614b0b81614421565b915060208301356144708161481c565b600060208284031215614b2d57600080fd5b81356124fb8161481c565b60008060008060808587031215614b4e57600080fd5b8435614b5981614421565b9350602085810135614b6a81614421565b93506040860135925060608601356001600160401b0380821115614b8d57600080fd5b818801915088601f830112614ba157600080fd5b813581811115614bb357614bb36145a8565b614bc5601f8201601f191685016145e6565b91508082528984828501011115614bdb57600080fd5b808484018584013760008482840101525080935050505092959194509250565b600060208284031215614c0d57600080fd5b6124fb826146c7565b60008060008060008060a08789031215614c2f57600080fd5b8635955060208701359450604087013593506060870135925060808701356001600160401b03811115614c6157600080fd5b614c6d89828a016149c8565b979a9699509497509295939492505050565b634e487b7160e01b600052603260045260246000fd5b600060208284031215614ca757600080fd5b81516124fb81614421565b634e487b7160e01b600052601160045260246000fd5b600060018201614cda57614cda614cb2565b5060010190565b600181811c90821680614cf557607f821691505b602082108103614d1557634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215614d2d57600080fd5b81516124fb8161481c565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b80820180821115610ceb57610ceb614cb2565b803565ffffffffffff8116811461297957600080fd5b60c0810169ffffffffffffffffffff614dc784614880565b168252614dd660208401614d99565b65ffffffffffff808216602085015280614df260408701614d99565b1660408501525050614e06606084016148af565b61ffff808216606085015280614e1e608087016148af565b166080850152505060a0830135614e348161481c565b80151560a08401525092915050565b8082028115828204841417610ceb57610ceb614cb2565b600082614e7757634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e19843603018112614ebc57600080fd5b83016020810192503590506001600160401b03811115614edb57600080fd5b80360382131561133857600080fd5b81835260006020808501808196508560051b810191508460005b87811015614f3a578284038952614f1b8288614ea5565b614f26868284614e7c565b9a87019a9550505090840190600101614f04565b5091979650505050505050565b602081528135602082015260006020830135601e19843603018112614f6b57600080fd5b83016020810190356001600160401b03811115614f8757600080fd5b8060051b3603821315614f9957600080fd5b60606040850152614fae608085018284614eea565b915050614fbe6040850185614ea5565b848303601f19016060860152614fd5838284614e7c565b9695505050505050565b63ffffffff828116828216039080821115611d2057611d20614cb2565b60006101008201905060018060a01b038416825269ffffffffffffffffffff835116602083015262ffffff6020840151166040830152604083015164ffffffffff80821660608501528060608601511660808501528060808601511660a0850152505060a083015161507460c084018261ffff169052565b5060c083015161ffff811660e0840152611a34565b602081526000613809602083018486614e7c565b803560ff8116811461297957600080fd5b6001600160a01b0383168152610120810169ffffffffffffffffffff6150d384614880565b16602083015261ffff6150e8602085016148af565b16604083015265ffffffffffff61510160408501614d99565b16606083015261511360608401614d99565b65ffffffffffff811660808401525061512e6080840161509d565b60ff811660a08401525061514460a084016146c7565b63ffffffff811660c08401525061515d60c084016148af565b61ffff811660e08401525061517460e0840161482a565b801515610100840152611a34565b6bffffffffffffffffffffffff19606096871b8116825260148201959095526034810193909352605483019190915290921b16607482015260880190565b600083516151d2818460208801614500565b8351908301906151e6818360208801614500565b01949350505050565b81810381811115610ceb57610ceb614cb2565b6001600160401b03828116828216039080821115611d2057611d20614cb2565b6001600160401b03818116838216019080821115611d2057611d20614cb2565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b60208082528181018390526000908460408401835b8681101561532457823561530981614421565b6001600160a01b0316825291830191908301906001016152f6565b509695505050505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b601f82111561103c57600081815260208120601f850160051c810160208610156153ab5750805b601f850160051c820191505b818110156111b6578281556001016153b7565b81516001600160401b038111156153e3576153e36145a8565b6153f7816153f18454614ce1565b84615384565b602080601f83116001811461542c57600084156154145750858301515b600019600386901b1c1916600185901b1785556111b6565b600085815260208120601f198616915b8281101561545b5788860151825594840194600190910190840161543c565b50858210156154795787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614fd590830184614524565b6000602082840312156154e457600080fd5b81516124fb816143ee56fed59f8a8c0d1463371c77782499276e5cbe466fd192ada543ceaea0a36604c1f2f268be8736a07172c20cb8afb46ffa17fa1131bf48395e58d9c0ce565c5047f368747470733a2f2f7368656c6c7a6f72622e6e66746170692e6172742f6d6574612f0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212206f16b61ef288e957e3ceab3d9301c197881f3206eedb99fc448d7dad1b9ef76464736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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