Verified contractExactMIT
SlothMintV19
Address0x319cbd1ea39cda74dfed42d5d63a4fc4a542c100
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.17
- Same code
Only this contract
Details
- Compiler
- solc 0.8.17+commit.8df45f5f
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- london
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 20,209,569
- Creation transaction
- 0x2d316787fe…1e3b729a20
15 files
- contracts/SlothMintV19.solmain18.54 KB
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol3.15 KB
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol6.64 KB
- @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol8.29 KB
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.35 KB
- contracts/interfaces/IEquipmentV2.sol372 B
- contracts/interfaces/IItemTypeV2.sol230 B
- contracts/interfaces/ISlothItemV5.sol879 B
- contracts/interfaces/ISlothMintV5.sol987 B
- contracts/interfaces/ISlothV3.sol840 B
- contracts/interfaces/ISpecialSlothItemV6.sol1.49 KB
- contracts/interfaces/ISpecialSlothMintV2.sol467 B
- erc721a-upgradeable/contracts/IERC721AUpgradeable.sol8.79 KB
- erc721a-upgradeable/contracts/extensions/IERC721AQueryableUpgradeable.sol2.47 KB
- erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol166 B
contracts/SlothMintV19.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "./interfaces/ISlothV3.sol";
import "./interfaces/ISlothItemV5.sol";
import "./interfaces/ISpecialSlothItemV6.sol";
import "./interfaces/ISlothMintV5.sol";
import "./interfaces/ISpecialSlothMintV2.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract SlothMintV19 is Initializable, OwnableUpgradeable, ISlothMintV5 {
address private _slothAddr;
address private _slothItemAddr;
address private _specialSlothItemAddr;
address private _piementAddress;
bool public publicSale;
mapping(uint256 => bool) public forSaleCollabo;
mapping(uint256 => uint256) public collaboSaleEndTimes;
mapping(uint256 => uint256) public collaboSalePricePatterns;
uint256 public collectionSize;
uint256 public itemCollectionSize;
uint256 public clothesSize;
uint256 public itemSize;
uint256 public currentItemCount;
uint256 public currentClothesCount;
mapping(uint256 => uint256) public collaboItemSizes;
mapping(uint256 => uint256) public currentCollaboItemCounts;
address private _treasuryAddress;
uint256 private _MINT_WITH_CLOTHES_PRICE;
uint256 private _MINT_WITH_COLLABO_PRICE;
uint256 private _MINT_WITH_COLLABO_PRICE2;
uint256 private _MINT_COLLABO_PRICE;
uint256 private _MINT_COLLABO_PRICE2;
address private _lightSlothAddr;
uint256 private _MINT_SLOTH_COLLECTION_PRICE;
uint256 private _MINT_SLOTH_BODY_PRICE;
uint256 private _MINT_SLOTH_CLOTHES_PRICE;
mapping(uint256 => uint256) private specialTypeSaleEndTime;
mapping(uint256 => uint256) private slothCollectionPrice;
mapping(uint256 => uint256) private slothCollectionSetPrice;
mapping(uint256 => bool) public isSaleCollaboSloth;
address private _specialSlothAddr;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(uint256 newCollectionSize, uint256 newItemCollectionSize, uint256 newClothesSize, uint256 newItemSize, uint256 newCurrentClothesCount, uint256 newCurrentItemCount) initializer public {
__Ownable_init();
collectionSize = newCollectionSize;
itemCollectionSize = newItemCollectionSize;
clothesSize = newClothesSize;
itemSize = newItemSize;
currentClothesCount = newCurrentClothesCount;
currentItemCount = newCurrentItemCount;
_treasuryAddress = payable(0x452Ccc6d4a818D461e20837B417227aB70C72B56);
_MINT_WITH_CLOTHES_PRICE = 0.021 ether;
_MINT_WITH_COLLABO_PRICE = 0.03 ether;
_MINT_WITH_COLLABO_PRICE2 = 0.04 ether;
_MINT_COLLABO_PRICE = 0.01 ether;
_MINT_COLLABO_PRICE2 = 0.02 ether;
}
function setSlothAddr(address newSlothAddr) external onlyOwner {
_slothAddr = newSlothAddr;
}
function setSlothItemAddr(address newSlothItemAddr) external onlyOwner {
_slothItemAddr = newSlothItemAddr;
}
function setSpecialSlothItemAddr(address newSpecialSlothItemAddr) external onlyOwner {
_specialSlothItemAddr = newSpecialSlothItemAddr;
}
function setPiementAddress(address newPiementAddress) external onlyOwner {
_piementAddress = newPiementAddress;
}
function setLightSlothAddr(address newLightSlothAddr) external onlyOwner {
_lightSlothAddr = newLightSlothAddr;
}
function setSpecialSlothAddr(address newSpecialSlothAddr) external onlyOwner {
_specialSlothAddr = newSpecialSlothAddr;
}
function setSlothCollectionPrice(uint256[] calldata specialTypeArray, uint256[] calldata priceArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
slothCollectionPrice[specialTypeArray[i]] = priceArray[i];
}
}
function setSlothCollectionPriceAll(uint256[] calldata specialTypeArray, uint256[] calldata priceArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
slothCollectionSetPrice[specialTypeArray[i]] = priceArray[i];
}
}
function setSlothBodyPrice(uint256 newPrice) external onlyOwner {
_MINT_SLOTH_BODY_PRICE = newPrice;
}
function setSlothClothesPrice(uint256 newPrice) external onlyOwner {
_MINT_SLOTH_CLOTHES_PRICE = newPrice;
}
function publicMintBody(uint8 quantity) payable public {
require(publicSale, "inactive");
require(ISlothV3(_slothAddr).totalSupply() + quantity <= collectionSize, "exceeds collection size");
require(msg.value == _MINT_SLOTH_BODY_PRICE * quantity, "wrong price");
_mintBody(quantity, msg.sender);
emit mintBody(quantity, false);
}
function _mintBody(uint8 quantity, address sender) internal {
ISlothV3(_slothAddr).mint(sender, quantity);
}
function publicMintBodyForPiement(address transferAddress, uint8 quantity) payable external {
require(publicSale, "inactive");
require(ISlothV3(_slothAddr).totalSupply() + quantity <= collectionSize, "exceeds collection size");
require(msg.value == _MINT_SLOTH_BODY_PRICE * quantity, "wrong price");
require(msg.sender == _piementAddress, "wrong address");
ISlothV3(_slothAddr).mint(transferAddress, quantity);
emit mintBody(quantity, true);
}
function _publicMint(uint8 quantity, address to) private {
require(publicSale, "inactive");
require(ISlothV3(_slothAddr).totalSupply() + quantity <= collectionSize, "exceeds collection size");
require(currentClothesCount + quantity <= clothesSize, "exceeds clothes size");
ISlothV3(_slothAddr).mint(to, quantity);
ISlothItemV5(_slothItemAddr).clothesMint(to, quantity);
currentClothesCount += quantity;
}
function _isSaleEnded(uint256 specialType) internal view returns (bool) {
if (collaboSaleEndTimes[specialType] == 0) {
return false;
}
return block.timestamp >= collaboSaleEndTimes[specialType];
}
function publicMintSlothCollectionDecemberAll(uint256 setQuantity) payable public {
require(forSaleCollabo[59], "inactive collabo");
require(setQuantity > 0, "quantity must be greater than 0");
require(msg.value == (0.02 ether * setQuantity), "wrong price");
for (uint8 clothType = 0; clothType < 3; clothType++) {
_mintSlothCollection(msg.sender, setQuantity, clothType, 59);
emit mintSlothCollection(setQuantity, 59, clothType, false);
}
}
function publicMintSlothCollectionDecember(uint256 quantity, uint8 clothType) payable public {
require(forSaleCollabo[59], "inactive collabo");
require(quantity > 0, "quantity must be greater than 0");
require(msg.value == (slothCollectionPrice[59] * quantity), "wrong price");
_mintSlothCollection(msg.sender, quantity, clothType, 59);
emit mintSlothCollection(quantity, 59, clothType, false);
}
function publicMintSlothCollectionDecemberAllForPiement(address transferAddress, uint256 setQuantity) payable public {
require(forSaleCollabo[59], "inactive collabo");
require(setQuantity > 0, "quantity must be greater than 0");
require(msg.sender == _piementAddress, "worng address");
require(msg.value == (0.02 ether * setQuantity), "wrong price");
for (uint8 clothType = 0; clothType < 3; clothType++) {
_mintSlothCollection(transferAddress, setQuantity, clothType, 59);
emit mintSlothCollection(setQuantity, 59, clothType, true);
}
}
function publicMintSlothCollection(uint256 quantity, uint8 clothType, uint256 specialType) payable public {
require(forSaleCollabo[specialType], "inactive collabo");
require(quantity > 0, "quantity must be greater than 0");
require(msg.value == (slothCollectionPrice[specialType] * quantity), "wrong price");
_mintSlothCollection(msg.sender, quantity, clothType, specialType);
emit mintSlothCollection(quantity, specialType, clothType, false);
}
function publicMintSlothCollectionAll(uint256 setQuantity, uint256 specialType) payable public {
require(forSaleCollabo[specialType], "inactive collabo");
require(setQuantity > 0, "quantity must be greater than 0");
require(msg.value == (slothCollectionSetPrice[specialType] * setQuantity), "wrong price");
_mintSlothCollectionAll(msg.sender, setQuantity, specialType);
emit mintSlothCollectionAll(setQuantity, specialType, false);
}
function publicMintSlothCollectionAllForPiemment(address transferAddress, uint256 setQuantity, uint256 specialType) payable public {
require(forSaleCollabo[specialType], "inactive collabo");
require(setQuantity > 0, "quantity must be greater than 0");
require(msg.sender == _piementAddress, "worng address");
require(msg.value == (slothCollectionSetPrice[specialType] * setQuantity), "wrong price");
_mintSlothCollectionAll(transferAddress, setQuantity, specialType);
emit mintSlothCollectionAll(setQuantity, specialType, true);
}
function _mintSlothCollection(address transferAddress, uint256 quantity, uint8 clothType, uint256 specialType) internal {
ISpecialSlothItemV6(_specialSlothItemAddr).mintSlothCollection(transferAddress, quantity, clothType, specialType);
}
function _mintSlothCollectionAll(address transferAddress, uint256 setQuantity, uint256 specialType) internal {
ISpecialSlothItemV6(_specialSlothItemAddr).mintSlothCollectionAll(transferAddress, setQuantity, specialType);
}
function checkAllowCollaboMint(uint8 quantity, uint256 specialType) internal view {
require(forSaleCollabo[specialType], "inactive collabo");
require(!_isSaleEnded(specialType), "ended");
require(currentCollaboItemCounts[specialType] + quantity <= collaboItemSizes[specialType], "collabo sold out");
}
function collaboMintValue(uint8 quantity, uint256 specialType) internal view returns (uint256) {
if (collaboSalePricePatterns[specialType] == 1) {
return _MINT_COLLABO_PRICE2 * quantity;
}
return _MINT_COLLABO_PRICE * quantity;
}
function bodyWithCollaboMintValue(uint8 quantity, uint256 specialType) internal view returns (uint256) {
if (collaboSalePricePatterns[specialType] == 1) {
return _MINT_COLLABO_PRICE2 * quantity + _MINT_SLOTH_BODY_PRICE * quantity;
}
return _MINT_COLLABO_PRICE * quantity + _MINT_SLOTH_BODY_PRICE * quantity;
}
function bodyAndClothWithCollaboMintValue(uint8 quantity, uint256 specialType) internal view returns (uint256) {
if (collaboSalePricePatterns[specialType] == 1) {
return _MINT_WITH_COLLABO_PRICE2 * quantity;
}
return _MINT_WITH_COLLABO_PRICE * quantity;
}
function mintCollaboWithBody(uint8 quantity, uint256 specialType) internal {
checkAllowCollaboMint(quantity, specialType);
require(msg.value == bodyWithCollaboMintValue(quantity, specialType), "wrong price");
_mintBody(quantity, msg.sender);
ISpecialSlothItemV6(_specialSlothItemAddr).mintCollaboCloth(msg.sender, quantity, specialType);
currentCollaboItemCounts[specialType] += quantity;
}
function mintCollaboCloth(uint8 quantity, uint256 specialType) internal {
checkAllowCollaboMint(quantity, specialType);
require(msg.value == collaboMintValue(quantity, specialType), "wrong price");
ISpecialSlothItemV6(_specialSlothItemAddr).mintCollaboCloth(msg.sender, quantity, specialType);
currentCollaboItemCounts[specialType] += quantity;
}
function publicMintBodyWithCollabo(uint256 specialType, uint8 quantity) payable external {
mintCollaboWithBody(quantity, specialType);
emit mintWithClothAndCollabo(quantity, specialType, false);
}
function publicMintBodyWithCollaboForPiement(address transferAddress, uint256 specialType) payable external {
checkAllowCollaboMint(1, specialType);
require(msg.value == bodyWithCollaboMintValue(1, specialType), "wrong price");
require(msg.sender == _piementAddress, "worng address");
_mintBody(1, transferAddress);
ISpecialSlothItemV6(_specialSlothItemAddr).mintCollaboCloth(transferAddress, 1, specialType);
currentCollaboItemCounts[specialType] += 1;
emit mintWithClothAndCollabo(1, specialType, true);
}
function publicMintWithClothesAndCollabo(uint256 specialType, uint8 quantity) payable external {
checkAllowCollaboMint(quantity, specialType);
require(msg.value == bodyAndClothWithCollaboMintValue(quantity, specialType), "wrong price");
_publicMint(quantity, msg.sender);
ISpecialSlothItemV6(_specialSlothItemAddr).mintCollaboCloth(msg.sender, quantity, specialType);
currentCollaboItemCounts[specialType] += quantity;
emit mintWithClothAndCollabo(quantity, specialType, false);
}
function publicMintOnlyCollabo(uint256 specialType, uint8 quantity) payable external {
mintCollaboCloth(quantity, specialType);
emit mintCollabo(quantity, specialType);
}
function mintAnyItem(IItemTypeV2.ItemType itemType, uint256 itemId) payable external {
if (itemType == IItemTypeV2.ItemType.CLOTHES) {
require(msg.value == _MINT_SLOTH_CLOTHES_PRICE, "wrong price");
} else if (itemType == IItemTypeV2.ItemType.HEAD || itemType == IItemTypeV2.ItemType.HAND || itemType == IItemTypeV2.ItemType.FOOT) {
require(msg.value == 0.02 ether, "wrong price");
}
ISlothItemV5.anyItemMintItem memory item = ISlothItemV5.anyItemMintItem(itemType, itemId);
ISlothItemV5(_slothItemAddr).anyItemMint(msg.sender, item);
}
function mintAnyItemMulti(ISlothItemV5.anyItemMintItem[] calldata items) payable external {
_mintAnyItemPirceCheck(items);
ISlothItemV5(_slothItemAddr).anyItemMintMulti(msg.sender, items);
}
function _mintAnyItemPirceCheck(ISlothItemV5.anyItemMintItem[] calldata items) internal view {
uint256 price = 0;
uint256[2] memory itemTypeCount;
for (uint256 i = 0; i < items.length; i++) {
if (items[i].itemType == IItemTypeV2.ItemType.CLOTHES) {
itemTypeCount[0] = itemTypeCount[0] + 1;
continue;
}
if (items[i].itemType == IItemTypeV2.ItemType.BACKGROUND) {
continue;
}
itemTypeCount[1] = itemTypeCount[1] + 1;
}
price = price + _MINT_SLOTH_CLOTHES_PRICE * itemTypeCount[0];
price = price + (0.02 ether * itemTypeCount[1]);
require(msg.value == price, "wrong price");
}
function checkHaveAnyNFT(address wallet) internal view returns (bool) {
return ISlothV3(_slothAddr).balanceOf(wallet) > 0 || ISlothV3(_lightSlothAddr).balanceOf(wallet) > 0;
}
function mintLiteracyTestFreeMint() external {
require(checkHaveAnyNFT(msg.sender), "no nft");
_mintSlothCollection(msg.sender, 1, 0, 76);
}
function mintPurista() external {
checkAllowCollaboMint(1, 1003);
ISpecialSlothMintV2(_specialSlothAddr).mintBodyWithClothType(msg.sender, 1003, 0, 1, 1);
ISpecialSlothItemV6(_specialSlothItemAddr).mintSlothCollectionRandom(msg.sender, 1, 77);
currentCollaboItemCounts[1003] += 1;
}
function mintPresentPurista(address transferAddress) external {
checkAllowCollaboMint(1, 1003);
ISpecialSlothMintV2(_specialSlothAddr).mintBodyWithClothType(transferAddress, 1003, 0, 1, 100);
ISpecialSlothItemV6(_specialSlothItemAddr).mintSlothCollectionRandom(transferAddress, 1, 77);
currentCollaboItemCounts[1003] += 1;
}
function setPublicSale(bool newPublicSale) external onlyOwner {
publicSale = newPublicSale;
}
function setSaleCollabo(uint256[] calldata specialTypeArray, bool[] calldata newSaleCollaboArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
forSaleCollabo[specialTypeArray[i]] = newSaleCollaboArray[i];
}
}
function setCollaboItemSizes(uint256[] calldata specialTypeArray, uint256[] calldata itemSizeArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
collaboItemSizes[specialTypeArray[i]] = itemSizeArray[i];
}
}
function setCollaboSaleEndTimes(uint256[] calldata specialTypeArray, uint256[] calldata endTimeArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
collaboSaleEndTimes[specialTypeArray[i]] = endTimeArray[i];
}
}
function setCollaboSalePricePatterns(uint256[] calldata specialTypeArray, uint256[] calldata pricePatternArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
collaboSalePricePatterns[specialTypeArray[i]] = pricePatternArray[i];
}
}
function setCurrentCollaboItemCount(uint256[] calldata specialTypeArray, uint256[] calldata itemCountArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
currentCollaboItemCounts[specialTypeArray[i]] = itemCountArray[i];
}
}
function setSecialTypeSaleEndTime(uint256[] calldata specialTypeArray, uint256[] calldata endTimeArray) external onlyOwner {
for (uint256 i = 0; i < specialTypeArray.length; i++) {
specialTypeSaleEndTime[specialTypeArray[i]] = endTimeArray[i];
}
}
function withdraw() external onlyOwner {
(bool sent,) = _treasuryAddress.call{value: address(this).balance}("");
require(sent, "Failed to send Ether");
}
function ownerMint(uint8 quantity, uint256 itemQuantity) external onlyOwner {
require(ISlothItemV5(_slothItemAddr).totalSupply() + (quantity + itemQuantity) <= itemCollectionSize, "exceeds item collection size");
if (quantity > 0) {
_publicMint(quantity, msg.sender);
}
}
function ownerMintSpecialSloth(address transferAddress, uint256 _specialBodyType, uint256 _clothType, uint8 quantity) external onlyOwner {
ISpecialSlothMintV2(_specialSlothAddr).mintBodyWithClothType(transferAddress, _specialBodyType, _clothType, quantity, 100);
}
}@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0-rc.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Internal function that returns the initialized version. Returns `_initialized`
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Internal function that returns the initialized version. Returns `_initializing`
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0-rc.1) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/interfaces/IEquipmentV2.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "./IItemTypeV2.sol";
interface IEquipmentV2 {
struct EquipmentTargetItem {
uint256 itemTokenId;
IItemTypeV2.ItemMintType itemMintType;
}
struct Equipment {
uint256 itemId;
address itemAddr;
}
struct EquipmentTargetSpecial {
uint256 specialType;
bool combinationable;
}
}contracts/interfaces/IItemTypeV2.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
interface IItemTypeV2 {
enum ItemType { CLOTHES, HEAD, HAND, FOOT, STAMP, BACKGROUND }
enum ItemMintType { SLOTH_ITEM, SPECIAL_SLOTH_ITEM, USER_GENERATED_SLOTH_ITEM }
} contracts/interfaces/ISlothItemV5.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
import "./IItemTypeV2.sol";
interface ISlothItemV5 is IERC721AQueryableUpgradeable {
struct anyItemMintItem {
IItemTypeV2.ItemType itemType;
uint256 itemId;
}
function getItemType(uint256 tokenId) external view returns (IItemTypeV2.ItemType);
function getItemMintCount(address sender) external view returns (uint256);
function exists(uint256 tokenId) external view returns (bool);
function clothesMint(address sender, uint256 quantity) external;
function itemMint(address sender, uint256 quantity) external;
function anyItemMint(address sender, anyItemMintItem calldata item) external;
function anyItemMintMulti(address sender, anyItemMintItem[] calldata items) external;
}contracts/interfaces/ISlothMintV5.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
* @title Interface for Auction Houses
*/
interface ISlothMintV5 {
event mintWithCloth(
uint256 quantity
);
event mintWithClothAndItem(
uint256 quantity,
uint256 itemQuantity,
bool piement
);
event mintWithClothAndPoupelle(
uint256 quantity,
bool piement
);
event mintPoupelle(
uint256 quantity
);
event mintItem(
uint256 quantity,
bool piement
);
event mintWithClothAndCollabo(
uint256 quantity,
uint256 specialType,
bool piement
);
event mintCollabo(
uint256 quantity,
uint256 specialType
);
event mintSlothCollection(
uint256 quantity,
uint256 specialType,
uint256 clothType,
bool piement
);
event mintSlothCollectionAll(
uint256 quantity,
uint256 specialType,
bool piement
);
event mintBody(
uint256 quantity,
bool piement
);
event mintClothes(
uint quantity,
bool piement
);
}contracts/interfaces/ISlothV3.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
import { IEquipmentV2 } from "./IEquipmentV2.sol";
import { IItemTypeV2 } from "./IItemTypeV2.sol";
interface ISlothV3 is IERC721AQueryableUpgradeable {
function mint(address sender, uint8 quantity) external;
function numberMinted(address sender) external view returns (uint256);
function setItem(uint256 _tokenId, IEquipmentV2.EquipmentTargetItem memory _targetItem, IItemTypeV2.ItemType _targetItemType, address sender) external returns (address);
function receiveItem(address tokenOwner, address itemContractAddress, uint256 itemTokenId) external;
function sendItem(address tokenOwner, address itemContractAddress, uint256 itemTokenId) external;
}contracts/interfaces/ISpecialSlothItemV6.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "./IItemTypeV2.sol";
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
interface ISpecialSlothItemV6 is IERC721AQueryableUpgradeable, IItemTypeV2 {
function getItemType(uint256 tokenId) external view returns (IItemTypeV2.ItemType);
function getSpecialType(uint256 tokenId) external view returns (uint256);
function getClothType(uint256 tokenId) external view returns (uint256);
function exists(uint256 tokenId) external view returns (bool);
function isCombinational(uint256 _specialType) external view returns (bool);
function mintPoupelle(address sender, uint256 quantity) external;
function mintCollaboCloth(address sender, uint256 quantity, uint256 _specialType) external;
function mintHalloweenJiangshiSet(address sender, uint256 quantity) external;
function mintHalloweenJacKOLanternSet(address sender, uint256 quantity) external;
function mintHalloweenGhostSet(address sender, uint256 quantity) external;
function mintSlothCollectionNovember(address sender, uint256 quantity, uint8 clothType) external;
function mintSlothCollection(address sender, uint256 quantity, uint8 clothType, uint256 specialType) external;
function mintSlothCollectionAll(address sender, uint256 setQuantity, uint256 specialType) external;
function mintSlothCollectionRandom(address sender, uint256 quantity, uint256 _specialType) external;
}
contracts/interfaces/ISpecialSlothMintV2.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
interface ISpecialSlothMintV2 {
function mintBody(address transderAddress, uint256 _specialBodyType, uint8 quantity, uint8 maxMintCount) external;
function mintBodyWithClothType(address transderAddress, uint256 _specialBodyType, uint256 _clothType, uint8 quantity, uint8 maxMintCount) external;
function blancePerSpecialBodyType(address target, uint256 _specialBodyType) external view returns(uint256);
}erc721a-upgradeable/contracts/IERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721AUpgradeable {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* The caller cannot approve to their own address.
*/
error ApproveToCaller();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables
* (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`,
* checking first that contract recipients are aware of the ERC721 protocol
* to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move
* this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom}
* whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
erc721a-upgradeable/contracts/extensions/IERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '../IERC721AUpgradeable.sol';
/**
* @dev Interface of ERC721AQueryable.
*/
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
/**
* Invalid query range (`start` >= `stop`).
*/
error InvalidQueryRange();
/**
* @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
*
* If the `tokenId` is out of bounds:
*
* - `addr = address(0)`
* - `startTimestamp = 0`
* - `burned = false`
* - `extraData = 0`
*
* If the `tokenId` is burned:
*
* - `addr = <Address of owner before token was burned>`
* - `startTimestamp = <Timestamp when token was burned>`
* - `burned = true`
* - `extraData = <Extra data when token was burned>`
*
* Otherwise:
*
* - `addr = <Address of owner>`
* - `startTimestamp = <Timestamp of start of ownership>`
* - `burned = false`
* - `extraData = <Extra data at start of ownership>`
*/
function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);
/**
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`)
* (i.e. `start <= tokenId < stop`).
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
*
* Requirements:
*
* - `start < stop`
*/
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`.
*
* This function scans the ownership mapping and is O(`totalSupply`) in complexity.
* It is meant to be called off-chain.
*
* See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K collections should be fine).
*/
function tokensOfOwner(address owner) external view returns (uint256[] memory);
}
erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '../extensions/IERC721AQueryableUpgradeable.sol';
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "london",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.