文件 1 的 25:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
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);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 25:Constants.sol
pragma solidity ^0.8.7;
library Constants {
address public constant EXTINCTION_OPEN_EDITION_BY_WHISBE = 0xcD136E30b316837C190241e838639c619516Fdf9;
address public constant THE_HORNED_KARMA_CHAMELEON_BURN_REDEMPTION_BY_WHISBE =
0x41C884CC6847a95CfFf4EaC251173ea72C3c5eFB;
address public constant KARMA_KEY_BLACK_BY_WHISBE = 0xe2C2613E647Ebd03fdC71a1Cf1fD1F938321356c;
address public constant KARMA_KEYS_BY_WHISBE = 0xA53e7Fd6abC0fe9769690Af55f19c2b4A13F2Bc3;
address public constant GOOD_KARMA_TOKEN = 0xC5dd321472f80A3EC9779F55cc1Af854712fAE70;
}
文件 3 的 25:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 25:Counters.sol
pragma solidity ^0.8.0;
library Counters {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
文件 5 的 25:DataTypes.sol
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/utils/Counters.sol";
library DataTypes {
struct Tier {
uint256 from;
uint256 to;
uint256 pieces;
Counters.Counter tokenCount;
}
}
文件 6 的 25:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 7 的 25:ERC165Storage.sol
pragma solidity ^0.8.0;
import "./ERC165.sol";
abstract contract ERC165Storage is ERC165 {
mapping(bytes4 => bool) private _supportedInterfaces;
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return super.supportsInterface(interfaceId) || _supportedInterfaces[interfaceId];
}
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
文件 8 的 25:ERC721.sol
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
文件 9 的 25:ERC721Burnable.sol
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "../../../utils/Context.sol";
abstract contract ERC721Burnable is Context, ERC721 {
function burn(uint256 tokenId) public virtual {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}
文件 10 的 25:ERC721Holder.sol
pragma solidity ^0.8.0;
import "../IERC721Receiver.sol";
contract ERC721Holder is IERC721Receiver {
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
}
文件 11 的 25:ERC721LimitedSupply.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
abstract contract ERC721LimitedSupply {
using Counters for Counters.Counter;
event SupplyChanged(uint256 indexed supply);
Counters.Counter private _tokenCount;
uint256 private _totalSupply;
constructor(uint256 totalSupply_) {
_totalSupply = totalSupply_;
}
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
function tokenCount() public view returns (uint256) {
return _tokenCount.current();
}
function availableTokenCount() public view returns (uint256) {
return totalSupply() - tokenCount();
}
function _nextToken() internal virtual returns (uint256) {
uint256 token = _tokenCount.current();
_tokenCount.increment();
return token;
}
modifier ensureAvailability() {
require(availableTokenCount() > 0, "No more tokens available");
_;
}
modifier ensureAvailabilityFor(uint256 amount) {
require(availableTokenCount() >= amount, "Requested number of tokens not available");
_;
}
function _setSupply(uint256 _supply) internal virtual {
require(_supply > tokenCount(), "Can't set the supply to less than the current token count");
_totalSupply = _supply;
emit SupplyChanged(totalSupply());
}
}
文件 12 的 25:ERC721RandomlyAssignVandalzTier.sol
pragma solidity ^0.8.0;
import "./ERC721Extensions/ERC721LimitedSupply.sol";
import { DataTypes } from "./types/DataTypes.sol";
import { Errors } from "./types/Errors.sol";
abstract contract ERC721RandomlyAssignVandalzTier is ERC721LimitedSupply {
using Counters for Counters.Counter;
uint256 public startFrom;
mapping(uint256 => uint256) private tokenMatrix;
DataTypes.Tier[] public tiers;
constructor(uint256 _totalSupply, uint256 _startFrom) ERC721LimitedSupply(_totalSupply) {
startFrom = _startFrom;
}
function tierWiseTokenCount(uint256 _tierIndex) public view returns (uint256) {
return tiers[_tierIndex].tokenCount.current();
}
function availableTierTokenCount(uint256 _tierIndex) public view returns (uint256) {
return tiers[_tierIndex].pieces - tiers[_tierIndex].tokenCount.current();
}
function _nextToken() internal override ensureAvailability returns (uint256) {
uint256 _nextTokenId = _internalNextToken(totalSupply() - tokenCount()) + startFrom;
_updateTierTokenCount(_nextTokenId);
return _nextTokenId;
}
function _updateTierTokenCount(uint256 _nextTokenId) internal {
for (uint256 _i; _i < tiers.length; _i++) {
if (_nextTokenId >= tiers[_i].from && _nextTokenId <= tiers[_i].to) {
tiers[_i].tokenCount.increment();
break;
}
}
}
function _nextTokenFromTier(uint256 _tierIndex) internal ensureAvailability returns (uint256) {
if (availableTierTokenCount(_tierIndex) == 0) {
revert Errors.ERC721RandomlyAssignVandalzTier__UnavailableTierTokens(_tierIndex);
}
uint256 _nextTokenId =
_internalNextToken(tiers[_tierIndex].pieces - tiers[_tierIndex].tokenCount.current()) +
tiers[_tierIndex].from;
tiers[_tierIndex].tokenCount.increment();
return _nextTokenId;
}
function _internalNextToken(uint256 _maxIndex) internal returns (uint256) {
uint256 _randomNumber = _getRandomNumber() % _maxIndex;
uint256 value;
if (tokenMatrix[_randomNumber] == 0) {
value = _randomNumber;
} else {
value = tokenMatrix[_randomNumber];
}
if (tokenMatrix[_maxIndex - 1] == 0) {
tokenMatrix[_randomNumber] = _maxIndex - 1;
} else {
tokenMatrix[_randomNumber] = tokenMatrix[_maxIndex - 1];
}
super._nextToken();
return value;
}
function _setTier(
uint256 _tierIndex,
uint256 _from,
uint256 _to
) internal virtual {
require(_to - _from >= tiers[_tierIndex].pieces, "ERC721RandomlyAssignVandalzTier : misaligned pieces");
tiers[_tierIndex].from = _from;
tiers[_tierIndex].to = _to;
tiers[_tierIndex].pieces = _to - _from + 1;
}
function _getRandomNumber() internal view virtual returns (uint256) {
return
uint256(
keccak256(
abi.encodePacked(
msg.sender,
block.coinbase,
blockhash(block.number),
block.gaslimit,
block.timestamp,
tokenCount(),
availableTokenCount(),
totalSupply()
)
)
);
}
}
文件 13 的 25:Errors.sol
pragma solidity ^0.8.7;
library Errors {
error WhisbeVandalz__InvalidCollection(address);
error WhisbeVandalz__EightTiersRequired(uint256);
error ERC721RandomlyAssignVandalzTier__UnavailableTierTokens(uint256);
error WhisbeVandalz__MintNotAvailable();
error WhisbeVandalz__PublicMintUpToTwoPerWallet();
error WhisbeVandalz__NoGroupTier15678Group();
error WhisbeVandalz__NoGroupTier5678Group();
}
文件 14 的 25:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 15 的 25:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 16 的 25:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 17 的 25:IERC2981.sol
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 18 的 25:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 19 的 25:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 20 的 25:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 21 的 25:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
computedHash = _efficientHash(computedHash, proofElement);
} else {
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 22 的 25:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 23 的 25:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
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));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
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));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 24 的 25:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
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);
}
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);
}
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);
}
}
文件 25 的 25:WhIsBeVandalz.sol
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
import { IERC2981 } from "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import { Errors } from "./types/Errors.sol";
import { Constants } from "./Constants.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import { ERC165Storage } from "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC721RandomlyAssignVandalzTier.sol";
interface IGoodKarmaToken {
function burnTokenForVandal(address holderAddress) external;
}
contract WhIsBeVandalz is
ERC721,
Ownable,
ERC721RandomlyAssignVandalzTier,
ERC721Holder,
ERC721Burnable,
ERC165Storage,
IERC2981
{
using Strings for uint256;
using SafeERC20 for IERC20;
uint256 public publicSalePrice;
bool public publicMintPaused = true;
bool public whitelistState = true;
bool public revealed = true;
bool public redeemPaused = true;
bool public includeTier1 = false;
bytes32 public merkleRoot;
address public royaltyAddress;
uint256 public royaltyPercent;
uint256[] public groupTier15678Indexes;
uint256[] public groupTier5678Indexes;
string public baseURI;
string public baseExtension = ".json";
string public notRevealedUri;
mapping(address => bool) public acceptedCollections;
mapping(address => uint256) public burnCounter;
mapping(address => uint256) public publicMintCounter;
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
bytes4 private constant _INTERFACE_ID_IERC2981 = 0x2a55205a;
bytes4 private constant _INTERFACE_ID_IERC721Metadata = 0x5b5e139f;
uint256 public constant TIERS = uint256(8);
event UpdatedRoyalties(address newRoyaltyAddress, uint256 newPercentage);
modifier publicMintNotPaused() {
require(publicMintPaused == false, "Public mint is paused");
_;
}
modifier redeemNotPaused() {
require(redeemPaused == false, "Redeem is paused");
_;
}
constructor(
string memory _name,
string memory _symbol,
uint256 _totalSupply,
uint256 _startFrom,
DataTypes.Tier[] memory _tiers,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721(_name, _symbol) ERC721RandomlyAssignVandalzTier(_totalSupply, _startFrom) {
uint256 _tiersLen = _tiers.length;
if (_tiersLen != TIERS) {
revert Errors.WhisbeVandalz__EightTiersRequired(_tiersLen);
}
baseURI = _initBaseURI;
notRevealedUri = _initNotRevealedUri;
acceptedCollections[address(Constants.EXTINCTION_OPEN_EDITION_BY_WHISBE)] = true;
acceptedCollections[address(Constants.THE_HORNED_KARMA_CHAMELEON_BURN_REDEMPTION_BY_WHISBE)] = true;
acceptedCollections[address(Constants.KARMA_KEY_BLACK_BY_WHISBE)] = true;
acceptedCollections[address(Constants.KARMA_KEYS_BY_WHISBE)] = true;
acceptedCollections[address(Constants.GOOD_KARMA_TOKEN)] = true;
for (uint256 _i; _i < _tiersLen; _i++) {
tiers.push(_tiers[_i]);
}
groupTier15678Indexes.push(0);
groupTier15678Indexes.push(4);
groupTier15678Indexes.push(5);
groupTier15678Indexes.push(6);
groupTier15678Indexes.push(7);
groupTier5678Indexes.push(4);
groupTier5678Indexes.push(5);
groupTier5678Indexes.push(6);
groupTier5678Indexes.push(7);
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_IERC2981);
_registerInterface(_INTERFACE_ID_IERC721Metadata);
_setRoyalties(msg.sender, 1100);
}
receive() external payable {
publicMint(new bytes32[](0));
}
function redeem(address[] memory _collections, uint256[][] memory _tokenIds) external redeemNotPaused {
uint256 _collectionsLen = _collections.length;
require(_collectionsLen == _tokenIds.length, "");
for (uint256 _j; _j < _collectionsLen; _j++) {
if (!acceptedCollections[_collections[_j]]) {
revert Errors.WhisbeVandalz__InvalidCollection(_collections[_j]);
}
uint256 _tokenIdsLen = _tokenIds[_j].length;
burnCounter[_collections[_j]] += _tokenIdsLen;
for (uint256 _i; _i < _tokenIdsLen; _i++) {
if (_collections[_j] == Constants.EXTINCTION_OPEN_EDITION_BY_WHISBE) {
ERC721Burnable(_collections[_j]).safeTransferFrom(msg.sender, address(this), _tokenIds[_j][_i]);
} else if (_collections[_j] == Constants.GOOD_KARMA_TOKEN) {
IGoodKarmaToken(_collections[_j]).burnTokenForVandal(msg.sender);
} else {
ERC721Burnable(_collections[_j]).burn(_tokenIds[_j][_i]);
}
_mintRandomVandalz(msg.sender, _collections[_j]);
}
}
}
function airDropToOG(address[] memory _tos) external onlyOwner {
if (includeTier1) {
for (uint256 _i; _i < _tos.length; _i++) {
_handleMintRandomlyFromTierGroup15678(_tos[_i], 1);
}
} else {
for (uint256 _i; _i < _tos.length; _i++) {
_handleMintRandomlyFromTierGroup5678(_tos[_i], 1);
}
}
}
function creatorMint(address _to, uint256[] memory _tokenIds) external onlyOwner {
for (uint256 _i; _i < _tokenIds.length; _i++) {
_internalCreatorMint(_to, _tokenIds[_i]);
}
}
function _internalCreatorMint(address _to, uint256 _tokenId) internal ensureAvailability {
_updateTierTokenCount(_tokenId);
_safeMint(_to, _tokenId);
}
function setSupply(uint256 _supply) external onlyOwner {
_setSupply(_supply);
}
function setTier(
uint256[] memory _tierIndex,
uint256[] memory _from,
uint256[] memory _to
) external onlyOwner {
require(
_tierIndex.length == _from.length && _from.length == _to.length,
"WhisbeVandalz: tier details length mismatch"
);
for (uint256 _i; _i < _tierIndex.length; _i++) {
require(_tierIndex[_i] < TIERS, "WhisbeVandalz: tierIndex exceeds max permitted tiers");
_setTier(_tierIndex[_i], _from[_i], _to[_i]);
}
}
function reveal() external onlyOwner {
revealed = true;
}
function setPublicSalePrice(uint256 _publicSalePrice) external onlyOwner {
publicSalePrice = _publicSalePrice;
}
function setBaseExtension(string memory _newBaseExtension) external onlyOwner {
baseExtension = _newBaseExtension;
}
function pauseRedeem(bool _state) external onlyOwner {
redeemPaused = _state;
}
function pausePublicMint(bool _state) external onlyOwner {
publicMintPaused = _state;
}
function setWhitelistState(bool _state) external onlyOwner {
whitelistState = _state;
}
function setIncludeTier1(bool _includeTier1) external onlyOwner {
includeTier1 = _includeTier1;
}
function updateMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
merkleRoot = _merkleRoot;
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
baseURI = _newBaseURI;
}
function setNotRevealedURI(string memory _notRevealedURI) external onlyOwner {
notRevealedUri = _notRevealedURI;
}
function withdrawETH() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function transferAccidentallyLockedTokens(IERC20 _token, uint256 _amount) external onlyOwner {
require(address(_token) != address(0), "Token address can not be zero");
_token.safeTransfer(msg.sender, _amount);
}
function setRoyaltyInfo(address $royaltyAddress, uint256 $percentage) external onlyOwner {
_setRoyalties($royaltyAddress, $percentage);
emit UpdatedRoyalties($royaltyAddress, $percentage);
}
function publicMint(bytes32[] memory _proof) public payable publicMintNotPaused {
if (publicMintCounter[msg.sender] >= 2) {
revert Errors.WhisbeVandalz__PublicMintUpToTwoPerWallet();
}
require(msg.value == publicSalePrice, "WhisbeVandalz: eth value should be equal to publicSalePrice");
if (whitelistState) {
_isWhitelistedAddress(_proof);
}
_safeMint(msg.sender, _nextToken());
publicMintCounter[msg.sender] += 1;
}
function royaltyInfo(uint256, uint256 $salePrice)
public
view
override(IERC2981)
returns (address _receiver, uint256 _royaltyAmount)
{
_receiver = royaltyAddress;
_royaltyAmount = ($salePrice * royaltyPercent) / 10000;
}
function supportsInterface(bytes4 $interfaceId)
public
view
override(ERC165Storage, ERC721, IERC165)
returns (bool)
{
return super.supportsInterface($interfaceId);
}
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;
}
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
: "";
}
function getBlockTimestamp() public view virtual returns (uint256) {
return block.timestamp;
}
function _setRoyalties(address $receiver, uint256 $percentage) internal {
royaltyAddress = $receiver;
royaltyPercent = $percentage;
}
function _mintRandomVandalz(address _to, address _collection) internal {
if (_collection == Constants.EXTINCTION_OPEN_EDITION_BY_WHISBE) {
_handleMintForExtinctionOpenEditionByWhisbe(_to);
} else if (_collection == Constants.THE_HORNED_KARMA_CHAMELEON_BURN_REDEMPTION_BY_WHISBE) {
_handleMintForTheHornedKarmaChamaleonBurnRedemptionByWhisbe(_to);
} else if (_collection == Constants.KARMA_KEY_BLACK_BY_WHISBE) {
_handleMintForKarmaKeyBlackByWhisbe(_to);
} else if (_collection == Constants.KARMA_KEYS_BY_WHISBE) {
_handleMintForKarmaKeysByWhisbe(_to);
} else if (_collection == Constants.GOOD_KARMA_TOKEN) {
_handleMintForGoodKarmaToken(_to);
} else {
revert Errors.WhisbeVandalz__MintNotAvailable();
}
}
function _isWhitelistedAddress(bytes32[] memory _proof) internal view {
bytes32 addressHash = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_proof, merkleRoot, addressHash), "Whitelist: caller is not whitelisted");
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function _handleMintForExtinctionOpenEditionByWhisbe(address _to) private {
_safeMint(_to, _nextTokenFromTier(3));
if (includeTier1) {
_handleMintRandomlyFromTierGroup15678(_to, 1);
} else {
_handleMintRandomlyFromTierGroup5678(_to, 1);
}
}
function _handleMintForTheHornedKarmaChamaleonBurnRedemptionByWhisbe(address _to) private {
_safeMint(_to, _nextTokenFromTier(1));
_safeMint(_to, _nextTokenFromTier(3));
if (includeTier1) {
_handleMintRandomlyFromTierGroup15678(_to, uint256(8));
} else {
_handleMintRandomlyFromTierGroup5678(_to, uint256(8));
}
}
function _handleMintForKarmaKeyBlackByWhisbe(address _to) private {
_safeMint(_to, _nextTokenFromTier(3));
if (includeTier1) {
_handleMintRandomlyFromTierGroup15678(_to, uint256(1));
} else {
_handleMintRandomlyFromTierGroup5678(_to, uint256(1));
}
}
function _handleMintForKarmaKeysByWhisbe(address _to) private {
if (includeTier1) {
_handleMintRandomlyFromTierGroup15678(_to, uint256(1));
} else {
_handleMintRandomlyFromTierGroup5678(_to, uint256(1));
}
}
function _handleMintForGoodKarmaToken(address _to) private {
if (includeTier1) {
_handleMintRandomlyFromTierGroup15678(_to, uint256(1));
} else {
_handleMintRandomlyFromTierGroup5678(_to, uint256(1));
}
}
function _handleMintRandomlyFromTierGroup15678(address _to, uint256 _count) private {
uint256 _groupTier15678IndexesLen = groupTier15678Indexes.length;
if (_groupTier15678IndexesLen == 0) {
revert Errors.WhisbeVandalz__NoGroupTier15678Group();
}
uint256 _randomTier15678GroupIndex;
for (uint256 _i; _i < _count; _i++) {
_randomTier15678GroupIndex = _getRandomNumber() % _groupTier15678IndexesLen;
_safeMint(_to, _nextTokenFromTier(groupTier15678Indexes[_randomTier15678GroupIndex]));
_checkAndUpdateGroupTier15678TokenAvailability(_randomTier15678GroupIndex);
if (_randomTier15678GroupIndex != 0) {
_checkAndUpdateGroupTier5678TokenAvailability(_randomTier15678GroupIndex - 1);
}
}
}
function _handleMintRandomlyFromTierGroup5678(address _to, uint256 _count) private {
uint256 _groupTier5678IndexesLen = groupTier5678Indexes.length;
if (_groupTier5678IndexesLen == 0) {
revert Errors.WhisbeVandalz__NoGroupTier5678Group();
}
uint256 _randomTier5678GroupIndex;
for (uint256 _i; _i < _count; _i++) {
_randomTier5678GroupIndex = _getRandomNumber() % _groupTier5678IndexesLen;
_safeMint(_to, _nextTokenFromTier(groupTier5678Indexes[_randomTier5678GroupIndex]));
_checkAndUpdateGroupTier5678TokenAvailability(_randomTier5678GroupIndex);
_checkAndUpdateGroupTier15678TokenAvailability(_randomTier5678GroupIndex + 1);
}
}
function _checkAndUpdateGroupTier15678TokenAvailability(uint256 _index) private {
if (availableTierTokenCount(groupTier15678Indexes[_index]) == 0) {
groupTier15678Indexes[_index] = groupTier15678Indexes[groupTier15678Indexes.length - 1];
groupTier15678Indexes.pop();
}
}
function _checkAndUpdateGroupTier5678TokenAvailability(uint256 _index) private {
if (availableTierTokenCount(groupTier5678Indexes[_index]) == 0) {
groupTier5678Indexes[_index] = groupTier5678Indexes[groupTier5678Indexes.length - 1];
groupTier5678Indexes.pop();
}
}
}
{
"compilationTarget": {
"contracts/WhIsBeVandalz.sol": "WhIsBeVandalz"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_startFrom","type":"uint256"},{"components":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"},{"internalType":"uint256","name":"pieces","type":"uint256"},{"components":[{"internalType":"uint256","name":"_value","type":"uint256"}],"internalType":"struct Counters.Counter","name":"tokenCount","type":"tuple"}],"internalType":"struct DataTypes.Tier[]","name":"_tiers","type":"tuple[]"},{"internalType":"string","name":"_initBaseURI","type":"string"},{"internalType":"string","name":"_initNotRevealedUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ERC721RandomlyAssignVandalzTier__UnavailableTierTokens","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"WhisbeVandalz__EightTiersRequired","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"WhisbeVandalz__InvalidCollection","type":"error"},{"inputs":[],"name":"WhisbeVandalz__MintNotAvailable","type":"error"},{"inputs":[],"name":"WhisbeVandalz__NoGroupTier15678Group","type":"error"},{"inputs":[],"name":"WhisbeVandalz__NoGroupTier5678Group","type":"error"},{"inputs":[],"name":"WhisbeVandalz__PublicMintUpToTwoPerWallet","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":"uint256","name":"supply","type":"uint256"}],"name":"SupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRoyaltyAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"UpdatedRoyalties","type":"event"},{"inputs":[],"name":"TIERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"acceptedCollections","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tos","type":"address[]"}],"name":"airDropToOG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tierIndex","type":"uint256"}],"name":"availableTierTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseExtension","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"","type":"address"}],"name":"burnCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"creatorMint","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":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupTier15678Indexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupTier5678Indexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"includeTier1","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","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":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"pausePublicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"pauseRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publicMintCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_collections","type":"address[]"},{"internalType":"uint256[][]","name":"_tokenIds","type":"uint256[][]"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"$salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPercent","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":"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":"_newBaseExtension","type":"string"}],"name":"setBaseExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_includeTier1","type":"bool"}],"name":"setIncludeTier1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_notRevealedURI","type":"string"}],"name":"setNotRevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicSalePrice","type":"uint256"}],"name":"setPublicSalePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"$royaltyAddress","type":"address"},{"internalType":"uint256","name":"$percentage","type":"uint256"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tierIndex","type":"uint256[]"},{"internalType":"uint256[]","name":"_from","type":"uint256[]"},{"internalType":"uint256[]","name":"_to","type":"uint256[]"}],"name":"setTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setWhitelistState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"uint256","name":"_tierIndex","type":"uint256"}],"name":"tierWiseTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"},{"internalType":"uint256","name":"pieces","type":"uint256"},{"components":[{"internalType":"uint256","name":"_value","type":"uint256"}],"internalType":"struct Counters.Counter","name":"tokenCount","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferAccidentallyLockedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"updateMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]