编译器
0.8.17+commit.8df45f5f
文件 1 的 12:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 12:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 3 的 12: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 packed) {
if (_startTokenId() <= tokenId) {
packed = _packedOwnerships[tokenId];
if (packed & _BITMASK_BURNED == 0) {
if (packed == 0) {
if (tokenId >= _currentIndex) revert OwnerQueryForNonexistentToken();
for (;;) {
unchecked {
packed = _packedOwnerships[--tokenId];
}
if (packed == 0) continue;
return packed;
}
}
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 {
_approve(to, tokenId, true);
}
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 _approve(address to, uint256 tokenId) internal virtual {
_approve(to, tokenId, false);
}
function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck)
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
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 的 12: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 的 12:GenPadNFTV4.sol
pragma solidity ^0.8.17;
import "./ERC721AQueryable.sol";
import "./IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract GENPADNFT_v4 is ERC721A, ERC721AQueryable, Ownable, ReentrancyGuard {
struct SharedData {
uint256 totalAmount;
uint256 totalBoostedAmount;
uint256 rewardPerShareEth;
uint256 rewardPerShareToken;
}
struct Reward {
uint256 totalExcludedEth;
uint256 totalExcludedToken;
uint256 lastClaim;
}
struct UserData {
uint256 amount;
uint256 boostedAmount;
uint256 nftAmount;
uint256 lockedTime;
}
struct TokenInfo {
string name;
address addr;
uint256 price;
bool enabled;
}
IERC20 public rewardToken;
uint256 public constant ACC_FACTOR = 10 ** 36;
uint256 public MAX_MINTS = 100;
uint256 public MAX_SUPPLY = 1000;
uint256 public minLockTime = 7 days;
uint256 public boostPerNft = 5;
uint256 public maxBoostAmount = 50;
uint256 public totalEthClaimed;
uint256 public totalTokenClaimed;
uint256 private addedTokens;
bool public transferEnabled = true;
bool public multisaleEnable = false;
bool public bypricesaleEnable = false;
bool public specialsaleEnable = true;
uint256 public specialEthPrice;
uint256 public specialTokenPrice;
address public specialToken;
uint256 public transferPrice = 0.05 ether;
uint256 public refFee = 10;
SharedData public sharedData;
bool public claimEnable = false;
bool public lockEnable = true;
bool public zeroLock;
mapping(address => uint256) public ref;
mapping(address => UserData) public userData;
mapping(address => bool) public isExempted;
mapping(address => bool) public isLocked;
mapping(address => bool) public isBlackListed;
mapping(address => Reward) public rewards;
mapping(uint256 => TokenInfo) public allowedCrypto;
address public royaltyAddress = 0x363D4053cfB4C77597117f1c5f178F3668801109;
address public treasureAddress;
uint256 private royaltyBasisPoints = 100;
event RoyaltyBasisPoints(uint256 indexed _royaltyBasisPoints);
event MintedNft(uint256 indexed _quantity, address add);
event RoyaltyAddressUpdated(
address newAddress,
address oldAddress,
uint256 time
);
event UriUpdated(string newUri, uint256 time);
event MintsPerWalletUpdated(
uint256 newAmount,
uint256 oldAmount,
uint256 time
);
event MaxSupplyUpdated(uint256 newAmount, uint256 oldAmount, uint256 time);
event NewLock(address user, uint256 amount, uint256 boost);
event RefFeeUpdated(uint256 newRefFee, uint256 oldRefFee, uint256 time);
event RewardDeposited(bool isEth, uint256 amount, uint256 time);
event ClaimRewards(
uint256 tokenId,
uint256 _ethAmount,
uint256 _tokenAmount,
address recipient
);
string public baseURI = "ipfs://bafybeickwunetdegtuzpltrhhog5vlc2uhwp4gwxrg5iag34l3kxhqeshq/";
address private signerAddress = 0xE10C4022882D087Ea412CbFdA745Ff841089E7Fe;
constructor() ERC721A("GenPad NFTs", "yGENS") {
allowedCrypto[addedTokens] = TokenInfo("ETH", address(0), 0.5 ether, true);
addedTokens++;
}
function setrewardTokenAddress(address tokenAddress) external onlyOwner {
rewardToken = IERC20(tokenAddress);
}
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
function TotalBurned() public view returns (uint256) {
return _totalBurned();
}
function next() public view returns (uint256) {
return _nextTokenId();
}
function toggleStatus(
bool _specialsaleEnable,
bool _bypricesaleEnable,
bool _multisaleEnable,
bool _transferEnabled
) external onlyOwner {
specialsaleEnable = _specialsaleEnable;
bypricesaleEnable = _bypricesaleEnable;
multisaleEnable = _multisaleEnable;
transferEnabled = _transferEnabled;
}
function setminLockTime(uint256 _minLockTime) external onlyOwner {
minLockTime = _minLockTime;
}
function getSigner(
address _toAddress,
uint _quantity,
address _refAddrses,
bytes memory signature
) internal pure returns (address) {
bytes32 hash = keccak256(
abi.encodePacked(_toAddress, _quantity, _refAddrses)
);
bytes32 message = ECDSA.toEthSignedMessageHash(hash);
address signer = ECDSA.recover(message, signature);
return signer;
}
function getSignerWithPrice(
address _toAddress,
uint _quantity,
uint256 _price,
bytes memory signature
) internal pure returns (address) {
bytes32 hash = keccak256(
abi.encodePacked(_toAddress, _quantity, _price)
);
bytes32 message = ECDSA.toEthSignedMessageHash(hash);
address signer = ECDSA.recover(message, signature);
return signer;
}
function getSignerWithPriceRef(
address _toAddress,
uint _quantity,
uint256 _price,
address _refAddrses,
bytes memory signature
) internal pure returns (address) {
bytes32 hash = keccak256(
abi.encodePacked(_toAddress, _quantity, _price, _refAddrses)
);
bytes32 message = ECDSA.toEthSignedMessageHash(hash);
address signer = ECDSA.recover(message, signature);
return signer;
}
function giftmint(uint256 _quantity, address add) external onlyOwner {
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
_mint(add, _quantity);
emit MintedNft(_quantity, add);
}
function emergencyWithdraw() external payable onlyOwner {
(bool success,) = payable(owner()).call{value : address(this).balance}(
""
);
require(success, "eth transfer failed");
}
function rescueERC20(address tokenAdd, uint256 amount) external onlyOwner {
require(
IERC20(tokenAdd).balanceOf(address(this)) >= amount,
'Insufficient ERC20 balance'
);
IERC20(tokenAdd).transfer(owner(), amount);
}
function _baseURI() internal view override returns (string memory) {
return baseURI;
}
function setRoyaltyAddress(address _address) external onlyOwner {
require(_address != address(0), "zero address passed");
address oldAddress = royaltyAddress;
royaltyAddress = _address;
emit RoyaltyAddressUpdated(_address, oldAddress, block.timestamp);
}
function setBaseURI(string memory _uri) external onlyOwner {
baseURI = _uri;
emit UriUpdated(_uri, block.timestamp);
}
function setRoyaltyBasisPoints(uint256 _basisPoints) external onlyOwner {
require(_basisPoints <= 1000, "more than 100%");
royaltyBasisPoints = _basisPoints;
emit RoyaltyBasisPoints(_basisPoints);
}
function changeMaxMintPerWallet(
uint256 _max_mint_amount
) external onlyOwner {
uint256 oldAmount = MAX_MINTS;
MAX_MINTS = _max_mint_amount;
emit MintsPerWalletUpdated(
_max_mint_amount,
oldAmount,
block.timestamp
);
}
function changeMaxSupply(uint256 _newSupply) external onlyOwner {
require(
_newSupply > MAX_SUPPLY,
"new supply cannot be less than current"
);
uint256 oldSupply = MAX_SUPPLY;
MAX_SUPPLY = _newSupply;
emit MaxSupplyUpdated(_newSupply, oldSupply, block.timestamp);
}
function tokenURI(
uint256 tokenId
) public view virtual override(IERC721A, ERC721A) returns (string memory) {
require(_exists(tokenId), "Nonexistent token");
return string(abi.encodePacked(_baseURI(), _toString(tokenId), ".json"));
}
function lock(uint256 amount) external {
require(lockEnable, "lock temporary suspended");
require(!isBlackListed[_msgSender()], "you are blacklisted");
uint256 nftBalance = balanceOf(_msgSender());
require(amount > 0, "zero amount input");
uint256 totalAmount = amount * 10 ** rewardToken.decimals();
require(
rewardToken.transferFrom(_msgSender(), address(this), totalAmount),
"token transfer failed"
);
isLocked[_msgSender()] = true;
uint256 boostMultiplier;
if (zeroLock) {
boostMultiplier = (nftBalance * boostPerNft) > maxBoostAmount
? maxBoostAmount
: (nftBalance) * boostPerNft;
} else {
require(nftBalance > 0, "nft balance 0");
boostMultiplier = ((nftBalance - 1) * boostPerNft) > maxBoostAmount
? maxBoostAmount
: (nftBalance - 1) * boostPerNft;
}
uint256 boostedAmount = totalAmount +
(totalAmount * boostMultiplier) /
100;
sharedData.totalAmount += totalAmount;
sharedData.totalBoostedAmount += boostedAmount;
userData[_msgSender()].amount += totalAmount;
userData[_msgSender()].boostedAmount += boostedAmount;
userData[_msgSender()].nftAmount = nftBalance;
userData[_msgSender()].lockedTime = block.timestamp;
(
rewards[_msgSender()].totalExcludedEth,
rewards[_msgSender()].totalExcludedToken
) = getCumulativeRewards(userData[_msgSender()].boostedAmount);
emit NewLock(_msgSender(), totalAmount, boostMultiplier);
}
function unlock() public nonReentrant {
require(lockEnable, "unlock temporary suspended");
require(!isBlackListed[_msgSender()], "you are blacklisted");
require(
block.timestamp >= userData[_msgSender()].lockedTime + minLockTime,
"lock not ended"
);
sharedData.totalAmount -= userData[_msgSender()].amount;
sharedData.totalBoostedAmount -= userData[_msgSender()].boostedAmount;
(uint256 unclaimedAmountEth, uint256 unclaimedAmountToken) = getUnpaid(
_msgSender()
);
if (unclaimedAmountEth > 0 || unclaimedAmountToken > 0) {
_claim(_msgSender());
}
require(
rewardToken.transfer(_msgSender(), userData[_msgSender()].amount),
"token transfer failed"
);
isLocked[_msgSender()] = false;
delete userData[_msgSender()];
}
function depositRewardEth() external payable {
require(msg.value > 0, "value must be greater than 0");
require(
sharedData.totalBoostedAmount > 0,
"must be shares deposited to be rewarded rewards"
);
sharedData.rewardPerShareEth +=
(msg.value * ACC_FACTOR) /
sharedData.totalBoostedAmount;
emit RewardDeposited(true, msg.value, block.timestamp);
}
function depositRewardToken(uint256 amount) external payable {
require(amount > 0, "value must be greater than 0");
require(
sharedData.totalBoostedAmount > 0,
"must be shares deposited to be rewarded rewards"
);
require(
rewardToken.transferFrom(_msgSender(), address(this), amount),
"token transfer failed"
);
sharedData.rewardPerShareToken +=
(amount * ACC_FACTOR) /
sharedData.totalBoostedAmount;
emit RewardDeposited(false, amount, block.timestamp);
}
function getCumulativeRewards(
uint256 share
) internal view returns (uint256, uint256) {
return (
(share * sharedData.rewardPerShareEth) / ACC_FACTOR,
(share * sharedData.rewardPerShareToken) / ACC_FACTOR
);
}
function getUnpaid(
address shareholder
) public view returns (uint256, uint256) {
if (userData[shareholder].amount == 0) {
return (0, 0);
}
(
uint256 earnedRewardsEth,
uint256 earnedRewardsToken
) = getCumulativeRewards(userData[shareholder].boostedAmount);
uint256 rewardsExcludedEth = rewards[shareholder].totalExcludedEth;
uint256 rewardsExcludedToken = rewards[shareholder].totalExcludedToken;
if (
earnedRewardsEth <= rewardsExcludedEth &&
earnedRewardsToken <= rewardsExcludedToken
) {
return (0, 0);
}
return (
(earnedRewardsEth - rewardsExcludedEth),
(earnedRewardsToken - rewardsExcludedToken)
);
}
function claim() external nonReentrant {
_claim(_msgSender());
}
function _claim(address user) internal {
require(
block.timestamp > rewards[user].lastClaim,
"can only claim once per block"
);
require(!isBlackListed[user], "you are blacklisted");
require(claimEnable, "claim temporary disabled");
require(userData[user].amount > 0, "no tokens staked");
(uint256 amountEth, uint256 amountToken) = getUnpaid(user);
require(amountEth > 0 || amountToken > 0, "nothing to claim");
if (amountEth > 0) {
totalEthClaimed += amountEth;
(rewards[user].totalExcludedEth,) = getCumulativeRewards(
userData[user].boostedAmount
);
_handleEthTransfer(user, amountEth);
}
if (amountToken > 0) {
totalTokenClaimed += amountToken;
(, rewards[user].totalExcludedToken) = getCumulativeRewards(
userData[user].boostedAmount
);
require(rewardToken.transfer(user, amountToken));
}
rewards[user].lastClaim = block.timestamp;
}
function flipZeroLockStatus() external onlyOwner {
zeroLock = !zeroLock;
}
function flipLockStatus() external onlyOwner {
lockEnable = !lockEnable;
}
function flipClaimStatus() external onlyOwner {
claimEnable = !claimEnable;
}
function changeBoostPerNft(uint256 newBoost) external onlyOwner {
boostPerNft = newBoost;
}
function changeMaxBoost(uint256 newMaxBoost) external onlyOwner {
maxBoostAmount = newMaxBoost;
}
function setTreasureAddress(address _newTreasure) external onlyOwner {
treasureAddress = _newTreasure;
}
function setSigner(address _signer) external onlyOwner {
signerAddress = _signer;
}
function toggleBlacklistStatus(address[] memory users, bool[] memory status) external onlyOwner {
require(users.length == status.length && users.length > 0, "wrong input");
for (uint i = 0; i < users.length; i++) {
isBlackListed[users[i]] = status[i];
}
}
function toggleExemptionStatus(address[] memory users, bool[] memory status) external onlyOwner {
require(users.length == status.length && users.length > 0, "wrong input");
for (uint i = 0; i < users.length; i++) {
isExempted[users[i]] = status[i];
}
}
function changeRefFee(uint256 _newRefFee) external onlyOwner {
require(_newRefFee <= 100, "More than 100%");
uint256 oldRefFee = refFee;
refFee = _newRefFee;
emit RefFeeUpdated(_newRefFee, oldRefFee, block.timestamp);
}
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function addCurrency(
string memory _name,
address _add,
uint256 _priceInWei,
bool _enabled
) external onlyOwner {
allowedCrypto[addedTokens] = TokenInfo(
_name,
_add,
_priceInWei,
_enabled
);
addedTokens++;
}
function disableToken(uint256 _id, bool _toggle) external onlyOwner {
allowedCrypto[_id].enabled = _toggle;
}
function setSpecialMint(
address tokenAddress,
uint256 ethPrice,
uint256 tokenPrice
) external onlyOwner {
require(tokenAddress != address(0), "zero address");
specialToken = tokenAddress;
specialEthPrice = ethPrice;
specialTokenPrice = tokenPrice;
}
function specialMint(uint256 _quantity) external payable {
require(specialToken != address(0), "special method not set");
require(specialsaleEnable, "Special Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(
msg.value >= specialEthPrice * _quantity,
"Not enough ETH send"
);
_handleEthTransfer(owner(), msg.value);
IERC20 tokenAddress = IERC20(specialToken);
uint256 totalTokenPrice = specialTokenPrice * _quantity;
require(
tokenAddress.transferFrom(msg.sender, owner(), totalTokenPrice),
"token transfer failed"
);
_safeMint(_msgSender(), _quantity);
emit MintedNft(_quantity, _msgSender());
}
function specialMintByRef(
uint256 _quantity,
address _refAddress,
bytes memory signature
) external payable {
address _toAddress = _msgSender();
require(specialToken != address(0), "special method not set");
require(specialsaleEnable, "Special Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(
getSigner(_toAddress, _quantity, _refAddress, signature) ==
signerAddress,
"ECDSA check failed"
);
require(_refAddress != _toAddress, "Don't cheat");
uint256 amountToRefEth = (msg.value * refFee) / 100;
uint256 mintFeeEth = msg.value - amountToRefEth;
_handleEthTransfer(owner(), mintFeeEth);
_handleEthTransfer(_refAddress, amountToRefEth);
IERC20 tokenAddress = IERC20(specialToken);
uint256 totalPrice = specialTokenPrice * _quantity;
uint256 amountToRefToken = (totalPrice * refFee) / 100;
uint256 mintFeeToken = totalPrice - amountToRefToken;
require(
tokenAddress.transferFrom(
msg.sender,
_refAddress,
amountToRefToken
),
"transfer to ref failed"
);
require(
tokenAddress.transferFrom(msg.sender, owner(), mintFeeToken),
"transfer to owner failed"
);
_safeMint(_msgSender(), _quantity);
emit MintedNft(_quantity, _msgSender());
}
function specialTransferFrom(
address from,
address to,
uint256[] memory tokenIds
) public payable virtual {
require(!isBlackListed[from], "you are blacklisted");
require(!isLocked[from], "unlock tokens before transfer");
require(tokenIds.length > 0, "empty array");
require(
msg.value >= tokenIds.length * transferPrice,
"not enough eth sent"
);
for (uint i = 0; i < tokenIds.length; i++) {
super.transferFrom(from, to, tokenIds[i]);
}
_handleEthTransfer(owner(), msg.value);
}
function _handleEthTransfer(address recipient, uint256 amount) internal {
(bool success,) = payable(recipient).call{value : amount}("");
require(success, "ETH transfer failed");
}
function multiMint(uint256 _quantity, uint256 _id) external payable {
require(multisaleEnable, "Multi Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(allowedCrypto[_id].enabled, "This payment method is disabled");
uint256 _price = allowedCrypto[_id].price;
_handleMintPayment(_id, _price, _quantity);
_safeMint(_msgSender(), _quantity);
emit MintedNft(_quantity, _msgSender());
}
function multiMintbyref(
uint256 _quantity,
uint256 _id,
address _refAddress,
bytes memory signature
) external payable {
address _toAddress = _msgSender();
require(multisaleEnable, "Multi Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(getSigner(_toAddress, _quantity, _refAddress, signature) == signerAddress, "ECDSA check failed");
require(_refAddress != _toAddress, "Don't cheat");
require(allowedCrypto[_id].enabled, "This payment method is disabled");
uint256 _price = allowedCrypto[_id].price;
_handleRefFee(_id, _price, _quantity, _refAddress);
_safeMint(_msgSender(), _quantity);
ref[_refAddress] += _quantity;
emit MintedNft(_quantity, _msgSender());
}
function mintByPriceRef(
uint256 _quantity,
uint256 _id,
uint256 _price,
address _refAddress,
bytes memory signature
) external payable {
address _toAddress = _msgSender();
require(bypricesaleEnable, "Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(getSignerWithPriceRef(_toAddress, _quantity, _price, _refAddress, signature) == signerAddress, "ECDSA check failed");
require(allowedCrypto[_id].enabled, "This payment method is disabled");
_handleRefFee(_id, _price, _quantity, _refAddress);
_safeMint(_msgSender(), _quantity);
emit MintedNft(_quantity, _msgSender());
}
function mintByPrice(
uint256 _quantity,
uint256 _id,
uint256 _price,
bytes memory signature
) external payable {
address _toAddress = _msgSender();
require(bypricesaleEnable, "Sale is not Enabled");
require(
_quantity + _numberMinted(_msgSender()) <= MAX_MINTS,
"Exceeded the limit"
);
require(
totalSupply() + _quantity <= MAX_SUPPLY,
"Not enough tokens left"
);
require(getSignerWithPrice(_toAddress, _quantity, _price, signature) == signerAddress, "ECDSA check failed");
require(allowedCrypto[_id].enabled, "This payment method is disabled");
_handleMintPayment(_id, _price, _quantity);
_safeMint(_msgSender(), _quantity);
emit MintedNft(_quantity, _msgSender());
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override (ERC721A, IERC721A) {
require(!isBlackListed[from], "you are blacklisted");
require(!isLocked[from], "unlock tokens before transfer");
if (!transferEnabled) {
require(from == address(0) || isExempted[from], "transfer disabled");
}
super.transferFrom(from, to, tokenId);
}
function _handleRefFee(uint256 _id, uint256 _price, uint256 _quantity, address _refAddress) internal {
if (_id == 0) {
require(msg.value >= _price * _quantity, "Not enough ETH sent");
uint256 amountToRef = msg.value * refFee / 100;
uint256 mintFee = msg.value - amountToRef;
_handleEthTransfer(owner(), mintFee);
_handleEthTransfer(_refAddress, amountToRef);
} else {
IERC20 tokenAddress = IERC20(allowedCrypto[_id].addr);
uint256 totalPrice = _price * _quantity;
uint256 amountToRef = totalPrice * refFee / 100;
uint256 mintFee = totalPrice - amountToRef;
require(tokenAddress.transferFrom(msg.sender, owner(), mintFee), "transfer to owner failed");
require(tokenAddress.transferFrom(msg.sender, _refAddress, amountToRef), "transfer to ref failed");
}
}
function _handleMintPayment(uint256 _id, uint256 _price, uint256 _quantity) internal {
if (_id == 0) {
require(msg.value >= _price * _quantity, "Not enough ETH send");
_handleEthTransfer(owner(), msg.value);
} else {
IERC20 tokenAddress = IERC20(allowedCrypto[_id].addr);
uint256 totalPrice = _price * _quantity;
require(tokenAddress.transferFrom(msg.sender, owner(), totalPrice), "transfer failed");
}
}
receive() external payable {}
}
文件 6 的 12: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);
function decimals() external view returns (uint8);
}
文件 7 的 12: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 的 12: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 的 12:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
文件 10 的 12:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 11 的 12: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() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
}
文件 12 的 12:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
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] = _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);
}
}
{
"compilationTarget": {
"contracts/GenPadNFTV4.sol": "GENPADNFT_v4"
},
"evmVersion": "london",
"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":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"ClaimRewards","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":false,"internalType":"uint256","name":"newAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MaxSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"address","name":"add","type":"address"}],"name":"MintedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"MintsPerWalletUpdated","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":"boost","type":"uint256"}],"name":"NewLock","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":"uint256","name":"newRefFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldRefFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RefFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isEth","type":"bool"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RewardDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAddress","type":"address"},{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RoyaltyAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_royaltyBasisPoints","type":"uint256"}],"name":"RoyaltyBasisPoints","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newUri","type":"string"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"UriUpdated","type":"event"},{"inputs":[],"name":"ACC_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TotalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_add","type":"address"},{"internalType":"uint256","name":"_priceInWei","type":"uint256"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"addCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allowedCrypto","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boostPerNft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bypricesaleEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBoost","type":"uint256"}],"name":"changeBoostPerNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxBoost","type":"uint256"}],"name":"changeMaxBoost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_max_mint_amount","type":"uint256"}],"name":"changeMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newSupply","type":"uint256"}],"name":"changeMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newRefFee","type":"uint256"}],"name":"changeRefFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositRewardEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositRewardToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_toggle","type":"bool"}],"name":"disableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"payable","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":"flipClaimStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipLockStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipZeroLockStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"shareholder","type":"address"}],"name":"getUnpaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"add","type":"address"}],"name":"giftmint","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":"address","name":"","type":"address"}],"name":"isBlackListed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isExempted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBoostAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintByPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"_refAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintByPriceRef","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"multiMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_refAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"multiMintbyref","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"multisaleEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"next","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"","type":"address"}],"name":"ref","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAdd","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"totalExcludedEth","type":"uint256"},{"internalType":"uint256","name":"totalExcludedToken","type":"uint256"},{"internalType":"uint256","name":"lastClaim","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"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":"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":"_address","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_basisPoints","type":"uint256"}],"name":"setRoyaltyBasisPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"ethPrice","type":"uint256"},{"internalType":"uint256","name":"tokenPrice","type":"uint256"}],"name":"setSpecialMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newTreasure","type":"address"}],"name":"setTreasureAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minLockTime","type":"uint256"}],"name":"setminLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setrewardTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedData","outputs":[{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"totalBoostedAmount","type":"uint256"},{"internalType":"uint256","name":"rewardPerShareEth","type":"uint256"},{"internalType":"uint256","name":"rewardPerShareToken","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"specialEthPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"specialMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"address","name":"_refAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"specialMintByRef","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"specialToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"specialTokenPrice","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":"tokenIds","type":"uint256[]"}],"name":"specialTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"specialsaleEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address[]","name":"users","type":"address[]"},{"internalType":"bool[]","name":"status","type":"bool[]"}],"name":"toggleBlacklistStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"bool[]","name":"status","type":"bool[]"}],"name":"toggleExemptionStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_specialsaleEnable","type":"bool"},{"internalType":"bool","name":"_bypricesaleEnable","type":"bool"},{"internalType":"bool","name":"_multisaleEnable","type":"bool"},{"internalType":"bool","name":"_transferEnabled","type":"bool"}],"name":"toggleStatus","outputs":[],"stateMutability":"nonpayable","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":"totalEthClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokenClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferEnabled","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":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasureAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userData","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"boostedAmount","type":"uint256"},{"internalType":"uint256","name":"nftAmount","type":"uint256"},{"internalType":"uint256","name":"lockedTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"zeroLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]