// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)pragmasolidity ^0.8.1;/**
* @dev Collection of functions related to the address type
*/libraryAddress{
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/functionisContract(address account) internalviewreturns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0// for contracts in construction, since the code is only stored at the end// of the constructor execution.return account.code.length>0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/functionsendValue(addresspayable recipient, uint256 amount) internal{
require(address(this).balance>= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/functionfunctionCall(address target, bytesmemory data) internalreturns (bytesmemory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/functionfunctionCall(address target,
bytesmemory data,
stringmemory errorMessage
) internalreturns (bytesmemory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/functionfunctionCallWithValue(address target,
bytesmemory data,
uint256 value
) internalreturns (bytesmemory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/functionfunctionCallWithValue(address target,
bytesmemory data,
uint256 value,
stringmemory errorMessage
) internalreturns (bytesmemory) {
require(address(this).balance>= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytesmemory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/functionfunctionStaticCall(address target, bytesmemory data) internalviewreturns (bytesmemory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/functionfunctionStaticCall(address target,
bytesmemory data,
stringmemory errorMessage
) internalviewreturns (bytesmemory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytesmemory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/functionfunctionDelegateCall(address target, bytesmemory data) internalreturns (bytesmemory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/functionfunctionDelegateCall(address target,
bytesmemory data,
stringmemory errorMessage
) internalreturns (bytesmemory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytesmemory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/functionverifyCallResult(bool success,
bytesmemory returndata,
stringmemory errorMessage
) internalpurereturns (bytesmemory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if presentif (returndata.length>0) {
// The easiest way to bubble the revert reason is using memory via assemblyassembly {
let returndata_size :=mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Contract Source Code
File 2 of 13: Context.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)pragmasolidity ^0.8.0;/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/abstractcontractContext{
function_msgSender() internalviewvirtualreturns (address) {
returnmsg.sender;
}
function_msgData() internalviewvirtualreturns (bytescalldata) {
returnmsg.data;
}
}
Contract Source Code
File 3 of 13: ECDSA.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)pragmasolidity ^0.8.0;import"../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/libraryECDSA{
enumRecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function_throwError(RecoverError error) privatepure{
if (error == RecoverError.NoError) {
return; // no error: do nothing
} elseif (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} elseif (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} elseif (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} elseif (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/functiontryRecover(bytes32 hash, bytesmemory signature) internalpurereturns (address, RecoverError) {
// Check the signature length// - case 65: r,s,v signature (standard)// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._if (signature.length==65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them// currently is to use assembly.assembly {
r :=mload(add(signature, 0x20))
s :=mload(add(signature, 0x40))
v :=byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} elseif (signature.length==64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them// currently is to use assembly.assembly {
r :=mload(add(signature, 0x20))
vs :=mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/functionrecover(bytes32 hash, bytesmemory signature) internalpurereturns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/functiontryRecover(bytes32 hash,
bytes32 r,
bytes32 vs
) internalpurereturns (address, RecoverError) {
bytes32 s = vs &bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v =uint8((uint256(vs) >>255) +27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/functionrecover(bytes32 hash,
bytes32 r,
bytes32 vs
) internalpurereturns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/functiontryRecover(bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internalpurereturns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most// signatures from current libraries generate a unique signature with an s-value in the lower half order.//// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept// these malleable signatures as well.if (uint256(s) >0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v !=27&& v !=28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer addressaddress signer =ecrecover(hash, v, r, s);
if (signer ==address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/functionrecover(bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internalpurereturns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/functiontoEthSignedMessageHash(bytes32 hash) internalpurereturns (bytes32) {
// 32 is the length in bytes of hash,// enforced by the type signature abovereturnkeccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/functiontoEthSignedMessageHash(bytesmemory s) internalpurereturns (bytes32) {
returnkeccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/functiontoTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internalpurereturns (bytes32) {
returnkeccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
Contract Source Code
File 4 of 13: ERC165.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)pragmasolidity ^0.8.0;import"./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/abstractcontractERC165isIERC165{
/**
* @dev See {IERC165-supportsInterface}.
*/functionsupportsInterface(bytes4 interfaceId) publicviewvirtualoverridereturns (bool) {
return interfaceId ==type(IERC165).interfaceId;
}
}
Contract Source Code
File 5 of 13: ERC721SZNS.sol
// SPDX-License-Identifier: MIT// Creator: Christopher Mikel Sheltonpragmasolidity ^0.8.12;import"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import"@openzeppelin/contracts/utils/Address.sol";
import"@openzeppelin/contracts/utils/Context.sol";
import"@openzeppelin/contracts/utils/Strings.sol";
import"@openzeppelin/contracts/utils/introspection/ERC165.sol";
import"@openzeppelin/contracts/token/ERC721/IERC721.sol";
import"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
errorApprovalCallerNotOwnerNorApproved();
errorApprovalQueryForNonexistentToken();
errorApproveToCaller();
errorApprovalToCurrentOwner();
errorBalanceQueryForZeroAddress();
errorMintZeroQuantity();
errorTokenNotClaimable();
errorTokenAlreadyExists();
errorOwnerIsZeroAddress();
errorCallOnlyValidAfterTokenOffset();
errorOwnerQueryForNonexistentToken();
errorTransferCallerNotOwnerNorApproved();
errorTransferFromIncorrectOwner();
errorTransferToNonERC721ReceiverImplementer();
errorTransferToZeroAddress();
errorURIQueryForNonexistentToken();
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard
*
* This contract is design to handle the standard ERC721 implementation
* and a gas optimized batch minting process pioneered by ERC721A.
* Within the same collection, the first range of tokens may be minted in any order
* using {_safeClaim} and at the point of the offset, every token after that must
* be minted sequentially as it implements batch minting using {_safeMint}
*
*/contractERC721SZNSisContext, ERC165, IERC721, IERC721Metadata{
usingAddressforaddress;
usingStringsforuint256;
// Token namestringprivate _name;
// Token symbolstringprivate _symbol;
// Mapping from token ID to owner addressmapping(uint256=>address) private _owners;
// Mapping owner address to token countmapping(address=>uint256) private _balances;
// Mapping from token ID to approved addressmapping(uint256=>address) private _tokenApprovals;
// Mapping from owner to operator approvalsmapping(address=>mapping(address=>bool)) private _operatorApprovals;
// ===== Key token split offset between known tokenIds and new collection =====uint256internalimmutable _tokenSplitOffset;
// ===== tokenIds for the latter part of the collection, after offset =====uint256private _nextTokenId;
uint256private _tokensClaimed;
uint256private _tokensMinted;
constructor(stringmemory name_, stringmemory symbol_, uint256 offset) {
_name = name_;
_symbol = symbol_;
_tokenSplitOffset = offset;
// the next token id will be the offset plus 1, as it is 1 based indexed// i.e. offset is 5864, next token to be minted sequentially is 5865
_nextTokenId = offset +1;
}
/**
* @dev See {IERC165-supportsInterface}.
*/functionsupportsInterface(bytes4 interfaceId) publicviewvirtualoverride(ERC165, IERC165) returns (bool) {
return
interfaceId ==type(IERC721).interfaceId||
interfaceId ==type(IERC721Metadata).interfaceId||super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*
* Number of claimed summer tokens plus number of minted season tokens
*/functiontotalSupply() publicviewreturns (uint256) {
unchecked {
return _tokensClaimed + _tokensMinted;
}
}
functiontokensClaimed() publicviewreturns (uint256) {
return _tokensClaimed;
}
functiontokensMinted() publicviewreturns (uint256) {
return _tokensMinted;
}
/**
* @dev See {IERC721-balanceOf}.
*/functionbalanceOf(address owner) publicviewvirtualoverridereturns (uint256) {
if (owner ==address(0)) revert BalanceQueryForZeroAddress();
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf} or {ERC721A-ownerOf}
*/functionownerOf(uint256 tokenId) publicviewreturns (address) {
address owner;
if (tokenId > _tokenSplitOffset) {
unchecked {
// 'tokenId + 1' and '>' is cheaper than doing '>=' without '+1'if (tokenId +1> _nextTokenId) revert OwnerQueryForNonexistentToken();
for (uint256 curr = tokenId;; curr--) {
owner = _owners[curr];
if (owner !=address(0)) {
return owner;
}
}
}
revert OwnerQueryForNonexistentToken();
}
owner = _owners[tokenId];
if (owner ==address(0)) revert OwnerIsZeroAddress();
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/functionname() publicviewvirtualreturns (stringmemory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/functionsymbol() publicviewvirtualreturns (stringmemory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/functiontokenURI(uint256 tokenId) publicviewvirtualreturns (stringmemory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
stringmemory baseURI = _baseURI();
returnbytes(baseURI).length!=0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/function_baseURI() internalviewvirtualreturns (stringmemory) {
return"";
}
/**
* @dev See {IERC721-approve}.
*/functionapprove(address to, uint256 tokenId) publicvirtual{
address owner = ERC721SZNS.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner &&!isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/functiongetApproved(uint256 tokenId) publicviewvirtualreturns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/functionsetApprovalForAll(address operator, bool approved) publicvirtual{
if (operator == _msgSender()) revert ApproveToCaller();
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/functionisApprovedForAll(address owner, address operator) publicviewvirtualreturns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/functiontransferFrom(addressfrom, address to, uint256 tokenId) public{
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/functionsafeTransferFrom(addressfrom, address to, uint256 tokenId) public{
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/functionsafeTransferFrom(addressfrom, address to, uint256 tokenId, bytesmemory _data) public{
_transfer(from, to, tokenId);
if (!_checkOnERC721Received(from, to, tokenId, _data)) revert TransferToNonERC721ReceiverImplementer();
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event.
*/function_mint(address to, uint256 quantity) internal{
if (quantity ==0) revert MintZeroQuantity();
// Overflows are incredibly unrealistic.// balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1// updatedIndex overflows if currentIndex + quantity > 1.56e77 (2**256) - 1unchecked {
_balances[to] += quantity;
_owners[_nextTokenId] = to;
uint256 updatedIndex = _nextTokenId;
for (uint256 i; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
updatedIndex++;
}
_tokensMinted += quantity;
_nextTokenId = updatedIndex;
}
}
function_claim(address to, uint256 tokenId) internal{
if (tokenId > _tokenSplitOffset) revert TokenNotClaimable();
if (_exists(tokenId)) revert TokenAlreadyExists();
unchecked {
_balances[to]++;
_owners[tokenId] = to;
_tokensClaimed++;
emit Transfer(address(0), to, tokenId);
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/function_transfer(addressfrom, address to, uint256 tokenId) private{
address prevOwner = ERC721SZNS.ownerOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwner ||
isApprovedForAll(prevOwner, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (prevOwner !=from) revert TransferFromIncorrectOwner();
if (to ==address(0)) revert TransferToZeroAddress();
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwner);
// Underflow of the sender's balance is impossible because we check for// ownership above and the recipient's balance can't realistically overflow.// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.unchecked {
_balances[from]--;
_balances[to]++;
_owners[tokenId] = to;
// this only applies to the second part of the collectionif (tokenId > _tokenSplitOffset) {
// If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.// Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.uint256 nextTokenId = tokenId +1;
if (_owners[nextTokenId] ==address(0)) {
if (_exists(nextTokenId)) {
_owners[nextTokenId] = prevOwner;
}
}
}
}
emit Transfer(from, to, tokenId);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens will exist once they are claimed within the first part of the collection
* or when they are {_mint}
*
* @dev If token is greater than the collection offset, it uses {ERC721A-_exist}
* else it uses {ERC721-_exist}
*/function_exists(uint256 tokenId) internalviewreturns (bool) {
if (tokenId > _tokenSplitOffset) return tokenId < _nextTokenId;
return _owners[tokenId] !=address(0);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/function_approve(address to, uint256 tokenId, address owner) internalvirtual{
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/function_checkOnERC721Received(addressfrom, address to, uint256 tokenId, bytesmemory _data) privatereturns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(
_msgSender(),
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytesmemory reason) {
if (reason.length==0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
returntrue;
}
}
}
Contract Source Code
File 6 of 13: IERC165.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)pragmasolidity ^0.8.0;/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/interfaceIERC165{
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/functionsupportsInterface(bytes4 interfaceId) externalviewreturns (bool);
}
Contract Source Code
File 7 of 13: IERC2981.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)pragmasolidity ^0.8.0;import"./IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/interfaceIERC2981isIERC165{
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
*/functionroyaltyInfo(uint256 tokenId, uint256 salePrice)
externalviewreturns (address receiver, uint256 royaltyAmount);
}
Contract Source Code
File 8 of 13: IERC721.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)pragmasolidity ^0.8.0;import"../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/interfaceIERC721isIERC165{
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/eventTransfer(addressindexedfrom, addressindexed to, uint256indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/eventApproval(addressindexed owner, addressindexed approved, uint256indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/eventApprovalForAll(addressindexed owner, addressindexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/functionbalanceOf(address owner) externalviewreturns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/functionownerOf(uint256 tokenId) externalviewreturns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/functionsafeTransferFrom(addressfrom,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/functiontransferFrom(addressfrom,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/functionapprove(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/functiongetApproved(uint256 tokenId) externalviewreturns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/functionsetApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/functionisApprovedForAll(address owner, address operator) externalviewreturns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/functionsafeTransferFrom(addressfrom,
address to,
uint256 tokenId,
bytescalldata data
) external;
}
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)pragmasolidity ^0.8.0;/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/interfaceIERC721Receiver{
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/functiononERC721Received(address operator,
addressfrom,
uint256 tokenId,
bytescalldata data
) externalreturns (bytes4);
}
Contract Source Code
File 11 of 13: Ownable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)pragmasolidity ^0.8.0;import"../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/abstractcontractOwnableisContext{
addressprivate _owner;
eventOwnershipTransferred(addressindexed previousOwner, addressindexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/functionowner() publicviewvirtualreturns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/modifieronlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/functionrenounceOwnership() publicvirtualonlyOwner{
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/functiontransferOwnership(address newOwner) publicvirtualonlyOwner{
require(newOwner !=address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/function_transferOwnership(address newOwner) internalvirtual{
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Contract Source Code
File 12 of 13: Strings.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)pragmasolidity ^0.8.0;/**
* @dev String operations.
*/libraryStrings{
bytes16privateconstant _HEX_SYMBOLS ="0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/functiontoString(uint256 value) internalpurereturns (stringmemory) {
// Inspired by OraclizeAPI's implementation - MIT licence// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.solif (value ==0) {
return"0";
}
uint256 temp = value;
uint256 digits;
while (temp !=0) {
digits++;
temp /=10;
}
bytesmemory buffer =newbytes(digits);
while (value !=0) {
digits -=1;
buffer[digits] =bytes1(uint8(48+uint256(value %10)));
value /=10;
}
returnstring(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/functiontoHexString(uint256 value) internalpurereturns (stringmemory) {
if (value ==0) {
return"0x00";
}
uint256 temp = value;
uint256 length =0;
while (temp !=0) {
length++;
temp >>=8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/functiontoHexString(uint256 value, uint256 length) internalpurereturns (stringmemory) {
bytesmemory buffer =newbytes(2* length +2);
buffer[0] ="0";
buffer[1] ="x";
for (uint256 i =2* length +1; i >1; --i) {
buffer[i] = _HEX_SYMBOLS[value &0xf];
value >>=4;
}
require(value ==0, "Strings: hex length insufficient");
returnstring(buffer);
}
}
Contract Source Code
File 13 of 13: TheArtOfSeasons.sol
// SPDX-License-Identifier: MIT// Creator: Christopher Mikel Sheltonpragmasolidity ^0.8.12;import"@openzeppelin/contracts/access/Ownable.sol";
import"@openzeppelin/contracts/interfaces/IERC2981.sol";
import"@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import"./ERC721SZNS.sol";
errorSummerTokensClaimClosed();
errorSeasonsMintClosed();
errorNoContractMints();
errorMaxMintExceeded();
errorInvalidSignature();
errorNotEnoughEth();
errorInncorrectLengths();
errorBaseURILocked();
errorRoyaltyInfoForNonexistentToken();
errorTransferFailed();
contractTheArtOfSeasonsisOwnable, ERC721SZNS, IERC2981{
usingECDSAforbytes32;
eventPermanentURI(string _value, uint256indexed _id);
// the largest possible token id from the summer seasonuint256publicconstant SUMMER_MAX_TOKEN_ID =8564;
uint256publicconstant MAX_SEASONS_COUNT =6304;
uint256publicconstant CLAIMER_MINT_PRICE =0.04ether;
uint256publicconstant MINT_PRICE =0.08ether;
uint256publicconstant MAX_MINT_DURING_CLAIM =2;
uint256publicconstant MAX_MINT_PER_TX =8;
boolpublic summerTokensClaimable;
boolpublic seasonsMintOpen;
addresspublic sigSigner =0x68cBE370A1b35f3f185172c063BBbabF836d7Ecc;
addresspublic royaltyAddress;
uint256public royaltyPercent;
stringprivate _baseTokenURI;
boolpublic locked;
constructor() ERC721SZNS("The Art of Seasons", "TAOS", SUMMER_MAX_TOKEN_ID) {
royaltyAddress = owner();
royaltyPercent =5;
}
functionmintSeason(uint256 quantity) externalpayable{
if (!seasonsMintOpen) revert SeasonsMintClosed();
if (quantity > MAX_MINT_PER_TX) revert MaxMintExceeded();
if (tx.origin!=msg.sender) revert NoContractMints();
if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();
_mint(msg.sender, quantity);
_refundOverPayment(MINT_PRICE * quantity);
}
functionmintForSummerHolder(bytescalldata ticketSignature, uint256 ticket, uint256 quantity) externalpayable{
if (!summerTokensClaimable) revert SummerTokensClaimClosed();
if (quantity > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
if (tx.origin!=msg.sender) revert NoContractMints();
if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();
_claimSummerMintTicket(ticketSignature, ticket, quantity);
_mint(msg.sender, quantity);
_refundOverPayment(CLAIMER_MINT_PRICE * quantity);
}
functionclaimSummer(bytescalldata claimSignature,
uint256[] calldata tokens,
uint256[] calldata claimIdxs
) externalpayable{
if (!summerTokensClaimable) revert SummerTokensClaimClosed();
if (tx.origin!=msg.sender) revert NoContractMints();
uint256 len = claimIdxs.length;
if (len -1> tokens.length) revert InncorrectLengths();
_verifyClaimSignature(claimSignature, tokens);
for (uint256 i =0; i < len; i++) {
uint256 tokenId = tokens[claimIdxs[i]];
_claim(msg.sender, tokenId);
}
}
functionclaimSummerAndMint(bytescalldata claimSignature,
bytescalldata ticketSignature,
uint256[] calldata tokens,
uint256[] calldata claimIdxs,
uint256 ticket,
uint256 mintQty
) externalpayable{
if (!summerTokensClaimable) revert SummerTokensClaimClosed();
if (mintQty > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
if (tx.origin!=msg.sender) revert NoContractMints();
if (tokensMinted() + mintQty > MAX_SEASONS_COUNT) revert MaxMintExceeded();
uint256 len = claimIdxs.length;
if (len -1> tokens.length) revert InncorrectLengths();
_verifyClaimSignature(claimSignature, tokens);
for (uint256 i =0; i < len; i++) {
uint256 tokenId = tokens[claimIdxs[i]];
_claim(msg.sender, tokenId);
}
if (mintQty ==0) return;
_claimSummerMintTicket(ticketSignature, ticket, mintQty);
_mint(msg.sender, mintQty);
_refundOverPayment(CLAIMER_MINT_PRICE * mintQty);
}
functionclaimAllSummer(bytescalldata signature, uint256[] calldata tokens) externalpayable{
if (!summerTokensClaimable) revert SummerTokensClaimClosed();
if (tx.origin!=msg.sender) revert NoContractMints();
_verifyClaimSignature(signature, tokens);
uint256 len = tokens.length;
for (uint256 i =0; i < len; i++) {
_claim(msg.sender, tokens[i]);
}
}
functionclaimAllSummerAndMint(bytescalldata claimSignature,
bytescalldata ticketSignature,
uint256[] calldata tokens,
uint256 ticket,
uint256 mintQty
) externalpayable{
if (!summerTokensClaimable) revert SummerTokensClaimClosed();
if (mintQty > MAX_MINT_DURING_CLAIM) revert MaxMintExceeded();
if (tx.origin!=msg.sender) revert NoContractMints();
if (tokensMinted() + mintQty > MAX_SEASONS_COUNT) revert MaxMintExceeded();
_verifyClaimSignature(claimSignature, tokens);
uint256 len = tokens.length;
for (uint256 i =0; i < len; i++) {
_claim(msg.sender, tokens[i]);
}
if (mintQty ==0) return;
_claimSummerMintTicket(ticketSignature, ticket, mintQty);
_mint(msg.sender, mintQty);
_refundOverPayment(CLAIMER_MINT_PRICE * mintQty);
}
function_refundOverPayment(uint256 amount) internal{
if (msg.value< amount) revert NotEnoughEth();
if (msg.value> amount) {
payable(msg.sender).transfer(msg.value- amount);
}
}
functionsetSigSigner(address signer) externalonlyOwner{
if (signer ==address(0)) revert OwnerIsZeroAddress();
sigSigner = signer;
}
function_verifyClaimSignature(bytescalldata signature, uint256[] calldata tokens) internalview{
address signedAddr =keccak256(abi.encodePacked(msg.sender, tokens))
.toEthSignedMessageHash()
.recover(signature);
if (sigSigner != signedAddr) revert InvalidSignature();
}
uint256privateconstant MAX_INT =2**256-1;
uint256private mintGroup0 = MAX_INT;
uint256private mintGroup1 = MAX_INT;
uint256private mintGroup2 = MAX_INT;
uint256private mintGroup3 = MAX_INT;
uint256private mintGroup4 = MAX_INT;
uint256private mintGroup5 = MAX_INT;
function_getBitForTicket(uint256 ticket) internalviewreturns(uint256) {
uint256 slot;
uint256 offsetInSlot;
uint256 localGroup;
unchecked {
slot = ticket /256;
offsetInSlot = ticket %256;
}
assembly {
slot :=add(mintGroup0.slot, slot)
localGroup :=sload(slot)
}
return (localGroup >> offsetInSlot) &uint256(1);
}
function_useBitForTicket(uint256 ticket) internal{
uint256 slot;
uint256 offsetInSlot;
uint256 localGroup;
unchecked {
slot = ticket /256;
offsetInSlot = ticket %256;
}
assembly {
slot :=add(mintGroup0.slot, slot)
localGroup :=sload(slot)
}
localGroup = localGroup &~(uint256(1) << offsetInSlot);
assembly {
sstore(slot, localGroup)
}
}
function_claimSummerMintTicket(bytescalldata signature, uint256 ticket, uint256 mintQty) internal{
address signedAddr =keccak256(abi.encodePacked(msg.sender, ticket))
.toEthSignedMessageHash()
.recover(signature);
if (sigSigner != signedAddr) revert InvalidSignature();
// check the ticket number for the first mint available for minteruint256 storedBit1 = _getBitForTicket(ticket);
// we will use the second ticket slot first// so if the first ticket slot is used, then we have none availableif (storedBit1 ==0) revert MaxMintExceeded();
uint256 secondTicket = ticket +1;
uint256 storedBit2 = _getBitForTicket(secondTicket);
if (storedBit2 ==1) {
_useBitForTicket(secondTicket);
if (mintQty ==2) {
_useBitForTicket(ticket);
}
} else {
if (mintQty ==2) revert MaxMintExceeded();
// mintQty is 1 and available is 1
_useBitForTicket(ticket);
}
}
functionnumberMintedDuringClaim(uint256 ticket) externalviewreturns (uint256) {
uint256 storedBit1 = _getBitForTicket(ticket);
if (storedBit1 ==0) return2;
uint256 storedBit2 = _getBitForTicket(ticket +1);
if (storedBit2 ==0) return1;
return0;
}
functiontoggleClaiming() externalonlyOwner{
summerTokensClaimable =!summerTokensClaimable;
}
functiontoggleMint() externalonlyOwner{
seasonsMintOpen =!seasonsMintOpen;
}
functionsetRoyaltyReceiver(address royaltyReceiver) externalonlyOwner{
royaltyAddress = royaltyReceiver;
}
functionsetRoyaltyPercentage(uint256 royaltyPercentage) externalonlyOwner{
royaltyPercent = royaltyPercentage;
}
functionroyaltyInfo(uint256 tokenId, uint256 salePrice) externalviewoverridereturns (address receiver, uint256 royaltyAmount) {
if (!_exists(tokenId)) revert RoyaltyInfoForNonexistentToken();
return (royaltyAddress, salePrice * royaltyPercent /100);
}
function_baseURI() internalviewvirtualoverridereturns (stringmemory) {
return _baseTokenURI;
}
functionsetBaseURI(stringcalldata baseURI_) externalonlyOwner{
if (locked) revert BaseURILocked();
_baseTokenURI = baseURI_;
}
functionlockBaseURI() externalonlyOwner{
if (locked) revert BaseURILocked();
locked =true;
}
functionwithdraw() externalonlyOwner{
(bool success, ) =msg.sender.call{value: address(this).balance}("");
if (!success) revert TransferFailed();
}
// @dev contract owner must be an EOA accountfunctiondevClaimForHolder(uint256 tokenId, address to) externalonlyOwner{
_claim(to, tokenId);
}
// used for giveaways// @dev contract owner must be an EOA accountfunctiondevMint(uint256 quantity, address to) externalonlyOwner{
if (tokensMinted() + quantity > MAX_SEASONS_COUNT) revert MaxMintExceeded();
_mint(to, quantity);
}
functionsupportsInterface(bytes4 interfaceId) publicviewvirtualoverride(ERC721SZNS, IERC165) returns(bool) {
returnsuper.supportsInterface(interfaceId) || interfaceId ==type(IERC2981).interfaceId;
}
}