文件 1 的 17:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 17: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;
}
}
文件 3 的 17:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 4 的 17:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.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';
contract ERC721A is Context, ERC165, IERC721A {
using Address for address;
using Strings for uint256;
uint256 internal _currentIndex;
uint256 internal _burnCounter;
string private _name;
string private _symbol;
mapping(uint256 => TokenOwnership) internal _ownerships;
mapping(address => AddressData) private _addressData;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function totalSupply() public view override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
function _totalMinted() internal view returns (uint256) {
unchecked {
return _currentIndex - _startTokenId();
}
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].numberMinted);
}
function _numberBurned(address owner) internal view returns (uint256) {
return uint256(_addressData[owner].numberBurned);
}
function _getAux(address owner) internal view returns (uint64) {
return _addressData[owner].aux;
}
function _setAux(address owner, uint64 aux) internal {
_addressData[owner].aux = aux;
}
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr) if (curr < _currentIndex) {
TokenOwnership memory ownership = _ownerships[curr];
if (!ownership.burned) {
if (ownership.addr != address(0)) {
return ownership;
}
while (true) {
curr--;
ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
}
}
revert OwnerQueryForNonexistentToken();
}
function ownerOf(uint256 tokenId) public view override returns (address) {
return _ownershipOf(tokenId).addr;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
}
function _baseURI() internal view virtual returns (string memory) {
return '';
}
function approve(address to, uint256 tokenId) public override {
address owner = ERC721A.ownerOf(tokenId);
if (to == owner) revert ApprovalToCurrentOwner();
if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_approve(to, tokenId, owner);
}
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSender()) revert ApproveToCaller();
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
_transfer(from, to, tokenId);
if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _exists(uint256 tokenId) internal view returns (bool) {
return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_addressData[to].balance += uint64(quantity);
_addressData[to].numberMinted += uint64(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
uint256 end = updatedIndex + quantity;
if (to.isContract()) {
do {
emit Transfer(address(0), to, updatedIndex);
if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (updatedIndex < end);
if (_currentIndex != startTokenId) revert();
} else {
do {
emit Transfer(address(0), to, updatedIndex++);
} while (updatedIndex < end);
}
_currentIndex = updatedIndex;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _mint(address to, uint256 quantity) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_addressData[to].balance += uint64(quantity);
_addressData[to].numberMinted += uint64(quantity);
_ownerships[startTokenId].addr = to;
_ownerships[startTokenId].startTimestamp = uint64(block.timestamp);
uint256 updatedIndex = startTokenId;
uint256 end = updatedIndex + quantity;
do {
emit Transfer(address(0), to, updatedIndex++);
} while (updatedIndex < end);
_currentIndex = updatedIndex;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
_approve(address(0), tokenId, from);
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = to;
currSlot.startTimestamp = uint64(block.timestamp);
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
if (nextTokenId != _currentIndex) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
TokenOwnership memory prevOwnership = _ownershipOf(tokenId);
address from = prevOwnership.addr;
if (approvalCheck) {
bool isApprovedOrOwner = (_msgSender() == from ||
isApprovedForAll(from, _msgSender()) ||
getApproved(tokenId) == _msgSender());
if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
_approve(address(0), tokenId, from);
unchecked {
AddressData storage addressData = _addressData[from];
addressData.balance -= 1;
addressData.numberBurned += 1;
TokenOwnership storage currSlot = _ownerships[tokenId];
currSlot.addr = from;
currSlot.startTimestamp = uint64(block.timestamp);
currSlot.burned = true;
uint256 nextTokenId = tokenId + 1;
TokenOwnership storage nextSlot = _ownerships[nextTokenId];
if (nextSlot.addr == address(0)) {
if (nextTokenId != _currentIndex) {
nextSlot.addr = from;
nextSlot.startTimestamp = prevOwnership.startTimestamp;
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
文件 5 的 17:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 6 的 17:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 7 的 17:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 8 的 17:IERC721A.sol
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
interface IERC721A is IERC721, IERC721Metadata {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
}
struct AddressData {
uint64 balance;
uint64 numberMinted;
uint64 numberBurned;
uint64 aux;
}
function totalSupply() external view returns (uint256);
}
文件 9 的 17:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 10 的 17:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 11 的 17: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)
}
}
}
文件 12 的 17:MogiesDutchAuction.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "erc721a/contracts/ERC721A.sol";
contract MogiesDutchAuction is Ownable, ERC721A, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
IERC20 stars;
uint256 public immutable maxBatchSize;
uint256 public immutable amountForDevs = 50;
uint256 public immutable amountForSales = 1073;
uint256 public immutable amountForAuction = 800;
uint256 public immutable totalAmount = 1923;
uint256 public ethUSDPrice;
uint256 public starsUSDPrice;
string private _name;
string private _symbol;
uint256 public constant AUCTION_PRICE_CURVE_LENGTH = 5 days;
uint256 public constant AUCTION_DROP_INTERVAL = 1 days;
uint256 usersBonusNotMinted = 0;
uint256 usersBonusMinted = 0;
uint256 totalRebateAmount = 0;
bytes32 public allowListMerkleRoot;
struct SaleConfig {
uint32 auctionSaleStartTime;
uint32 auctionSaleEndTime;
uint32 whitelistSaleStartTime;
uint32 whitelistSaleEndTime;
uint32 publicSaleStartTime;
uint32 publicSaleEndTime;
uint32 devMintedAmount;
uint32 auctionMintedAmount;
uint32 saleMintedAmount;
uint256 ethPrice;
uint256 starsPrice;
bool hasPublicSale;
}
struct Sale {
uint8 quantity;
uint32 tier;
uint256 pricePaid;
bool isStars;
}
mapping(uint256 => address[]) public buyerList;
mapping(address => Sale[]) public sales;
mapping(address => bool) public hasClaimedRebate;
mapping(address => uint256) public remainingMintAmount;
SaleConfig public saleConfig =
SaleConfig({
auctionSaleStartTime: 0,
auctionSaleEndTime: 0,
whitelistSaleStartTime: 0,
whitelistSaleEndTime: 0,
publicSaleStartTime: 0,
publicSaleEndTime: 0,
devMintedAmount: 0,
auctionMintedAmount: 0,
saleMintedAmount: 0,
ethPrice: 1 ether,
starsPrice: 74862 ether,
hasPublicSale: false
});
event Purchase(
address wallet,
uint32 quantity,
bool isUsingStars,
uint256 starsPrice,
uint256 ethPrice
);
constructor(
IERC20 _stars,
address _owner,
uint256 _maxBatchSize,
uint256 _ethUSDPrice,
uint256 _starsUSDPrice,
uint32 _auctionSaleStartTime,
uint32 _auctionSaleEndTime,
uint32 _whitelistSaleStartTime,
uint32 _whitelistSaleEndTime,
uint32 _publicSaleStartTime,
uint32 _publicSaleEndTime
) ERC721A("Mogies", "MOGIES") {
transferOwnership(_owner);
maxBatchSize = _maxBatchSize;
stars = _stars;
ethUSDPrice = _ethUSDPrice;
starsUSDPrice = _starsUSDPrice;
_name = "Mogies";
_symbol = "MOGIES";
saleConfig.auctionSaleStartTime = _auctionSaleStartTime;
saleConfig.auctionSaleEndTime = _auctionSaleEndTime;
saleConfig.whitelistSaleStartTime = _whitelistSaleStartTime;
saleConfig.whitelistSaleEndTime = _whitelistSaleEndTime;
saleConfig.publicSaleStartTime = _publicSaleStartTime;
saleConfig.publicSaleEndTime = _publicSaleEndTime;
}
modifier callerIsUser() {
require(tx.origin == msg.sender, "The caller is another contract");
_;
}
modifier auctionAndSalesEnded() {
require(
block.timestamp > saleConfig.publicSaleEndTime &&
block.timestamp > saleConfig.whitelistSaleEndTime &&
block.timestamp >
saleConfig.auctionSaleStartTime + AUCTION_PRICE_CURVE_LENGTH,
"too early"
);
_;
}
modifier isBeforeAuctionStarts() {
require(
block.timestamp < saleConfig.auctionSaleStartTime,
"sale has already started"
);
_;
}
function devMint(uint32 quantity, address recipient) external onlyOwner {
require(
saleConfig.devMintedAmount + quantity <= amountForDevs,
"too many already minted before dev mint"
);
saleConfig.devMintedAmount += quantity;
_batchMint(recipient, quantity);
}
function earlyMint(uint32 quantity, address recipient)
external
onlyOwner
isBeforeAuctionStarts
{
require(
saleConfig.auctionMintedAmount + quantity <= amountForAuction,
"too many already minted before early mint"
);
saleConfig.auctionMintedAmount += quantity;
_batchMint(recipient, quantity);
}
function auctionMint(uint32 quantity, bool isUsingStars)
external
payable
callerIsUser
{
uint256 _auctionStartTime = uint256(saleConfig.auctionSaleStartTime);
require(
_auctionStartTime <= block.timestamp &&
block.timestamp < saleConfig.auctionSaleEndTime,
"sale has not started yet"
);
require(
saleConfig.auctionMintedAmount + quantity <= amountForAuction,
"Purchase would exceed max supply for Dutch auction mint"
);
uint256 auctionPrice = getAuctionPrice(_auctionStartTime, isUsingStars);
uint256 otherAuctionPrice = getAuctionPrice(
_auctionStartTime,
!isUsingStars
);
uint256 totalCost = auctionPrice * quantity;
uint256 totalPaid;
if (isUsingStars) {
saleConfig.starsPrice = auctionPrice;
saleConfig.ethPrice = otherAuctionPrice;
totalPaid = totalCost;
stars.safeTransferFrom(msg.sender, address(this), totalPaid);
} else {
saleConfig.ethPrice = auctionPrice;
saleConfig.starsPrice = otherAuctionPrice;
totalPaid = msg.value - refundIfOver(totalCost);
}
saleConfig.auctionMintedAmount += quantity;
_batchMint(msg.sender, quantity);
uint256 tier = (block.timestamp - _auctionStartTime) /
AUCTION_DROP_INTERVAL;
buyerList[tier].push(msg.sender);
if (remainingMintAmount[msg.sender] == 0) {
usersBonusNotMinted++;
remainingMintAmount[msg.sender] = usersBonusNotMinted;
}
sales[msg.sender].push(
Sale({
quantity: uint8(quantity),
pricePaid: totalPaid,
tier: uint32(tier),
isStars: isUsingStars
})
);
emit Purchase(
msg.sender,
quantity,
isUsingStars,
saleConfig.starsPrice,
saleConfig.ethPrice
);
}
function allowlistMint(
uint32 quantity,
bool isUsingStars,
bytes32[] calldata _proof
) external payable callerIsUser {
require(
saleConfig.saleMintedAmount + quantity <= amountForSales,
"Purchase would exceed max supply for allowlistMint"
);
require(
isAllowListed(_proof, msg.sender),
"This address is not allow listed for the presale"
);
require(
saleConfig.whitelistSaleStartTime < block.timestamp &&
block.timestamp < saleConfig.whitelistSaleEndTime,
"outside of allowlist sale times"
);
if (isUsingStars) {
stars.safeTransferFrom(
msg.sender,
address(this),
saleConfig.starsPrice * quantity
);
} else {
refundIfOver(saleConfig.ethPrice * quantity);
}
saleConfig.saleMintedAmount += quantity;
_batchMint(msg.sender, quantity);
emit Purchase(
msg.sender,
quantity,
isUsingStars,
saleConfig.starsPrice,
saleConfig.ethPrice
);
}
function isAllowListed(bytes32[] calldata _proof, address _address)
public
view
returns (bool)
{
require(_address != address(0), "Zero address not on Allow List");
bytes32 leaf = keccak256(abi.encodePacked(_address));
return MerkleProof.verify(_proof, allowListMerkleRoot, leaf);
}
function setAllowListMerkleRoot(bytes32 _allowListMerkleRoot)
external
onlyOwner
{
allowListMerkleRoot = _allowListMerkleRoot;
}
function publicSaleMint(uint32 quantity, bool isUsingStars)
external
payable
callerIsUser
{
require(
amountForDevs + saleConfig.saleMintedAmount + saleConfig.auctionMintedAmount + quantity <=
totalAmount,
"Purchase would exceed max supply"
);
require(saleConfig.publicSaleStartTime < block.timestamp && block.timestamp < saleConfig.publicSaleEndTime, "public sale not active");
require(isPublicSaleOn(), "public sale is not active");
saleConfig.saleMintedAmount += quantity;
if (isUsingStars) {
stars.safeTransferFrom(
msg.sender,
address(this),
saleConfig.starsPrice * quantity
);
} else {
refundIfOver(saleConfig.ethPrice * quantity);
}
_batchMint(msg.sender, quantity);
emit Purchase(
msg.sender,
quantity,
isUsingStars,
saleConfig.starsPrice,
saleConfig.ethPrice
);
}
function rebate() external auctionAndSalesEnded {
require(sales[msg.sender].length > 0, "Nothing to rebate.");
require(!hasClaimedRebate[msg.sender], "Rebate already claimed");
uint256 rebateAmount = 0;
for (uint256 i = 0; i < sales[msg.sender].length; i++) {
uint256 quantity = sales[msg.sender][i].quantity;
if (sales[msg.sender][i].isStars) {
rebateAmount += (sales[msg.sender][i].pricePaid -
(saleConfig.starsPrice * quantity));
} else {
if (sales[msg.sender][i].tier == 0) {
rebateAmount +=
(15000 *
((sales[msg.sender][i].pricePaid -
(saleConfig.ethPrice * quantity)) * ethUSDPrice)) /
(10000 * starsUSDPrice);
} else if (sales[msg.sender][i].tier == 1) {
rebateAmount +=
(13000 *
((sales[msg.sender][i].pricePaid -
(saleConfig.ethPrice * quantity)) * ethUSDPrice)) /
(10000 * starsUSDPrice);
} else if (sales[msg.sender][i].tier == 2) {
rebateAmount +=
((sales[msg.sender][i].pricePaid -
(saleConfig.ethPrice * quantity)) * ethUSDPrice) /
starsUSDPrice;
}
}
}
require(rebateAmount > 0, "Nothing to rebate.");
hasClaimedRebate[msg.sender] = true;
stars.safeTransfer(msg.sender, rebateAmount);
}
function mintRemaining() external callerIsUser auctionAndSalesEnded {
require(totalSupply() < totalAmount, "nothing to mint");
require(remainingMintAmount[msg.sender] != 0, "cannot mint more");
uint256 quantity;
if (totalRebateAmount == 0) {
totalRebateAmount = totalAmount - totalSupply();
}
if (usersBonusNotMinted + usersBonusMinted == totalRebateAmount) {
quantity = 1;
} else if (usersBonusNotMinted + usersBonusMinted < totalRebateAmount) {
quantity = totalRebateAmount / (usersBonusNotMinted + usersBonusMinted);
}
if (
remainingMintAmount[msg.sender] <=
totalRebateAmount % (usersBonusNotMinted + usersBonusMinted)
) {
quantity++;
}
usersBonusNotMinted--;
usersBonusMinted++;
remainingMintAmount[msg.sender] = 0;
require(quantity > 0, "not entitled to mint remaining");
_batchMint(msg.sender, quantity);
}
function adminFinalMint(address recipient)
external
onlyOwner
auctionAndSalesEnded
{
require(totalSupply() < totalAmount, "nothing to mint");
_batchMint(recipient, totalAmount - totalSupply());
}
function isPublicSaleOn() public view returns (bool) {
return
saleConfig.hasPublicSale &&
saleConfig.publicSaleStartTime <= block.timestamp &&
block.timestamp < saleConfig.publicSaleEndTime;
}
function setPublicSale(bool _publicSale) external onlyOwner {
saleConfig.hasPublicSale = _publicSale;
}
uint256 public AUCTION_START_ETH_PRICE = 1 ether;
uint256 public AUCTION_END_ETH_PRICE = 200000000 gwei;
uint256 public AUCTION_DROP_PER_STEP_ETH = 200000000 gwei;
uint256 public AUCTION_START_STARS_PRICE = 74862 ether;
uint256 public AUCTION_END_STARS_PRICE = 14972400000000 gwei;
uint256 public AUCTION_DROP_PER_STEP_STARS = 14972400000000 gwei;
function setAuctionEthParams(
uint256 _auctionStartEthPrice,
uint256 _auctionEndEthPrice,
uint256 _auctionDropPerStepEth
) external onlyOwner isBeforeAuctionStarts {
AUCTION_START_ETH_PRICE = _auctionStartEthPrice;
AUCTION_END_ETH_PRICE = _auctionEndEthPrice;
AUCTION_DROP_PER_STEP_ETH = _auctionDropPerStepEth;
}
function setAuctionStarsParams(
uint256 _auctionStartStarsPrice,
uint256 _auctionEndStarsPrice,
uint256 _auctionDropPerStepStars
) external onlyOwner isBeforeAuctionStarts {
AUCTION_START_STARS_PRICE = _auctionStartStarsPrice;
AUCTION_END_STARS_PRICE = _auctionEndStarsPrice;
AUCTION_DROP_PER_STEP_STARS = _auctionDropPerStepStars;
}
function getAuctionPrice(uint256 _saleStartTime, bool _isUsingStars)
public
view
returns (uint256)
{
if (_isUsingStars) {
if (block.timestamp < _saleStartTime) {
return AUCTION_START_STARS_PRICE;
}
if (block.timestamp >= _saleStartTime + AUCTION_PRICE_CURVE_LENGTH) {
return AUCTION_END_STARS_PRICE;
} else {
uint256 steps = (block.timestamp - _saleStartTime) /
AUCTION_DROP_INTERVAL;
return
AUCTION_START_STARS_PRICE - (steps * AUCTION_DROP_PER_STEP_STARS);
}
} else {
if (block.timestamp < _saleStartTime) {
return AUCTION_START_ETH_PRICE;
}
if (block.timestamp >= _saleStartTime + AUCTION_PRICE_CURVE_LENGTH) {
return AUCTION_END_ETH_PRICE;
} else {
uint256 steps = (block.timestamp - _saleStartTime) /
AUCTION_DROP_INTERVAL;
return AUCTION_START_ETH_PRICE - (steps * AUCTION_DROP_PER_STEP_ETH);
}
}
}
function refundIfOver(uint256 price) private returns (uint256) {
require(msg.value >= price, "Need to send more ETH.");
uint256 refundAmount = 0;
if (msg.value > price) {
refundAmount = msg.value - price;
payable(msg.sender).transfer(refundAmount);
}
return refundAmount;
}
function getBuyerList(uint256 tier) external view returns (address[] memory) {
return buyerList[tier];
}
function setEthUsdPrice(uint256 _ethUsdPrice)
external
onlyOwner
isBeforeAuctionStarts
{
ethUSDPrice = _ethUsdPrice;
}
function setStarsUsdPrice(uint256 _starsUsdPrice)
external
onlyOwner
isBeforeAuctionStarts
{
starsUSDPrice = _starsUsdPrice;
}
function setAuctionSaleStartTime(uint32 timestamp) external onlyOwner {
saleConfig.auctionSaleStartTime = timestamp;
}
function setAuctionSaleEndTime(uint32 timestamp) external onlyOwner {
saleConfig.auctionSaleEndTime = timestamp;
}
function setWhitelistSaleStartTime(uint32 timestamp) external onlyOwner {
saleConfig.whitelistSaleStartTime = timestamp;
}
function setWhitelistSaleEndTime(uint32 timestamp) external onlyOwner {
saleConfig.whitelistSaleEndTime = timestamp;
}
function setPublicSaleStartTime(uint32 timestamp) external onlyOwner {
saleConfig.publicSaleStartTime = timestamp;
}
function setPublicSaleEndTime(uint32 timestamp) external onlyOwner {
saleConfig.publicSaleEndTime = timestamp;
}
function batchSetTimes(uint32 _auctionSaleStartTime, uint32 _auctionSaleEndTime, uint32 _whitelistSaleStartTime, uint32 _whitelistSaleEndTime, uint32 _publicSaleStartTime, uint32 _publicSaleEndTime) external onlyOwner {
require(_auctionSaleStartTime < _auctionSaleEndTime, "Auction timestamps inverted");
require(_auctionSaleEndTime < _whitelistSaleStartTime, "Auction before whitelist sale");
require(_whitelistSaleStartTime < _whitelistSaleEndTime, "Whitelist sale timestamps inverted");
require(_whitelistSaleEndTime < _publicSaleStartTime, "Whitelist sale before public sale");
require(_publicSaleStartTime < _publicSaleEndTime, "Public sale timestamps inverted");
saleConfig.auctionSaleStartTime = _auctionSaleStartTime;
saleConfig.auctionSaleEndTime = _auctionSaleEndTime;
saleConfig.whitelistSaleStartTime = _whitelistSaleStartTime;
saleConfig.whitelistSaleEndTime = _whitelistSaleEndTime;
saleConfig.publicSaleStartTime = _publicSaleStartTime;
saleConfig.publicSaleEndTime = _publicSaleEndTime;
}
string public uriPrefix;
string public uriSuffix = ".json";
string public hiddenMetadataUri;
bool public revealed;
function setUriPrefix(string calldata _uriPrefix) external onlyOwner {
uriPrefix = _uriPrefix;
}
function setUriSuffix(string calldata _uriSuffix) external onlyOwner {
uriSuffix = _uriSuffix;
}
function setRevealed(bool _state) external onlyOwner {
revealed = _state;
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(_tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
if (revealed == false) {
return hiddenMetadataUri;
}
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix)
)
: "";
}
function setHiddenMetadataUri(string calldata _hiddenMetadataUri)
external
onlyOwner
{
hiddenMetadataUri = _hiddenMetadataUri;
}
function _baseURI() internal view virtual override returns (string memory) {
return uriPrefix;
}
function withdrawMoney() external onlyOwner nonReentrant {
(bool os, ) = payable(owner()).call{ value: address(this).balance }("");
require(os, "withdraw: transfer failed");
stars.safeTransfer(owner(), stars.balanceOf(address(this)));
}
function _batchMint(address recipient, uint256 quantity) private {
uint256 numChunks = quantity / maxBatchSize;
for (uint256 i = 0; i < numChunks; i++) {
_safeMint(recipient, maxBatchSize);
}
uint256 remainder = quantity % maxBatchSize;
if (remainder != 0) {
_safeMint(recipient, remainder);
}
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
}
文件 13 的 17: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);
}
}
文件 14 的 17:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 15 的 17:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 16 的 17:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
文件 17 的 17:draft-IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
{
"compilationTarget": {
"contracts/MogiesDutchAuction.sol": "MogiesDutchAuction"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"contract IERC20","name":"_stars","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_maxBatchSize","type":"uint256"},{"internalType":"uint256","name":"_ethUSDPrice","type":"uint256"},{"internalType":"uint256","name":"_starsUSDPrice","type":"uint256"},{"internalType":"uint32","name":"_auctionSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_auctionSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"_whitelistSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_whitelistSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"_publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_publicSaleEndTime","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint32","name":"quantity","type":"uint32"},{"indexed":false,"internalType":"bool","name":"isUsingStars","type":"bool"},{"indexed":false,"internalType":"uint256","name":"starsPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethPrice","type":"uint256"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"AUCTION_DROP_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_DROP_PER_STEP_ETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_DROP_PER_STEP_STARS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_END_ETH_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_END_STARS_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_PRICE_CURVE_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_START_ETH_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AUCTION_START_STARS_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"adminFinalMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowListMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"bool","name":"isUsingStars","type":"bool"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"amountForAuction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountForDevs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountForSales","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"bool","name":"isUsingStars","type":"bool"}],"name":"auctionMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_auctionSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_auctionSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"_whitelistSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_whitelistSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"_publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"_publicSaleEndTime","type":"uint32"}],"name":"batchSetTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"buyerList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"address","name":"recipient","type":"address"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"address","name":"recipient","type":"address"}],"name":"earlyMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethUSDPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleStartTime","type":"uint256"},{"internalType":"bool","name":"_isUsingStars","type":"bool"}],"name":"getAuctionPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"getBuyerList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasClaimedRebate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hiddenMetadataUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"address","name":"_address","type":"address"}],"name":"isAllowListed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSaleOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBatchSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintRemaining","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"quantity","type":"uint32"},{"internalType":"bool","name":"isUsingStars","type":"bool"}],"name":"publicSaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"rebate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"remainingMintAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleConfig","outputs":[{"internalType":"uint32","name":"auctionSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"auctionSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"whitelistSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"whitelistSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleStartTime","type":"uint32"},{"internalType":"uint32","name":"publicSaleEndTime","type":"uint32"},{"internalType":"uint32","name":"devMintedAmount","type":"uint32"},{"internalType":"uint32","name":"auctionMintedAmount","type":"uint32"},{"internalType":"uint32","name":"saleMintedAmount","type":"uint32"},{"internalType":"uint256","name":"ethPrice","type":"uint256"},{"internalType":"uint256","name":"starsPrice","type":"uint256"},{"internalType":"bool","name":"hasPublicSale","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"sales","outputs":[{"internalType":"uint8","name":"quantity","type":"uint8"},{"internalType":"uint32","name":"tier","type":"uint32"},{"internalType":"uint256","name":"pricePaid","type":"uint256"},{"internalType":"bool","name":"isStars","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_allowListMerkleRoot","type":"bytes32"}],"name":"setAllowListMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionStartEthPrice","type":"uint256"},{"internalType":"uint256","name":"_auctionEndEthPrice","type":"uint256"},{"internalType":"uint256","name":"_auctionDropPerStepEth","type":"uint256"}],"name":"setAuctionEthParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setAuctionSaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setAuctionSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionStartStarsPrice","type":"uint256"},{"internalType":"uint256","name":"_auctionEndStarsPrice","type":"uint256"},{"internalType":"uint256","name":"_auctionDropPerStepStars","type":"uint256"}],"name":"setAuctionStarsParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethUsdPrice","type":"uint256"}],"name":"setEthUsdPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hiddenMetadataUri","type":"string"}],"name":"setHiddenMetadataUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_publicSale","type":"bool"}],"name":"setPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setPublicSaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setPublicSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_starsUsdPrice","type":"uint256"}],"name":"setStarsUsdPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"setUriPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriSuffix","type":"string"}],"name":"setUriSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setWhitelistSaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"timestamp","type":"uint32"}],"name":"setWhitelistSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"starsUSDPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uriPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uriSuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawMoney","outputs":[],"stateMutability":"nonpayable","type":"function"}]