编译器
0.8.17+commit.8df45f5f
文件 1 的 11:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 11:IERC721AQueryableUpgradeable.sol
pragma solidity ^0.8.4;
import '../IERC721AUpgradeable.sol';
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
error InvalidQueryRange();
function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
function tokensOfOwner(address owner) external view returns (uint256[] memory);
}
文件 3 的 11:IERC721AUpgradeable.sol
pragma solidity ^0.8.4;
interface IERC721AUpgradeable {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
文件 4 的 11:IItemType.sol
pragma solidity ^0.8.17;
interface IItemType {
enum ItemType { CLOTHES, HEAD, HAND, FOOT, STAMP }
enum ItemMintType { SLOTH_ITEM, SPECIAL_SLOTH_ITEM, USER_GENERATED_SLOTH_ITEM }
}
文件 5 的 11:ISloth.sol
pragma solidity ^0.8.17;
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
interface ISloth is IERC721AQueryableUpgradeable {
function mint(address sender, uint8 quantity) external;
function numberMinted(address sender) external view returns (uint256);
}
文件 6 的 11:ISlothItemV2.sol
pragma solidity ^0.8.17;
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
interface ISlothItemV2 is IERC721AQueryableUpgradeable {
enum ItemType { CLOTHES, HEAD, HAND, FOOT, STAMP }
function getItemType(uint256 tokenId) external view returns (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;
}
文件 7 的 11:ISlothMintV2.sol
pragma solidity ^0.8.17;
interface ISlothMintV2 {
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
);
event mintWithClothAndCollabo(
uint256 quantity,
uint256 specialType,
bool piement
);
event mintCollabo(
uint256 quantity,
uint256 specialType
);
}
文件 8 的 11:ISpecialSlothItem.sol
pragma solidity ^0.8.17;
import "./IItemType.sol";
import { IERC721AQueryableUpgradeable } from "erc721a-upgradeable/contracts/interfaces/IERC721AQueryableUpgradeable.sol";
interface ISpecialSlothItem is IERC721AQueryableUpgradeable, IItemType {
function getItemType(uint256 tokenId) external view returns (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;
}
文件 9 的 11:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 10 的 11:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 11 的 11:SlothMintV6.sol
pragma solidity ^0.8.17;
import "./interfaces/ISloth.sol";
import "./interfaces/ISlothItemV2.sol";
import "./interfaces/ISpecialSlothItem.sol";
import "./interfaces/ISlothMintV2.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract SlothMintV6 is Ownable, ISlothMintV2 {
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 immutable maxPerAddressDuringMint;
uint256 public immutable collectionSize;
uint256 public immutable itemCollectionSize;
uint256 public immutable clothesSize;
uint256 public immutable itemSize;
uint256 public currentItemCount;
uint256 public currentClothesCount;
mapping(uint256 => uint256) public collaboItemSizes;
mapping(uint256 => uint256) public currentCollaboItemCounts;
uint256 private constant _MINT_WITH_CLOTHES_PRICE = 0.021 ether;
uint256 private constant _MINT_WITH_COLLABO_PRICE = 0.03 ether;
uint256 private constant _MINT_WITH_COLLABO_PRICE2 = 0.04 ether;
uint256 private constant _MINT_COLLABO_PRICE = 0.01 ether;
uint256 private constant _MINT_COLLABO_PRICE2 = 0.02 ether;
address private _treasuryAddress = 0x452Ccc6d4a818D461e20837B417227aB70C72B56;
constructor(uint256 newMaxPerAddressDuringMint, uint256 newCollectionSize, uint256 newItemCollectionSize, uint256 newClothesSize, uint256 newItemSize, uint256 newCurrentClothesCount, uint256 newCurrentItemCount) {
maxPerAddressDuringMint = newMaxPerAddressDuringMint;
collectionSize = newCollectionSize;
itemCollectionSize = newItemCollectionSize;
clothesSize = newClothesSize;
itemSize = newItemSize;
currentClothesCount = newCurrentClothesCount;
currentItemCount = newCurrentItemCount;
}
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 _itemMint(uint256 quantity, address to) private {
require(currentItemCount + quantity <= itemSize, "exceeds item size");
ISlothItemV2(_slothItemAddr).itemMint(to, quantity);
currentItemCount += quantity;
}
function publicMintWithClothes(uint8 quantity) payable external {
require(msg.value == _MINT_WITH_CLOTHES_PRICE * quantity, "wrong price");
require(ISloth(_slothAddr).numberMinted(msg.sender) + quantity <= maxPerAddressDuringMint, "wrong num");
_publicMint(quantity, msg.sender);
emit mintWithCloth(quantity);
}
function _publicMint(uint8 quantity, address to) private {
require(publicSale, "inactive");
require(ISloth(_slothAddr).totalSupply() + quantity <= collectionSize, "exceeds collection size");
require(currentClothesCount + quantity <= clothesSize, "exceeds clothes size");
ISloth(_slothAddr).mint(to, quantity);
ISlothItemV2(_slothItemAddr).clothesMint(to, quantity);
currentClothesCount += quantity;
}
function publicMintWithClothesAndItem(uint8 quantity, uint8 itemQuantity) payable external {
require(msg.value == itemPrice(itemQuantity) + _MINT_WITH_CLOTHES_PRICE * quantity, "wrong price");
require(ISlothItemV2(_slothItemAddr).totalSupply() + (quantity + itemQuantity) <= itemCollectionSize, "exceeds item collection size");
require(ISloth(_slothAddr).numberMinted(msg.sender) + quantity <= maxPerAddressDuringMint, "wrong num");
require(ISlothItemV2(_slothItemAddr).getItemMintCount(msg.sender) + itemQuantity <= 99, "wrong item num");
_publicMint(quantity, msg.sender);
_itemMint(itemQuantity, msg.sender);
emit mintWithClothAndItem(quantity, itemQuantity, false);
}
function publicItemMint(uint8 quantity) payable external {
require(publicSale, "inactive");
require(msg.value == itemPrice(quantity), "wrong price");
require(ISlothItemV2(_slothItemAddr).totalSupply() + quantity <= itemCollectionSize, "exceeds item collection size");
require(ISlothItemV2(_slothItemAddr).getItemMintCount(msg.sender) + quantity <= 99, "wrong item num");
_itemMint(quantity, msg.sender);
emit mintItem(quantity);
}
function mintForPiement(address transferAddress, uint256 itemQuantity) payable public {
uint8 quantity = 1;
require(msg.value == itemPrice(itemQuantity) + _MINT_WITH_CLOTHES_PRICE * quantity, "wrong price");
require(ISlothItemV2(_slothItemAddr).totalSupply() + (quantity + itemQuantity) <= itemCollectionSize, "exceeds item collection size");
if (msg.sender == owner()) {
_publicMint(quantity, transferAddress);
_itemMint(itemQuantity, transferAddress);
return;
}
require(msg.sender == _piementAddress, "worng address");
_publicMint(quantity, transferAddress);
_itemMint(itemQuantity, transferAddress);
}
function mintForPiementItem1(address transferAddress) payable public {
mintForPiement(transferAddress, 1);
emit mintWithClothAndItem(1, 1, true);
}
function mintForPiementItem3(address transferAddress) payable public {
mintForPiement(transferAddress, 3);
emit mintWithClothAndItem(1, 3, true);
}
function mintForPiementItem6(address transferAddress) payable public {
mintForPiement(transferAddress, 6);
emit mintWithClothAndItem(1, 6, true);
}
function mintForPiementItem9(address transferAddress) payable public {
mintForPiement(transferAddress, 9);
emit mintWithClothAndItem(1, 9, true);
}
function _isSaleEnded(uint256 specialType) internal view returns (bool) {
if (collaboSaleEndTimes[specialType] == 0) {
return false;
}
return block.timestamp >= collaboSaleEndTimes[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 withCollaboMintValue(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(ISlothItemV2(_slothItemAddr).totalSupply() + quantity <= itemCollectionSize, "exceeds item collection size");
require(msg.value == withCollaboMintValue(quantity, specialType), "wrong price");
_publicMint(quantity, msg.sender);
ISpecialSlothItem(_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");
require(ISloth(_slothAddr).balanceOf(msg.sender) > 0, "need sloth");
ISpecialSlothItem(_specialSlothItemAddr).mintCollaboCloth(msg.sender, quantity, specialType);
currentCollaboItemCounts[specialType] += quantity;
}
function publicMintWithClothesAndCollaboForPiement(address transferAddress, uint256 specialType) payable external {
checkAllowCollaboMint(1, specialType);
require(ISlothItemV2(_slothItemAddr).totalSupply() + 1 <= itemCollectionSize, "exceeds item collection size");
require(currentClothesCount + 1 <= clothesSize, "exceeds clothes size");
require(msg.value == withCollaboMintValue(1, specialType), "wrong price");
if (msg.sender == owner()) {
_publicMint(1, transferAddress);
ISpecialSlothItem(_specialSlothItemAddr).mintCollaboCloth(transferAddress, 1, specialType);
currentCollaboItemCounts[specialType] += 1;
return;
}
require(msg.sender == _piementAddress, "worng address");
_publicMint(1, transferAddress);
ISpecialSlothItem(_specialSlothItemAddr).mintCollaboCloth(transferAddress, 1, specialType);
currentCollaboItemCounts[specialType] += 1;
emit mintWithClothAndCollabo(1, specialType, true);
}
function publicMintWithClothesAndVerylongAnimals(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 3);
emit mintWithClothAndCollabo(quantity, 3, false);
}
function pulicMintOnlyVerylongAnimals(uint8 quantity) payable external {
mintCollaboCloth(quantity, 3);
emit mintCollabo(quantity, 3);
}
function publicMintWithClothesAndTakanotsumedan(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 4);
emit mintWithClothAndCollabo(quantity, 4, false);
}
function pulicMintOnlyTakanotsumedan(uint8 quantity) payable external {
mintCollaboCloth(quantity, 4);
emit mintCollabo(quantity, 4);
}
function publicMintWithClothesAndMocomocoworkers(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 5);
emit mintWithClothAndCollabo(quantity, 5, false);
}
function pulicMintOnlyMocomocoworkers(uint8 quantity) payable external {
mintCollaboCloth(quantity, 5);
emit mintCollabo(quantity, 5);
}
function publicMintWithClothesAndTorichan(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 6);
emit mintWithClothAndCollabo(quantity, 6, false);
}
function pulicMintOnlyTorichan(uint8 quantity) payable external {
mintCollaboCloth(quantity, 6);
emit mintCollabo(quantity, 6);
}
function publicMintWithClothesAndGyozao(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 7);
emit mintWithClothAndCollabo(quantity, 7, false);
}
function pulicMintOnlyGyozao(uint8 quantity) payable external {
mintCollaboCloth(quantity, 7);
emit mintCollabo(quantity, 7);
}
function publicMintWithClothesAndAstroOtto(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 8);
emit mintWithClothAndCollabo(quantity, 8, false);
}
function pulicMintOnlyAstroOtto(uint8 quantity) payable external {
mintCollaboCloth(quantity, 8);
emit mintCollabo(quantity, 8);
}
function publicMintWithClothesAndYoshioka(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 9);
emit mintWithClothAndCollabo(quantity, 9, false);
}
function pulicMintOnlyYoshioka(uint8 quantity) payable external {
mintCollaboCloth(quantity, 9);
emit mintCollabo(quantity, 9);
}
function publicMintWithClothesAndDJRIO(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 10);
emit mintWithClothAndCollabo(quantity, 10, false);
}
function pulicMintOnlyDJRIO(uint8 quantity) payable external {
mintCollaboCloth(quantity, 10);
emit mintCollabo(quantity, 10);
}
function publicMintWithClothesAndShimonzgate(uint8 quantity) payable external {
mintCollaboWithBody(quantity, 11);
emit mintWithClothAndCollabo(quantity, 11, false);
}
function pulicMintOnlyShimonzgate(uint8 quantity) payable external {
mintCollaboCloth(quantity, 11);
emit mintCollabo(quantity, 11);
}
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 itemPrice(uint256 quantity) internal pure returns(uint256) {
uint256 price = 0;
if (quantity == 1) {
price = 20;
} else if (quantity == 2) {
price = 39;
} else if (quantity == 3) {
price = 56;
} else if (quantity == 4) {
price = 72;
} else if (quantity == 5) {
price = 88;
} else if (quantity == 6) {
price = 100;
} else if (quantity == 7) {
price = 115 ;
} else if (quantity == 8) {
price = 125 ;
} else if (quantity == 9) {
price = 135;
} else {
price = 15 * quantity;
}
return price * 1 ether / 1000;
}
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(ISlothItemV2(_slothItemAddr).totalSupply() + (quantity + itemQuantity) <= itemCollectionSize, "exceeds item collection size");
if (quantity > 0) {
_publicMint(quantity, msg.sender);
}
if (itemQuantity > 0) {
_itemMint(itemQuantity, msg.sender);
}
}
}
{
"compilationTarget": {
"contracts/SlothMintV6.sol": "SlothMintV6"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"uint256","name":"newMaxPerAddressDuringMint","type":"uint256"},{"internalType":"uint256","name":"newCollectionSize","type":"uint256"},{"internalType":"uint256","name":"newItemCollectionSize","type":"uint256"},{"internalType":"uint256","name":"newClothesSize","type":"uint256"},{"internalType":"uint256","name":"newItemSize","type":"uint256"},{"internalType":"uint256","name":"newCurrentClothesCount","type":"uint256"},{"internalType":"uint256","name":"newCurrentItemCount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"specialType","type":"uint256"}],"name":"mintCollabo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPoupelle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintWithCloth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"specialType","type":"uint256"},{"indexed":false,"internalType":"bool","name":"piement","type":"bool"}],"name":"mintWithClothAndCollabo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"itemQuantity","type":"uint256"},{"indexed":false,"internalType":"bool","name":"piement","type":"bool"}],"name":"mintWithClothAndItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"bool","name":"piement","type":"bool"}],"name":"mintWithClothAndPoupelle","type":"event"},{"inputs":[],"name":"clothesSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collaboItemSizes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collaboSaleEndTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collaboSalePricePatterns","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentClothesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currentCollaboItemCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentItemCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"forSaleCollabo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"itemCollectionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"itemSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerAddressDuringMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"},{"internalType":"uint256","name":"itemQuantity","type":"uint256"}],"name":"mintForPiement","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"}],"name":"mintForPiementItem1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"}],"name":"mintForPiementItem3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"}],"name":"mintForPiementItem6","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"}],"name":"mintForPiementItem9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"},{"internalType":"uint256","name":"itemQuantity","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicItemMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothes","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndAstroOtto","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"transferAddress","type":"address"},{"internalType":"uint256","name":"specialType","type":"uint256"}],"name":"publicMintWithClothesAndCollaboForPiement","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndDJRIO","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndGyozao","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"},{"internalType":"uint8","name":"itemQuantity","type":"uint8"}],"name":"publicMintWithClothesAndItem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndMocomocoworkers","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndShimonzgate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndTakanotsumedan","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndTorichan","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndVerylongAnimals","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"publicMintWithClothesAndYoshioka","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyAstroOtto","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyDJRIO","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyGyozao","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyMocomocoworkers","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyShimonzgate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyTakanotsumedan","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyTorichan","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyVerylongAnimals","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"pulicMintOnlyYoshioka","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"specialTypeArray","type":"uint256[]"},{"internalType":"uint256[]","name":"itemSizeArray","type":"uint256[]"}],"name":"setCollaboItemSizes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"specialTypeArray","type":"uint256[]"},{"internalType":"uint256[]","name":"endTimeArray","type":"uint256[]"}],"name":"setCollaboSaleEndTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"specialTypeArray","type":"uint256[]"},{"internalType":"uint256[]","name":"pricePatternArray","type":"uint256[]"}],"name":"setCollaboSalePricePatterns","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPiementAddress","type":"address"}],"name":"setPiementAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newPublicSale","type":"bool"}],"name":"setPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"specialTypeArray","type":"uint256[]"},{"internalType":"bool[]","name":"newSaleCollaboArray","type":"bool[]"}],"name":"setSaleCollabo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSlothAddr","type":"address"}],"name":"setSlothAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSlothItemAddr","type":"address"}],"name":"setSlothItemAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSpecialSlothItemAddr","type":"address"}],"name":"setSpecialSlothItemAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]