编译器
0.8.18+commit.87f61d96
文件 1 的 21:BLBERC721A.sol
pragma solidity ^0.8.18;
import "./MGYERC721A.sol";
contract BLBERC721A is MGYERC721A{
constructor (
string memory _name,
string memory _symbol
) MGYERC721A (_name,_symbol) {
_extension = ".json";
operatorFilteringEnabled = true;
}
function setSBTMode(bool) external virtual override onlyOwner {
}
function withdraw() external payable override virtual onlyOwner nonReentrant {
address wallet = payable(0xE99073F2BA37B44f5CCCf4758b179485F3984d7f);
bool os;
(os, ) = payable(wallet).call{value: address(this).balance}("");
require(os);
}
function burnAndMint(uint256 _amount,uint256[] calldata _tokenids) external payable virtual override nonReentrant {
}
function burnAndMintWithGenesis(uint256 _amount,uint256[] calldata _tokenids,uint256[] calldata _tokenidGenesis) external payable virtual override nonReentrant {
}
function holdAndMint(uint256 _amount,uint256[] calldata _tokenids) external payable virtual override nonReentrant {
}
}
文件 2 的 21:Base64.sol
pragma solidity ^0.8.0;
library Base64 {
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "";
string memory table = _TABLE;
string memory result = new string(4 * ((data.length + 2) / 3));
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let dataPtr := data
let endPtr := add(data, mload(data))
} lt(dataPtr, endPtr) {
} {
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1)
}
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}
文件 3 的 21: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 的 21: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;
}
}
文件 5 的 21:ERC2981.sol
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
文件 6 的 21:ERC4906.sol
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./IERC4906.sol";
contract ERC4906 is ERC165, IERC4906 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return( interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId) );
}
}
文件 7 的 21:ERC4907A.sol
pragma solidity ^0.8.4;
import './IERC4907A.sol';
import '../ERC721A.sol';
abstract contract ERC4907A is ERC721A, IERC4907A {
uint256 private constant _BITPOS_EXPIRES = 160;
mapping(uint256 => uint256) private _packedUserInfo;
function setUser(
uint256 tokenId,
address user,
uint64 expires
) public virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A()))
if (getApproved(tokenId) != _msgSenderERC721A()) revert SetUserCallerNotOwnerNorApproved();
_packedUserInfo[tokenId] = (uint256(expires) << _BITPOS_EXPIRES) | uint256(uint160(user));
emit UpdateUser(tokenId, user, expires);
}
function userOf(uint256 tokenId) public view virtual override returns (address) {
uint256 packed = _packedUserInfo[tokenId];
assembly {
packed := mul(
packed,
lt(shl(_BITPOS_EXPIRES, timestamp()), packed)
)
}
return address(uint160(packed));
}
function userExpires(uint256 tokenId) public view virtual override returns (uint256) {
return _packedUserInfo[tokenId] >> _BITPOS_EXPIRES;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC721A) returns (bool) {
return super.supportsInterface(interfaceId) || interfaceId == 0xad092b5c;
}
function _explicitUserOf(uint256 tokenId) internal view virtual returns (address) {
return address(uint160(_packedUserInfo[tokenId]));
}
}
文件 8 的 21:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
uint256 private _burnCounter;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
function totalSupply() public view virtual override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
function _totalMinted() internal view virtual returns (uint256) {
unchecked {
return _currentIndex - _startTokenId();
}
}
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0x80ac58cd ||
interfaceId == 0x5b5e139f;
}
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) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
function _baseURI() internal view virtual returns (string memory) {
return '';
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
assembly {
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
function approve(address to, uint256 tokenId) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex &&
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0;
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
msgSender := and(msgSender, _BITMASK_ADDRESS)
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
--_packedAddressData[from];
++_packedAddressData[to];
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
startTokenId
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
if (_currentIndex != end) revert();
}
}
}
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
}
文件 9 的 21:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 10 的 21: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);
}
文件 11 的 21:IERC4906.sol
pragma solidity ^0.8.18;
interface IERC4906 {
event MetadataUpdate(uint256 _tokenId);
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
文件 12 的 21:IERC4907A.sol
pragma solidity ^0.8.4;
import '../IERC721A.sol';
interface IERC4907A is IERC721A {
error SetUserCallerNotOwnerNorApproved();
event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires);
function setUser(
uint256 tokenId,
address user,
uint64 expires
) external;
function userOf(uint256 tokenId) external view returns (address);
function userExpires(uint256 tokenId) external view returns (uint256);
}
文件 13 的 21:IERC721A.sol
pragma solidity ^0.8.4;
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
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 payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
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);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
文件 14 的 21:MGYERC721A.sol
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "erc721a/contracts/extensions/ERC4907A.sol";
import "closedsea/src/OperatorFilterer.sol";
import "./MGYREWARD.sol";
import "./ERC4906.sol";
contract MGYERC721A is Ownable,ERC4907A, ReentrancyGuard, ERC2981,OperatorFilterer,ERC4906{
uint256 public wlMintPrice;
uint256 public wlMintPrice1;
uint256 public wlMintPrice2;
uint256 public psMintPrice;
uint256 public bmMintPrice;
uint256 public hmMintPrice;
uint256 public maxMintsCapPerWL;
uint256 public maxMintsPerPS;
uint256 public maxMintsPerBM;
uint256 public maxMintsPerHM;
uint256 public otherContractCount;
uint256 public otherContractCountGenesis;
uint256 public maxSupply;
address payable internal _withdrawWallet;
bool public isSBTEnabled;
mapping(uint256 => string) internal _revealUri;
mapping(uint256 => string) internal _baseTokenURI;
bool public isWlEnabled;
mapping(uint256 => bool) public isWlNumDisabled;
bool public isPsEnabled;
bool public isBmEnabled;
bool public isHmEnabled;
bool public isStakingEnabled;
mapping(uint256 => bool) internal _isRevealed;
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) internal _wlMinted;
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) internal _wlMinted1;
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) internal _wlMinted2;
mapping(uint256 => mapping(address => uint256)) internal _psMinted;
mapping(uint256 => mapping(address => uint256)) internal _bmMinted;
mapping(uint256 => mapping(address => uint256)) internal _hmMinted;
mapping(uint256 => mapping(uint256 => bool)) internal _otherTokenidUsed;
uint256 internal _wlResetIndex;
uint256 internal _seasonCounter;
mapping(uint256 => uint256) public seasonStartTokenId;
uint256 internal _contractStatus;
bytes32 internal _merkleRoot;
bytes32 internal _merkleRoot1;
bytes32 internal _merkleRoot2;
mapping(uint256 => string) internal _customTokenURI;
string internal _extension;
address public otherContract;
MGYERC721A internal _otherContractFactory;
address public otherContractGenesis;
MGYERC721A internal _otherContractGenesisFactory;
mapping(uint256 => uint256) internal _stakingStartedTimestamp;
mapping(uint256 => uint256) internal _stakingTotalTime;
mapping(uint256 => uint256) internal _claimedLastTimestamp;
uint256 internal constant NULL_STAKED = 0;
address public rewardContract;
MGYREWARD internal _rewardContractFactory;
uint256 public stakingStartTimestamp;
uint256 public stakingEndTimestamp;
bool public operatorFilteringEnabled;
constructor (
string memory _name,
string memory _symbol
) ERC721A (_name,_symbol) {
seasonStartTokenId[_seasonCounter] = _startTokenId();
_extension = "";
_registerForOperatorFiltering();
}
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function setDefaultRoyalty(address _receiver, uint96 _feeNumerator) external virtual onlyOwner {
_setDefaultRoyalty(_receiver, _feeNumerator);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC4907A, ERC2981, ERC4906) returns (bool) {
return(
ERC721A.supportsInterface(interfaceId) ||
ERC4907A.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId) ||
ERC4906.supportsInterface(interfaceId)
);
}
function contractURI() external view virtual returns (string memory) {
return _formatContractURI();
}
function _formatContractURI() internal view returns (string memory) {
(address receiver, uint256 royaltyFraction) = royaltyInfo(0,_feeDenominator());
return string(
abi.encodePacked(
"data:application/json;base64,",
Base64.encode(
bytes(
abi.encodePacked(
'{"seller_fee_basis_points":', Strings.toString(royaltyFraction),
', "fee_recipient":"', Strings.toHexString(uint256(uint160(receiver)), 20), '"}'
)
)
)
)
);
}
function setWithdrawWallet(address _owner) external virtual onlyOwner {
_withdrawWallet = payable(_owner);
}
function setMaxSupply(uint256 _maxSupply) external virtual onlyOwner {
require(totalSupply() <= _maxSupply, "Lower than _currentIndex.");
maxSupply = _maxSupply;
}
function setWlPrice(uint256 newPrice) external virtual onlyOwner {
wlMintPrice = newPrice;
}
function setWlPrice1(uint256 newPrice) external virtual onlyOwner {
wlMintPrice1 = newPrice;
}
function setWlPrice2(uint256 newPrice) external virtual onlyOwner {
wlMintPrice2 = newPrice;
}
function setPsPrice(uint256 newPrice) external virtual onlyOwner {
psMintPrice = newPrice;
}
function setBmPrice(uint256 newPrice) external virtual onlyOwner {
bmMintPrice = newPrice;
}
function setHmPrice(uint256 newPrice) external virtual onlyOwner {
hmMintPrice = newPrice;
}
function setReveal(bool bool_) external virtual onlyOwner {
_isRevealed[_seasonCounter] = bool_;
}
function setRevealBySeason(bool bool_,uint256 _season) external virtual onlyOwner {
_isRevealed[_season] = bool_;
}
function isRevealed() external view virtual returns (bool){
return _isRevealed[_seasonCounter];
}
function isRevealedBySeason(uint256 _season) external view virtual returns (bool){
return _isRevealed[_season];
}
function wlMinted(address _address) external view virtual returns (uint256){
return _wlMinted[_seasonCounter][_address][_wlResetIndex];
}
function wlMintedBySeason(address _address,uint256 _season) external view virtual returns (uint256){
return _wlMinted[_season][_address][_wlResetIndex];
}
function wlMinted1(address _address) external view virtual returns (uint256){
return _wlMinted1[_seasonCounter][_address][_wlResetIndex];
}
function wlMintedBySeason1(address _address,uint256 _season) external view virtual returns (uint256){
return _wlMinted1[_season][_address][_wlResetIndex];
}
function wlMinted2(address _address) external view virtual returns (uint256){
return _wlMinted2[_seasonCounter][_address][_wlResetIndex];
}
function wlMintedBySeason2(address _address,uint256 _season) external view virtual returns (uint256){
return _wlMinted2[_season][_address][_wlResetIndex];
}
function psMinted(address _address) external view virtual returns (uint256){
return _psMinted[_seasonCounter][_address];
}
function psMintedBySeason(address _address,uint256 _season) external view virtual returns (uint256){
return _psMinted[_season][_address];
}
function bmMinted(address _address) external view virtual returns (uint256){
return _bmMinted[_seasonCounter][_address];
}
function bmMintedBySeason(address _address,uint256 _season) external view virtual returns (uint256){
return _bmMinted[_season][_address];
}
function hmMinted(address _address) external view virtual returns (uint256){
return _hmMinted[_seasonCounter][_address];
}
function hmMintedBySeason(address _address,uint256 _season) external view virtual returns (uint256){
return _hmMinted[_season][_address];
}
function setWlMaxMintsCap(uint256 _max) external virtual onlyOwner {
maxMintsCapPerWL = _max;
}
function setPsMaxMints(uint256 _max) external virtual onlyOwner {
maxMintsPerPS = _max;
}
function setBmMaxMints(uint256 _max) external virtual onlyOwner {
maxMintsPerBM = _max;
}
function setHmMaxMints(uint256 _max) external virtual onlyOwner {
maxMintsPerHM = _max;
}
function setOtherContractCount(uint256 _count) external virtual onlyOwner {
otherContractCount = _count;
}
function setOtherTokenidUsed(uint256 _tokenId,bool bool_) external virtual onlyOwner {
require(_otherContractFactory.ownerOf(_tokenId) != address(0), "nonexistent token");
_otherTokenidUsed[_seasonCounter][_tokenId] = bool_;
}
function setOtherTokenidUsedBySeason(uint256 _tokenId,bool bool_,uint256 _season) external virtual onlyOwner {
require(_otherContractFactory.ownerOf(_tokenId) != address(0), "nonexistent token");
_otherTokenidUsed[_season][_tokenId] = bool_;
}
function getOtherTokenidUsed(uint256 _tokenId) external view virtual returns (bool){
return _otherTokenidUsed[_seasonCounter][_tokenId];
}
function getOtherTokenidUsedBySeason(uint256 _tokenId,uint256 _season) external view virtual returns (bool){
return _otherTokenidUsed[_season][_tokenId];
}
function setWhitelistSale(bool bool_) external virtual onlyOwner {
isWlEnabled = bool_;
}
function setDisabledPartWhitelistSale(uint256 _wlNum,bool bool_) external virtual onlyOwner {
isWlNumDisabled[_wlNum] = bool_;
}
function setPublicSale(bool bool_) external virtual onlyOwner {
isPsEnabled = bool_;
}
function setBurnAndMintSale(bool bool_) external virtual onlyOwner {
isBmEnabled = bool_;
}
function setHoldAndMintSale(bool bool_) external virtual onlyOwner {
isHmEnabled = bool_;
}
function setMerkleRoot(bytes32 merkleRoot_) external virtual onlyOwner {
_merkleRoot = merkleRoot_;
}
function setMerkleRoot1(bytes32 merkleRoot_) external virtual onlyOwner {
_merkleRoot1 = merkleRoot_;
}
function setMerkleRoot2(bytes32 merkleRoot_) external virtual onlyOwner {
_merkleRoot2 = merkleRoot_;
}
function isWhitelisted(address address_, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) external view virtual returns (bool) {
(bool ret,) = _isWhitelisted(address_,maxmint_,proof_,proof1_,proof2_);
return(ret);
}
function _isWhitelisted(address address_,uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) internal view returns (bool,uint256) {
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot,proof_)) return(true,0);
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot1,proof1_)) return(true,1);
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot2,proof2_)) return(true,2);
return(false,9999);
}
function getWhitelistedMaxMints(address address_, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) external view virtual returns (uint256) {
return(_getWhitelistedMaxMints(address_, maxmint_, proof_, proof1_, proof2_));
}
function _getWhitelistedMaxMints(address address_, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) internal view returns (uint256) {
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot,proof_)) return maxmint_;
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot1,proof1_)) return maxmint_;
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot2,proof2_)) return maxmint_;
return 0;
}
function hasWhitelistedOneWL(address address_,uint256 maxmint_, bytes32[] calldata proof_) external view virtual returns (bool) {
return(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot,proof_));
}
function _hasWhitelistedOneWL(address address_,uint256 maxmint_,bytes32 root_, bytes32[] calldata proof_) internal view returns (bool) {
if(maxmint_ > maxMintsCapPerWL)return false;
bytes32 _leaf = keccak256(abi.encodePacked(address_,maxmint_));
return(root_ != 0x0 && MerkleProof.verifyCalldata(proof_,root_,_leaf));
}
function hasWhitelistedOneWL1(address address_,uint256 maxmint_,bytes32[] calldata proof_) external view virtual returns (bool) {
return(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot1,proof_));
}
function hasWhitelistedOneWL2(address address_,uint256 maxmint_,bytes32[] calldata proof_) external view virtual returns (bool) {
return(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot2,proof_));
}
function getWhitelistedPrice(address address_, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) external view virtual returns (uint256) {
return(_getWhitelistedPrice(address_, maxmint_, proof_, proof1_, proof2_));
}
function _getWhitelistedPrice(address address_, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) internal view returns (uint256) {
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot,proof_)) return wlMintPrice;
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot1,proof1_)) return wlMintPrice1;
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot2,proof2_)) return wlMintPrice2;
return 9999 ether;
}
function getWhitelistedStatus(uint256 wlNum_,address address_, uint256 maxmint_,bytes32[] calldata proof_) external view returns (bool,uint256,uint256,bool,uint256) {
if(wlNum_ == 0){
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot,proof_)) return(isWlNumDisabled[0],wlMintPrice,_wlMinted[_seasonCounter][address_][_wlResetIndex],true,maxmint_);
else return(isWlNumDisabled[0],wlMintPrice,_wlMinted[_seasonCounter][address_][_wlResetIndex],false,0);
}else if(wlNum_ == 1){
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot1,proof_)) return(isWlNumDisabled[1],wlMintPrice1,_wlMinted1[_seasonCounter][address_][_wlResetIndex],true,maxmint_);
else return(isWlNumDisabled[1],wlMintPrice1,_wlMinted1[_seasonCounter][address_][_wlResetIndex],false,0);
}else if(wlNum_ == 2){
if(_hasWhitelistedOneWL(address_,maxmint_,_merkleRoot2,proof_))return(isWlNumDisabled[2],wlMintPrice2,_wlMinted2[_seasonCounter][address_][_wlResetIndex],true,maxmint_);
else return(isWlNumDisabled[2],wlMintPrice2,_wlMinted2[_seasonCounter][address_][_wlResetIndex],false,0);
}
return (false, 0, 0, false, 0);
}
function setSBTMode(bool bool_) external virtual onlyOwner {
isSBTEnabled = bool_;
}
function _beforeTokenTransfers(address from_,address to_,uint256 startTokenId_,uint256 quantity_) internal virtual override {
require(!isSBTEnabled || msg.sender == owner() || from_ == address(0) || to_ == address(0) ,"SBT mode Enabled: token transfer while paused.");
for (uint256 tokenId = startTokenId_; tokenId < startTokenId_ + quantity_; tokenId++) {
require(!isStakingEnabled || _stakingStartedTimestamp[tokenId] == NULL_STAKED,"Staking now.: token transfer while paused.");
if (_stakingStartedTimestamp[tokenId] != NULL_STAKED) {
uint256 deltaTime = block.timestamp - _stakingStartedTimestamp[tokenId];
_stakingTotalTime[tokenId] += deltaTime;
_stakingStartedTimestamp[tokenId] = NULL_STAKED;
_claimedLastTimestamp[tokenId] = NULL_STAKED;
}
}
super._beforeTokenTransfers(from_, to_, startTokenId_, quantity_);
}
function setHiddenBaseURI(string memory uri_) external virtual onlyOwner {
_revealUri[_seasonCounter] = uri_;
}
function setHiddenBaseURIBySeason(string memory uri_,uint256 _season) external virtual onlyOwner {
_revealUri[_season] = uri_;
}
function getCurrentIndex() external view virtual returns (uint256){
return _nextTokenId();
}
function getContractStatus() external view virtual returns (uint256){
return _contractStatus;
}
function setContractStatus(uint256 status_) external virtual onlyOwner {
_contractStatus = status_;
}
function getWlResetIndex() external view virtual returns (uint256){
return _wlResetIndex;
}
function resetWlMinted() external virtual onlyOwner {
_wlResetIndex++;
}
function getSeason() external view virtual returns (uint256){
return _seasonCounter;
}
function incrementSeason() external virtual onlyOwner {
isWlEnabled = false;
isPsEnabled = false;
isBmEnabled = false;
isHmEnabled = false;
_merkleRoot = 0x0;
_merkleRoot1 = 0x0;
_merkleRoot2 = 0x0;
_seasonCounter++;
seasonStartTokenId[_seasonCounter] = _nextTokenId();
}
function getSeasonByTokenId(uint256 _tokenId) external view virtual returns(uint256){
return _getSeasonByTokenId(_tokenId);
}
function _getSeasonByTokenId(uint256 _tokenId) internal view returns(uint256){
require(_exists(_tokenId), "Season query for nonexistent token");
uint256 nextStartTokenId = 10000000000;
for (uint256 i = _seasonCounter; i >= 0; i--) {
if(seasonStartTokenId[i] <= _tokenId && _tokenId < nextStartTokenId) return i;
nextStartTokenId = seasonStartTokenId[i];
}
return 0;
}
function setBaseURI(string memory uri_) external virtual onlyOwner {
_baseTokenURI[_seasonCounter] = uri_;
}
function setBaseURIBySeason(string memory uri_,uint256 _season) external virtual onlyOwner {
_baseTokenURI[_season] = uri_;
}
function setCustomTokenURI(uint256 _tokenId,string memory uri_) external virtual onlyOwner {
require(_exists(_tokenId), "URI query for nonexistent token");
_customTokenURI[_tokenId] = uri_;
}
function getCustomTokenURI(uint256 _tokenId) external view virtual returns (string memory) {
require(_exists(_tokenId), "URI query for nonexistent token");
return(_customTokenURI[_tokenId]);
}
function _currentBaseURI(uint256 _season) internal view returns (string memory){
return _baseTokenURI[_season];
}
function tokenURI(uint256 _tokenId) public view virtual override(ERC721A,IERC721A) returns (string memory) {
require(_exists(_tokenId), "URI query for nonexistent token");
uint256 _season = _getSeasonByTokenId(_tokenId);
if(_isRevealed[_season] == false) return _revealUri[_season];
if(bytes(_customTokenURI[_tokenId]).length != 0) return _customTokenURI[_tokenId];
return string(abi.encodePacked(_currentBaseURI(_season), Strings.toString(_tokenId), _extension));
}
function _commonMint(address _address,uint256 _amount) internal virtual {
require((_amount + totalSupply()) <= (maxSupply), "No more NFTs");
_safeMint(_address, _amount);
}
function ownerMint(uint256 _amount, address _address) external virtual onlyOwner {
_commonMint(_address, _amount);
}
function whitelistMint(uint256 _amount, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) external payable virtual nonReentrant {
uint256 wlNum = _whitelistMintCheck(_amount, maxmint_, proof_, proof1_, proof2_);
_whitelistMintCheckValue(_amount, maxmint_, proof_, proof1_, proof2_);
unchecked{
if(wlNum == 0) _wlMinted[_seasonCounter][msg.sender][_wlResetIndex] += _amount;
else if(wlNum == 1) _wlMinted1[_seasonCounter][msg.sender][_wlResetIndex] += _amount;
else _wlMinted2[_seasonCounter][msg.sender][_wlResetIndex] += _amount;
}
_commonMint(msg.sender, _amount);
}
function _whitelistMintCheck(uint256 _amount, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) internal virtual returns(uint256) {
require(isWlEnabled, "whitelistMint is Paused");
(bool isWL,uint256 wlNum) = _isWhitelisted(msg.sender, maxmint_,proof_, proof1_, proof2_);
require(isWL, "You are not whitelisted!");
require(!isWlNumDisabled[wlNum],"Now part of whitelist disabled.");
uint256 maxMints = _getWhitelistedMaxMints(msg.sender, maxmint_, proof_, proof1_, proof2_);
require(maxMints >= _amount, "whitelistMint: Over max mints per wallet");
if(wlNum == 0) require(maxMints >= _wlMinted[_seasonCounter][msg.sender][_wlResetIndex] + _amount, "You have no whitelistMint left");
else if(wlNum == 1) require(maxMints >= _wlMinted1[_seasonCounter][msg.sender][_wlResetIndex] + _amount, "You have no whitelistMint1 left");
else require(maxMints >= _wlMinted2[_seasonCounter][msg.sender][_wlResetIndex] + _amount, "You have no whitelistMint2 left");
return (wlNum);
}
function _whitelistMintCheckValue(uint256 _amount, uint256 maxmint_, bytes32[] calldata proof_, bytes32[] calldata proof1_, bytes32[] calldata proof2_) internal virtual {
uint256 price = _getWhitelistedPrice(msg.sender, maxmint_, proof_, proof1_, proof2_);
require(msg.value == price * _amount, "ETH value is not correct");
}
function publicMint(uint256 _amount) external payable virtual nonReentrant {
require(isPsEnabled, "publicMint is Paused");
require(maxMintsPerPS >= _amount, "publicMint: Over max mints per wallet");
require(maxMintsPerPS >= _psMinted[_seasonCounter][msg.sender] + _amount, "You have no publicMint left");
_publicMintCheckValue(_amount);
require(tx.origin == msg.sender,"publicMint: Caller is contract.");
unchecked{
_psMinted[_seasonCounter][msg.sender] += _amount;
}
_commonMint(msg.sender, _amount);
}
function _publicMintCheckValue(uint256 _amount) internal virtual {
require(msg.value == psMintPrice * _amount, "ETH value is not correct");
}
function setOtherContract(address _addr) external virtual onlyOwner {
otherContract = _addr;
_otherContractFactory = MGYERC721A(otherContract);
}
function _burnAndMint(uint256 _amount,uint256[] calldata _tokenids) internal virtual {
require(isBmEnabled, "Burn&MintSale is Paused");
require(maxMintsPerBM >= _amount, "Burn&MintSale: Over max mints per wallet");
require(maxMintsPerBM >= _bmMinted[_seasonCounter][msg.sender] + _amount, "You have no Burn&MintSale left");
_burnAndMintCheckValue(_amount);
require(otherContract != address(0),"not set otherContract.");
require(otherContractCount != 0 ,"not set otherContractCount.");
require( _tokenids.length == (otherContractCount * _amount),"amount must be multiple of other contract count.");
for (uint256 i = 0; i < _tokenids.length; i++) {
require(_otherContractFactory.ownerOf(_tokenids[i]) == msg.sender,"You are not owner of this tokenid.");
_otherContractFactory.burn(_tokenids[i]);
}
unchecked{
_bmMinted[_seasonCounter][msg.sender] += _amount;
}
_commonMint(msg.sender, _amount);
}
function _burnAndMintCheckValue(uint256 _amount) internal virtual {
require(msg.value == bmMintPrice * _amount, "ETH value is not correct");
}
function burnAndMint(uint256 _amount,uint256[] calldata _tokenids) external payable virtual nonReentrant {
require(otherContractGenesis == address(0),"can not set otherContractGenesis.");
require(otherContractCountGenesis == 0 ,"can not set otherContractCountGenesis.");
_burnAndMint(_amount,_tokenids);
}
function setOtherContractGenesis(address _addr) external virtual onlyOwner {
otherContractGenesis = _addr;
_otherContractGenesisFactory = MGYERC721A(otherContractGenesis);
}
function setOtherContractCountGenesis(uint256 _count) external virtual onlyOwner {
otherContractCountGenesis = _count;
}
function burnAndMintWithGenesis(uint256 _amount,uint256[] calldata _tokenids,uint256[] calldata _tokenidGenesis) external payable virtual nonReentrant {
require(otherContractGenesis != address(0),"not set otherContractGenesis.");
require(otherContractCountGenesis > 0 ,"not set otherContractCountGenesis.");
require(_tokenidGenesis.length >= otherContractCountGenesis,"You have not enough Genesis.");
for (uint256 i = 0; i < _tokenidGenesis.length; i++) {
require(_otherContractGenesisFactory.ownerOf(_tokenidGenesis[i]) == msg.sender,"You are not owner of this tokenidGenesis.");
}
_burnAndMint(_amount,_tokenids);
}
function holdAndMint(uint256 _amount,uint256[] calldata _tokenids) external payable virtual nonReentrant {
require(isHmEnabled, "Hold&MintSale is Paused");
require(maxMintsPerHM >= _amount, "Hold&MintSale: Over max mints per wallet");
require(maxMintsPerHM >= _hmMinted[_seasonCounter][msg.sender] + _amount, "You have no Hold&MintSale left");
_holdAndMintCheckValue(_amount);
require(otherContract != address(0),"not set otherContract.");
require(otherContractCount != 0 ,"not set otherContractCount.");
require( _tokenids.length == (otherContractCount * _amount),"amount must be multiple of other contract count.");
for (uint256 i = 0; i < _tokenids.length; i++) {
require(_otherContractFactory.ownerOf(_tokenids[i]) == msg.sender,"You are not owner of this tokenid.");
require(!_otherTokenidUsed[_seasonCounter][_tokenids[i]] ,"This other tokenid is Used.");
_otherTokenidUsed[_seasonCounter][_tokenids[i]] = true;
}
unchecked{
_hmMinted[_seasonCounter][msg.sender] += _amount;
}
_commonMint(msg.sender, _amount);
}
function _holdAndMintCheckValue(uint256 _amount) internal virtual {
require(msg.value == hmMintPrice * _amount, "ETH value is not correct");
}
function burn(uint256 tokenId) external virtual {
_burn(tokenId, true);
}
function withdraw() external payable virtual onlyOwner nonReentrant{
bool os;
if(_withdrawWallet != address(0)){
(os, ) = payable(_withdrawWallet).call{value: address(this).balance}("");
}else{
(os, ) = payable(owner()).call{value: address(this).balance}("");
}
require(os);
}
function walletOfOwner(address owner) external view virtual returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memory ownership;
for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; i++) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
return tokenIds;
}
}
function setStakingEnable(bool bool_) external virtual onlyOwner {
isStakingEnabled = bool_;
if(bool_){
stakingStartTimestamp = block.timestamp;
stakingEndTimestamp = NULL_STAKED;
}else{
stakingEndTimestamp = block.timestamp;
}
}
function _getStakingInfo(uint256 _tokenId) internal view virtual returns (uint256 startTimestamp, uint256 currentStakingTime, uint256 totalStakingTime, bool isStaking,uint256 claimedLastTimestamp ){
require(_exists(_tokenId), "nonexistent token");
currentStakingTime = 0;
startTimestamp = _stakingStartedTimestamp[_tokenId];
if (startTimestamp != NULL_STAKED) {
currentStakingTime = block.timestamp - startTimestamp;
}
totalStakingTime = currentStakingTime + _stakingTotalTime[_tokenId];
isStaking = startTimestamp != NULL_STAKED;
claimedLastTimestamp = _claimedLastTimestamp[_tokenId];
}
function getStakingInfo(uint256 _tokenId) external view virtual returns (uint256 startTimestamp, uint256 currentStakingTime, uint256 totalStakingTime, bool isStaking,uint256 claimedLastTimestamp ){
(startTimestamp, currentStakingTime, totalStakingTime, isStaking, claimedLastTimestamp) = _getStakingInfo(_tokenId);
}
function _toggleStaking(uint256 _tokenId) internal virtual {
require(ownerOf(_tokenId) == msg.sender,"You are not owner of this tokenid.");
require(_exists(_tokenId), "nonexistent token");
uint256 startTimestamp = _stakingStartedTimestamp[_tokenId];
if (startTimestamp == NULL_STAKED) {
require(isStakingEnabled, "Staking closed");
_stakingStartedTimestamp[_tokenId] = block.timestamp;
} else {
_stakingTotalTime[_tokenId] += block.timestamp - startTimestamp;
_stakingStartedTimestamp[_tokenId] = NULL_STAKED;
_claimedLastTimestamp[_tokenId] = NULL_STAKED;
}
}
function toggleStaking(uint256[] calldata _tokenIds) external virtual {
uint256 num = _tokenIds.length;
for (uint256 i = 0; i < num; i++) {
uint256 tokenId = _tokenIds[i];
_toggleStaking(tokenId);
}
}
function setRewardContract(address _addr) external virtual onlyOwner {
rewardContract = _addr;
_rewardContractFactory = MGYREWARD(rewardContract);
}
function _claimReward(uint256 _tokenId) internal virtual {
require(ownerOf(_tokenId) == msg.sender,"You are not owner of this tokenid.");
require(_exists(_tokenId), "nonexistent token");
(uint256 startTimestamp, uint256 currentStakingTime, uint256 totalStakingTime, bool isStaking,uint256 claimedLastTimestamp ) = _getStakingInfo(_tokenId);
uint256 _lastTimestamp = block.timestamp;
_claimedLastTimestamp[_tokenId] = _lastTimestamp;
_rewardContractFactory.claimReward(stakingStartTimestamp, stakingEndTimestamp, _tokenId, startTimestamp, currentStakingTime, totalStakingTime, isStaking, claimedLastTimestamp, _lastTimestamp);
}
function claimReward(uint256[] calldata _tokenIds) external virtual nonReentrant{
require(isStakingEnabled, "Staking closed");
uint256 num = _tokenIds.length;
for (uint256 i = 0; i < num; i++) {
uint256 tokenId = _tokenIds[i];
_claimReward(tokenId);
}
}
function setApprovalForAll(address operator, bool approved) public override(ERC721A,IERC721A) onlyAllowedOperatorApproval(operator){
super.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId) public payable override(ERC721A,IERC721A) onlyAllowedOperatorApproval(operator){
super.approve(operator, tokenId);
}
function transferFrom(address from, address to, uint256 tokenId) public payable override(ERC721A,IERC721A) onlyAllowedOperator(from){
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override(ERC721A,IERC721A) onlyAllowedOperator(from){
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override(ERC721A,IERC721A) onlyAllowedOperator(from){
super.safeTransferFrom(from, to, tokenId, data);
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
operatorFilteringEnabled = value;
}
function _operatorFilteringEnabled() internal view override returns (bool) {
return operatorFilteringEnabled;
}
function metadataUpdate(uint256 _tokenId) external virtual onlyOwner {
emit MetadataUpdate(_tokenId);
}
function batchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId) external virtual onlyOwner {
emit BatchMetadataUpdate( _fromTokenId, _toTokenId);
}
}
文件 15 的 21:MGYREWARD.sol
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./MGYERC721A.sol";
contract MGYREWARD is Ownable,ReentrancyGuard{
address public callContract;
MGYERC721A internal _callContractFactory;
function setCallContract(address _callAddr) external virtual onlyOwner{
callContract = _callAddr;
_callContractFactory = MGYERC721A(callContract);
}
function _claimReward(uint256 _stakingStartTimestamp, uint256 _stakingEndTimestamp, uint256 _tokenId,uint256 _startTimestamp, uint256 _currentStakingTime, uint256 _totalStakingTime, bool _isStaking, uint256 _claimedLastTimestamp, uint256 _currentClaimedLastTimestamp) internal virtual{
}
function claimReward(uint256 _stakingStartTimestamp, uint256 _stakingEndTimestamp, uint256 _tokenId,uint256 _startTimestamp, uint256 _currentStakingTime, uint256 _totalStakingTime, bool _isStaking, uint256 _claimedLastTimestamp, uint256 _currentClaimedLastTimestamp) external virtual nonReentrant{
require(callContract != address(0),"not set callContract.");
require(msg.sender == callContract,"only callContract can call this function.");
_claimReward(_stakingStartTimestamp, _stakingEndTimestamp, _tokenId, _startTimestamp, _currentStakingTime, _totalStakingTime, _isStaking, _claimedLastTimestamp, _currentClaimedLastTimestamp);
}
}
文件 16 的 21:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
文件 17 的 21: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 verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(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++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
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;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
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 processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
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) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 18 的 21:OperatorFilterer.sol
pragma solidity ^0.8.4;
abstract contract OperatorFilterer {
address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E;
function _registerForOperatorFiltering() internal virtual {
_registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true);
}
function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe)
internal
virtual
{
assembly {
let functionSelector := 0x7d3e3dbe
subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy))
for {} iszero(subscribe) {} {
if iszero(subscriptionOrRegistrantToCopy) {
functionSelector := 0x4420e486
break
}
functionSelector := 0xa0af2903
break
}
mstore(0x00, shl(224, functionSelector))
mstore(0x04, address())
mstore(0x24, subscriptionOrRegistrantToCopy)
if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) {
if eq(shr(224, mload(0x00)), functionSelector) {
revert(0, 0)
}
}
mstore(0x24, 0)
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
if (!_isPriorityOperator(msg.sender)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender);
}
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
if (!_isPriorityOperator(operator)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(operator);
}
_;
}
function _revertIfBlocked(address operator) private view {
assembly {
mstore(0x00, 0xc6171134001122334455)
mstore(0x1a, address())
mstore(0x3a, operator)
if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) {
returndatacopy(0x00, 0x00, returndatasize())
revert(0x00, returndatasize())
}
mstore(0x3a, 0)
}
}
function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
function _isPriorityOperator(address) internal view virtual returns (bool) {
return false;
}
}
文件 19 的 21: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());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
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);
}
}
文件 20 的 21:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
}
文件 21 的 21:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
{
"compilationTarget": {
"contracts/BLBERC721A.sol": "BLBERC721A"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 1
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SetUserCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint64","name":"expires","type":"uint64"}],"name":"UpdateUser","type":"event"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"batchMetadataUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bmMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"bmMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"bmMintedBySeason","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_tokenids","type":"uint256[]"}],"name":"burnAndMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_tokenids","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenidGenesis","type":"uint256[]"}],"name":"burnAndMintWithGenesis","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractStatus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getCustomTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getOtherTokenidUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"getOtherTokenidUsedBySeason","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSeason","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getSeasonByTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getStakingInfo","outputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentStakingTime","type":"uint256"},{"internalType":"uint256","name":"totalStakingTime","type":"uint256"},{"internalType":"bool","name":"isStaking","type":"bool"},{"internalType":"uint256","name":"claimedLastTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof1_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof2_","type":"bytes32[]"}],"name":"getWhitelistedMaxMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof1_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof2_","type":"bytes32[]"}],"name":"getWhitelistedPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"wlNum_","type":"uint256"},{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"getWhitelistedStatus","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWlResetIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"hasWhitelistedOneWL","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"hasWhitelistedOneWL1","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"hasWhitelistedOneWL2","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hmMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"hmMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"hmMintedBySeason","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_tokenids","type":"uint256[]"}],"name":"holdAndMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"incrementSeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBmEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isHmEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"isRevealedBySeason","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSBTEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isStakingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof1_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof2_","type":"bytes32[]"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWlEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isWlNumDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintsCapPerWL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintsPerBM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintsPerHM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintsPerPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"metadataUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilteringEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherContractCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherContractCountGenesis","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherContractGenesis","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"psMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"psMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"psMintedBySeason","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetWlMinted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"seasonStartTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"setBaseURIBySeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setBmMaxMints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setBmPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setBurnAndMintSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"status_","type":"uint256"}],"name":"setContractStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setCustomTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_wlNum","type":"uint256"},{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setDisabledPartWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setHiddenBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"setHiddenBaseURIBySeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setHmMaxMints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setHmPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setHoldAndMintSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"setMerkleRoot1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"setMerkleRoot2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setOtherContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setOtherContractCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"setOtherContractCountGenesis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setOtherContractGenesis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setOtherTokenidUsed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"bool_","type":"bool"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"setOtherTokenidUsedBySeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setPsMaxMints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPsPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"setRevealBySeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRewardContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"","type":"bool"}],"name":"setSBTMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setStakingEnable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint64","name":"expires","type":"uint64"}],"name":"setUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setWithdrawWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setWlMaxMintsCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setWlPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setWlPrice1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setWlPrice2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingEndTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingStartTimestamp","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":"_tokenIds","type":"uint256[]"}],"name":"toggleStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"userExpires","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"userOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"maxmint_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof1_","type":"bytes32[]"},{"internalType":"bytes32[]","name":"proof2_","type":"bytes32[]"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"wlMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wlMintPrice1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wlMintPrice2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"wlMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"wlMinted1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"wlMinted2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"wlMintedBySeason","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"wlMintedBySeason1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_season","type":"uint256"}],"name":"wlMintedBySeason2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]