ETH Price: $3,179.06 (+3.44%)

Contract

0x3A2e6ea2eFB2fB1D2C2b1Eb364FCA376500D4785
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Grant Role180385072023-09-01 1:44:35444 days ago1693532675IN
0x3A2e6ea2...6500D4785
0 ETH0.0005492210.75901962
Revoke Role167827322023-03-08 9:44:59621 days ago1678268699IN
0x3A2e6ea2...6500D4785
0 ETH0.000594920.18191414
Revoke Role167824682023-03-08 8:51:23621 days ago1678265483IN
0x3A2e6ea2...6500D4785
0 ETH0.0005995822.12072803
Grant Role167824572023-03-08 8:49:11621 days ago1678265351IN
0x3A2e6ea2...6500D4785
0 ETH0.0011158921.85977867
Withdraw156999312022-10-08 0:56:59772 days ago1665190619IN
0x3A2e6ea2...6500D4785
0 ETH0.000164525.29003435
Grant Role156999272022-10-08 0:56:11772 days ago1665190571IN
0x3A2e6ea2...6500D4785
0 ETH0.000293955.71670648
Whitelist Sale156993482022-10-07 23:00:23772 days ago1665183623IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000261675.52432135
Whitelist Sale156993482022-10-07 23:00:23772 days ago1665183623IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000194484.1059229
Whitelist Sale156993482022-10-07 23:00:23772 days ago1665183623IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000204584.31714963
Permit Sale156993482022-10-07 23:00:23772 days ago1665183623IN
0x3A2e6ea2...6500D4785
0.1615 ETH0.000202084.41856069
Whitelist Sale156988232022-10-07 21:14:59772 days ago1665177299IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001179728.80128456
Whitelist Sale156988152022-10-07 21:13:23772 days ago1665177203IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000827088.28319842
Whitelist Sale156988052022-10-07 21:11:23772 days ago1665177083IN
0x3A2e6ea2...6500D4785
0.171 ETH0.00111628.32669854
Whitelist Sale156987982022-10-07 21:09:59772 days ago1665176999IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000916669.18022479
Whitelist Sale156987932022-10-07 21:08:59772 days ago1665176939IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001185658.84474984
Whitelist Sale156987762022-10-07 21:05:35772 days ago1665176735IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000851738.53056405
Whitelist Sale156987742022-10-07 21:04:59772 days ago1665176699IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001157928.63830892
Whitelist Sale156987682022-10-07 21:03:47772 days ago1665176627IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000926069.27429533
Whitelist Sale156987652022-10-07 21:03:11772 days ago1665176591IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001186918.85408834
Whitelist Sale156987582022-10-07 21:01:47772 days ago1665176507IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000971739.73037252
Whitelist Sale156987552022-10-07 21:01:11772 days ago1665176471IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001295099.66014784
Whitelist Sale156987492022-10-07 20:59:59772 days ago1665176399IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000784237.85369876
Whitelist Sale156987452022-10-07 20:59:11772 days ago1665176351IN
0x3A2e6ea2...6500D4785
0.171 ETH0.001094088.16139694
Whitelist Sale156987372022-10-07 20:57:35772 days ago1665176255IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000658616.59498159
Whitelist Sale156987332022-10-07 20:56:47772 days ago1665176207IN
0x3A2e6ea2...6500D4785
0.171 ETH0.000948687.07626953
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
156999312022-10-08 0:56:59772 days ago1665190619
0x3A2e6ea2...6500D4785
108.0815 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x52B27e70...9d4295398
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AmbrusStudioSaler

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000 runs

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

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IMintable.sol";

contract AmbrusStudioSaler is AccessControl {
    struct SaleConfig {
        uint32 start;
        uint32 end;
        uint8 discount;
        bytes32 merkleRoot;
    }
    struct FlashSaleConfig {
        uint32 start;
        uint32 end;
        uint8 discount;
        uint16 count;
    }

    using Strings for uint256;

    bytes32 public constant WITHDRAWER_ROLE = keccak256("WITHDRAWER_ROLE");

    address public nft;
    uint16 public count;
    uint256 public basePrice;

    SaleConfig public permitSaleConfig;
    SaleConfig public whitelistSaleConfig;
    FlashSaleConfig public flashSaleConfig;

    uint32 public publicSaleStart;
    uint32 public publicSaleEnd;

    uint16 public soldCount;
    uint16 public flashSaleSoldCount;

    mapping(address => uint256) public permitSaleCount;
    mapping(address => uint256) public whitelistSaleCount;

    constructor(
        address _nft,
        uint16 _count
    ) {
        nft = _nft;
        count = _count;

        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    function setBasePrice(uint256 _basePrice) external onlyRole(DEFAULT_ADMIN_ROLE) {
        basePrice = _basePrice;
    }
    function setPublicSaleTime(uint32 start, uint32 end) external onlyRole(DEFAULT_ADMIN_ROLE) {
        publicSaleStart = start;
        publicSaleEnd = end;
    }

    function permitSalePrice() external view returns (uint256) {
        return basePrice - basePrice * permitSaleConfig.discount / 100;
    }
    function setPermitSaleTime(uint32 start, uint32 end) external onlyRole(DEFAULT_ADMIN_ROLE) {
        permitSaleConfig.start = start;
        permitSaleConfig.end = end;
    }
    function setPermitSaleDiscount(uint8 discount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        permitSaleConfig.discount = discount;
    }
    function setPermitSaleMerkleRoot(bytes32 merkleRoot) external onlyRole(DEFAULT_ADMIN_ROLE) {
        permitSaleConfig.merkleRoot = merkleRoot;
    }

    function permitSale(bytes32[] calldata signature) external payable {
        require(permitSaleCount[msg.sender] < 2, "Exceeds purchase limit");
        permitSaleCount[msg.sender] += 1;
        _restrictedSale(permitSaleConfig, signature);
    }

    function whitelistSalePrice() external view returns (uint256) {
        return basePrice - basePrice * whitelistSaleConfig.discount / 100;
    }
    function setWhitelistSaleTime(uint32 start, uint32 end) external onlyRole(DEFAULT_ADMIN_ROLE) {
        whitelistSaleConfig.start = start;
        whitelistSaleConfig.end = end;
    }
    function setWhitelistSaleDiscount(uint8 discount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        whitelistSaleConfig.discount = discount;
    }
    function setWhitelistSaleMerkleRoot(bytes32 merkleRoot) external onlyRole(DEFAULT_ADMIN_ROLE) {
        whitelistSaleConfig.merkleRoot = merkleRoot;
    }

    function whitelistSale(bytes32[] calldata signature) external payable {
        require(whitelistSaleCount[msg.sender] < 2, "Exceeds purchase limit");
        whitelistSaleCount[msg.sender] += 1;
        _restrictedSale(whitelistSaleConfig, signature);
    }

    function _restrictedSale(SaleConfig memory config, bytes32[] calldata signature) private {
        require(block.timestamp >= config.start, "Sale not start");
        require(block.timestamp < config.end, "Sale has ended");
        require(isAccountAllowed(msg.sender, config.merkleRoot, signature), "You're not allowed to buy");
        require(msg.value == (basePrice - basePrice * config.discount / 100), "Sent value not equal to price");

        _sale();
    }
    function isAccountAllowed(address account, bytes32 merkleRoot, bytes32[] calldata signature) public pure returns (bool) {
        if (merkleRoot == "") {
            return false;
        }

        return MerkleProof.verify(signature, merkleRoot, keccak256(abi.encodePacked(account)));
    }

    function flashSalePrice() external view returns (uint256) {
        return basePrice - basePrice * flashSaleConfig.discount / 100;
    }
    function setFlashSaleTime(uint32 start, uint32 end) external onlyRole(DEFAULT_ADMIN_ROLE) {
        flashSaleConfig.start = start;
        flashSaleConfig.end = end;
    }
    function setFlashSaleDiscount(uint8 discount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        flashSaleConfig.discount = discount;
    }
    function setFlashSaleCount(uint16 _count) external onlyRole(DEFAULT_ADMIN_ROLE) {
        flashSaleConfig.count = _count;
    }

    function flashSale() external payable {
        require(block.timestamp >= flashSaleConfig.start, "Flash sale not start");
        require(block.timestamp < flashSaleConfig.end, "Flash sale has ended");
        require(flashSaleSoldCount < flashSaleConfig.count, "Flash sale sold out");
        require(msg.value == (basePrice - basePrice * flashSaleConfig.discount / 100), "Sent value not equal to price");

        flashSaleSoldCount = flashSaleSoldCount + 1;
        _sale();
    }

    function _sale() private {
        require(soldCount < count, "Sold out");

        soldCount = soldCount + 1;
        uint256 tokenId = soldCount;
        IMintable(nft).mintFor(msg.sender, 1, abi.encodePacked("{", tokenId.toString(), "}:{}"));
    }

    function mintRemaining(address account) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(block.timestamp >= publicSaleStart, "Public sale not start");

        uint256 tokenId = soldCount + 1;
        while (tokenId <= count) {
            IMintable(nft).mintFor(account, 1, abi.encodePacked("{", tokenId.toString(), "}:{}"));
            tokenId = tokenId + 1;
        }

        soldCount = count;
    }

    function withdraw(address account) external onlyRole(WITHDRAWER_ROLE) {
        payable(account).transfer(address(this).balance);
    }

    receive() external payable { }
}

File 2 of 12 : IMintable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

interface IMintable {
    function mintFor(
        address to,
        uint256 quantity,
        bytes calldata mintingBlob
    ) external;
}

File 3 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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);
}

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

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

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

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

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

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

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

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

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

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

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

File 5 of 12 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 6 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // 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);
    }

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

File 7 of 12 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

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

pragma solidity ^0.8.0;

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

File 9 of 12 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 10 of 12 : 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 11 of 12 : 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 12 of 12 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint16","name":"_count","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"basePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flashSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"flashSaleConfig","outputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"},{"internalType":"uint8","name":"discount","type":"uint8"},{"internalType":"uint16","name":"count","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flashSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flashSaleSoldCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes32[]","name":"signature","type":"bytes32[]"}],"name":"isAccountAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"mintRemaining","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"signature","type":"bytes32[]"}],"name":"permitSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"permitSaleConfig","outputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"},{"internalType":"uint8","name":"discount","type":"uint8"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"permitSaleCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permitSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleEnd","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleStart","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_basePrice","type":"uint256"}],"name":"setBasePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_count","type":"uint16"}],"name":"setFlashSaleCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"discount","type":"uint8"}],"name":"setFlashSaleDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"}],"name":"setFlashSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"discount","type":"uint8"}],"name":"setPermitSaleDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setPermitSaleMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"}],"name":"setPermitSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"}],"name":"setPublicSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"discount","type":"uint8"}],"name":"setWhitelistSaleDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setWhitelistSaleMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"}],"name":"setWhitelistSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"soldCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"signature","type":"bytes32[]"}],"name":"whitelistSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"whitelistSaleConfig","outputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"},{"internalType":"uint8","name":"discount","type":"uint8"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistSaleCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106102bf5760003560e01c806391d148541161016e578063c7876ea4116100cb578063de4b32621161007f578063f29ff18011610064578063f29ff18014610890578063fd305aa5146108b0578063fd481a25146108d957600080fd5b8063de4b32621461084b578063ec9b5cb21461086b57600080fd5b8063d40c81c6116100b0578063d40c81c61461078f578063d452e0301461080b578063d547741f1461082b57600080fd5b8063c7876ea414610764578063d3f7084c1461077a57600080fd5b8063ac43f51411610122578063ba0987b711610107578063ba0987b714610702578063bba0ed5714610715578063c11732501461074f57600080fd5b8063ac43f514146106cf578063b09f80f3146106ef57600080fd5b8063a217fddf11610153578063a217fddf1461067a578063a5a0adc61461068f578063ab050bec146106af57600080fd5b806391d14854146106215780639ddf07941461066557600080fd5b806336568abe1161021c5780635797db75116101d05780636bbf7b5f116101b55780636bbf7b5f146105a057806385f438c1146105c057806389805bd9146105f457600080fd5b80635797db7514610516578063656cf9181461053657600080fd5b806345b467da1161020157806345b467da1461049e57806347ccca02146104be57806351cff8d9146104f657600080fd5b806336568abe1461045c57806339f9c82c1461047c57600080fd5b8063248a9ca311610273578063303a06dc11610258578063303a06dc146103ea5780633360caa01461040a57806335077edf1461043c57600080fd5b8063248a9ca31461039a5780632f2ff15d146103ca57600080fd5b80630749abcb116102a45780630749abcb14610335578063138b2b561461037057806320ad58251461039257600080fd5b806301ffc9a7146102cb57806306661abd1461030057600080fd5b366102c657005b600080fd5b3480156102d757600080fd5b506102eb6102e6366004611aa4565b6108f9565b60405190151581526020015b60405180910390f35b34801561030c57600080fd5b5060015461032290600160a01b900461ffff1681565b60405161ffff90911681526020016102f7565b34801561034157600080fd5b50610362610350366004611b02565b600a6020526000908152604090205481565b6040519081526020016102f7565b34801561037c57600080fd5b5061039061038b366004611b1d565b610992565b005b6103906109cc565b3480156103a657600080fd5b506103626103b5366004611b41565b60009081526020819052604090206001015490565b3480156103d657600080fd5b506103906103e5366004611b5a565b610bc8565b3480156103f657600080fd5b50610390610405366004611b9a565b610bf2565b34801561041657600080fd5b506008546104279063ffffffff1681565b60405163ffffffff90911681526020016102f7565b34801561044857600080fd5b50610390610457366004611b9a565b610c2e565b34801561046857600080fd5b50610390610477366004611b5a565b610c6a565b34801561048857600080fd5b5060085461032290600160401b900461ffff1681565b3480156104aa57600080fd5b506103906104b9366004611b02565b610cf6565b3480156104ca57600080fd5b506001546104de906001600160a01b031681565b6040516001600160a01b0390911681526020016102f7565b34801561050257600080fd5b50610390610511366004611b02565b610e63565b34801561052257600080fd5b50610390610531366004611b41565b610ec2565b34801561054257600080fd5b506005546006546105709163ffffffff80821692640100000000830490911691600160401b900460ff169084565b6040805163ffffffff958616815294909316602085015260ff9091169183019190915260608201526080016102f7565b3480156105ac57600080fd5b506103906105bb366004611b41565b610ed3565b3480156105cc57600080fd5b506103627f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e481565b34801561060057600080fd5b5061036261060f366004611b02565b60096020526000908152604090205481565b34801561062d57600080fd5b506102eb61063c366004611b5a565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561067157600080fd5b50610362610ee4565b34801561068657600080fd5b50610362600081565b34801561069b57600080fd5b506103906106aa366004611b9a565b610f20565b3480156106bb57600080fd5b506103906106ca366004611bc4565b610f5c565b3480156106db57600080fd5b506102eb6106ea366004611c33565b610f8d565b6103906106fd366004611c8d565b61101d565b610390610710366004611c8d565b6110ea565b34801561072157600080fd5b506003546004546105709163ffffffff80821692640100000000830490911691600160401b900460ff169084565b34801561075b57600080fd5b506103626111b7565b34801561077057600080fd5b5061036260025481565b34801561078657600080fd5b506103626111d7565b34801561079b57600080fd5b506007546107d79063ffffffff80821691640100000000810490911690600160401b810460ff16906901000000000000000000900461ffff1684565b6040805163ffffffff958616815294909316602085015260ff9091169183019190915261ffff1660608201526080016102f7565b34801561081757600080fd5b50610390610826366004611b9a565b6111f7565b34801561083757600080fd5b50610390610846366004611b5a565b611233565b34801561085757600080fd5b50610390610866366004611b41565b611258565b34801561087757600080fd5b5060085461042790640100000000900463ffffffff1681565b34801561089c57600080fd5b506103906108ab366004611bc4565b611269565b3480156108bc57600080fd5b50600854610322906a0100000000000000000000900461ffff1681565b3480156108e557600080fd5b506103906108f4366004611bc4565b61129a565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061098c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b600061099d816112cb565b506007805461ffff9092166901000000000000000000026affff00000000000000000019909216919091179055565b60075463ffffffff16421015610a295760405162461bcd60e51b815260206004820152601460248201527f466c6173682073616c65206e6f7420737461727400000000000000000000000060448201526064015b60405180910390fd5b600754640100000000900463ffffffff164210610a885760405162461bcd60e51b815260206004820152601460248201527f466c6173682073616c652068617320656e6465640000000000000000000000006044820152606401610a20565b600754600854690100000000000000000090910461ffff9081166a01000000000000000000009092041610610aff5760405162461bcd60e51b815260206004820152601360248201527f466c6173682073616c6520736f6c64206f7574000000000000000000000000006044820152606401610a20565b600754600254606491610b1d91600160401b90910460ff1690611ce5565b610b279190611d12565b600254610b349190611d26565b3414610b825760405162461bcd60e51b815260206004820152601d60248201527f53656e742076616c7565206e6f7420657175616c20746f2070726963650000006044820152606401610a20565b600854610ba2906a0100000000000000000000900461ffff166001611d39565b6008600a6101000a81548161ffff021916908361ffff160217905550610bc66112d8565b565b600082815260208190526040902060010154610be3816112cb565b610bed838361141a565b505050565b6000610bfd816112cb565b506007805463ffffffff9283166401000000000267ffffffffffffffff199091169290931691909117919091179055565b6000610c39816112cb565b506005805463ffffffff9283166401000000000267ffffffffffffffff199091169290931691909117919091179055565b6001600160a01b0381163314610ce85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610a20565b610cf282826114b8565b5050565b6000610d01816112cb565b60085463ffffffff16421015610d595760405162461bcd60e51b815260206004820152601560248201527f5075626c69632073616c65206e6f7420737461727400000000000000000000006044820152606401610a20565b600854600090610d7590600160401b900461ffff166001611d39565b61ffff1690505b600154600160a01b900461ffff168111610e3257600180546001600160a01b0316906319ee6e3f908590610daf85611537565b604051602001610dbf9190611d7f565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401610dec93929190611e17565b600060405180830381600087803b158015610e0657600080fd5b505af1158015610e1a573d6000803e3d6000fd5b50505050806001610e2b9190611e3f565b9050610d7c565b50506001546008805469ffff00000000000000001916600160a01b90920461ffff16600160401b0291909117905550565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e4610e8d816112cb565b6040516001600160a01b038316904780156108fc02916000818181858888f19350505050158015610bed573d6000803e3d6000fd5b6000610ecd816112cb565b50600655565b6000610ede816112cb565b50600455565b600354600254600091606491610f0491600160401b900460ff1690611ce5565b610f0e9190611d12565b600254610f1b9190611d26565b905090565b6000610f2b816112cb565b506003805463ffffffff9283166401000000000267ffffffffffffffff199091169290931691909117919091179055565b6000610f67816112cb565b506003805460ff909216600160401b0268ff000000000000000019909216919091179055565b600083600003610f9f57506000611015565b611012838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516bffffffffffffffffffffffff1960608b901b166020820152889250603401905060405160208183030381529060405280519060200120611638565b90505b949350505050565b3360009081526009602052604090205460021161107c5760405162461bcd60e51b815260206004820152601660248201527f45786365656473207075726368617365206c696d6974000000000000000000006044820152606401610a20565b33600090815260096020526040812080546001929061109c908490611e3f565b90915550506040805160808101825260035463ffffffff80821683526401000000008204166020830152600160401b900460ff16918101919091526004546060820152610cf290838361164e565b336000908152600a60205260409020546002116111495760405162461bcd60e51b815260206004820152601660248201527f45786365656473207075726368617365206c696d6974000000000000000000006044820152606401610a20565b336000908152600a60205260408120805460019290611169908490611e3f565b90915550506040805160808101825260055463ffffffff80821683526401000000008204166020830152600160401b900460ff16918101919091526006546060820152610cf290838361164e565b600554600254600091606491610f0491600160401b900460ff1690611ce5565b600754600254600091606491610f0491600160401b900460ff1690611ce5565b6000611202816112cb565b506008805463ffffffff9283166401000000000267ffffffffffffffff199091169290931691909117919091179055565b60008281526020819052604090206001015461124e816112cb565b610bed83836114b8565b6000611263816112cb565b50600255565b6000611274816112cb565b506005805460ff909216600160401b0268ff000000000000000019909216919091179055565b60006112a5816112cb565b506007805460ff909216600160401b0268ff000000000000000019909216919091179055565b6112d581336117de565b50565b600154600854600160a01b90910461ffff908116600160401b90920416106113425760405162461bcd60e51b815260206004820152600860248201527f536f6c64206f75740000000000000000000000000000000000000000000000006044820152606401610a20565b60085461135b90600160401b900461ffff166001611d39565b6008805469ffff00000000000000001916600160401b61ffff938416810291909117918290556001805491909204909216916001600160a01b0316906319ee6e3f9033906113a885611537565b6040516020016113b89190611d7f565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016113e593929190611e17565b600060405180830381600087803b1580156113ff57600080fd5b505af1158015611413573d6000803e3d6000fd5b5050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610cf2576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114743390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610cf2576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60608160000361155e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611588578061157281611e52565b91506115819050600a83611d12565b9150611562565b60008167ffffffffffffffff8111156115a3576115a3611e6b565b6040519080825280601f01601f1916602001820160405280156115cd576020820181803683370190505b5090505b8415611015576115e2600183611d26565b91506115ef600a86611e81565b6115fa906030611e3f565b60f81b81838151811061160f5761160f611e95565b60200101906001600160f81b031916908160001a905350611631600a86611d12565b94506115d1565b600082611645858461185c565b14949350505050565b825163ffffffff164210156116a55760405162461bcd60e51b815260206004820152600e60248201527f53616c65206e6f742073746172740000000000000000000000000000000000006044820152606401610a20565b826020015163ffffffff1642106116fe5760405162461bcd60e51b815260206004820152600e60248201527f53616c652068617320656e6465640000000000000000000000000000000000006044820152606401610a20565b61170e3384606001518484610f8d565b61175a5760405162461bcd60e51b815260206004820152601960248201527f596f75277265206e6f7420616c6c6f77656420746f20627579000000000000006044820152606401610a20565b6064836040015160ff166002546117719190611ce5565b61177b9190611d12565b6002546117889190611d26565b34146117d65760405162461bcd60e51b815260206004820152601d60248201527f53656e742076616c7565206e6f7420657175616c20746f2070726963650000006044820152606401610a20565b610bed6112d8565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610cf25761181a816001600160a01b031660146118a9565b6118258360206118a9565b604051602001611836929190611eab565b60408051601f198184030181529082905262461bcd60e51b8252610a2091600401611f2c565b600081815b84518110156118a15761188d8286838151811061188057611880611e95565b6020026020010151611a75565b91508061189981611e52565b915050611861565b509392505050565b606060006118b8836002611ce5565b6118c3906002611e3f565b67ffffffffffffffff8111156118db576118db611e6b565b6040519080825280601f01601f191660200182016040528015611905576020820181803683370190505b509050600360fc1b8160008151811061192057611920611e95565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061196b5761196b611e95565b60200101906001600160f81b031916908160001a905350600061198f846002611ce5565b61199a906001611e3f565b90505b6001811115611a1f577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106119db576119db611e95565b1a60f81b8282815181106119f1576119f1611e95565b60200101906001600160f81b031916908160001a90535060049490941c93611a1881611f3f565b905061199d565b508315611a6e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a20565b9392505050565b6000818310611a91576000828152602084905260409020611a6e565b6000838152602083905260409020611a6e565b600060208284031215611ab657600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611a6e57600080fd5b80356001600160a01b0381168114611afd57600080fd5b919050565b600060208284031215611b1457600080fd5b611a6e82611ae6565b600060208284031215611b2f57600080fd5b813561ffff81168114611a6e57600080fd5b600060208284031215611b5357600080fd5b5035919050565b60008060408385031215611b6d57600080fd5b82359150611b7d60208401611ae6565b90509250929050565b803563ffffffff81168114611afd57600080fd5b60008060408385031215611bad57600080fd5b611bb683611b86565b9150611b7d60208401611b86565b600060208284031215611bd657600080fd5b813560ff81168114611a6e57600080fd5b60008083601f840112611bf957600080fd5b50813567ffffffffffffffff811115611c1157600080fd5b6020830191508360208260051b8501011115611c2c57600080fd5b9250929050565b60008060008060608587031215611c4957600080fd5b611c5285611ae6565b935060208501359250604085013567ffffffffffffffff811115611c7557600080fd5b611c8187828801611be7565b95989497509550505050565b60008060208385031215611ca057600080fd5b823567ffffffffffffffff811115611cb757600080fd5b611cc385828601611be7565b90969095509350505050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761098c5761098c611ccf565b634e487b7160e01b600052601260045260246000fd5b600082611d2157611d21611cfc565b500490565b8181038181111561098c5761098c611ccf565b61ffff818116838216019080821115611d5457611d54611ccf565b5092915050565b60005b83811015611d76578181015183820152602001611d5e565b50506000910152565b7f7b00000000000000000000000000000000000000000000000000000000000000815260008251611db7816001850160208701611d5b565b7f7d3a7b7d000000000000000000000000000000000000000000000000000000006001939091019283015250600501919050565b60008151808452611e03816020860160208601611d5b565b601f01601f19169290920160200192915050565b6001600160a01b03841681528260208201526060604082015260006110126060830184611deb565b8082018082111561098c5761098c611ccf565b600060018201611e6457611e64611ccf565b5060010190565b634e487b7160e01b600052604160045260246000fd5b600082611e9057611e90611cfc565b500690565b634e487b7160e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611ee3816017850160208801611d5b565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611f20816028840160208801611d5b565b01602801949350505050565b602081526000611a6e6020830184611deb565b600081611f4e57611f4e611ccf565b50600019019056fea26469706673582212204671f83cfb466fdd5dd2174b23f128f210b55223a39a18771be4de92dab6881d64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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