ETH Price: $2,068.22 (-15.48%)

Contract

0x3097e3C70DB5b0E2C238c0b1bCC5b801f3a4242B
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...189073162023-12-31 18:42:35428 days ago1704048155IN
SargeNFT: SARGE Token
0 ETH0.0006249513.53926036
Set Approval For...187196672023-12-05 10:51:35454 days ago1701773495IN
SargeNFT: SARGE Token
0 ETH0.0012113650.10798119
Set Approval For...184743162023-11-01 2:35:47489 days ago1698806147IN
SargeNFT: SARGE Token
0 ETH0.0003668715.17574938
Safe Transfer Fr...179810972023-08-24 0:50:23558 days ago1692838223IN
SargeNFT: SARGE Token
0 ETH0.0012340116.75197837
Set Approval For...176016942023-07-01 20:52:59611 days ago1688244779IN
SargeNFT: SARGE Token
0 ETH0.0006178413.40605598
Transfer From172217732023-05-09 8:41:47664 days ago1683621707IN
SargeNFT: SARGE Token
0 ETH0.0080852784.92402445
Set Approval For...172217712023-05-09 8:41:23664 days ago1683621683IN
SargeNFT: SARGE Token
0 ETH0.0038513183.41417035
Set Approval For...168241592023-03-14 5:37:47720 days ago1678772267IN
SargeNFT: SARGE Token
0 ETH0.0004039516.70974238
Set Approval For...167708662023-03-06 17:42:23728 days ago1678124543IN
SargeNFT: SARGE Token
0 ETH0.0009753140.34406489
Set Approval For...167477072023-03-03 11:32:23731 days ago1677843143IN
SargeNFT: SARGE Token
0 ETH0.0009846121.36420787
Withdraw166852132023-02-22 16:38:35740 days ago1677083915IN
SargeNFT: SARGE Token
0 ETH0.0013540844.34089127
Set Approval For...166524562023-02-18 2:06:59745 days ago1676686019IN
SargeNFT: SARGE Token
0 ETH0.001255227.23565599
Set Approval For...166506062023-02-17 19:50:23745 days ago1676663423IN
SargeNFT: SARGE Token
0 ETH0.0021031945.6352841
Safe Transfer Fr...166379652023-02-16 1:18:11747 days ago1676510291IN
SargeNFT: SARGE Token
0 ETH0.0030057341.16543151
Set Approval For...166148202023-02-12 19:38:23750 days ago1676230703IN
SargeNFT: SARGE Token
0 ETH0.0007774116.86852405
Safe Transfer Fr...166074102023-02-11 18:48:47751 days ago1676141327IN
SargeNFT: SARGE Token
0 ETH0.002161718.22059668
Set Approval For...165993312023-02-10 15:43:59752 days ago1676043839IN
SargeNFT: SARGE Token
0 ETH0.0018364239.84695536
Set Approval For...165993232023-02-10 15:42:23752 days ago1676043743IN
SargeNFT: SARGE Token
0 ETH0.001665436.13600925
Set Approval For...165936662023-02-09 20:45:59753 days ago1675975559IN
SargeNFT: SARGE Token
0 ETH0.0022939849.77500823
Set Approval For...165832222023-02-08 9:39:35754 days ago1675849175IN
SargeNFT: SARGE Token
0 ETH0.0011412224.7624111
Set Approval For...165771682023-02-07 13:22:11755 days ago1675776131IN
SargeNFT: SARGE Token
0 ETH0.0012495227.11239649
Update Batch Met...165762242023-02-07 10:11:35755 days ago1675764695IN
SargeNFT: SARGE Token
0 ETH0.0005693422.60036574
Set URI165762042023-02-07 10:07:35755 days ago1675764455IN
SargeNFT: SARGE Token
0 ETH0.0011110423.50930242
Transfer From165435682023-02-02 20:42:47760 days ago1675370567IN
SargeNFT: SARGE Token
0 ETH0.0014324729.69230077
Transfer From165435662023-02-02 20:42:23760 days ago1675370543IN
SargeNFT: SARGE Token
0 ETH0.001640630.92916696
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
166852132023-02-22 16:38:35740 days ago1677083915
SargeNFT: SARGE Token
5.643 ETH
165011572023-01-27 22:33:23766 days ago1674858803
SargeNFT: SARGE Token
13.652 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Sarge

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 23 : Sarge.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./SargeExtension.sol";
import "./errors/SargeNFTErrors.sol";

contract Sarge is SargeExtensions {
    struct Collection {
        uint32 maxWalletMint;
        uint32 maxWhitelistMint;
        uint32 teamAllocation;
        uint32 maxSupply;
        uint32 publicSaleStartTime;
        uint32 publicSaleEndTime;
        uint32 whitelistStartTime;
        uint32 whitelistEndTime;
        uint128 publicPrice;
        uint128 whitelistPrice;
        bytes32 whitelistMerkleRoot;
    }

    struct UserData {
        uint16 publicMinted;
        uint16 mintedWhitelist;
    }

    Collection public collection;
    mapping(address => UserData) public userData;

    constructor(
        string memory _name,
        string memory _symbol,
        string memory _uri,
        string memory _uriExtension,
        address _owner,
        Collection memory _collection
    ) SargeExtensions(_name, _symbol, _uri, _uriExtension) {
        _transferOwnership(_owner);
        _setDefaultRoyalty(owner(), 1000);
        collection = _collection;
        if (collection.teamAllocation > 0) {
            _mint(owner(), collection.teamAllocation);
        }
    }

    modifier checkMint(uint16 amount, bool isWhitelist) {
        if (collection.maxSupply < totalSupply() + amount) {
            revert ExceedsCollectionMaxSupply(
                collection.maxSupply - totalSupply(),
                amount
            );
        }

        if (msg.sender != owner()) {
            if (isWhitelist) {
                if (collection.whitelistMerkleRoot == bytes32(0)) {
                    revert WhitelistMerkleRootNotSet();
                }
                if (block.timestamp < collection.whitelistStartTime) {
                    revert WhitelistNotStarted(collection.whitelistStartTime);
                }

                if (block.timestamp > collection.whitelistEndTime) {
                    revert WhitelistEnded(collection.whitelistEndTime);
                }

                if (
                    userData[msg.sender].mintedWhitelist + amount >
                    collection.maxWhitelistMint
                ) {
                    revert ExceedsMaxWhitelistMint(
                        collection.maxWhitelistMint,
                        amount,
                        userData[msg.sender].mintedWhitelist
                    );
                }

                if (msg.value != collection.whitelistPrice * amount) {
                    revert IncorrectPaymentAmount(
                        collection.whitelistPrice * amount,
                        msg.value
                    );
                }

                userData[msg.sender].mintedWhitelist += amount;
            } else {
                if (
                    userData[msg.sender].publicMinted + amount >
                    collection.maxWalletMint
                ) {
                    revert ExceedsMaxWalletMint(
                        collection.maxWalletMint,
                        amount,
                        userData[msg.sender].publicMinted
                    );
                }

                if (block.timestamp < collection.publicSaleStartTime) {
                    revert PublicSaleNotStarted(collection.publicSaleStartTime);
                }

                if (block.timestamp > collection.publicSaleEndTime) {
                    revert PublicSaleEnded(collection.publicSaleEndTime);
                }

                if (msg.value != collection.publicPrice * amount) {
                    revert IncorrectPaymentAmount(
                        collection.publicPrice * amount,
                        msg.value
                    );
                }
                userData[msg.sender].publicMinted += amount;
            }
        }

        _;
    }

    modifier onlyWhitelisted(bytes32[] memory proof) {
        if (!_isWhitelisted(msg.sender, proof)) {
            revert NotWhitelisted();
        }
        _;
    }

    function _isWhitelisted(
        address user,
        bytes32[] memory proof
    ) internal view returns (bool) {
        bytes32 leaf = keccak256(abi.encodePacked(user));
        return MerkleProof.verify(proof, collection.whitelistMerkleRoot, leaf);
    }

    function mintWhitelist(
        uint16 quantity,
        bytes32[] memory merkleProof
    )
        external
        payable
        onlyWhitelisted(merkleProof)
        checkMint(quantity, true)
        whenNotPaused
    {
        _safeMint(msg.sender, quantity);
    }

    function mint(
        uint16 quantity
    ) external payable checkMint(quantity, false) whenNotPaused {
        _safeMint(msg.sender, quantity);
    }

    function mintAdmin(
        address to,
        uint16 quantity
    ) external payable checkMint(quantity, false) onlyOwner {
        _safeMint(to, quantity);
    }

    function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
        collection.whitelistMerkleRoot = _merkleRoot;
    }

    function setMintPrices(
        uint128 _price,
        uint128 _whitelistPrice
    ) external onlyOwner {
        collection.publicPrice = _price;
        collection.whitelistPrice = _whitelistPrice;
    }

    function setPublicMintTimes(
        uint32 _publicSaleStartTime,
        uint32 _publicSaleEndTime
    ) external onlyOwner {
        collection.publicSaleStartTime = _publicSaleStartTime;
        collection.publicSaleEndTime = _publicSaleEndTime;
    }

    function setMaxWalletPublicMint(uint16 _maxWalletMint) external onlyOwner {
        collection.maxWalletMint = _maxWalletMint;
    }

    function setMaxWhitelistWalletMint(
        uint16 _maxWhitelistMint
    ) external onlyOwner {
        collection.maxWhitelistMint = _maxWhitelistMint;
    }

    function setWhitelistMintTimes(
        uint32 _whitelistStartTime,
        uint32 _whitelistEndTime
    ) external onlyOwner {
        collection.whitelistStartTime = _whitelistStartTime;
        collection.whitelistEndTime = _whitelistEndTime;
    }

    function pause() external onlyOwner {
        _pause();
    }

    function unpause() external onlyOwner {
        _unpause();
    }

    function sendUnmintedToAdmin() external onlyOwner {
        _sendUnmintedToAdmin();
    }

    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;
        (bool success, ) = payable(owner()).call{value: balance}("");
        require(success, "Transfer failed.");
    }

    function withdrawAmount(uint256 amount) external onlyOwner {
        (bool success, ) = payable(owner()).call{value: amount}("");
        require(success, "Transfer failed.");
    }

    function withdrawStuckTokens(address _token) external onlyOwner {
        IERC20 token = IERC20(_token);
        uint256 balance = token.balanceOf(address(this));
        bool success = token.transfer(owner(), balance);
        require(success, "Transfer failed.");
    }

    function _sendUnmintedToAdmin() internal {
        uint256 unminted = collection.maxSupply - totalSupply();
        if (unminted > 0) {
            _safeMint(owner(), unminted);
        }
    }

    function getCollectionData() external view returns (Collection memory) {
        return collection;
    }

    function getUserData(
        address user
    ) external view returns (uint256 publicMinted, uint256 whitelistMinted) {
        return (userData[user].publicMinted, userData[user].mintedWhitelist);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 4 of 23 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

        return (royalty.receiver, royaltyAmount);
    }

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

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

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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 8 of 23 : 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 9 of 23 : 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 10 of 23 : Address.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 Address {
    /**
     * @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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(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 11 of 23 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 12 of 23 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 14 of 23 : 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 15 of 23 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 16 of 23 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 18 of 23 : SargeNFTErrors.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

error ExceedsCollectionMaxSupply(uint256 supplyLeft, uint256 mintAmount);
error ExceedsMaxWalletMint(
    uint256 maxWalletMint,
    uint256 mintAmount,
    uint256 userMinted
);
error CollectionDoesNotExist();
error PublicSaleNotStarted(uint256 startTime);
error PublicSaleEnded(uint256 endTime);
error IncorrectPaymentAmount(uint256 price, uint256 paymentAmount);
error WhitelistNotStarted(uint256 startTime);
error WhitelistEnded(uint256 endTime);
error ExceedsMaxWhitelistMint(
    uint256 maxWhitelistMint,
    uint256 mintAmount,
    uint256 userMinted
);
error WhitelistMerkleRootNotSet();
error NotWhitelisted();

File 19 of 23 : SargeExtension.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import "erc721psi/contracts/extension/ERC721PsiAddressData.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";

contract SargeExtensions is ERC721PsiAddressData, ERC2981, Ownable, Pausable {
    string private baseURI;
    string private uriExtension;

    constructor(
        string memory _name,
        string memory _symbol,
        string memory _uri,
        string memory _uriExtension
    ) ERC721Psi(_name, _symbol) {
        baseURI = _uri;
        uriExtension = _uriExtension;
    }

    function setBaseURI(string memory _newBaseURI) external onlyOwner {
        _setBaseURI(_newBaseURI);
    }

    function setURI(
        string memory _newBaseURI,
        string memory _newURIExtension
    ) external onlyOwner {
        _setBaseURI(_newBaseURI);
        uriExtension = _newURIExtension;
    }

    function _setBaseURI(string memory _newBaseURI) internal {
        baseURI = _newBaseURI;
    }

    function setURIExtension(
        string memory _newURIExtension
    ) external onlyOwner {
        uriExtension = _newURIExtension;
    }

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

    function tokenURI(
        uint256 tokenId
    ) public view override returns (string memory) {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        return
            string.concat(_baseURI(), Strings.toString(tokenId), uriExtension);
    }

    function setDefaultRoyalty(
        address _receiver,
        uint96 _royalty
    ) external onlyOwner {
        _setDefaultRoyalty(_receiver, _royalty);
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC721Psi, ERC2981) returns (bool) {
        return
            interfaceId == type(IERC2981).interfaceId ||
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function updateMetadata(uint256 _tokenId) external onlyOwner {
        emit MetadataUpdate(_tokenId);
    }

    function updateBatchMetadata(
        uint256 _fromTokenId,
        uint256 _toTokenId
    ) external onlyOwner {
        emit BatchMetadataUpdate(_fromTokenId, _toTokenId);
    }

    event MetadataUpdate(uint256 _tokenId);
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

File 20 of 23 : ERC721Psi.sol
// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   

 - github: https://github.com/estarriolvetch/ERC721Psi
 - npm: https://www.npmjs.com/package/erc721psi
                                          
 */

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
import "solidity-bits/contracts/BitMaps.sol";


contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings 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 private _currentIndex;

    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.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal pure returns (uint256) {
        // It will become modifiable in the future versions
        return 1;
    }

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

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        return _currentIndex - _startTokenId();
    }


    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC165, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).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 = _startTokenId(); i < _nextTokenId(); ++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 < _nextTokenId() && _startTokenId() <= tokenId;
    }

    /**
     * @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 nextTokenId = _nextTokenId();
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, nextTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 nextTokenId = _nextTokenId();
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, nextTokenId, quantity);
        _currentIndex += quantity;
        _owners[nextTokenId] = to;
        _batchHead.set(nextTokenId);
        _afterTokenTransfers(address(0), to, nextTokenId, quantity);
        
        // Emit events
        for(uint256 tokenId=nextTokenId; tokenId < nextTokenId + 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 subsequentTokenId = tokenId + 1;

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

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


    function totalSupply() public virtual view returns (uint256) {
        return _totalMinted();
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * This function is compatiable with ERC721AQueryable.
     */
    function tokensOfOwner(address owner) external view virtual returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                if (_exists(i)) {
                    if (ownerOf(i) == owner) {
                        tokenIds[tokenIdsIdx++] = i;
                    }
                }
            }
            return tokenIds;   
        }
    }

    /**
     * @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 21 of 23 : ERC721PsiAddressData.sol
// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   
                                              
                                            
 */
pragma solidity ^0.8.0;

import "solidity-bits/contracts/BitMaps.sol";
import "../ERC721Psi.sol";


/**
    @dev This extension follows the AddressData format of ERC721A, so
    it can be a dropped-in replacement for the contract that requires AddressData
*/ 
abstract contract ERC721PsiAddressData is ERC721Psi {
    // Mapping owner address to address data
    mapping(address => AddressData) _addressData;

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }


    /**
     * @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");
        return uint256(_addressData[owner].balance);   
    }

    /**
     * @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 override virtual {
        require(quantity < 2 ** 64);
        uint64 _quantity = uint64(quantity);

        if(from != address(0)){
            _addressData[from].balance -= _quantity;
        } else {
            // Mint
            _addressData[to].numberMinted += _quantity;
        }

        if(to != address(0)){
            _addressData[to].balance += _quantity;
        } else {
            // Burn
            _addressData[from].numberBurned += _quantity;
        }
        super._afterTokenTransfers(from, to, startTokenId, quantity);
    }
}

File 22 of 23 : 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 23 of 23 : 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
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"string","name":"_uriExtension","type":"string"},{"internalType":"address","name":"_owner","type":"address"},{"components":[{"internalType":"uint32","name":"maxWalletMint","type":"uint32"},{"internalType":"uint32","name":"maxWhitelistMint","type":"uint32"},{"internalType":"uint32","name":"teamAllocation","type":"uint32"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint128","name":"publicPrice","type":"uint128"},{"internalType":"uint128","name":"whitelistPrice","type":"uint128"},{"internalType":"bytes32","name":"whitelistMerkleRoot","type":"bytes32"}],"internalType":"struct Sarge.Collection","name":"_collection","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"supplyLeft","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"ExceedsCollectionMaxSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxWalletMint","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"uint256","name":"userMinted","type":"uint256"}],"name":"ExceedsMaxWalletMint","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxWhitelistMint","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"uint256","name":"userMinted","type":"uint256"}],"name":"ExceedsMaxWhitelistMint","type":"error"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"name":"IncorrectPaymentAmount","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"PublicSaleEnded","type":"error"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"PublicSaleNotStarted","type":"error"},{"inputs":[{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"WhitelistEnded","type":"error"},{"inputs":[],"name":"WhitelistMerkleRootNotSet","type":"error"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"WhitelistNotStarted","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collection","outputs":[{"internalType":"uint32","name":"maxWalletMint","type":"uint32"},{"internalType":"uint32","name":"maxWhitelistMint","type":"uint32"},{"internalType":"uint32","name":"teamAllocation","type":"uint32"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint128","name":"publicPrice","type":"uint128"},{"internalType":"uint128","name":"whitelistPrice","type":"uint128"},{"internalType":"bytes32","name":"whitelistMerkleRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCollectionData","outputs":[{"components":[{"internalType":"uint32","name":"maxWalletMint","type":"uint32"},{"internalType":"uint32","name":"maxWhitelistMint","type":"uint32"},{"internalType":"uint32","name":"teamAllocation","type":"uint32"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistEndTime","type":"uint32"},{"internalType":"uint128","name":"publicPrice","type":"uint128"},{"internalType":"uint128","name":"whitelistPrice","type":"uint128"},{"internalType":"bytes32","name":"whitelistMerkleRoot","type":"bytes32"}],"internalType":"struct Sarge.Collection","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserData","outputs":[{"internalType":"uint256","name":"publicMinted","type":"uint256"},{"internalType":"uint256","name":"whitelistMinted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"mintAdmin","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"quantity","type":"uint16"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintWhitelist","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"sendUnmintedToAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_royalty","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxWalletMint","type":"uint16"}],"name":"setMaxWalletPublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_maxWhitelistMint","type":"uint16"}],"name":"setMaxWhitelistWalletMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_price","type":"uint128"},{"internalType":"uint128","name":"_whitelistPrice","type":"uint128"}],"name":"setMintPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_publicSaleEndTime","type":"uint32"}],"name":"setPublicMintTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"},{"internalType":"string","name":"_newURIExtension","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newURIExtension","type":"string"}],"name":"setURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_whitelistStartTime","type":"uint32"},{"internalType":"uint32","name":"_whitelistEndTime","type":"uint32"}],"name":"setWhitelistMintTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"updateBatchMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"updateMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userData","outputs":[{"internalType":"uint16","name":"publicMinted","type":"uint16"},{"internalType":"uint16","name":"mintedWhitelist","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"withdrawStuckTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004aae38038062004aae83398101604081905262000034916200096d565b858585858383600162000048838262000adb565b50600262000057828262000adb565b50506001600455506200006a3362000234565b600a805460ff60a01b19169055600b62000085838262000adb565b50600c62000094828262000adb565b5050505050620000aa826200023460201b60201c565b620000ca620000c1600a546001600160a01b031690565b6103e862000286565b8051600d8054602084015160408501516060860151608087015160a088015160c089015160e08a015163ffffffff998a166001600160401b031990981697909717640100000000968a169690960295909517600160401b600160801b03191668010000000000000000948916850263ffffffff60601b1916176c010000000000000000000000009389169390930292909217600160801b600160c01b031916600160801b918816820263ffffffff60a01b191617600160a01b92881692909202919091176001600160c01b0316600160c01b938716939093026001600160e01b031692909217600160e01b9386169390930292909217928390556101008501516101208601516001600160801b03918216911690910217600e55610140840151600f55900416156200022857620002286200020d600a546001600160a01b031690565b600d5468010000000000000000900463ffffffff166200038b565b50505050505062000c42565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6127106001600160601b0382161115620002fa5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003525760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002f1565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b60006200039760045490565b905060008211620003f95760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401620002f1565b6001600160a01b0383166200045d5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401620002f1565b816004600082825462000471919062000bbd565b90915550506000818152600360209081526040822080546001600160a01b0319166001600160a01b038716179055620004b6919083906200052e811b620021d417901c565b620004c560008483856200055a565b805b620004d3838362000bbd565b811015620005285760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4806200051f8162000bd9565b915050620004c7565b50505050565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b6801000000000000000081106200057057600080fd5b806001600160a01b03851615620005de576001600160a01b03851660009081526007602052604081208054839290620005b49084906001600160401b031662000bf5565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555062000645565b6001600160a01b03841660009081526007602052604090208054829190600890620006209084906801000000000000000090046001600160401b031662000c1f565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b03841615620006b2576001600160a01b03841660009081526007602052604081208054839290620006889084906001600160401b031662000c1f565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555062000714565b6001600160a01b03851660009081526007602052604090208054829190601090620006ef908490600160801b90046001600160401b031662000c1f565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6200072d858585856200052860201b620016cb1760201c565b5050505050565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b038111828210171562000770576200077062000734565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620007a157620007a162000734565b604052919050565b600082601f830112620007bb57600080fd5b81516001600160401b03811115620007d757620007d762000734565b6020620007ed601f8301601f1916820162000776565b82815285828487010111156200080257600080fd5b60005b838110156200082257858101830151828201840152820162000805565b506000928101909101919091529392505050565b80516001600160a01b03811681146200084e57600080fd5b919050565b805163ffffffff811681146200084e57600080fd5b80516001600160801b03811681146200084e57600080fd5b600061016082840312156200089457600080fd5b6200089e6200074a565b9050620008ab8262000853565b8152620008bb6020830162000853565b6020820152620008ce6040830162000853565b6040820152620008e16060830162000853565b6060820152620008f46080830162000853565b60808201526200090760a0830162000853565b60a08201526200091a60c0830162000853565b60c08201526200092d60e0830162000853565b60e08201526101006200094281840162000868565b908201526101206200095683820162000868565b818301525061014080830151818301525092915050565b60008060008060008061020087890312156200098857600080fd5b86516001600160401b0380821115620009a057600080fd5b620009ae8a838b01620007a9565b97506020890151915080821115620009c557600080fd5b620009d38a838b01620007a9565b96506040890151915080821115620009ea57600080fd5b620009f88a838b01620007a9565b9550606089015191508082111562000a0f57600080fd5b5062000a1e89828a01620007a9565b93505062000a2f6080880162000836565b915062000a408860a0890162000880565b90509295509295509295565b600181811c9082168062000a6157607f821691505b60208210810362000a8257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000ad657600081815260208120601f850160051c8101602086101562000ab15750805b601f850160051c820191505b8181101562000ad25782815560010162000abd565b5050505b505050565b81516001600160401b0381111562000af75762000af762000734565b62000b0f8162000b08845462000a4c565b8462000a88565b602080601f83116001811462000b47576000841562000b2e5750858301515b600019600386901b1c1916600185901b17855562000ad2565b600085815260208120601f198616915b8281101562000b785788860151825594840194600190910190840162000b57565b508582101562000b975787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000bd35762000bd362000ba7565b92915050565b60006001820162000bee5762000bee62000ba7565b5060010190565b6001600160401b0382811682821603908082111562000c185762000c1862000ba7565b5092915050565b6001600160401b0381811683821601908082111562000c185762000c1862000ba7565b613e5c8062000c526000396000f3fe6080604052600436106102725760003560e01c8063715018a61161014f578063a22cb465116100c1578063c89109131161007a578063c891091314610922578063cb96372814610978578063e163262b14610998578063e985e9c5146109b8578063f2fde38b146109d8578063ffc9896b146109f857600080fd5b8063a22cb46514610862578063a2ab134c14610882578063b88d4fde146108a2578063bf2db4c8146108c2578063c1d3ec9f146108e2578063c87b56dd1461090257600080fd5b80638456cb59116101135780638456cb59146107ad5780638462151c146107c25780638da5cb5b146107ef578063907097511461080d57806395d89b411461082d5780639c09628d1461084257600080fd5b8063715018a61461064e5780637499c00a1461066357806375f5b86b146106785780637cb64759146106985780637de1e536146106b857600080fd5b8063322d6f66116101e85780635328764b116101ac5780635328764b1461059c57806355f804b3146105bc5780635c975abb146105dc5780636352211e146105fb5780636bc6e5f81461061b57806370a082311461062e57600080fd5b8063322d6f661461041d57806334c13706146104305780633ccfd60b146105525780633f4ba83a1461056757806342842e0e1461057c57600080fd5b8063095ea7b31161023a578063095ea7b31461034857806318160ddd1461036857806323b872dd1461038b57806323cf0a22146103ab5780632a55205a146103be5780632e9c8fe3146103fd57600080fd5b806301ffc9a71461027757806304634d8d146102ac5780630562b9f7146102ce57806306fdde03146102ee578063081812fc14610310575b600080fd5b34801561028357600080fd5b50610297610292366004613234565b610a52565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102cc6102c736600461326d565b610ab3565b005b3480156102da57600080fd5b506102cc6102e93660046132b0565b610ac9565b3480156102fa57600080fd5b50610303610b7d565b6040516102a39190613319565b34801561031c57600080fd5b5061033061032b3660046132b0565b610c0f565b6040516001600160a01b0390911681526020016102a3565b34801561035457600080fd5b506102cc61036336600461332c565b610c9a565b34801561037457600080fd5b5061037d610db1565b6040519081526020016102a3565b34801561039757600080fd5b506102cc6103a6366004613356565b610dc0565b6102cc6103b93660046133a4565b610df1565b3480156103ca57600080fd5b506103de6103d93660046133bf565b61121d565b604080516001600160a01b0390931683526020830191909152016102a3565b34801561040957600080fd5b506102cc6104183660046133f5565b6112c9565b6102cc61042b366004613428565b61130b565b34801561043c57600080fd5b506105456040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101829052610140810191909152506040805161016081018252600d5463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b810483166060830152600160801b80820484166080840152600160a01b8204841660a0840152600160c01b8204841660c0840152600160e01b90910490921660e0820152600e546001600160801b03808216610100840152929004909116610120820152600f5461014082015290565b6040516102a39190613452565b34801561055e57600080fd5b506102cc6116d1565b34801561057357600080fd5b506102cc6116ee565b34801561058857600080fd5b506102cc610597366004613356565b611700565b3480156105a857600080fd5b506102cc6105b73660046133f5565b61171b565b3480156105c857600080fd5b506102cc6105d7366004613603565b611763565b3480156105e857600080fd5b50600a54600160a01b900460ff16610297565b34801561060757600080fd5b506103306106163660046132b0565b611777565b6102cc610629366004613637565b61178b565b34801561063a57600080fd5b5061037d6106493660046136ef565b611b7a565b34801561065a57600080fd5b506102cc611c0d565b34801561066f57600080fd5b506102cc611c1f565b34801561068457600080fd5b506102cc6106933660046133bf565b611c2f565b3480156106a457600080fd5b506102cc6106b33660046132b0565b611c74565b3480156106c457600080fd5b50600d54600e54600f546107399263ffffffff80821693600160201b8304821693600160401b8404831693600160601b8104841693600160801b808304821694600160a01b8404831694600160c01b8504841694600160e01b9004909316926001600160801b0380831693909204909116908b565b6040805163ffffffff9c8d1681529a8c1660208c0152988b16988a01989098529589166060890152938816608088015291871660a0870152861660c086015290941660e08401526001600160801b0393841661010084015292909216610120820152610140810191909152610160016102a3565b3480156107b957600080fd5b506102cc611c81565b3480156107ce57600080fd5b506107e26107dd3660046136ef565b611c91565b6040516102a3919061370a565b3480156107fb57600080fd5b50600a546001600160a01b0316610330565b34801561081957600080fd5b506102cc610828366004613603565b611d57565b34801561083957600080fd5b50610303611d6b565b34801561084e57600080fd5b506102cc61085d3660046132b0565b611d7a565b34801561086e57600080fd5b506102cc61087d36600461375c565b611db8565b34801561088e57600080fd5b506102cc61089d3660046133a4565b611e7c565b3480156108ae57600080fd5b506102cc6108bd366004613788565b611ea8565b3480156108ce57600080fd5b506102cc6108dd366004613803565b611eda565b3480156108ee57600080fd5b506102cc6108fd3660046133a4565b611ef7565b34801561090e57600080fd5b5061030361091d3660046132b0565b611f18565b34801561092e57600080fd5b5061095d61093d3660046136ef565b60106020526000908152604090205461ffff808216916201000090041682565b6040805161ffff9384168152929091166020830152016102a3565b34801561098457600080fd5b506102cc6109933660046136ef565b611fc2565b3480156109a457600080fd5b506102cc6109b336600461387d565b61210f565b3480156109c457600080fd5b506102976109d33660046138a7565b612130565b3480156109e457600080fd5b506102cc6109f33660046136ef565b61215e565b348015610a0457600080fd5b50610a3d610a133660046136ef565b6001600160a01b031660009081526010602052604090205461ffff80821692620100009092041690565b604080519283526020830191909152016102a3565b60006001600160e01b0319821663152a902d60e11b1480610a8357506001600160e01b031982166380ac58cd60e01b145b80610a9e57506001600160e01b03198216635b5e139f60e01b145b80610aad5750610aad82612200565b92915050565b610abb612225565b610ac5828261227f565b5050565b610ad1612225565b6000610ae5600a546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b2f576040519150601f19603f3d011682016040523d82523d6000602084013e610b34565b606091505b5050905080610ac55760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064015b60405180910390fd5b606060018054610b8c906138d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb8906138d1565b8015610c055780601f10610bda57610100808354040283529160200191610c05565b820191906000526020600020905b815481529060010190602001808311610be857829003601f168201915b5050505050905090565b6000610c1a8261237c565b610c7e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b506000908152600560205260409020546001600160a01b031690565b6000610ca582611777565b9050806001600160a01b0316836001600160a01b031603610d145760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610b74565b336001600160a01b0382161480610d305750610d308133612130565b610da25760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610b74565b610dac8383612398565b505050565b6000610dbb612406565b905090565b610dca3382612417565b610de65760405162461bcd60e51b8152600401610b749061390b565b610dac8383836124e4565b8060008161ffff16610e01610db1565b610e0b9190613975565b600d54600160601b900463ffffffff161015610e6a57610e29610db1565b600d54610e439190600160601b900463ffffffff16613988565b6040516356eb4ae160e01b8152600481019190915261ffff83166024820152604401610b74565b600a546001600160a01b0316331461120757801561108457600f54610ea257604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff16421015610ee457600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff16421115610f2657600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff1690610f5d90849062010000900461ffff1661399b565b61ffff161115610fbb57600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e54610fdd9061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b0316341461103957600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b6040516311ebdab360e21b81526001600160801b039091166004820152346024820152604401610b74565b336000908152601060205260409020805483919060029061106590849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff160217905550611207565b600d543360009081526010602052604090205463ffffffff909116906110af90849061ffff1661399b565b61ffff16111561110057600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff1642101561114257600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff1642111561118457600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e5461119f9061ffff8416906001600160801b03166139bd565b6001600160801b031634146111c957600e5461100e9061ffff8416906001600160801b03166139bd565b33600090815260106020526040812080548492906111ec90849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b61120f6126dd565b610dac338461ffff1661272a565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916112925750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906112b1906001600160601b0316876139ec565b6112bb9190613a0b565b915196919550909350505050565b6112d1612225565b600d80546001600160c01b0316600160c01b63ffffffff948516026001600160e01b031617600160e01b9290931691909102919091179055565b8060008161ffff1661131b610db1565b6113259190613975565b600d54600160601b900463ffffffff16101561134357610e29610db1565b600a546001600160a01b031633146116b557801561153257600f5461137b57604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff164210156113bd57600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff164211156113ff57600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff169061143690849062010000900461ffff1661399b565b61ffff16111561149457600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e546114b69061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b031634146114e757600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b336000908152601060205260409020805483919060029061151390849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055506116b5565b600d543360009081526010602052604090205463ffffffff9091169061155d90849061ffff1661399b565b61ffff1611156115ae57600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff164210156115f057600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff1642111561163257600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e5461164d9061ffff8416906001600160801b03166139bd565b6001600160801b0316341461167757600e5461100e9061ffff8416906001600160801b03166139bd565b336000908152601060205260408120805484929061169a90849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b6116bd612225565b6116cb848461ffff1661272a565b50505050565b6116d9612225565b476000610ae5600a546001600160a01b031690565b6116f6612225565b6116fe612744565b565b610dac83838360405180602001604052806000815250611ea8565b611723612225565b600d805467ffffffffffffffff60801b1916600160801b63ffffffff9485160263ffffffff60a01b191617600160a01b9290931691909102919091179055565b61176b612225565b61177481612799565b50565b600080611783836127a5565b509392505050565b80611796338261283c565b6117b357604051630b094f2760e31b815260040160405180910390fd5b8260018161ffff166117c3610db1565b6117cd9190613975565b600d54600160601b900463ffffffff1610156117eb57610e29610db1565b600a546001600160a01b03163314611b5d5780156119da57600f5461182357604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff1642101561186557600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff164211156118a757600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff16906118de90849062010000900461ffff1661399b565b61ffff16111561193c57600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e5461195e9061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b0316341461198f57600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b33600090815260106020526040902080548391906002906119bb90849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff160217905550611b5d565b600d543360009081526010602052604090205463ffffffff90911690611a0590849061ffff1661399b565b61ffff161115611a5657600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff16421015611a9857600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff16421115611ada57600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e54611af59061ffff8416906001600160801b03166139bd565b6001600160801b03163414611b1f57600e5461100e9061ffff8416906001600160801b03166139bd565b3360009081526010602052604081208054849290611b4290849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b611b656126dd565b611b73338661ffff1661272a565b5050505050565b60006001600160a01b038216611be85760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610b74565b506001600160a01b03166000908152600760205260409020546001600160401b031690565b611c15612225565b6116fe6000612888565b611c27612225565b6116fe6128da565b611c37612225565b60408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b611c7c612225565b600f55565b611c89612225565b6116fe612921565b6060600080611c9f84611b7a565b90506000816001600160401b03811115611cbb57611cbb613546565b604051908082528060200260200182016040528015611ce4578160200160208202803683370190505b50905060015b828414611d4e57611cfa8161237c565b15611d4657856001600160a01b0316611d1282611777565b6001600160a01b031603611d465780828580600101965081518110611d3957611d39613a2d565b6020026020010181815250505b600101611cea565b50949350505050565b611d5f612225565b600c610ac58282613a89565b606060028054610b8c906138d1565b611d82612225565b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150565b336001600160a01b03831603611e105760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610b74565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611e84612225565b600d805467ffffffff00000000191661ffff92909216600160201b02919091179055565b611eb23383612417565b611ece5760405162461bcd60e51b8152600401610b749061390b565b6116cb84848484612964565b611ee2612225565b611eeb82612799565b600c610dac8282613a89565b611eff612225565b600d805463ffffffff191661ffff909216919091179055565b6060611f238261237c565b611f875760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b611f8f612999565b611f98836129a8565b600c604051602001611fac93929190613b48565b6040516020818303038152906040529050919050565b611fca612225565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120379190613be8565b90506000826001600160a01b031663a9059cbb61205c600a546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af11580156120a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120cd9190613c01565b9050806116cb5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610b74565b612117612225565b6001600160801b03908116600160801b02911617600e55565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b612166612225565b6001600160a01b0381166121cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b74565b61177481612888565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b60006001600160e01b0319821663152a902d60e11b1480610aad5750610aad82612a3a565b600a546001600160a01b031633146116fe5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b74565b6127106001600160601b03821611156122ed5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b74565b6001600160a01b0382166123435760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b74565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b600061238760045490565b82108015610aad5750506001111590565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906123cd82611777565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006001600454610dbb9190613988565b60006124228261237c565b6124865760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b600061249183611777565b9050806001600160a01b0316846001600160a01b031614806124cc5750836001600160a01b03166124c184610c0f565b6001600160a01b0316145b806124dc57506124dc8185612130565b949350505050565b6000806124f0836127a5565b91509150846001600160a01b0316826001600160a01b03161461256a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610b74565b6001600160a01b0384166125d05760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610b74565b6125db600084612398565b60006125e8846001613975565b600881901c600090815260208190526040902054909150600160ff1b60ff83161c16158015612618575060045481105b1561264e57600081815260036020526040812080546001600160a01b0319166001600160a01b03891617905561264e90826121d4565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414612687576126876000856121d4565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46126d58686866001612a8a565b505050505050565b600a54600160a01b900460ff16156116fe5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b74565b610ac5828260405180602001604052806000815250612c08565b61274c612c2d565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600b610ac58282613a89565b6000806127b18361237c565b6128125760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b74565b61281b83612c7d565b6000818152600360205260409020546001600160a01b031694909350915050565b6040516bffffffffffffffffffffffff19606084901b16602082015260009081906034016040516020818303038152906040528051906020012090506124dc83600d6002015483612c89565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006128e4610db1565b600d546128fe9190600160601b900463ffffffff16613988565b905080156117745761177461291b600a546001600160a01b031690565b8261272a565b6129296126dd565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861277c3390565b61296f8484846124e4565b61297d848484600185612c9f565b6116cb5760405162461bcd60e51b8152600401610b7490613c1e565b6060600b8054610b8c906138d1565b606060006129b583612dd6565b60010190506000816001600160401b038111156129d4576129d4613546565b6040519080825280601f01601f1916602001820160405280156129fe576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612a0857509392505050565b60006001600160e01b031982166380ac58cd60e01b1480612a6b57506001600160e01b03198216635b5e139f60e01b145b80610aad57506301ffc9a760e01b6001600160e01b0319831614610aad565b600160401b8110612a9a57600080fd5b806001600160a01b03851615612b04576001600160a01b03851660009081526007602052604081208054839290612adb9084906001600160401b0316613c73565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550612b64565b6001600160a01b03841660009081526007602052604090208054829190600890612b3f908490600160401b90046001600160401b0316613c93565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b03841615612bcd576001600160a01b03841660009081526007602052604081208054839290612ba49084906001600160401b0316613c93565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550611b73565b6001600160a01b03851660009081526007602052604090208054829190601090612ba4908490600160801b90046001600160401b0316613c93565b6000612c1360045490565b9050612c1f8484612eae565b61297d600085838686612c9f565b600a54600160a01b900460ff166116fe5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b74565b6000610aad818361302d565b600082612c968584613125565b14949350505050565b60006001600160a01b0385163b15612dc957506001835b612cc08486613975565b811015612dc357604051630a85bd0160e11b81526001600160a01b0387169063150b7a0290612cf99033908b9086908990600401613cb3565b6020604051808303816000875af1925050508015612d34575060408051601f3d908101601f19168201909252612d3191810190613cf0565b60015b612d91573d808015612d62576040519150601f19603f3d011682016040523d82523d6000602084013e612d67565b606091505b508051600003612d895760405162461bcd60e51b8152600401610b7490613c1e565b805181602001fd5b828015612dae57506001600160e01b03198116630a85bd0160e11b145b92505080612dbb81613d0d565b915050612cb6565b50612dcd565b5060015b95945050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e155772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e41576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e5f57662386f26fc10000830492506010015b6305f5e1008310612e77576305f5e100830492506008015b6127108310612e8b57612710830492506004015b60648310612e9d576064830492506002015b600a8310610aad5760010192915050565b6000612eb960045490565b905060008211612f195760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610b74565b6001600160a01b038316612f7b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610b74565b8160046000828254612f8d9190613975565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b038616179055612fc390826121d4565b612fd06000848385612a8a565b805b612fdc8383613975565b8110156116cb5760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48061302581613d0d565b915050612fd2565b600881901c60008181526020849052604081205490919060ff808516919082181c801561306f5761305d8161316a565b60ff168203600884901b17935061311c565b600083116130dc5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610b74565b506000199091016000818152602086905260409020549091908015613117576131048161316a565b60ff0360ff16600884901b17935061311c565b61306f565b50505092915050565b600081815b8451811015611783576131568286838151811061314957613149613a2d565b60200260200101516131d4565b91508061316281613d0d565b91505061312a565b60006040518061012001604052806101008152602001613d27610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6131b385613206565b02901c815181106131c6576131c6613a2d565b016020015160f81c92915050565b60008183106131f05760008281526020849052604090206131ff565b60008381526020839052604090205b9392505050565b600080821161321457600080fd5b5060008190031690565b6001600160e01b03198116811461177457600080fd5b60006020828403121561324657600080fd5b81356131ff8161321e565b80356001600160a01b038116811461326857600080fd5b919050565b6000806040838503121561328057600080fd5b61328983613251565b915060208301356001600160601b03811681146132a557600080fd5b809150509250929050565b6000602082840312156132c257600080fd5b5035919050565b60005b838110156132e45781810151838201526020016132cc565b50506000910152565b600081518084526133058160208601602086016132c9565b601f01601f19169290920160200192915050565b6020815260006131ff60208301846132ed565b6000806040838503121561333f57600080fd5b61334883613251565b946020939093013593505050565b60008060006060848603121561336b57600080fd5b61337484613251565b925061338260208501613251565b9150604084013590509250925092565b803561ffff8116811461326857600080fd5b6000602082840312156133b657600080fd5b6131ff82613392565b600080604083850312156133d257600080fd5b50508035926020909101359150565b803563ffffffff8116811461326857600080fd5b6000806040838503121561340857600080fd5b613411836133e1565b915061341f602084016133e1565b90509250929050565b6000806040838503121561343b57600080fd5b61344483613251565b915061341f60208401613392565b815163ffffffff16815261016081016020830151613478602084018263ffffffff169052565b506040830151613490604084018263ffffffff169052565b5060608301516134a8606084018263ffffffff169052565b5060808301516134c0608084018263ffffffff169052565b5060a08301516134d860a084018263ffffffff169052565b5060c08301516134f060c084018263ffffffff169052565b5060e083015161350860e084018263ffffffff169052565b50610100838101516001600160801b038116848301525050610120838101516001600160801b03811684830152505061014092830151919092015290565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561358457613584613546565b604052919050565b60006001600160401b038311156135a5576135a5613546565b6135b8601f8401601f191660200161355c565b90508281528383830111156135cc57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126135f457600080fd5b6131ff8383356020850161358c565b60006020828403121561361557600080fd5b81356001600160401b0381111561362b57600080fd5b6124dc848285016135e3565b6000806040838503121561364a57600080fd5b61365383613392565b91506020808401356001600160401b038082111561367057600080fd5b818601915086601f83011261368457600080fd5b81358181111561369657613696613546565b8060051b91506136a784830161355c565b81815291830184019184810190898411156136c157600080fd5b938501935b838510156136df578435825293850193908501906136c6565b8096505050505050509250929050565b60006020828403121561370157600080fd5b6131ff82613251565b6020808252825182820181905260009190848201906040850190845b8181101561374257835183529284019291840191600101613726565b50909695505050505050565b801515811461177457600080fd5b6000806040838503121561376f57600080fd5b61377883613251565b915060208301356132a58161374e565b6000806000806080858703121561379e57600080fd5b6137a785613251565b93506137b560208601613251565b92506040850135915060608501356001600160401b038111156137d757600080fd5b8501601f810187136137e857600080fd5b6137f78782356020840161358c565b91505092959194509250565b6000806040838503121561381657600080fd5b82356001600160401b038082111561382d57600080fd5b613839868387016135e3565b9350602085013591508082111561384f57600080fd5b5061385c858286016135e3565b9150509250929050565b80356001600160801b038116811461326857600080fd5b6000806040838503121561389057600080fd5b61389983613866565b915061341f60208401613866565b600080604083850312156138ba57600080fd5b6138c383613251565b915061341f60208401613251565b600181811c908216806138e557607f821691505b60208210810361390557634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610aad57610aad61395f565b81810381811115610aad57610aad61395f565b61ffff8181168382160190808211156139b6576139b661395f565b5092915050565b60006001600160801b03808316818516818304811182151516156139e3576139e361395f565b02949350505050565b6000816000190483118215151615613a0657613a0661395f565b500290565b600082613a2857634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b601f821115610dac57600081815260208120601f850160051c81016020861015613a6a5750805b601f850160051c820191505b818110156126d557828155600101613a76565b81516001600160401b03811115613aa257613aa2613546565b613ab681613ab084546138d1565b84613a43565b602080601f831160018114613aeb5760008415613ad35750858301515b600019600386901b1c1916600185901b1785556126d5565b600085815260208120601f198616915b82811015613b1a57888601518255948401946001909101908401613afb565b5085821015613b385787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516020613b5b8285838a016132c9565b855191840191613b6e8184848a016132c9565b8554920191600090613b7f816138d1565b60018281168015613b975760018114613bac57613bd8565b60ff1984168752821515830287019450613bd8565b896000528560002060005b84811015613bd057815489820152908301908701613bb7565b505082870194505b50929a9950505050505050505050565b600060208284031215613bfa57600080fd5b5051919050565b600060208284031215613c1357600080fd5b81516131ff8161374e565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b6001600160401b038281168282160390808211156139b6576139b661395f565b6001600160401b038181168382160190808211156139b6576139b661395f565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ce6908301846132ed565b9695505050505050565b600060208284031215613d0257600080fd5b81516131ff8161321e565b600060018201613d1f57613d1f61395f565b506001019056fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212208bef27268c6b37ad3d71064bebd05368312ec3d8ad1f5e547d880f94f4da093064736f6c6343000810003300000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000d94ab5687a231bba44fd05a4d1f4eb1d74f309dc00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000063d44a8c0000000000000000000000000000000000000000000000000000000063d4bb0c0000000000000000000000000000000000000000000000000000000063d449600000000000000000000000000000000000000000000000000000000063d45068000000000000000000000000000000000000000000000000015fb7f9b8c38000000000000000000000000000000000000000000000000000013c3107490280008ee385b35c2db543d44a68012ea76d61c946f68f91e8db38cdb4db3335ac1fec000000000000000000000000000000000000000000000000000000000000000853617267654e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055341524745000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b68747470733a2f2f73617267652d6e66742d6170692e76657263656c2e6170702f6170692f746f6b656e2f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102725760003560e01c8063715018a61161014f578063a22cb465116100c1578063c89109131161007a578063c891091314610922578063cb96372814610978578063e163262b14610998578063e985e9c5146109b8578063f2fde38b146109d8578063ffc9896b146109f857600080fd5b8063a22cb46514610862578063a2ab134c14610882578063b88d4fde146108a2578063bf2db4c8146108c2578063c1d3ec9f146108e2578063c87b56dd1461090257600080fd5b80638456cb59116101135780638456cb59146107ad5780638462151c146107c25780638da5cb5b146107ef578063907097511461080d57806395d89b411461082d5780639c09628d1461084257600080fd5b8063715018a61461064e5780637499c00a1461066357806375f5b86b146106785780637cb64759146106985780637de1e536146106b857600080fd5b8063322d6f66116101e85780635328764b116101ac5780635328764b1461059c57806355f804b3146105bc5780635c975abb146105dc5780636352211e146105fb5780636bc6e5f81461061b57806370a082311461062e57600080fd5b8063322d6f661461041d57806334c13706146104305780633ccfd60b146105525780633f4ba83a1461056757806342842e0e1461057c57600080fd5b8063095ea7b31161023a578063095ea7b31461034857806318160ddd1461036857806323b872dd1461038b57806323cf0a22146103ab5780632a55205a146103be5780632e9c8fe3146103fd57600080fd5b806301ffc9a71461027757806304634d8d146102ac5780630562b9f7146102ce57806306fdde03146102ee578063081812fc14610310575b600080fd5b34801561028357600080fd5b50610297610292366004613234565b610a52565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102cc6102c736600461326d565b610ab3565b005b3480156102da57600080fd5b506102cc6102e93660046132b0565b610ac9565b3480156102fa57600080fd5b50610303610b7d565b6040516102a39190613319565b34801561031c57600080fd5b5061033061032b3660046132b0565b610c0f565b6040516001600160a01b0390911681526020016102a3565b34801561035457600080fd5b506102cc61036336600461332c565b610c9a565b34801561037457600080fd5b5061037d610db1565b6040519081526020016102a3565b34801561039757600080fd5b506102cc6103a6366004613356565b610dc0565b6102cc6103b93660046133a4565b610df1565b3480156103ca57600080fd5b506103de6103d93660046133bf565b61121d565b604080516001600160a01b0390931683526020830191909152016102a3565b34801561040957600080fd5b506102cc6104183660046133f5565b6112c9565b6102cc61042b366004613428565b61130b565b34801561043c57600080fd5b506105456040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101829052610140810191909152506040805161016081018252600d5463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b810483166060830152600160801b80820484166080840152600160a01b8204841660a0840152600160c01b8204841660c0840152600160e01b90910490921660e0820152600e546001600160801b03808216610100840152929004909116610120820152600f5461014082015290565b6040516102a39190613452565b34801561055e57600080fd5b506102cc6116d1565b34801561057357600080fd5b506102cc6116ee565b34801561058857600080fd5b506102cc610597366004613356565b611700565b3480156105a857600080fd5b506102cc6105b73660046133f5565b61171b565b3480156105c857600080fd5b506102cc6105d7366004613603565b611763565b3480156105e857600080fd5b50600a54600160a01b900460ff16610297565b34801561060757600080fd5b506103306106163660046132b0565b611777565b6102cc610629366004613637565b61178b565b34801561063a57600080fd5b5061037d6106493660046136ef565b611b7a565b34801561065a57600080fd5b506102cc611c0d565b34801561066f57600080fd5b506102cc611c1f565b34801561068457600080fd5b506102cc6106933660046133bf565b611c2f565b3480156106a457600080fd5b506102cc6106b33660046132b0565b611c74565b3480156106c457600080fd5b50600d54600e54600f546107399263ffffffff80821693600160201b8304821693600160401b8404831693600160601b8104841693600160801b808304821694600160a01b8404831694600160c01b8504841694600160e01b9004909316926001600160801b0380831693909204909116908b565b6040805163ffffffff9c8d1681529a8c1660208c0152988b16988a01989098529589166060890152938816608088015291871660a0870152861660c086015290941660e08401526001600160801b0393841661010084015292909216610120820152610140810191909152610160016102a3565b3480156107b957600080fd5b506102cc611c81565b3480156107ce57600080fd5b506107e26107dd3660046136ef565b611c91565b6040516102a3919061370a565b3480156107fb57600080fd5b50600a546001600160a01b0316610330565b34801561081957600080fd5b506102cc610828366004613603565b611d57565b34801561083957600080fd5b50610303611d6b565b34801561084e57600080fd5b506102cc61085d3660046132b0565b611d7a565b34801561086e57600080fd5b506102cc61087d36600461375c565b611db8565b34801561088e57600080fd5b506102cc61089d3660046133a4565b611e7c565b3480156108ae57600080fd5b506102cc6108bd366004613788565b611ea8565b3480156108ce57600080fd5b506102cc6108dd366004613803565b611eda565b3480156108ee57600080fd5b506102cc6108fd3660046133a4565b611ef7565b34801561090e57600080fd5b5061030361091d3660046132b0565b611f18565b34801561092e57600080fd5b5061095d61093d3660046136ef565b60106020526000908152604090205461ffff808216916201000090041682565b6040805161ffff9384168152929091166020830152016102a3565b34801561098457600080fd5b506102cc6109933660046136ef565b611fc2565b3480156109a457600080fd5b506102cc6109b336600461387d565b61210f565b3480156109c457600080fd5b506102976109d33660046138a7565b612130565b3480156109e457600080fd5b506102cc6109f33660046136ef565b61215e565b348015610a0457600080fd5b50610a3d610a133660046136ef565b6001600160a01b031660009081526010602052604090205461ffff80821692620100009092041690565b604080519283526020830191909152016102a3565b60006001600160e01b0319821663152a902d60e11b1480610a8357506001600160e01b031982166380ac58cd60e01b145b80610a9e57506001600160e01b03198216635b5e139f60e01b145b80610aad5750610aad82612200565b92915050565b610abb612225565b610ac5828261227f565b5050565b610ad1612225565b6000610ae5600a546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b2f576040519150601f19603f3d011682016040523d82523d6000602084013e610b34565b606091505b5050905080610ac55760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064015b60405180910390fd5b606060018054610b8c906138d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb8906138d1565b8015610c055780601f10610bda57610100808354040283529160200191610c05565b820191906000526020600020905b815481529060010190602001808311610be857829003601f168201915b5050505050905090565b6000610c1a8261237c565b610c7e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b506000908152600560205260409020546001600160a01b031690565b6000610ca582611777565b9050806001600160a01b0316836001600160a01b031603610d145760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610b74565b336001600160a01b0382161480610d305750610d308133612130565b610da25760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610b74565b610dac8383612398565b505050565b6000610dbb612406565b905090565b610dca3382612417565b610de65760405162461bcd60e51b8152600401610b749061390b565b610dac8383836124e4565b8060008161ffff16610e01610db1565b610e0b9190613975565b600d54600160601b900463ffffffff161015610e6a57610e29610db1565b600d54610e439190600160601b900463ffffffff16613988565b6040516356eb4ae160e01b8152600481019190915261ffff83166024820152604401610b74565b600a546001600160a01b0316331461120757801561108457600f54610ea257604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff16421015610ee457600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff16421115610f2657600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff1690610f5d90849062010000900461ffff1661399b565b61ffff161115610fbb57600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e54610fdd9061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b0316341461103957600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b6040516311ebdab360e21b81526001600160801b039091166004820152346024820152604401610b74565b336000908152601060205260409020805483919060029061106590849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff160217905550611207565b600d543360009081526010602052604090205463ffffffff909116906110af90849061ffff1661399b565b61ffff16111561110057600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff1642101561114257600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff1642111561118457600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e5461119f9061ffff8416906001600160801b03166139bd565b6001600160801b031634146111c957600e5461100e9061ffff8416906001600160801b03166139bd565b33600090815260106020526040812080548492906111ec90849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b61120f6126dd565b610dac338461ffff1661272a565b60008281526009602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916112925750604080518082019091526008546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906112b1906001600160601b0316876139ec565b6112bb9190613a0b565b915196919550909350505050565b6112d1612225565b600d80546001600160c01b0316600160c01b63ffffffff948516026001600160e01b031617600160e01b9290931691909102919091179055565b8060008161ffff1661131b610db1565b6113259190613975565b600d54600160601b900463ffffffff16101561134357610e29610db1565b600a546001600160a01b031633146116b557801561153257600f5461137b57604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff164210156113bd57600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff164211156113ff57600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff169061143690849062010000900461ffff1661399b565b61ffff16111561149457600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e546114b69061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b031634146114e757600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b336000908152601060205260409020805483919060029061151390849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055506116b5565b600d543360009081526010602052604090205463ffffffff9091169061155d90849061ffff1661399b565b61ffff1611156115ae57600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff164210156115f057600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff1642111561163257600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e5461164d9061ffff8416906001600160801b03166139bd565b6001600160801b0316341461167757600e5461100e9061ffff8416906001600160801b03166139bd565b336000908152601060205260408120805484929061169a90849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b6116bd612225565b6116cb848461ffff1661272a565b50505050565b6116d9612225565b476000610ae5600a546001600160a01b031690565b6116f6612225565b6116fe612744565b565b610dac83838360405180602001604052806000815250611ea8565b611723612225565b600d805467ffffffffffffffff60801b1916600160801b63ffffffff9485160263ffffffff60a01b191617600160a01b9290931691909102919091179055565b61176b612225565b61177481612799565b50565b600080611783836127a5565b509392505050565b80611796338261283c565b6117b357604051630b094f2760e31b815260040160405180910390fd5b8260018161ffff166117c3610db1565b6117cd9190613975565b600d54600160601b900463ffffffff1610156117eb57610e29610db1565b600a546001600160a01b03163314611b5d5780156119da57600f5461182357604051634ec785e560e11b815260040160405180910390fd5b600d54600160c01b900463ffffffff1642101561186557600d546040516303d7cd1760e41b8152600160c01b90910463ffffffff166004820152602401610b74565b600d54600160e01b900463ffffffff164211156118a757600d5460405163953614e960e01b8152600160e01b90910463ffffffff166004820152602401610b74565b600d5433600090815260106020526040902054600160201b90910463ffffffff16906118de90849062010000900461ffff1661399b565b61ffff16111561193c57600d54336000908152601060205260409081902054905163695180f360e01b8152600160201b90920463ffffffff16600483015261ffff808516602484015262010000909104166044820152606401610b74565b600e5461195e9061ffff841690600160801b90046001600160801b03166139bd565b6001600160801b0316341461198f57600e5461100e9061ffff841690600160801b90046001600160801b03166139bd565b33600090815260106020526040902080548391906002906119bb90849062010000900461ffff1661399b565b92506101000a81548161ffff021916908361ffff160217905550611b5d565b600d543360009081526010602052604090205463ffffffff90911690611a0590849061ffff1661399b565b61ffff161115611a5657600d543360009081526010602052604090819020549051638313c93d60e01b815263ffffffff909216600483015261ffff8085166024840152166044820152606401610b74565b600d54600160801b900463ffffffff16421015611a9857600d54604051632a4c099b60e01b8152600160801b90910463ffffffff166004820152602401610b74565b600d54600160a01b900463ffffffff16421115611ada57600d54604051639b1348a760e01b8152600160a01b90910463ffffffff166004820152602401610b74565b600e54611af59061ffff8416906001600160801b03166139bd565b6001600160801b03163414611b1f57600e5461100e9061ffff8416906001600160801b03166139bd565b3360009081526010602052604081208054849290611b4290849061ffff1661399b565b92506101000a81548161ffff021916908361ffff1602179055505b611b656126dd565b611b73338661ffff1661272a565b5050505050565b60006001600160a01b038216611be85760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610b74565b506001600160a01b03166000908152600760205260409020546001600160401b031690565b611c15612225565b6116fe6000612888565b611c27612225565b6116fe6128da565b611c37612225565b60408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b611c7c612225565b600f55565b611c89612225565b6116fe612921565b6060600080611c9f84611b7a565b90506000816001600160401b03811115611cbb57611cbb613546565b604051908082528060200260200182016040528015611ce4578160200160208202803683370190505b50905060015b828414611d4e57611cfa8161237c565b15611d4657856001600160a01b0316611d1282611777565b6001600160a01b031603611d465780828580600101965081518110611d3957611d39613a2d565b6020026020010181815250505b600101611cea565b50949350505050565b611d5f612225565b600c610ac58282613a89565b606060028054610b8c906138d1565b611d82612225565b6040518181527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a150565b336001600160a01b03831603611e105760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610b74565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611e84612225565b600d805467ffffffff00000000191661ffff92909216600160201b02919091179055565b611eb23383612417565b611ece5760405162461bcd60e51b8152600401610b749061390b565b6116cb84848484612964565b611ee2612225565b611eeb82612799565b600c610dac8282613a89565b611eff612225565b600d805463ffffffff191661ffff909216919091179055565b6060611f238261237c565b611f875760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b611f8f612999565b611f98836129a8565b600c604051602001611fac93929190613b48565b6040516020818303038152906040529050919050565b611fca612225565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120379190613be8565b90506000826001600160a01b031663a9059cbb61205c600a546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af11580156120a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120cd9190613c01565b9050806116cb5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610b74565b612117612225565b6001600160801b03908116600160801b02911617600e55565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b612166612225565b6001600160a01b0381166121cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b74565b61177481612888565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b60006001600160e01b0319821663152a902d60e11b1480610aad5750610aad82612a3a565b600a546001600160a01b031633146116fe5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b74565b6127106001600160601b03821611156122ed5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b74565b6001600160a01b0382166123435760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b74565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600855565b600061238760045490565b82108015610aad5750506001111590565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906123cd82611777565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006001600454610dbb9190613988565b60006124228261237c565b6124865760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b74565b600061249183611777565b9050806001600160a01b0316846001600160a01b031614806124cc5750836001600160a01b03166124c184610c0f565b6001600160a01b0316145b806124dc57506124dc8185612130565b949350505050565b6000806124f0836127a5565b91509150846001600160a01b0316826001600160a01b03161461256a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610b74565b6001600160a01b0384166125d05760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610b74565b6125db600084612398565b60006125e8846001613975565b600881901c600090815260208190526040902054909150600160ff1b60ff83161c16158015612618575060045481105b1561264e57600081815260036020526040812080546001600160a01b0319166001600160a01b03891617905561264e90826121d4565b600084815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414612687576126876000856121d4565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46126d58686866001612a8a565b505050505050565b600a54600160a01b900460ff16156116fe5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b74565b610ac5828260405180602001604052806000815250612c08565b61274c612c2d565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600b610ac58282613a89565b6000806127b18361237c565b6128125760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b74565b61281b83612c7d565b6000818152600360205260409020546001600160a01b031694909350915050565b6040516bffffffffffffffffffffffff19606084901b16602082015260009081906034016040516020818303038152906040528051906020012090506124dc83600d6002015483612c89565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006128e4610db1565b600d546128fe9190600160601b900463ffffffff16613988565b905080156117745761177461291b600a546001600160a01b031690565b8261272a565b6129296126dd565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861277c3390565b61296f8484846124e4565b61297d848484600185612c9f565b6116cb5760405162461bcd60e51b8152600401610b7490613c1e565b6060600b8054610b8c906138d1565b606060006129b583612dd6565b60010190506000816001600160401b038111156129d4576129d4613546565b6040519080825280601f01601f1916602001820160405280156129fe576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612a0857509392505050565b60006001600160e01b031982166380ac58cd60e01b1480612a6b57506001600160e01b03198216635b5e139f60e01b145b80610aad57506301ffc9a760e01b6001600160e01b0319831614610aad565b600160401b8110612a9a57600080fd5b806001600160a01b03851615612b04576001600160a01b03851660009081526007602052604081208054839290612adb9084906001600160401b0316613c73565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550612b64565b6001600160a01b03841660009081526007602052604090208054829190600890612b3f908490600160401b90046001600160401b0316613c93565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b03841615612bcd576001600160a01b03841660009081526007602052604081208054839290612ba49084906001600160401b0316613c93565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550611b73565b6001600160a01b03851660009081526007602052604090208054829190601090612ba4908490600160801b90046001600160401b0316613c93565b6000612c1360045490565b9050612c1f8484612eae565b61297d600085838686612c9f565b600a54600160a01b900460ff166116fe5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b74565b6000610aad818361302d565b600082612c968584613125565b14949350505050565b60006001600160a01b0385163b15612dc957506001835b612cc08486613975565b811015612dc357604051630a85bd0160e11b81526001600160a01b0387169063150b7a0290612cf99033908b9086908990600401613cb3565b6020604051808303816000875af1925050508015612d34575060408051601f3d908101601f19168201909252612d3191810190613cf0565b60015b612d91573d808015612d62576040519150601f19603f3d011682016040523d82523d6000602084013e612d67565b606091505b508051600003612d895760405162461bcd60e51b8152600401610b7490613c1e565b805181602001fd5b828015612dae57506001600160e01b03198116630a85bd0160e11b145b92505080612dbb81613d0d565b915050612cb6565b50612dcd565b5060015b95945050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e155772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e41576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e5f57662386f26fc10000830492506010015b6305f5e1008310612e77576305f5e100830492506008015b6127108310612e8b57612710830492506004015b60648310612e9d576064830492506002015b600a8310610aad5760010192915050565b6000612eb960045490565b905060008211612f195760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610b74565b6001600160a01b038316612f7b5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610b74565b8160046000828254612f8d9190613975565b9091555050600081815260036020526040812080546001600160a01b0319166001600160a01b038616179055612fc390826121d4565b612fd06000848385612a8a565b805b612fdc8383613975565b8110156116cb5760405181906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48061302581613d0d565b915050612fd2565b600881901c60008181526020849052604081205490919060ff808516919082181c801561306f5761305d8161316a565b60ff168203600884901b17935061311c565b600083116130dc5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610b74565b506000199091016000818152602086905260409020549091908015613117576131048161316a565b60ff0360ff16600884901b17935061311c565b61306f565b50505092915050565b600081815b8451811015611783576131568286838151811061314957613149613a2d565b60200260200101516131d4565b91508061316281613d0d565b91505061312a565b60006040518061012001604052806101008152602001613d27610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6131b385613206565b02901c815181106131c6576131c6613a2d565b016020015160f81c92915050565b60008183106131f05760008281526020849052604090206131ff565b60008381526020839052604090205b9392505050565b600080821161321457600080fd5b5060008190031690565b6001600160e01b03198116811461177457600080fd5b60006020828403121561324657600080fd5b81356131ff8161321e565b80356001600160a01b038116811461326857600080fd5b919050565b6000806040838503121561328057600080fd5b61328983613251565b915060208301356001600160601b03811681146132a557600080fd5b809150509250929050565b6000602082840312156132c257600080fd5b5035919050565b60005b838110156132e45781810151838201526020016132cc565b50506000910152565b600081518084526133058160208601602086016132c9565b601f01601f19169290920160200192915050565b6020815260006131ff60208301846132ed565b6000806040838503121561333f57600080fd5b61334883613251565b946020939093013593505050565b60008060006060848603121561336b57600080fd5b61337484613251565b925061338260208501613251565b9150604084013590509250925092565b803561ffff8116811461326857600080fd5b6000602082840312156133b657600080fd5b6131ff82613392565b600080604083850312156133d257600080fd5b50508035926020909101359150565b803563ffffffff8116811461326857600080fd5b6000806040838503121561340857600080fd5b613411836133e1565b915061341f602084016133e1565b90509250929050565b6000806040838503121561343b57600080fd5b61344483613251565b915061341f60208401613392565b815163ffffffff16815261016081016020830151613478602084018263ffffffff169052565b506040830151613490604084018263ffffffff169052565b5060608301516134a8606084018263ffffffff169052565b5060808301516134c0608084018263ffffffff169052565b5060a08301516134d860a084018263ffffffff169052565b5060c08301516134f060c084018263ffffffff169052565b5060e083015161350860e084018263ffffffff169052565b50610100838101516001600160801b038116848301525050610120838101516001600160801b03811684830152505061014092830151919092015290565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561358457613584613546565b604052919050565b60006001600160401b038311156135a5576135a5613546565b6135b8601f8401601f191660200161355c565b90508281528383830111156135cc57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126135f457600080fd5b6131ff8383356020850161358c565b60006020828403121561361557600080fd5b81356001600160401b0381111561362b57600080fd5b6124dc848285016135e3565b6000806040838503121561364a57600080fd5b61365383613392565b91506020808401356001600160401b038082111561367057600080fd5b818601915086601f83011261368457600080fd5b81358181111561369657613696613546565b8060051b91506136a784830161355c565b81815291830184019184810190898411156136c157600080fd5b938501935b838510156136df578435825293850193908501906136c6565b8096505050505050509250929050565b60006020828403121561370157600080fd5b6131ff82613251565b6020808252825182820181905260009190848201906040850190845b8181101561374257835183529284019291840191600101613726565b50909695505050505050565b801515811461177457600080fd5b6000806040838503121561376f57600080fd5b61377883613251565b915060208301356132a58161374e565b6000806000806080858703121561379e57600080fd5b6137a785613251565b93506137b560208601613251565b92506040850135915060608501356001600160401b038111156137d757600080fd5b8501601f810187136137e857600080fd5b6137f78782356020840161358c565b91505092959194509250565b6000806040838503121561381657600080fd5b82356001600160401b038082111561382d57600080fd5b613839868387016135e3565b9350602085013591508082111561384f57600080fd5b5061385c858286016135e3565b9150509250929050565b80356001600160801b038116811461326857600080fd5b6000806040838503121561389057600080fd5b61389983613866565b915061341f60208401613866565b600080604083850312156138ba57600080fd5b6138c383613251565b915061341f60208401613251565b600181811c908216806138e557607f821691505b60208210810361390557634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610aad57610aad61395f565b81810381811115610aad57610aad61395f565b61ffff8181168382160190808211156139b6576139b661395f565b5092915050565b60006001600160801b03808316818516818304811182151516156139e3576139e361395f565b02949350505050565b6000816000190483118215151615613a0657613a0661395f565b500290565b600082613a2857634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b601f821115610dac57600081815260208120601f850160051c81016020861015613a6a5750805b601f850160051c820191505b818110156126d557828155600101613a76565b81516001600160401b03811115613aa257613aa2613546565b613ab681613ab084546138d1565b84613a43565b602080601f831160018114613aeb5760008415613ad35750858301515b600019600386901b1c1916600185901b1785556126d5565b600085815260208120601f198616915b82811015613b1a57888601518255948401946001909101908401613afb565b5085821015613b385787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516020613b5b8285838a016132c9565b855191840191613b6e8184848a016132c9565b8554920191600090613b7f816138d1565b60018281168015613b975760018114613bac57613bd8565b60ff1984168752821515830287019450613bd8565b896000528560002060005b84811015613bd057815489820152908301908701613bb7565b505082870194505b50929a9950505050505050505050565b600060208284031215613bfa57600080fd5b5051919050565b600060208284031215613c1357600080fd5b81516131ff8161374e565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b6001600160401b038281168282160390808211156139b6576139b661395f565b6001600160401b038181168382160190808211156139b6576139b661395f565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ce6908301846132ed565b9695505050505050565b600060208284031215613d0257600080fd5b81516131ff8161321e565b600060018201613d1f57613d1f61395f565b506001019056fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212208bef27268c6b37ad3d71064bebd05368312ec3d8ad1f5e547d880f94f4da093064736f6c63430008100033

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

00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000d94ab5687a231bba44fd05a4d1f4eb1d74f309dc00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000063d44a8c0000000000000000000000000000000000000000000000000000000063d4bb0c0000000000000000000000000000000000000000000000000000000063d449600000000000000000000000000000000000000000000000000000000063d45068000000000000000000000000000000000000000000000000015fb7f9b8c38000000000000000000000000000000000000000000000000000013c3107490280008ee385b35c2db543d44a68012ea76d61c946f68f91e8db38cdb4db3335ac1fec000000000000000000000000000000000000000000000000000000000000000853617267654e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055341524745000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b68747470733a2f2f73617267652d6e66742d6170692e76657263656c2e6170702f6170692f746f6b656e2f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): SargeNFT
Arg [1] : _symbol (string): SARGE
Arg [2] : _uri (string): https://sarge-nft-api.vercel.app/api/token/
Arg [3] : _uriExtension (string):
Arg [4] : _owner (address): 0xd94aB5687a231BbA44FD05a4D1f4Eb1d74f309DC
Arg [5] : _collection (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
24 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [3] : 00000000000000000000000000000000000000000000000000000000000002e0
Arg [4] : 000000000000000000000000d94ab5687a231bba44fd05a4d1f4eb1d74f309dc
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [8] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [9] : 0000000000000000000000000000000000000000000000000000000063d44a8c
Arg [10] : 0000000000000000000000000000000000000000000000000000000063d4bb0c
Arg [11] : 0000000000000000000000000000000000000000000000000000000063d44960
Arg [12] : 0000000000000000000000000000000000000000000000000000000063d45068
Arg [13] : 000000000000000000000000000000000000000000000000015fb7f9b8c38000
Arg [14] : 000000000000000000000000000000000000000000000000013c310749028000
Arg [15] : 8ee385b35c2db543d44a68012ea76d61c946f68f91e8db38cdb4db3335ac1fec
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [17] : 53617267654e4654000000000000000000000000000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [19] : 5341524745000000000000000000000000000000000000000000000000000000
Arg [20] : 000000000000000000000000000000000000000000000000000000000000002b
Arg [21] : 68747470733a2f2f73617267652d6e66742d6170692e76657263656c2e617070
Arg [22] : 2f6170692f746f6b656e2f000000000000000000000000000000000000000000
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

Welcome to The Sarge Universe! We as a AAA world-class team of partnerships who have worked on multiple $1Billion+ gaming franchises, have come together to build The Next Generation of Reward-Based Gaming!The Sarge Universe is a disruptive multi-genre mobile gaming franchise...

Validator Index Block Amount
View All Withdrawals

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

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