编译器
0.8.18+commit.87f61d96
文件 1 的 13:Auction.sol
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
contract AuctionMintContract is Ownable {
struct AuctionData {
uint256 initialSupply;
uint256 minted;
uint256 startTimestamp;
uint256 finishTimestamp;
uint256 initialPrice;
uint256 maxBuy;
}
uint256[] public auctionStepList;
uint256[] public auctionPriceList;
uint256[] public auctionSupplyList;
bool public auctionSoldout = false;
event AuctionNewStep(address user, uint256 minted, uint256 newPrice, uint256 newSupply);
event AuctionMint(address user, uint256 amount, uint256 timestamp, uint256 price);
AuctionData public auctionData;
mapping(address => uint256) public auctionMinted;
uint256 public finalAuctionPrice = 0.0169 ether;
function initAuction(
uint256 initialSupply,
uint256 startTimestamp,
uint256 finishTimestamp,
uint256 initialPrice,
uint256 maxBuy
) public onlyOwner {
auctionData.initialSupply = initialSupply;
auctionData.startTimestamp = startTimestamp;
auctionData.finishTimestamp = finishTimestamp;
auctionData.initialPrice = initialPrice;
auctionData.maxBuy = maxBuy;
}
function initAuctionPrice(
uint256[] calldata _auctionStepList,
uint256[] calldata _auctionPriceList,
uint256[] calldata _auctionSupplyList
) public onlyOwner {
uint len = _auctionStepList.length;
require(len == _auctionPriceList.length, "auction price list not equal");
require(len == _auctionSupplyList.length, "auction supply list not equal");
for (uint256 i = 0; i < len; i++) {
if (auctionStepList.length < i + 1) {
auctionStepList.push(_auctionStepList[i]);
} else {
auctionStepList[i] = _auctionStepList[i];
}
if (auctionPriceList.length < i + 1) {
auctionPriceList.push(_auctionPriceList[i]);
} else {
auctionPriceList[i] = _auctionPriceList[i];
}
if (auctionSupplyList.length < i + 1) {
auctionSupplyList.push(_auctionSupplyList[i]);
} else {
auctionSupplyList[i] = _auctionSupplyList[i];
}
}
}
function currentPriceAndSupply(uint256 currentTime) public view returns (uint256 price, uint256 supply) {
uint256 len = auctionStepList.length;
if (len == 0) {
return (uint256(0), uint256(0));
}
if (currentTime < auctionStepList[0]) {
return (auctionPriceList[0], auctionSupplyList[0]);
}
for (uint256 i = 0; i < len; i++) {
if (currentTime < auctionStepList[i]) {
return (auctionPriceList[i - 1], auctionSupplyList[i - 1]);
}
}
return (auctionPriceList[len - 1], auctionSupplyList[len - 1]);
}
function auctionRunning() public view returns (bool) {
return block.timestamp >= auctionData.startTimestamp && block.timestamp <= auctionData.finishTimestamp;
}
function auctionBeforeMint(
address user,
uint256 amount,
uint256 userPayed
) internal {
require(auctionRunning(), "auction is not running");
require(auctionMinted[user] + amount <= auctionData.maxBuy, "u can only buy 5");
(uint256 newPrice, uint256 newSupply) = currentPriceAndSupply(block.timestamp);
require(userPayed >= newPrice * amount, "user pay not enough");
require(
auctionData.minted + amount <= newSupply,
"there is no enough auction sofa maker for u! auction sell finished!"
);
emit AuctionMint(user, amount, block.timestamp, newPrice);
auctionMinted[user] += amount;
auctionData.minted += amount;
if (finalAuctionPrice != newPrice) {
finalAuctionPrice = newPrice;
}
if (auctionData.minted >= newSupply) {
auctionSoldout = true;
}
}
function getAuctionPriceConfig()
public
view
returns (
uint256[] memory priceList,
uint256[] memory timeList,
uint256[] memory supplyList
)
{
priceList = new uint256[](auctionStepList.length);
timeList = new uint256[](auctionStepList.length);
supplyList = new uint256[](auctionStepList.length);
for (uint i = 0; i < auctionStepList.length; i++) {
priceList[i] = auctionPriceList[i];
timeList[i] = auctionStepList[i];
supplyList[i] = auctionSupplyList[i];
}
}
}
文件 2 的 13: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 的 13:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
uint256 private _burnCounter;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
function totalSupply() public view virtual override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
function _totalMinted() internal view virtual returns (uint256) {
unchecked {
return _currentIndex - _startTokenId();
}
}
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0x80ac58cd ||
interfaceId == 0x5b5e139f;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
function _baseURI() internal view virtual returns (string memory) {
return '';
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
assembly {
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
function approve(address to, uint256 tokenId) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex &&
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0;
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
msgSender := and(msgSender, _BITMASK_ADDRESS)
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
--_packedAddressData[from];
++_packedAddressData[to];
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
startTokenId
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
if (_currentIndex != end) revert();
}
}
}
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
}
文件 4 的 13:ERC721AQueryable.sol
pragma solidity ^0.8.4;
import './IERC721AQueryable.sol';
import '../ERC721A.sol';
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
TokenOwnership memory ownership;
if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
return ownership;
}
ownership = _ownershipAt(tokenId);
if (ownership.burned) {
return ownership;
}
return _ownershipOf(tokenId);
}
function explicitOwnershipsOf(uint256[] calldata tokenIds)
external
view
virtual
override
returns (TokenOwnership[] memory)
{
unchecked {
uint256 tokenIdsLength = tokenIds.length;
TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
for (uint256 i; i != tokenIdsLength; ++i) {
ownerships[i] = explicitOwnershipOf(tokenIds[i]);
}
return ownerships;
}
}
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view virtual override returns (uint256[] memory) {
unchecked {
if (start >= stop) revert InvalidQueryRange();
uint256 tokenIdsIdx;
uint256 stopLimit = _nextTokenId();
if (start < _startTokenId()) {
start = _startTokenId();
}
if (stop > stopLimit) {
stop = stopLimit;
}
uint256 tokenIdsMaxLength = balanceOf(owner);
if (start < stop) {
uint256 rangeLength = stop - start;
if (rangeLength < tokenIdsMaxLength) {
tokenIdsMaxLength = rangeLength;
}
} else {
tokenIdsMaxLength = 0;
}
uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
if (tokenIdsMaxLength == 0) {
return tokenIds;
}
TokenOwnership memory ownership = explicitOwnershipOf(start);
address currOwnershipAddr;
if (!ownership.burned) {
currOwnershipAddr = ownership.addr;
}
for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
assembly {
mstore(tokenIds, tokenIdsIdx)
}
return tokenIds;
}
}
function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memory ownership;
for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
return tokenIds;
}
}
}
文件 5 的 13:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 6 的 13: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);
}
文件 7 的 13:IERC721A.sol
pragma solidity ^0.8.4;
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
文件 8 的 13:IERC721AQueryable.sol
pragma solidity ^0.8.4;
import '../IERC721A.sol';
interface IERC721AQueryable is IERC721A {
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);
}
文件 9 的 13:IRevealed721NFT.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface IRevealed721NFT is IERC721 {
function revealMint(address wallet, uint256 tokenId) external;
}
文件 10 的 13: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)
}
}
}
文件 11 的 13: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);
}
}
文件 12 的 13: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;
}
}
文件 13 的 13:SofaNft.sol
pragma solidity ^0.8.11;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./interface/IRevealed721NFT.sol";
import "./Auction.sol";
contract SofaNFT is Ownable, ERC721AQueryable, ReentrancyGuard, AuctionMintContract {
constructor() ERC721A("Sofa Maker", "Sofa Maker") {
_safeMint(owner(), 1);
}
string public BASE_URI = "ipfs://bafybeiei3tgirxccl4sgoq4b5xkzquropmgzucy3w3pz5wmgs5pprf5o2q/";
mapping(uint256 => uint256) private claimedBitMap;
bytes32 public merkleRoot;
function initialize() public onlyOwner nonReentrant {}
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
uint256 public constant MAX_SUPPLY = 5555;
uint256 public constant WL1_SUPPLY = 2000;
uint256 public constant WL1_MAX_MINT = 3;
uint256 public constant WL_MAX_MINT = 3;
uint256 public constant PUBLIC_MAX_MINT = 3;
uint256 public wl1Minted = 0;
uint256 public wl2Minted = 0;
uint256 public publicMinted = 0;
bool public paused = false;
uint256 public minted = 0;
uint256 public PUBLIC_PRICE = 0.0169 ether;
mapping(address => mapping(uint256 => uint256)) public userStageMinted;
mapping(address => uint256) public userMinted;
mapping(address => bool) public burnPassMap;
mapping(uint256 => uint256) public timeRanges;
function setBaseUri(string memory uri) public onlyOwner {
BASE_URI = uri;
}
function setMerkleRoot(bytes32 _root) public onlyOwner {
merkleRoot = _root;
}
function _baseURI() internal view virtual override returns (string memory) {
return BASE_URI;
}
function setPause(bool _paused) public onlyOwner {
paused = _paused;
}
function setPublicPrice(uint256 newPrice) public onlyOwner {
PUBLIC_PRICE = newPrice;
}
function setTimeRanges(uint256[] calldata ranges) public onlyOwner {
for (uint8 i = 0; i < ranges.length; i++) {
timeRanges[i] = ranges[i];
}
}
function checkRange(uint256 index) public {
require(block.timestamp >= timeRanges[index * 2], "stage not start");
require(block.timestamp <= timeRanges[index * 2 + 1], "stage already finished");
}
modifier notPaused() {
require(!paused, "error: sale paused!");
_;
}
function wlPrice() public view returns (uint256) {
if (auctionSoldout && finalAuctionPrice != auctionPriceList[auctionStepList.length - 1]) {
return (finalAuctionPrice * 800) / 1000;
}
return 0.0119 ether;
}
function whitelist1Mint(
uint256 amount,
uint256 index,
address account,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
address wallet = _msgSender();
require(wallet == account, "error: u are not the real WL owner!");
checkRange(0);
require(msg.sender == tx.origin, "error: eoa only");
require(wlPrice() * amount <= msg.value, "error: price not enough");
require(
userStageMinted[wallet][1] + amount <= WL1_MAX_MINT,
"error: whitelist cannot mint more than MAX_MINT (1) !"
);
require(wl1Minted + amount <= WL1_SUPPLY, "error: current stage mint finished");
bool claimed = merkleVerifyAndSetClaimed(index, 1, account, merkleProof);
_safeMint(wallet, amount);
userStageMinted[wallet][1] += amount;
wl1Minted += amount;
}
function whitelistMint(
uint256 amount,
uint256 index,
address account,
bytes32[] calldata merkleProof
) public payable notPaused nonReentrant {
address wallet = _msgSender();
require(wallet == account, "error: u are not the real WL owner!");
checkRange(1);
require(msg.sender == tx.origin, "error: eoa only");
require(wlPrice() * amount <= msg.value, "error: price not enough");
require(
userStageMinted[wallet][2] + amount <= WL_MAX_MINT,
"error: whitelist cannot mint more than MAX_MINT (2) !"
);
require(MAX_SUPPLY >= minted + amount, "error: MAX_SUPPLY reached!");
bool claimed = merkleVerifyAndSetClaimed(index, 2, account, merkleProof);
_safeMint(wallet, amount);
userStageMinted[wallet][2] += amount;
wl2Minted += amount;
}
function auctionMint(uint256 amount) public payable notPaused nonReentrant {
address wallet = _msgSender();
require(msg.sender == tx.origin, "error: eoa only");
auctionBeforeMint(wallet, amount, msg.value);
_safeMint(wallet, amount);
}
function WL2_SUPPLY() public view returns (uint256) {
return MAX_SUPPLY - auctionData.minted - wl1Minted;
}
function publicSupply() public view returns (uint256) {
return MAX_SUPPLY - auctionData.minted - wl1Minted - wl2Minted;
}
function publicMint(uint256 amount) public payable notPaused nonReentrant {
address wallet = _msgSender();
require(msg.sender == tx.origin, "error: eoa only");
checkRange(2);
require(wlPrice() * amount <= msg.value, "error: price not enough");
require(MAX_SUPPLY >= minted + amount, "error: MAX_SUPPLY reached!");
require(
PUBLIC_MAX_MINT >= userStageMinted[wallet][3] + amount,
"error: u cannot mint more than PUBLIC_MAX_MINT(2) !"
);
_safeMint(wallet, amount);
publicMinted += amount;
userStageMinted[wallet][3] += amount;
}
function isClaimed(uint256 index) public view returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[claimedWordIndex];
uint256 mask = (1 << claimedBitIndex);
return claimedWord & mask == mask;
}
function _setClaimed(uint256 index) internal {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
}
function verify(
bytes32 _merkleRoot,
uint256 index,
address account,
uint256 stage,
bytes32[] calldata merkleProof
) public pure returns (bool) {
bytes32 node = keccak256(abi.encodePacked(index, account, stage));
return MerkleProof.verify(merkleProof, _merkleRoot, node);
}
function merkleVerifyAndSetClaimed(
uint256 index,
uint256 stage,
address account,
bytes32[] calldata merkleProof
) internal returns (bool claimed) {
bytes32 node = keccak256(abi.encodePacked(index, account, stage));
require(MerkleProof.verify(merkleProof, merkleRoot, node), "MerkleDistributor: Invalid proof.");
claimed = isClaimed(index);
if (!claimed) {
_setClaimed(index);
}
}
function _safeMint(address wallet, uint256 amount) internal override {
super._safeMint(wallet, amount);
userMinted[wallet] += amount;
minted += amount;
}
function setBurnPassMap(address _addr, bool pass) public onlyOwner {
burnPassMap[_addr] = pass;
}
function burn(uint256 tokenId, address _user) external {
require(_msgSender() == owner() || burnPassMap[_msgSender()], "error:user or contract shall not pass");
require(ownerOf(tokenId) == _user, "error:only owner can burn this token!");
_burn(tokenId);
}
function setApprovalForAll(address operator, bool approved) public override(IERC721A, ERC721A) {
super.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId) public payable override(IERC721A, ERC721A) {
super.approve(operator, tokenId);
}
struct ContractDashboard {
bool paused;
uint256 maxSupply;
uint256 totalMinted;
uint256 totalSupply;
uint256 currentStage;
uint256 price_auction;
uint256 minted_auction;
uint256 supply_auction;
uint256 user_minted_auction;
uint256[] auction_price_list;
uint256[] auction_time_list;
uint256[] auction_supply_list;
uint256 price;
uint256 minted_wl_1;
uint256 supply_wl_1;
uint256 user_minted_wl_1;
uint256 minted_wl_2;
uint256 supply_wl_2;
uint256 user_minted_wl_2;
uint256 minted_public;
uint256 supply_public;
uint256 user_minted_public;
uint256 auctionStart;
uint256 auctionEnd;
uint256 wl1Start;
uint256 wl1End;
uint256 wl2Start;
uint256 wl2End;
uint256 publicStart;
uint256 publicEnd;
uint256 now;
uint256 userCurrentMinted;
uint256 currentRoundUserMax;
bool auctionSoldout;
}
function status(address _addr, uint256 now) public view returns (ContractDashboard memory dashboard) {
dashboard.paused = paused;
dashboard.maxSupply = MAX_SUPPLY;
dashboard.totalMinted = minted;
dashboard.totalSupply = totalSupply();
(uint256 auctionPrice, uint256 auctionSupply) = currentPriceAndSupply(block.timestamp);
dashboard.price_auction = auctionPrice;
dashboard.minted_auction = auctionData.minted;
dashboard.supply_auction = auctionSupply;
dashboard.user_minted_auction = auctionMinted[_addr];
dashboard.auction_price_list = new uint256[](auctionStepList.length);
dashboard.auction_time_list = new uint256[](auctionStepList.length);
dashboard.auction_supply_list = new uint256[](auctionStepList.length);
for (uint i = 0; i < auctionStepList.length; i++) {
dashboard.auction_price_list[i] = auctionPriceList[i];
dashboard.auction_time_list[i] = auctionStepList[i];
dashboard.auction_supply_list[i] = auctionSupplyList[i];
}
dashboard.price = wlPrice();
dashboard.minted_wl_1 = wl1Minted;
dashboard.supply_wl_1 = WL1_SUPPLY;
dashboard.user_minted_wl_1 = userStageMinted[_addr][1];
dashboard.minted_wl_2 = wl2Minted;
dashboard.supply_wl_2 = WL2_SUPPLY();
dashboard.user_minted_wl_2 = userStageMinted[_addr][2];
dashboard.minted_public = publicMinted;
dashboard.supply_public = publicSupply();
dashboard.user_minted_public = userStageMinted[_addr][3];
dashboard.auctionStart = auctionData.startTimestamp;
dashboard.auctionEnd = auctionData.finishTimestamp;
dashboard.wl1Start = timeRanges[0];
dashboard.wl1End = timeRanges[1];
dashboard.wl2Start = timeRanges[2];
dashboard.wl2End = timeRanges[3];
dashboard.publicStart = timeRanges[4];
dashboard.publicEnd = timeRanges[5];
dashboard.now = block.timestamp + 0;
dashboard.auctionSoldout = auctionSoldout;
if (block.timestamp < dashboard.auctionStart) {
dashboard.currentStage = 101;
} else if (block.timestamp < dashboard.auctionEnd && !auctionSoldout) {
dashboard.currentStage = 1;
dashboard.userCurrentMinted = dashboard.user_minted_auction;
dashboard.currentRoundUserMax = auctionData.maxBuy;
} else if (block.timestamp < dashboard.auctionEnd && auctionSoldout) {
dashboard.currentStage = 102;
dashboard.userCurrentMinted = dashboard.user_minted_auction;
dashboard.currentRoundUserMax = auctionData.maxBuy;
} else if (block.timestamp < dashboard.wl1Start) {
dashboard.currentStage = 102;
dashboard.userCurrentMinted = dashboard.user_minted_auction;
dashboard.currentRoundUserMax = auctionData.maxBuy;
} else if (block.timestamp < dashboard.wl1End) {
dashboard.currentStage = 2;
dashboard.userCurrentMinted = dashboard.user_minted_wl_1;
dashboard.currentRoundUserMax = WL1_MAX_MINT;
} else if (block.timestamp < dashboard.wl2Start) {
dashboard.currentStage = 103;
dashboard.userCurrentMinted = dashboard.user_minted_wl_1;
dashboard.currentRoundUserMax = WL1_MAX_MINT;
} else if (block.timestamp < dashboard.wl2End) {
dashboard.currentStage = 3;
dashboard.userCurrentMinted = dashboard.user_minted_wl_2;
dashboard.currentRoundUserMax = WL_MAX_MINT;
} else if (block.timestamp < dashboard.publicStart) {
dashboard.currentStage = 104;
dashboard.userCurrentMinted = dashboard.user_minted_wl_2;
dashboard.currentRoundUserMax = WL_MAX_MINT;
} else if (block.timestamp < dashboard.publicEnd) {
dashboard.currentStage = 4;
dashboard.userCurrentMinted = dashboard.user_minted_public;
dashboard.currentRoundUserMax = PUBLIC_MAX_MINT;
} else {
dashboard.currentStage = 105;
dashboard.userCurrentMinted = dashboard.user_minted_public;
dashboard.currentRoundUserMax = PUBLIC_MAX_MINT;
}
return dashboard;
}
IRevealed721NFT revealedContract;
function setRevealContract(address addr) public onlyOwner {
revealedContract = IRevealed721NFT(addr);
}
function reveal(uint256[] calldata tokenIdList) public {
require(isAllowTransfer, "reveal not begin");
require(_msgSender() == tx.origin, "error: eoa only");
for (uint i = 0; i < tokenIdList.length; i++) {
uint256 tokenId = tokenIdList[i];
require(ownerOf(tokenId) == _msgSender(), "only owner can reveal");
revealedContract.revealMint(_msgSender(), tokenId);
_burn(tokenId);
}
}
function transferFrom(address from, address to, uint256 tokenId) public payable override(IERC721A, ERC721A) {
assertAllowTransfer(from, to);
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override(IERC721A, ERC721A) {
assertAllowTransfer(from, to);
super.safeTransferFrom(from, to, tokenId);
}
bool private isAllowTransfer = false;
function setAllowTransfer(bool _isAllow) public onlyOwner {
isAllowTransfer = _isAllow;
}
function assertAllowTransfer(address from, address to) internal view {
if (!isAllowTransfer) {
require(from == address(0), "transfer reach limit");
}
}
function mintTreasure(uint256 _amount,uint256 stage) public onlyOwner {
uint256 amount = _amount;
if(stage == 1) {
require(auctionRunning(),"sorry auction not running");
(uint256 newPrice, uint256 newSupply) = currentPriceAndSupply(block.timestamp);
finalAuctionPrice = newPrice;
if (auctionData.minted + amount >= newSupply) {
amount = newSupply - auctionData.minted;
auctionData.minted = newSupply;
auctionSoldout = true;
} else {
auctionData.minted += amount;
}
}
if(stage == 2) {
checkRange(0);
if(wl1Minted + amount > WL1_SUPPLY) {
amount = WL1_SUPPLY - wl1Minted;
}
wl1Minted += amount;
}
if(stage == 3) {
checkRange(1);
wl2Minted += amount;
}
if(stage == 4) {
checkRange(2);
publicMinted += amount;
}
require(MAX_SUPPLY >= minted + amount, "error: MAX_SUPPLY reached!");
_safeMint(owner(), amount);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override(IERC721A, ERC721A) {
assertAllowTransfer(from, to);
super.safeTransferFrom(from, to, tokenId, data);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A) returns (bool) {
return ERC721A.supportsInterface(interfaceId);
}
function withdraw(uint256 amount) public onlyOwner nonReentrant {
uint256 _amt = amount;
if (amount == 0) {
_amt = address(this).balance;
}
require(_amt > 0, "error:amount cannot be zero");
_widthdraw(owner(), _amt);
}
function _widthdraw(address _address, uint256 _amount) private {
(bool success, ) = _address.call{value: _amount}("");
require(success, "error:Transfer failed.");
}
}
{
"compilationTarget": {
"contracts/sofa/SofaNft.sol": "SofaNFT"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"AuctionMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"minted","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newSupply","type":"uint256"}],"name":"AuctionNewStep","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BASE_URI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_MAX_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WL1_MAX_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WL1_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WL2_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WL_MAX_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"auctionData","outputs":[{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"finishTimestamp","type":"uint256"},{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"uint256","name":"maxBuy","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"auctionMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"auctionMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionPriceList","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionRunning","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionSoldout","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionStepList","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionSupplyList","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"burnPassMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"checkRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"currentTime","type":"uint256"}],"name":"currentPriceAndSupply","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalAuctionPrice","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":[],"name":"getAuctionPriceConfig","outputs":[{"internalType":"uint256[]","name":"priceList","type":"uint256[]"},{"internalType":"uint256[]","name":"timeList","type":"uint256[]"},{"internalType":"uint256[]","name":"supplyList","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"finishTimestamp","type":"uint256"},{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"uint256","name":"maxBuy","type":"uint256"}],"name":"initAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_auctionStepList","type":"uint256[]"},{"internalType":"uint256[]","name":"_auctionPriceList","type":"uint256[]"},{"internalType":"uint256[]","name":"_auctionSupplyList","type":"uint256[]"}],"name":"initAuctionPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"stage","type":"uint256"}],"name":"mintTreasure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIdList","type":"uint256[]"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isAllow","type":"bool"}],"name":"setAllowTransfer","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":"string","name":"uri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"pass","type":"bool"}],"name":"setBurnPassMap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setRevealContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ranges","type":"uint256[]"}],"name":"setTimeRanges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"now","type":"uint256"}],"name":"status","outputs":[{"components":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalMinted","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"currentStage","type":"uint256"},{"internalType":"uint256","name":"price_auction","type":"uint256"},{"internalType":"uint256","name":"minted_auction","type":"uint256"},{"internalType":"uint256","name":"supply_auction","type":"uint256"},{"internalType":"uint256","name":"user_minted_auction","type":"uint256"},{"internalType":"uint256[]","name":"auction_price_list","type":"uint256[]"},{"internalType":"uint256[]","name":"auction_time_list","type":"uint256[]"},{"internalType":"uint256[]","name":"auction_supply_list","type":"uint256[]"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"minted_wl_1","type":"uint256"},{"internalType":"uint256","name":"supply_wl_1","type":"uint256"},{"internalType":"uint256","name":"user_minted_wl_1","type":"uint256"},{"internalType":"uint256","name":"minted_wl_2","type":"uint256"},{"internalType":"uint256","name":"supply_wl_2","type":"uint256"},{"internalType":"uint256","name":"user_minted_wl_2","type":"uint256"},{"internalType":"uint256","name":"minted_public","type":"uint256"},{"internalType":"uint256","name":"supply_public","type":"uint256"},{"internalType":"uint256","name":"user_minted_public","type":"uint256"},{"internalType":"uint256","name":"auctionStart","type":"uint256"},{"internalType":"uint256","name":"auctionEnd","type":"uint256"},{"internalType":"uint256","name":"wl1Start","type":"uint256"},{"internalType":"uint256","name":"wl1End","type":"uint256"},{"internalType":"uint256","name":"wl2Start","type":"uint256"},{"internalType":"uint256","name":"wl2End","type":"uint256"},{"internalType":"uint256","name":"publicStart","type":"uint256"},{"internalType":"uint256","name":"publicEnd","type":"uint256"},{"internalType":"uint256","name":"now","type":"uint256"},{"internalType":"uint256","name":"userCurrentMinted","type":"uint256"},{"internalType":"uint256","name":"currentRoundUserMax","type":"uint256"},{"internalType":"bool","name":"auctionSoldout","type":"bool"}],"internalType":"struct SofaNFT.ContractDashboard","name":"dashboard","type":"tuple"}],"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":"","type":"uint256"}],"name":"timeRanges","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userStageMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"stage","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"whitelist1Mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wl1Minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wl2Minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wlPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]