ETH Price: $3,481.84 (+1.97%)

Token

Donut Normad (DN)
 

Overview

Max Total Supply

8,496 DN

Holders

7,228

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 DN
0x9b5f981B45B42dC748149DF982AdedA4038d55Ab
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
Donut

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

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

import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC721A-noQuery.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";


contract Donut is ERC2981, ERC721A, Ownable {
    using Address for address payable;
    using Strings for uint256;
    using SafeERC20 for IERC20;

    string public baseURI = "";
    string public notRevealedURI= "https://datanft.mypinata.cloud/ipfs/QmchantEJRqGteuxU7TTT5PLqkNG5xf3tGzugCWNkphedk";

    bool public started = true;
    bool public revealed = false;

    uint256 public maxSupplyAmount = 8888;
    uint256 public publicSalePrice = 0.0098 ether;
    uint32 public walletLimit = 15;


    constructor(
    ) ERC721A("Donut Normad", "DN") {
        setFeeNumerator(800);
    }

    function mint(uint256 amount) external payable {
        require(started, "Sale is not started");
        require(_numberMinted(msg.sender) + amount <= walletLimit, "Exceed the limit of each address");
        require(amount + totalSupply() <= maxSupplyAmount, "REACHED MAX SUPPLY AMOUNT");

        uint256 requiredValue = 0;
        if (_numberMinted(msg.sender) > 0) {
            requiredValue = publicSalePrice * amount;
        } else {
            requiredValue = publicSalePrice * (amount - 1);
        }
        
        require(msg.value >= requiredValue);
        if (msg.value > requiredValue) {
            payable(msg.sender).sendValue(msg.value - requiredValue);
        }
        _safeMint(msg.sender, amount);
    }

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

        if (revealed == false) {
            return notRevealedURI;
        }
        
        return string(abi.encodePacked(baseURI, tokenId.toString(), ".json"));
    }


    struct Status {
        uint256 price;
        uint32 walletLimit;
        uint256 maxSupply;
        uint32 userMinted;
        bool soldout;
        bool started;
    }

    function status(address minter) external view returns (Status memory) {
        return Status({
            price: publicSalePrice,
            walletLimit: walletLimit,
            maxSupply: maxSupplyAmount,

            userMinted: uint32(_numberMinted(minter)),
            soldout: totalSupply() >= maxSupplyAmount,
            started: started
        });
    }

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

    /************************************* onlyOwner ********************/
    function devmint(address to, uint32 amount) external onlyOwner {
        require(amount + totalSupply() <= maxSupplyAmount, "REACHED MAX SUPPLY AMOUNT");
        _safeMint(to, amount);
    }

    function multidevmint(address [] calldata tos, uint32 [] calldata amounts) external onlyOwner {
        require(tos.length == amounts.length, "tos length must eq amounts");
        for(uint l = 0; l < tos.length; l ++) {
            require(amounts[l] + totalSupply() <= maxSupplyAmount, "REACHED MAX SUPPLY AMOUNT");
            _safeMint(tos[l], amounts[l]);
        }
    }

    function setBaseURI(string memory newBaseURI) external onlyOwner {
        baseURI = newBaseURI;
    }

    function setNotRevealedURI(string memory newURI)external onlyOwner {
        notRevealedURI = newURI;
    }

    address private wallet1 = 0xB19a3fA871bab86430A00b1AD224Deaa42964459;
    address private wallet2 = 0x3518226246A8Ad79fCeD9056D48540a1D3a8e2cf;
    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;

        (bool success1, ) = payable(wallet1).call{value: balance*20/100}("");
        require(success1, "Failed to withdraw to wallet1");

        balance = address(this).balance;
        (bool success2, ) = payable(wallet2).call{value: balance}("");
        require(success2, "Failed to withdraw to wallet2");
    }

    function setFeeNumerator(uint96 feeNumerator) public onlyOwner {
        _setDefaultRoyalty(owner(), feeNumerator);
    }

    function setStarted(bool _started) external onlyOwner {
        started = _started;
    }

    function setPrice(uint256 _newValue) external onlyOwner {
        publicSalePrice = _newValue;
    }

    function setMaxSupply(uint32 _newValue) external onlyOwner {
        maxSupplyAmount = _newValue;
    }

    function toggleRevealed() external onlyOwner {
        revealed = !revealed;
    }

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

File 2 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 13 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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:
     *
     * - `tokenId` must be already minted.
     * - `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 4 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 6 of 13 : ERC721A-noQuery.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.0.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

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

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

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

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

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

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

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

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant BITMASK_BURNED = 1 << 224;
    
    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant BITPOS_NEXT_INITIALIZED = 225;

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

    // The tokenId of the next token to be minted.
    uint256 private _currentIndex;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes of the XOR of
        // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
        // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

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

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

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

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

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

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

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

    /**
     * Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
        ownership.burned = packed & BITMASK_BURNED != 0;
    }

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

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

    /**
     * @dev Casts the address to uint256 without masking.
     */
    function _addressToUint256(address value) private pure returns (uint256 result) {
        assembly {
            result := value
        }
    }

    /**
     * @dev Casts the boolean to uint256 without branching.
     */
    function _boolToUint256(bool value) private pure returns (uint256 result) {
        assembly {
            result := value
        }
    }

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

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

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

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

        return _tokenApprovals[tokenId];
    }

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

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _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 {
        _transfer(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

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

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

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

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

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the balance and number minted.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (to.code.length != 0) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex < end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex < end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

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

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

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the balance and number minted.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                (_boolToUint256(quantity == 1) << BITPOS_NEXT_INITIALIZED);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            do {
                emit Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex < end);

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

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

        bool isApprovedOrOwner = (_msgSenderERC721A() == from ||
            isApprovedForAll(from, _msgSenderERC721A()) ||
            getApproved(tokenId) == _msgSenderERC721A());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        delete _tokenApprovals[tokenId];

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

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] =
                _addressToUint256(to) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                BITMASK_NEXT_INITIALIZED;

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

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

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

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

        address from = address(uint160(prevOwnershipPacked));

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSenderERC721A() == from ||
                isApprovedForAll(from, _msgSenderERC721A()) ||
                getApproved(tokenId) == _msgSenderERC721A());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        delete _tokenApprovals[tokenId];

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

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] =
                _addressToUint256(from) |
                (block.timestamp << BITPOS_START_TIMESTAMP) |
                BITMASK_BURNED | 
                BITMASK_NEXT_INITIALIZED;

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

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

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

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

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

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

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function _toString(uint256 value) internal pure returns (string memory ptr) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), 
            // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
            // We will need 1 32-byte word to store the length, 
            // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
            ptr := add(mload(0x40), 128)
            // Update the free memory pointer to allocate.
            mstore(0x40, ptr)

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.4;

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

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

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

    /**
     * The caller cannot approve to the current owner.
     */
    error ApprovalToCurrentOwner();

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

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

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

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

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

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

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

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

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

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 13 : 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 10 of 13 : 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 11 of 13 : 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 12 of 13 : 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 13 of 13 : 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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"amount","type":"uint32"}],"name":"devmint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"uint32[]","name":"amounts","type":"uint32[]"}],"name":"multidevmint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"notRevealedURI","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":"publicSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setFeeNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_newValue","type":"uint32"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newURI","type":"string"}],"name":"setNotRevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newValue","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_started","type":"bool"}],"name":"setStarted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"started","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"status","outputs":[{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint32","name":"walletLimit","type":"uint32"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint32","name":"userMinted","type":"uint32"},{"internalType":"bool","name":"soldout","type":"bool"},{"internalType":"bool","name":"started","type":"bool"}],"internalType":"struct Donut.Status","name":"","type":"tuple"}],"stateMutability":"view","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":[],"name":"toggleRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"walletLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405260006080908152600b906200001a9082620003c3565b5060405180608001604052806052815260200162002be660529139600c90620000449082620003c3565b50600d805461ffff191660011790556122b8600e556622d10c4ecc8000600f556010805477b19a3fa871bab86430a00b1ad224deaa429644590000000f6001600160c01b0319909116179055601180546001600160a01b031916733518226246a8ad79fced9056d48540a1d3a8e2cf179055348015620000c357600080fd5b506040518060400160405280600c81526020016b111bdb9d5d08139bdc9b585960a21b81525060405180604001604052806002815260200161222760f11b8152508160049081620001159190620003c3565b506005620001248282620003c3565b505060016002555062000137336200014a565b620001446103206200019c565b6200048f565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a546001600160a01b03163314620001fc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6200021a62000213600a546001600160a01b031690565b826200021d565b50565b6127106001600160601b03821611156200028d5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401620001f3565b6001600160a01b038216620002e55760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620001f3565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200034957607f821691505b6020821081036200036a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003be57600081815260208120601f850160051c81016020861015620003995750805b601f850160051c820191505b81811015620003ba57828155600101620003a5565b5050505b505050565b81516001600160401b03811115620003df57620003df6200031e565b620003f781620003f0845462000334565b8462000370565b602080601f8311600181146200042f5760008415620004165750858301515b600019600386901b1c1916600185901b178555620003ba565b600085815260208120601f198616915b8281101562000460578886015182559484019460019091019084016200043f565b50858210156200047f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612747806200049f6000396000f3fe6080604052600436106102255760003560e01c80636c0360eb11610123578063a22cb465116100ab578063e985e9c51161006f578063e985e9c51461069f578063ef6b141a146106e8578063f2c4ce1e14610708578063f2fde38b14610728578063f9da32241461074857600080fd5b8063a22cb46514610609578063b0dc4efc14610629578063b5b9e6691461063f578063b88d4fde1461065f578063c87b56dd1461067f57600080fd5b80638da5cb5b116100f25780638da5cb5b1461058d57806391b7f5ed146105ab57806395d89b41146105cb5780639b6860c8146105e0578063a0712d68146105f657600080fd5b80636c0360eb1461052e57806370a0823114610543578063715018a614610563578063722503801461057857600080fd5b80633ccfd60b116101b15780635bc020bc116101755780635bc020bc1461043d5780636352211e14610452578063645b8b1b14610472578063653a819e146104ee57806366c152611461050e57600080fd5b80633ccfd60b146103a957806342842e0e146103be57806342966c68146103de57806351830227146103fe57806355f804b31461041d57600080fd5b806318160ddd116101f857806318160ddd146102db5780631f2698ab146102fe57806323b872dd146103185780632a55205a146103385780633c8463a11461037757600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc14610281578063095ea7b3146102b9575b600080fd5b34801561023657600080fd5b5061024a610245366004611f0f565b610768565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b506102746107ae565b6040516102569190611f84565b34801561028d57600080fd5b506102a161029c366004611f97565b610840565b6040516001600160a01b039091168152602001610256565b3480156102c557600080fd5b506102d96102d4366004611fcc565b610884565b005b3480156102e757600080fd5b506102f0610956565b604051908152602001610256565b34801561030a57600080fd5b50600d5461024a9060ff1681565b34801561032457600080fd5b506102d9610333366004611ff6565b610964565b34801561034457600080fd5b50610358610353366004612032565b610974565b604080516001600160a01b039093168352602083019190915201610256565b34801561038357600080fd5b506010546103949063ffffffff1681565b60405163ffffffff9091168152602001610256565b3480156103b557600080fd5b506102d9610a22565b3480156103ca57600080fd5b506102d96103d9366004611ff6565b610bbd565b3480156103ea57600080fd5b506102d96103f9366004611f97565b610bd8565b34801561040a57600080fd5b50600d5461024a90610100900460ff1681565b34801561042957600080fd5b506102d96104383660046120e0565b610be4565b34801561044957600080fd5b506102d9610c1e565b34801561045e57600080fd5b506102a161046d366004611f97565b610c65565b34801561047e57600080fd5b5061049261048d366004612129565b610c70565b6040516102569190600060c08201905082518252602083015163ffffffff808216602085015260408501516040850152806060860151166060850152505060808301511515608083015260a0830151151560a083015292915050565b3480156104fa57600080fd5b506102d9610509366004612144565b610d04565b34801561051a57600080fd5b506102d96105293660046121b2565b610d49565b34801561053a57600080fd5b50610274610ea2565b34801561054f57600080fd5b506102f061055e366004612129565b610f30565b34801561056f57600080fd5b506102d9610f7f565b34801561058457600080fd5b50610274610fb5565b34801561059957600080fd5b50600a546001600160a01b03166102a1565b3480156105b757600080fd5b506102d96105c6366004611f97565b610fc2565b3480156105d757600080fd5b50610274610ff1565b3480156105ec57600080fd5b506102f0600f5481565b6102d9610604366004611f97565b611000565b34801561061557600080fd5b506102d961062436600461222e565b61115b565b34801561063557600080fd5b506102f0600e5481565b34801561064b57600080fd5b506102d961065a366004612275565b6111f0565b34801561066b57600080fd5b506102d961067a36600461229f565b611263565b34801561068b57600080fd5b5061027461069a366004611f97565b6112ad565b3480156106ab57600080fd5b5061024a6106ba36600461231b565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b3480156106f457600080fd5b506102d9610703366004612345565b6113f4565b34801561071457600080fd5b506102d96107233660046120e0565b611431565b34801561073457600080fd5b506102d9610743366004612129565b611467565b34801561075457600080fd5b506102d9610763366004612360565b6114ff565b60006001600160e01b0319821663152a902d60e11b148061079957506001600160e01b0319821663184371e560e31b145b806107a857506107a882611534565b92915050565b6060600480546107bd9061237b565b80601f01602080910402602001604051908101604052809291908181526020018280546107e99061237b565b80156108365780601f1061080b57610100808354040283529160200191610836565b820191906000526020600020905b81548152906001019060200180831161081957829003601f168201915b5050505050905090565b600061084b82611582565b610868576040516333d1c03960e21b815260040160405180910390fd5b506000908152600860205260409020546001600160a01b031690565b600061088f826115b7565b9050806001600160a01b0316836001600160a01b0316036108c35760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146108fa576108dd81336106ba565b6108fa576040516367d9dca160e11b815260040160405180910390fd5b60008281526008602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600354600254036000190190565b61096f83838361162d565b505050565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109e95750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610a08906001600160601b0316876123cb565b610a129190612400565b91519350909150505b9250929050565b600a546001600160a01b03163314610a555760405162461bcd60e51b8152600401610a4c90612414565b60405180910390fd5b601054479060009064010000000090046001600160a01b03166064610a7b8460146123cb565b610a859190612400565b604051600081818185875af1925050503d8060008114610ac1576040519150601f19603f3d011682016040523d82523d6000602084013e610ac6565b606091505b5050905080610b175760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20776974686472617720746f2077616c6c6574310000006044820152606401610a4c565b6011546040514793506000916001600160a01b03169084908381818185875af1925050503d8060008114610b67576040519150601f19603f3d011682016040523d82523d6000602084013e610b6c565b606091505b505090508061096f5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20776974686472617720746f2077616c6c6574320000006044820152606401610a4c565b61096f83838360405180602001604052806000815250611263565b610be1816117c0565b50565b600a546001600160a01b03163314610c0e5760405162461bcd60e51b8152600401610a4c90612414565b600b610c1a8282612497565b5050565b600a546001600160a01b03163314610c485760405162461bcd60e51b8152600401610a4c90612414565b600d805461ff001981166101009182900460ff1615909102179055565b60006107a8826115b7565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040805160c081018252600f54815260105463ffffffff166020820152600e549181019190915260608101610cd6846117cb565b63ffffffff168152602001600e54610cec610956565b10158152600d5460ff16151560209091015292915050565b600a546001600160a01b03163314610d2e5760405162461bcd60e51b8152600401610a4c90612414565b610be1610d43600a546001600160a01b031690565b826117f4565b600a546001600160a01b03163314610d735760405162461bcd60e51b8152600401610a4c90612414565b828114610dc25760405162461bcd60e51b815260206004820152601a60248201527f746f73206c656e677468206d75737420657120616d6f756e74730000000000006044820152606401610a4c565b60005b83811015610e9b57600e54610dd8610956565b848484818110610dea57610dea612557565b9050602002016020810190610dff9190612360565b63ffffffff16610e0f919061256d565b1115610e2d5760405162461bcd60e51b8152600401610a4c90612585565b610e89858583818110610e4257610e42612557565b9050602002016020810190610e579190612129565b848484818110610e6957610e69612557565b9050602002016020810190610e7e9190612360565b63ffffffff166118f1565b80610e93816125bc565b915050610dc5565b5050505050565b600b8054610eaf9061237b565b80601f0160208091040260200160405190810160405280929190818152602001828054610edb9061237b565b8015610f285780601f10610efd57610100808354040283529160200191610f28565b820191906000526020600020905b815481529060010190602001808311610f0b57829003601f168201915b505050505081565b60006001600160a01b038216610f59576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526007602052604090205467ffffffffffffffff1690565b600a546001600160a01b03163314610fa95760405162461bcd60e51b8152600401610a4c90612414565b610fb3600061190b565b565b600c8054610eaf9061237b565b600a546001600160a01b03163314610fec5760405162461bcd60e51b8152600401610a4c90612414565b600f55565b6060600580546107bd9061237b565b600d5460ff166110485760405162461bcd60e51b815260206004820152601360248201527214d85b19481a5cc81b9bdd081cdd185c9d1959606a1b6044820152606401610a4c565b60105463ffffffff168161105b336117cb565b611065919061256d565b11156110b35760405162461bcd60e51b815260206004820181905260248201527f45786365656420746865206c696d6974206f66206561636820616464726573736044820152606401610a4c565b600e546110be610956565b6110c8908361256d565b11156110e65760405162461bcd60e51b8152600401610a4c90612585565b6000806110f2336117cb565b111561110d5781600f5461110691906123cb565b9050611128565b6111186001836125d5565b600f5461112591906123cb565b90505b8034101561113557600080fd5b803411156111515761115161114a82346125d5565b339061195d565b610c1a33836118f1565b336001600160a01b038316036111845760405163b06307db60e01b815260040160405180910390fd5b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316331461121a5760405162461bcd60e51b8152600401610a4c90612414565b600e54611225610956565b6112359063ffffffff841661256d565b11156112535760405162461bcd60e51b8152600401610a4c90612585565b610c1a828263ffffffff166118f1565b61126e84848461162d565b6001600160a01b0383163b156112a75761128a84848484611a76565b6112a7576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60606112b882611582565b61131c5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610a4c565b600d54610100900460ff1615156000036113c257600c805461133d9061237b565b80601f01602080910402602001604051908101604052809291908181526020018280546113699061237b565b80156113b65780601f1061138b576101008083540402835291602001916113b6565b820191906000526020600020905b81548152906001019060200180831161139957829003601f168201915b50505050509050919050565b600b6113cd83611b62565b6040516020016113de9291906125ec565b6040516020818303038152906040529050919050565b600a546001600160a01b0316331461141e5760405162461bcd60e51b8152600401610a4c90612414565b600d805460ff1916911515919091179055565b600a546001600160a01b0316331461145b5760405162461bcd60e51b8152600401610a4c90612414565b600c610c1a8282612497565b600a546001600160a01b031633146114915760405162461bcd60e51b8152600401610a4c90612414565b6001600160a01b0381166114f65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a4c565b610be18161190b565b600a546001600160a01b031633146115295760405162461bcd60e51b8152600401610a4c90612414565b63ffffffff16600e55565b60006301ffc9a760e01b6001600160e01b03198316148061156557506380ac58cd60e01b6001600160e01b03198316145b806107a85750506001600160e01b031916635b5e139f60e01b1490565b600081600111158015611596575060025482105b80156107a8575050600090815260066020526040902054600160e01b161590565b60008180600111611614576002548110156116145760008181526006602052604081205490600160e01b82169003611612575b8060000361160b5750600019016000818152600660205260409020546115ea565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b6000611638826115b7565b9050836001600160a01b0316816001600160a01b03161461166b5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611689575061168985336106ba565b806116a457503361169984610840565b6001600160a01b0316145b9050806116c457604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166116eb57604051633a954ecd60e21b815260040160405180910390fd5b600083815260086020908152604080832080546001600160a01b03191690556001600160a01b038881168452600783528184208054600019019055871683528083208054600101905585835260069091528120600160e11b4260a01b871781179091558316900361178c5760018301600081815260066020526040812054900361178a57600254811461178a5760008181526006602052604090208390555b505b82846001600160a01b0316866001600160a01b03166000805160206126f283398151915260405160405180910390a4610e9b565b610be1816000611c63565b6001600160a01b03166000908152600760205260409081902054901c67ffffffffffffffff1690565b6127106001600160601b03821611156118625760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610a4c565b6001600160a01b0382166118b85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a4c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b610c1a828260405180602001604052806000815250611daa565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b804710156119ad5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a4c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119fa576040519150601f19603f3d011682016040523d82523d6000602084013e6119ff565b606091505b505090508061096f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a4c565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611aab903390899088908890600401612683565b6020604051808303816000875af1925050508015611ae6575060408051601f3d908101601f19168201909252611ae3918101906126c0565b60015b611b44573d808015611b14576040519150601f19603f3d011682016040523d82523d6000602084013e611b19565b606091505b508051600003611b3c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606081600003611b895750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611bb35780611b9d816125bc565b9150611bac9050600a83612400565b9150611b8d565b60008167ffffffffffffffff811115611bce57611bce612054565b6040519080825280601f01601f191660200182016040528015611bf8576020820181803683370190505b5090505b8415611b5a57611c0d6001836125d5565b9150611c1a600a866126dd565b611c2590603061256d565b60f81b818381518110611c3a57611c3a612557565b60200101906001600160f81b031916908160001a905350611c5c600a86612400565b9450611bfc565b6000611c6e836115b7565b9050808215611cd2576000336001600160a01b0383161480611c955750611c9582336106ba565b80611cb0575033611ca586610840565b6001600160a01b0316145b905080611cd057604051632ce44b5f60e11b815260040160405180910390fd5b505b600084815260086020908152604080832080546001600160a01b03191690556001600160a01b03841683526007825280832080546fffffffffffffffffffffffffffffffff01905586835260069091528120600360e01b4260a01b8417179055600160e11b83169003611d7557600184016000818152600660205260408120549003611d73576002548114611d735760008181526006602052604090208390555b505b60405184906000906001600160a01b038416906000805160206126f2833981519152908390a450506003805460010190555050565b6002546001600160a01b038416611dd357604051622e076360e81b815260040160405180910390fd5b82600003611df45760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03841660008181526007602090815260408083208054680100000000000000018902019055848352600690915290204260a01b86176001861460e11b1790558190818501903b15611eb7575b60405182906001600160a01b038816906000906000805160206126f2833981519152908290a4611e806000878480600101955087611a76565b611e9d576040516368d2bf6b60e11b815260040160405180910390fd5b808210611e47578260025414611eb257600080fd5b611eea565b5b6040516001830192906001600160a01b038816906000906000805160206126f2833981519152908290a4808210611eb8575b506002556112a7600085838684565b6001600160e01b031981168114610be157600080fd5b600060208284031215611f2157600080fd5b813561160b81611ef9565b60005b83811015611f47578181015183820152602001611f2f565b838111156112a75750506000910152565b60008151808452611f70816020860160208601611f2c565b601f01601f19169290920160200192915050565b60208152600061160b6020830184611f58565b600060208284031215611fa957600080fd5b5035919050565b80356001600160a01b0381168114611fc757600080fd5b919050565b60008060408385031215611fdf57600080fd5b611fe883611fb0565b946020939093013593505050565b60008060006060848603121561200b57600080fd5b61201484611fb0565b925061202260208501611fb0565b9150604084013590509250925092565b6000806040838503121561204557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561208557612085612054565b604051601f8501601f19908116603f011681019082821181831017156120ad576120ad612054565b816040528093508581528686860111156120c657600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156120f257600080fd5b813567ffffffffffffffff81111561210957600080fd5b8201601f8101841361211a57600080fd5b611b5a8482356020840161206a565b60006020828403121561213b57600080fd5b61160b82611fb0565b60006020828403121561215657600080fd5b81356001600160601b038116811461160b57600080fd5b60008083601f84011261217f57600080fd5b50813567ffffffffffffffff81111561219757600080fd5b6020830191508360208260051b8501011115610a1b57600080fd5b600080600080604085870312156121c857600080fd5b843567ffffffffffffffff808211156121e057600080fd5b6121ec8883890161216d565b9096509450602087013591508082111561220557600080fd5b506122128782880161216d565b95989497509550505050565b80358015158114611fc757600080fd5b6000806040838503121561224157600080fd5b61224a83611fb0565b91506122586020840161221e565b90509250929050565b803563ffffffff81168114611fc757600080fd5b6000806040838503121561228857600080fd5b61229183611fb0565b915061225860208401612261565b600080600080608085870312156122b557600080fd5b6122be85611fb0565b93506122cc60208601611fb0565b925060408501359150606085013567ffffffffffffffff8111156122ef57600080fd5b8501601f8101871361230057600080fd5b61230f8782356020840161206a565b91505092959194509250565b6000806040838503121561232e57600080fd5b61233783611fb0565b915061225860208401611fb0565b60006020828403121561235757600080fd5b61160b8261221e565b60006020828403121561237257600080fd5b61160b82612261565b600181811c9082168061238f57607f821691505b6020821081036123af57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156123e5576123e56123b5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261240f5761240f6123ea565b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b601f82111561096f57600081815260208120601f850160051c810160208610156124705750805b601f850160051c820191505b8181101561248f5782815560010161247c565b505050505050565b815167ffffffffffffffff8111156124b1576124b1612054565b6124c5816124bf845461237b565b84612449565b602080601f8311600181146124fa57600084156124e25750858301515b600019600386901b1c1916600185901b17855561248f565b600085815260208120601f198616915b828110156125295788860151825594840194600190910190840161250a565b50858210156125475787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60008219821115612580576125806123b5565b500190565b60208082526019908201527f52454143484544204d415820535550504c5920414d4f554e5400000000000000604082015260600190565b6000600182016125ce576125ce6123b5565b5060010190565b6000828210156125e7576125e76123b5565b500390565b60008084546125fa8161237b565b60018281168015612612576001811461262757612656565b60ff1984168752821515830287019450612656565b8860005260208060002060005b8581101561264d5781548a820152908401908201612634565b50505082870194505b50505050835161266a818360208801611f2c565b64173539b7b760d91b9101908152600501949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126b690830184611f58565b9695505050505050565b6000602082840312156126d257600080fd5b815161160b81611ef9565b6000826126ec576126ec6123ea565b50069056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122005f4bc1dd8452a0bcad120f3bbe8f5d0ebedc3853edc774ed07ba8bb195bab6e64736f6c634300080f003368747470733a2f2f646174616e66742e6d7970696e6174612e636c6f75642f697066732f516d6368616e74454a52714774657578553754545435504c716b4e473578663374477a756743574e6b706865646b

Deployed Bytecode

0x6080604052600436106102255760003560e01c80636c0360eb11610123578063a22cb465116100ab578063e985e9c51161006f578063e985e9c51461069f578063ef6b141a146106e8578063f2c4ce1e14610708578063f2fde38b14610728578063f9da32241461074857600080fd5b8063a22cb46514610609578063b0dc4efc14610629578063b5b9e6691461063f578063b88d4fde1461065f578063c87b56dd1461067f57600080fd5b80638da5cb5b116100f25780638da5cb5b1461058d57806391b7f5ed146105ab57806395d89b41146105cb5780639b6860c8146105e0578063a0712d68146105f657600080fd5b80636c0360eb1461052e57806370a0823114610543578063715018a614610563578063722503801461057857600080fd5b80633ccfd60b116101b15780635bc020bc116101755780635bc020bc1461043d5780636352211e14610452578063645b8b1b14610472578063653a819e146104ee57806366c152611461050e57600080fd5b80633ccfd60b146103a957806342842e0e146103be57806342966c68146103de57806351830227146103fe57806355f804b31461041d57600080fd5b806318160ddd116101f857806318160ddd146102db5780631f2698ab146102fe57806323b872dd146103185780632a55205a146103385780633c8463a11461037757600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc14610281578063095ea7b3146102b9575b600080fd5b34801561023657600080fd5b5061024a610245366004611f0f565b610768565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b506102746107ae565b6040516102569190611f84565b34801561028d57600080fd5b506102a161029c366004611f97565b610840565b6040516001600160a01b039091168152602001610256565b3480156102c557600080fd5b506102d96102d4366004611fcc565b610884565b005b3480156102e757600080fd5b506102f0610956565b604051908152602001610256565b34801561030a57600080fd5b50600d5461024a9060ff1681565b34801561032457600080fd5b506102d9610333366004611ff6565b610964565b34801561034457600080fd5b50610358610353366004612032565b610974565b604080516001600160a01b039093168352602083019190915201610256565b34801561038357600080fd5b506010546103949063ffffffff1681565b60405163ffffffff9091168152602001610256565b3480156103b557600080fd5b506102d9610a22565b3480156103ca57600080fd5b506102d96103d9366004611ff6565b610bbd565b3480156103ea57600080fd5b506102d96103f9366004611f97565b610bd8565b34801561040a57600080fd5b50600d5461024a90610100900460ff1681565b34801561042957600080fd5b506102d96104383660046120e0565b610be4565b34801561044957600080fd5b506102d9610c1e565b34801561045e57600080fd5b506102a161046d366004611f97565b610c65565b34801561047e57600080fd5b5061049261048d366004612129565b610c70565b6040516102569190600060c08201905082518252602083015163ffffffff808216602085015260408501516040850152806060860151166060850152505060808301511515608083015260a0830151151560a083015292915050565b3480156104fa57600080fd5b506102d9610509366004612144565b610d04565b34801561051a57600080fd5b506102d96105293660046121b2565b610d49565b34801561053a57600080fd5b50610274610ea2565b34801561054f57600080fd5b506102f061055e366004612129565b610f30565b34801561056f57600080fd5b506102d9610f7f565b34801561058457600080fd5b50610274610fb5565b34801561059957600080fd5b50600a546001600160a01b03166102a1565b3480156105b757600080fd5b506102d96105c6366004611f97565b610fc2565b3480156105d757600080fd5b50610274610ff1565b3480156105ec57600080fd5b506102f0600f5481565b6102d9610604366004611f97565b611000565b34801561061557600080fd5b506102d961062436600461222e565b61115b565b34801561063557600080fd5b506102f0600e5481565b34801561064b57600080fd5b506102d961065a366004612275565b6111f0565b34801561066b57600080fd5b506102d961067a36600461229f565b611263565b34801561068b57600080fd5b5061027461069a366004611f97565b6112ad565b3480156106ab57600080fd5b5061024a6106ba36600461231b565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b3480156106f457600080fd5b506102d9610703366004612345565b6113f4565b34801561071457600080fd5b506102d96107233660046120e0565b611431565b34801561073457600080fd5b506102d9610743366004612129565b611467565b34801561075457600080fd5b506102d9610763366004612360565b6114ff565b60006001600160e01b0319821663152a902d60e11b148061079957506001600160e01b0319821663184371e560e31b145b806107a857506107a882611534565b92915050565b6060600480546107bd9061237b565b80601f01602080910402602001604051908101604052809291908181526020018280546107e99061237b565b80156108365780601f1061080b57610100808354040283529160200191610836565b820191906000526020600020905b81548152906001019060200180831161081957829003601f168201915b5050505050905090565b600061084b82611582565b610868576040516333d1c03960e21b815260040160405180910390fd5b506000908152600860205260409020546001600160a01b031690565b600061088f826115b7565b9050806001600160a01b0316836001600160a01b0316036108c35760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146108fa576108dd81336106ba565b6108fa576040516367d9dca160e11b815260040160405180910390fd5b60008281526008602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600354600254036000190190565b61096f83838361162d565b505050565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109e95750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610a08906001600160601b0316876123cb565b610a129190612400565b91519350909150505b9250929050565b600a546001600160a01b03163314610a555760405162461bcd60e51b8152600401610a4c90612414565b60405180910390fd5b601054479060009064010000000090046001600160a01b03166064610a7b8460146123cb565b610a859190612400565b604051600081818185875af1925050503d8060008114610ac1576040519150601f19603f3d011682016040523d82523d6000602084013e610ac6565b606091505b5050905080610b175760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20776974686472617720746f2077616c6c6574310000006044820152606401610a4c565b6011546040514793506000916001600160a01b03169084908381818185875af1925050503d8060008114610b67576040519150601f19603f3d011682016040523d82523d6000602084013e610b6c565b606091505b505090508061096f5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f20776974686472617720746f2077616c6c6574320000006044820152606401610a4c565b61096f83838360405180602001604052806000815250611263565b610be1816117c0565b50565b600a546001600160a01b03163314610c0e5760405162461bcd60e51b8152600401610a4c90612414565b600b610c1a8282612497565b5050565b600a546001600160a01b03163314610c485760405162461bcd60e51b8152600401610a4c90612414565b600d805461ff001981166101009182900460ff1615909102179055565b60006107a8826115b7565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091526040805160c081018252600f54815260105463ffffffff166020820152600e549181019190915260608101610cd6846117cb565b63ffffffff168152602001600e54610cec610956565b10158152600d5460ff16151560209091015292915050565b600a546001600160a01b03163314610d2e5760405162461bcd60e51b8152600401610a4c90612414565b610be1610d43600a546001600160a01b031690565b826117f4565b600a546001600160a01b03163314610d735760405162461bcd60e51b8152600401610a4c90612414565b828114610dc25760405162461bcd60e51b815260206004820152601a60248201527f746f73206c656e677468206d75737420657120616d6f756e74730000000000006044820152606401610a4c565b60005b83811015610e9b57600e54610dd8610956565b848484818110610dea57610dea612557565b9050602002016020810190610dff9190612360565b63ffffffff16610e0f919061256d565b1115610e2d5760405162461bcd60e51b8152600401610a4c90612585565b610e89858583818110610e4257610e42612557565b9050602002016020810190610e579190612129565b848484818110610e6957610e69612557565b9050602002016020810190610e7e9190612360565b63ffffffff166118f1565b80610e93816125bc565b915050610dc5565b5050505050565b600b8054610eaf9061237b565b80601f0160208091040260200160405190810160405280929190818152602001828054610edb9061237b565b8015610f285780601f10610efd57610100808354040283529160200191610f28565b820191906000526020600020905b815481529060010190602001808311610f0b57829003601f168201915b505050505081565b60006001600160a01b038216610f59576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526007602052604090205467ffffffffffffffff1690565b600a546001600160a01b03163314610fa95760405162461bcd60e51b8152600401610a4c90612414565b610fb3600061190b565b565b600c8054610eaf9061237b565b600a546001600160a01b03163314610fec5760405162461bcd60e51b8152600401610a4c90612414565b600f55565b6060600580546107bd9061237b565b600d5460ff166110485760405162461bcd60e51b815260206004820152601360248201527214d85b19481a5cc81b9bdd081cdd185c9d1959606a1b6044820152606401610a4c565b60105463ffffffff168161105b336117cb565b611065919061256d565b11156110b35760405162461bcd60e51b815260206004820181905260248201527f45786365656420746865206c696d6974206f66206561636820616464726573736044820152606401610a4c565b600e546110be610956565b6110c8908361256d565b11156110e65760405162461bcd60e51b8152600401610a4c90612585565b6000806110f2336117cb565b111561110d5781600f5461110691906123cb565b9050611128565b6111186001836125d5565b600f5461112591906123cb565b90505b8034101561113557600080fd5b803411156111515761115161114a82346125d5565b339061195d565b610c1a33836118f1565b336001600160a01b038316036111845760405163b06307db60e01b815260040160405180910390fd5b3360008181526009602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316331461121a5760405162461bcd60e51b8152600401610a4c90612414565b600e54611225610956565b6112359063ffffffff841661256d565b11156112535760405162461bcd60e51b8152600401610a4c90612585565b610c1a828263ffffffff166118f1565b61126e84848461162d565b6001600160a01b0383163b156112a75761128a84848484611a76565b6112a7576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60606112b882611582565b61131c5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610a4c565b600d54610100900460ff1615156000036113c257600c805461133d9061237b565b80601f01602080910402602001604051908101604052809291908181526020018280546113699061237b565b80156113b65780601f1061138b576101008083540402835291602001916113b6565b820191906000526020600020905b81548152906001019060200180831161139957829003601f168201915b50505050509050919050565b600b6113cd83611b62565b6040516020016113de9291906125ec565b6040516020818303038152906040529050919050565b600a546001600160a01b0316331461141e5760405162461bcd60e51b8152600401610a4c90612414565b600d805460ff1916911515919091179055565b600a546001600160a01b0316331461145b5760405162461bcd60e51b8152600401610a4c90612414565b600c610c1a8282612497565b600a546001600160a01b031633146114915760405162461bcd60e51b8152600401610a4c90612414565b6001600160a01b0381166114f65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a4c565b610be18161190b565b600a546001600160a01b031633146115295760405162461bcd60e51b8152600401610a4c90612414565b63ffffffff16600e55565b60006301ffc9a760e01b6001600160e01b03198316148061156557506380ac58cd60e01b6001600160e01b03198316145b806107a85750506001600160e01b031916635b5e139f60e01b1490565b600081600111158015611596575060025482105b80156107a8575050600090815260066020526040902054600160e01b161590565b60008180600111611614576002548110156116145760008181526006602052604081205490600160e01b82169003611612575b8060000361160b5750600019016000818152600660205260409020546115ea565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b6000611638826115b7565b9050836001600160a01b0316816001600160a01b03161461166b5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611689575061168985336106ba565b806116a457503361169984610840565b6001600160a01b0316145b9050806116c457604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166116eb57604051633a954ecd60e21b815260040160405180910390fd5b600083815260086020908152604080832080546001600160a01b03191690556001600160a01b038881168452600783528184208054600019019055871683528083208054600101905585835260069091528120600160e11b4260a01b871781179091558316900361178c5760018301600081815260066020526040812054900361178a57600254811461178a5760008181526006602052604090208390555b505b82846001600160a01b0316866001600160a01b03166000805160206126f283398151915260405160405180910390a4610e9b565b610be1816000611c63565b6001600160a01b03166000908152600760205260409081902054901c67ffffffffffffffff1690565b6127106001600160601b03821611156118625760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610a4c565b6001600160a01b0382166118b85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a4c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b610c1a828260405180602001604052806000815250611daa565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b804710156119ad5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a4c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119fa576040519150601f19603f3d011682016040523d82523d6000602084013e6119ff565b606091505b505090508061096f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a4c565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611aab903390899088908890600401612683565b6020604051808303816000875af1925050508015611ae6575060408051601f3d908101601f19168201909252611ae3918101906126c0565b60015b611b44573d808015611b14576040519150601f19603f3d011682016040523d82523d6000602084013e611b19565b606091505b508051600003611b3c576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606081600003611b895750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611bb35780611b9d816125bc565b9150611bac9050600a83612400565b9150611b8d565b60008167ffffffffffffffff811115611bce57611bce612054565b6040519080825280601f01601f191660200182016040528015611bf8576020820181803683370190505b5090505b8415611b5a57611c0d6001836125d5565b9150611c1a600a866126dd565b611c2590603061256d565b60f81b818381518110611c3a57611c3a612557565b60200101906001600160f81b031916908160001a905350611c5c600a86612400565b9450611bfc565b6000611c6e836115b7565b9050808215611cd2576000336001600160a01b0383161480611c955750611c9582336106ba565b80611cb0575033611ca586610840565b6001600160a01b0316145b905080611cd057604051632ce44b5f60e11b815260040160405180910390fd5b505b600084815260086020908152604080832080546001600160a01b03191690556001600160a01b03841683526007825280832080546fffffffffffffffffffffffffffffffff01905586835260069091528120600360e01b4260a01b8417179055600160e11b83169003611d7557600184016000818152600660205260408120549003611d73576002548114611d735760008181526006602052604090208390555b505b60405184906000906001600160a01b038416906000805160206126f2833981519152908390a450506003805460010190555050565b6002546001600160a01b038416611dd357604051622e076360e81b815260040160405180910390fd5b82600003611df45760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03841660008181526007602090815260408083208054680100000000000000018902019055848352600690915290204260a01b86176001861460e11b1790558190818501903b15611eb7575b60405182906001600160a01b038816906000906000805160206126f2833981519152908290a4611e806000878480600101955087611a76565b611e9d576040516368d2bf6b60e11b815260040160405180910390fd5b808210611e47578260025414611eb257600080fd5b611eea565b5b6040516001830192906001600160a01b038816906000906000805160206126f2833981519152908290a4808210611eb8575b506002556112a7600085838684565b6001600160e01b031981168114610be157600080fd5b600060208284031215611f2157600080fd5b813561160b81611ef9565b60005b83811015611f47578181015183820152602001611f2f565b838111156112a75750506000910152565b60008151808452611f70816020860160208601611f2c565b601f01601f19169290920160200192915050565b60208152600061160b6020830184611f58565b600060208284031215611fa957600080fd5b5035919050565b80356001600160a01b0381168114611fc757600080fd5b919050565b60008060408385031215611fdf57600080fd5b611fe883611fb0565b946020939093013593505050565b60008060006060848603121561200b57600080fd5b61201484611fb0565b925061202260208501611fb0565b9150604084013590509250925092565b6000806040838503121561204557600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561208557612085612054565b604051601f8501601f19908116603f011681019082821181831017156120ad576120ad612054565b816040528093508581528686860111156120c657600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156120f257600080fd5b813567ffffffffffffffff81111561210957600080fd5b8201601f8101841361211a57600080fd5b611b5a8482356020840161206a565b60006020828403121561213b57600080fd5b61160b82611fb0565b60006020828403121561215657600080fd5b81356001600160601b038116811461160b57600080fd5b60008083601f84011261217f57600080fd5b50813567ffffffffffffffff81111561219757600080fd5b6020830191508360208260051b8501011115610a1b57600080fd5b600080600080604085870312156121c857600080fd5b843567ffffffffffffffff808211156121e057600080fd5b6121ec8883890161216d565b9096509450602087013591508082111561220557600080fd5b506122128782880161216d565b95989497509550505050565b80358015158114611fc757600080fd5b6000806040838503121561224157600080fd5b61224a83611fb0565b91506122586020840161221e565b90509250929050565b803563ffffffff81168114611fc757600080fd5b6000806040838503121561228857600080fd5b61229183611fb0565b915061225860208401612261565b600080600080608085870312156122b557600080fd5b6122be85611fb0565b93506122cc60208601611fb0565b925060408501359150606085013567ffffffffffffffff8111156122ef57600080fd5b8501601f8101871361230057600080fd5b61230f8782356020840161206a565b91505092959194509250565b6000806040838503121561232e57600080fd5b61233783611fb0565b915061225860208401611fb0565b60006020828403121561235757600080fd5b61160b8261221e565b60006020828403121561237257600080fd5b61160b82612261565b600181811c9082168061238f57607f821691505b6020821081036123af57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156123e5576123e56123b5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261240f5761240f6123ea565b500490565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b601f82111561096f57600081815260208120601f850160051c810160208610156124705750805b601f850160051c820191505b8181101561248f5782815560010161247c565b505050505050565b815167ffffffffffffffff8111156124b1576124b1612054565b6124c5816124bf845461237b565b84612449565b602080601f8311600181146124fa57600084156124e25750858301515b600019600386901b1c1916600185901b17855561248f565b600085815260208120601f198616915b828110156125295788860151825594840194600190910190840161250a565b50858210156125475787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60008219821115612580576125806123b5565b500190565b60208082526019908201527f52454143484544204d415820535550504c5920414d4f554e5400000000000000604082015260600190565b6000600182016125ce576125ce6123b5565b5060010190565b6000828210156125e7576125e76123b5565b500390565b60008084546125fa8161237b565b60018281168015612612576001811461262757612656565b60ff1984168752821515830287019450612656565b8860005260208060002060005b8581101561264d5781548a820152908401908201612634565b50505082870194505b50505050835161266a818360208801611f2c565b64173539b7b760d91b9101908152600501949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906126b690830184611f58565b9695505050505050565b6000602082840312156126d257600080fd5b815161160b81611ef9565b6000826126ec576126ec6123ea565b50069056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122005f4bc1dd8452a0bcad120f3bbe8f5d0ebedc3853edc774ed07ba8bb195bab6e64736f6c634300080f0033

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

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