编译器
0.8.19+commit.7dd6d404
文件 1 的 10:999KillTimez.sol
pragma solidity ^0.8.19;
error SaleNotStarted();
error RoundSoldOut();
error PublicSaleStillLive();
error MaxMints();
error SoldOut();
error ValueTooLow();
error NotWL();
error NotVIP();
error NotAllowedToCreateReferralCodes();
import "ERC721A.sol";
import "ERC721AQueryable.sol";
import "ECDSA.sol";
import "Ownable.sol";
import "ReentrancyGuard.sol";
contract _999KillTimez is ERC721AQueryable, Ownable, ReentrancyGuard {
using Strings for uint256;
using ECDSA for bytes32;
uint public maxSupply = 666;
uint public wlMintCounter = 169;
uint public vipMintCounter = 130;
uint public maxVipMints = 999;
uint public publicPrice = 0.0199 ether;
uint public whitelistPrice = 0 ether;
bool publicSaleStarted = true;
bool whiteListStarted = true;
bool vipStarted = true;
mapping(address => uint) public giftReceived;
address private vipAddress = 0x150B0Bed2B8a0D293252b9910cc9ee47FeAb51Aa;
address private whitelistAddress = 0xECDA7Af07E5F228fBF2e9f23186b251c3dA9deB6;
address private communityPayoutAddress = 0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA;
address private developmentPayoutAddress = 0x78Cca4e539EB68cc0b01A11034434BA67314456C;
address private creatorPayoutAddress = 0x5F7F0560C7d8ECfD341620888df2BB072e064BF0;
address private communityManagerPayoutAddress = 0x61C2138d7A63bf100eEAedE90a55a65736A3DFAD;
address private marketingPayoutAddress = 0x58b54887DE1aE8D85351BE9112355465F9cD438D;
string public baseURI = "https://api.nft.lunarxy.com/v1/nft/metadata/999killtimez/";
string public uriSuffix = ".json";
mapping(address => uint) public publicMints;
mapping(address => uint) public wlMints;
mapping(address => uint) public vipMints;
constructor()
ERC721A("999KillTimez", "999KT")
{
wlMints[0x04d619ff29c74e17e5FEf02E543de668C0296519] = 2;
wlMints[0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560] = 1;
vipMints[0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560] = 7;
publicMints[0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560] = 3;
giftReceived[0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560] = 1;
wlMints[0x766D5f2d38589aC4702184199c540cD97565B13B] = 5;
vipMints[0x766D5f2d38589aC4702184199c540cD97565B13B] = 2;
giftReceived[0x766D5f2d38589aC4702184199c540cD97565B13B] = 1;
wlMints[0x47B73B6B53152470052AfD207017d812C73e26D6] = 3;
vipMints[0x47B73B6B53152470052AfD207017d812C73e26D6] = 4;
giftReceived[0x47B73B6B53152470052AfD207017d812C73e26D6] = 1;
wlMints[0x40d429507e88f69F41DF6a1A822711E12649dE04] = 1;
vipMints[0x18B1146573cEbdF82D8Ce7D7698D172499C95755] = 2;
wlMints[0x9e468A8E352ED80BB7e09CB0aB6E49ef77741938] = 1;
giftReceived[0x9e468A8E352ED80BB7e09CB0aB6E49ef77741938] = 1;
wlMints[0xb69C70A15954316920896cf11cEC942bB3CeA06f] = 16;
vipMints[0xb69C70A15954316920896cf11cEC942bB3CeA06f] = 12;
publicMints[0xb69C70A15954316920896cf11cEC942bB3CeA06f] = 2;
giftReceived[0xb69C70A15954316920896cf11cEC942bB3CeA06f] = 2;
wlMints[0x7A0CdF925C4796519ddd2DCDfe63E2d6880E1FFF] = 3;
giftReceived[0x7A0CdF925C4796519ddd2DCDfe63E2d6880E1FFF] = 1;
publicMints[0x94a7A0cCBbf54E37b154737B8cc1ecB5cC5310BB] = 3;
wlMints[0x30faC264384582Fe99411c4D893F7e0b838708DA] = 3;
vipMints[0x30faC264384582Fe99411c4D893F7e0b838708DA] = 1;
wlMints[0xd434B922e30193f9181284382517884c94350f9e] = 12;
vipMints[0xd434B922e30193f9181284382517884c94350f9e] = 16;
giftReceived[0xd434B922e30193f9181284382517884c94350f9e] = 4;
wlMints[0x878bA4295Ee46b2Fc055cB216218d0445a3f1DAF] = 1;
giftReceived[0x878bA4295Ee46b2Fc055cB216218d0445a3f1DAF] = 1;
vipMints[0xc6513B70666C4a682D8FECF16B4D45BB8a2DA534] = 1;
publicMints[0xc6513B70666C4a682D8FECF16B4D45BB8a2DA534] = 3;
wlMints[0xC59297F3aCDe356f546c925FD5943a860A296603] = 5;
giftReceived[0xC59297F3aCDe356f546c925FD5943a860A296603] = 1;
publicMints[0xd6E0F82a4bD119Ee24b8708a880e6167ed5a7a7E] = 1;
wlMints[0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49] = 8;
vipMints[0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49] = 18;
publicMints[0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49] = 6;
giftReceived[0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49] = 6;
wlMints[0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300] = 8;
vipMints[0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300] = 15;
publicMints[0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300] = 3;
giftReceived[0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300] = 3;
wlMints[0xc170A147c93a19a2D77385545C13FDC09555e622] = 1;
vipMints[0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105] = 7;
wlMints[0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3] = 1;
vipMints[0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3] = 4;
giftReceived[0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3] = 1;
wlMints[0x73F43E66041f8804DaB52592d1c0f1C26fF6fefe] = 5;
giftReceived[0x73F43E66041f8804DaB52592d1c0f1C26fF6fefe] = 1;
vipMints[0x90c0F855979018daBC6b517f39FAddc90Acae292] = 2;
wlMints[0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA] = 22;
vipMints[0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA] = 12;
giftReceived[0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA] = 2;
vipMints[0x73cFA71eD8EF82c85B28D9CbB58365cB22191141] = 1;
publicMints[0x5Fa60DB0C6422f09925a45eae367F5C205feC961] = 6;
wlMints[0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5] = 2;
vipMints[0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5] = 7;
publicMints[0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5] = 1;
giftReceived[0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5] = 2;
wlMints[0x305Bf946250A380b160ae6FD4dF64AeeA7813677] = 2;
vipMints[0x305Bf946250A380b160ae6FD4dF64AeeA7813677] = 1;
wlMints[0xc55f0572178d6A6217Be36d3f756eF7f5a7F396c] = 4;
giftReceived[0xc55f0572178d6A6217Be36d3f756eF7f5a7F396c] = 1;
wlMints[0x1D884A8cB1a18E3435112d503897B40dE464F822] = 2;
giftReceived[0x1D884A8cB1a18E3435112d503897B40dE464F822] = 2;
wlMints[0x2C077C051fdBaDc8388427E3aD30059E050b5f8f] = 5;
vipMints[0x2C077C051fdBaDc8388427E3aD30059E050b5f8f] = 7;
giftReceived[0x2C077C051fdBaDc8388427E3aD30059E050b5f8f] = 1;
wlMints[0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA] = 11;
vipMints[0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA] = 10;
publicMints[0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA] = 5;
giftReceived[0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA] = 1;
wlMints[0x37667d93e047e1231e2CE3BC7a762dD36bCf6aFE] = 2;
giftReceived[0x37667d93e047e1231e2CE3BC7a762dD36bCf6aFE] = 1;
publicMints[0x9b95d8f7c44efc92B03ae2f17E2344E67de04F96] = 1;
wlMints[0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6] = 5;
vipMints[0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6] = 1;
giftReceived[0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6] = 2;
wlMints[0x2FFb3aA4359be1DAa675E13882F24a530cF273f9] = 1;
giftReceived[0x2FFb3aA4359be1DAa675E13882F24a530cF273f9] = 1;
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 2);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0xc6513B70666C4a682D8FECF16B4D45BB8a2DA534, 1);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 5);
_mint(0x40d429507e88f69F41DF6a1A822711E12649dE04, 1);
_mint(0x2C077C051fdBaDc8388427E3aD30059E050b5f8f, 2);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 1);
_mint(0x2C077C051fdBaDc8388427E3aD30059E050b5f8f, 1);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 2);
_mint(0xc55f0572178d6A6217Be36d3f756eF7f5a7F396c, 5);
_mint(0x644580B17fd98F42B37B56773e71dcfD81eff4cB, 2);
_mint(0xfC6f3a3874c75c887Df42605FA0150b9cdBca81E, 2);
_mint(0x7A0CdF925C4796519ddd2DCDfe63E2d6880E1FFF, 4);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 4);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x8AC65B1D807EB2C8BbB04B90c3Aee2E49aaCD6A7, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3, 2);
_mint(0x40d429507e88f69F41DF6a1A822711E12649dE04, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x766D5f2d38589aC4702184199c540cD97565B13B, 2);
_mint(0x30faC264384582Fe99411c4D893F7e0b838708DA, 1);
_mint(0xc170A147c93a19a2D77385545C13FDC09555e622, 1);
_mint(0x2FFb3aA4359be1DAa675E13882F24a530cF273f9, 2);
_mint(0x644580B17fd98F42B37B56773e71dcfD81eff4cB, 2);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0x73F43E66041f8804DaB52592d1c0f1C26fF6fefe, 2);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0x2C077C051fdBaDc8388427E3aD30059E050b5f8f, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x9e468A8E352ED80BB7e09CB0aB6E49ef77741938, 1);
_mint(0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5, 2);
_mint(0x90c0F855979018daBC6b517f39FAddc90Acae292, 2);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 3);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0xfC6f3a3874c75c887Df42605FA0150b9cdBca81E, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 2);
_mint(0x766D5f2d38589aC4702184199c540cD97565B13B, 2);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0x73F43E66041f8804DaB52592d1c0f1C26fF6fefe, 1);
_mint(0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6, 2);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 2);
_mint(0x18B1146573cEbdF82D8Ce7D7698D172499C95755, 2);
_mint(0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6, 2);
_mint(0x2C077C051fdBaDc8388427E3aD30059E050b5f8f, 1);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 6);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 2);
_mint(0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6, 2);
_mint(0x644580B17fd98F42B37B56773e71dcfD81eff4cB, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 1);
_mint(0x1D884A8cB1a18E3435112d503897B40dE464F822, 4);
_mint(0x73cFA71eD8EF82c85B28D9CbB58365cB22191141, 1);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 6);
_mint(0x878bA4295Ee46b2Fc055cB216218d0445a3f1DAF, 2);
_mint(0xc6513B70666C4a682D8FECF16B4D45BB8a2DA534, 3);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 1);
_mint(0xc6513B70666C4a682D8FECF16B4D45BB8a2DA534, 1);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 3);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 3);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 2);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 2);
_mint(0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5, 2);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 7);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 1);
_mint(0x37667d93e047e1231e2CE3BC7a762dD36bCf6aFE, 3);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 5);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 4);
_mint(0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 3);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 2);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 2);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 1);
_mint(0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5, 1);
_mint(0x40d429507e88f69F41DF6a1A822711E12649dE04, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 6);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 1);
_mint(0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5, 1);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 1);
_mint(0xd6E0F82a4bD119Ee24b8708a880e6167ed5a7a7E, 1);
_mint(0x5Fa60DB0C6422f09925a45eae367F5C205feC961, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 5);
_mint(0x5Fa60DB0C6422f09925a45eae367F5C205feC961, 3);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xC59297F3aCDe356f546c925FD5943a860A296603, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 1);
_mint(0x30faC264384582Fe99411c4D893F7e0b838708DA, 1);
_mint(0xd6E0F82a4bD119Ee24b8708a880e6167ed5a7a7E, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 2);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 5);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 5);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 5);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 5);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 11);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 4);
_mint(0xCEA431A6f20889670e59e2CEeb5E41Ba0d6d88c3, 3);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 6);
_mint(0x94a7A0cCBbf54E37b154737B8cc1ecB5cC5310BB, 3);
_mint(0x98eEd6Ce0b0b4bF302315C50d0Fe694305242105, 7);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 4);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 4);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 4);
_mint(0x8AC65B1D807EB2C8BbB04B90c3Aee2E49aaCD6A7, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 3);
_mint(0xAf46585a4d22dAB188D3c7c4bE08c9e2d1C980d5, 6);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xC59297F3aCDe356f546c925FD5943a860A296603, 2);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 2);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 1);
_mint(0x2C077C051fdBaDc8388427E3aD30059E050b5f8f, 7);
_mint(0xb5105c731c5F3ec29eE4E84C7e0D45e8Ef43B300, 1);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 5);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0x478FFba8eA4945fB9327812231dfB1c6cAFD2C49, 1);
_mint(0x0EDf79CBd5BEF41e59D8e4ddAd352DDf6aAb6560, 1);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 2);
_mint(0x766D5f2d38589aC4702184199c540cD97565B13B, 4);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 1);
_mint(0xd434B922e30193f9181284382517884c94350f9e, 3);
_mint(0x73F43E66041f8804DaB52592d1c0f1C26fF6fefe, 3);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 2);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 3);
_mint(0xC59297F3aCDe356f546c925FD5943a860A296603, 3);
_mint(0x37fDf57B5bA51B777865753CD4b0F2949d8b4FfA, 2);
_mint(0x62e3E1f39025fdADD7454704C13B7b2AE8C1A8EA, 13);
_mint(0xb69C70A15954316920896cf11cEC942bB3CeA06f, 2);
_mint(0x7c0a1f789c683B6636837C9D51c8AA2469d30ed6, 2);
}
function verifyAddressSigner(
address referenceAddress,
bytes32 messageHash,
bytes memory signature
) internal pure returns (bool) {
return
referenceAddress ==
messageHash.toEthSignedMessageHash().recover(signature);
}
function hashMessage(uint number, address sender)
private
pure
returns (bytes32)
{
return keccak256(abi.encodePacked(number, sender));
}
function hashMessageGift(uint number, uint gift, address sender)
private
pure
returns (bytes32)
{
return keccak256(abi.encodePacked(number, gift, sender));
}
function vipMint(uint amount, uint max, bytes memory signature) external {
if (!vipStarted) revert SaleNotStarted();
if (totalSupply() + amount > maxSupply) revert SoldOut();
if (vipMintCounter + amount > maxVipMints) revert RoundSoldOut();
if (vipMints[_msgSender()] + amount > max) revert MaxMints();
if (!verifyAddressSigner(vipAddress, hashMessage(max, msg.sender), signature)) revert NotWL();
vipMints[_msgSender()] += amount;
vipMintCounter += amount;
_mint(_msgSender(), amount);
}
function whiteListMint(uint amount, uint max, uint gift, bytes memory signature) external payable {
if (!whiteListStarted) revert SaleNotStarted();
if (totalSupply() + amount > maxSupply) revert SoldOut();
if (!verifyAddressSigner(whitelistAddress, hashMessageGift(max, gift, msg.sender), signature)) revert NotWL();
if (msg.value < (amount * whitelistPrice)) revert ValueTooLow();
if (wlMints[_msgSender()] + amount > max) revert MaxMints();
uint payout = amount * whitelistPrice;
wlMints[msg.sender] += amount;
uint gift_diff = gift - giftReceived[_msgSender()];
if (gift_diff > 0) {
giftReceived[_msgSender()] = gift;
amount += gift_diff;
}
wlMintCounter += amount;
_mint(msg.sender, amount);
spreadPayments(payout);
}
function publicMint(uint amount) external payable {
if (!publicSaleStarted) revert SaleNotStarted();
if (totalSupply() + amount > maxSupply) revert SoldOut();
if (msg.value < amount * publicPrice) revert ValueTooLow();
publicMints[_msgSender()] += amount;
_mint(msg.sender, amount);
uint payout = amount * publicPrice;
spreadPayments(payout);
}
function spreadPayments(uint payout) private {
uint communityPayout = payout * 4300 / 10000;
uint developmentPayout = payout * 1300 / 10000;
uint creatorPayout = payout * 2800 / 10000;
uint communityManagerPayout = payout * 1200 / 10000;
uint marketingPayout = payout * 400 / 10000;
(bool osCommunity,) = payable(communityPayoutAddress).call{value: communityPayout}("");
(bool osDevelopment,) = payable(developmentPayoutAddress).call{value: developmentPayout}("");
(bool osCreator,) = payable(creatorPayoutAddress).call{value: creatorPayout}("");
(bool osCommunityManager,) = payable(communityManagerPayoutAddress).call{value: communityManagerPayout}("");
(bool osMarketing,) = payable(marketingPayoutAddress).call{value: marketingPayout}("");
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setWlAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
whitelistAddress = _newAddress;
}
function setVipAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
vipAddress = _newAddress;
}
function setCommunityPayoutAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
communityPayoutAddress = _newAddress;
}
function setdevelopmentPayoutAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
developmentPayoutAddress = _newAddress;
}
function setCreatorPayoutAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
creatorPayoutAddress = _newAddress;
}
function setCommunityManagerPayoutAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
communityManagerPayoutAddress = _newAddress;
}
function setMarketingPayoutAddress(address _newAddress) external onlyOwner {
require(_newAddress != address(0), "CAN'T PUT 0 ADDRESS");
marketingPayoutAddress = _newAddress;
}
function setUriSuffix(string memory _newSuffix) external onlyOwner {
uriSuffix = _newSuffix;
}
function setPublicStatus(bool status) external onlyOwner {
publicSaleStarted = status;
}
function setWhiteListStatus(bool status) external onlyOwner {
whiteListStarted = status;
}
function setVipStatus(bool status) external onlyOwner {
vipStarted = status;
}
function setPublicPrice(uint64 _newPrice) external onlyOwner {
publicPrice = _newPrice;
}
function setWhiteListPrice(uint64 _newPrice) external onlyOwner {
whitelistPrice = _newPrice;
}
function setMaxVipSupply(uint16 _wlSupply) external onlyOwner {
maxVipMints = _wlSupply;
}
function setMaxSupply(uint newSupply) external onlyOwner {
maxSupply = newSupply;
}
function _startTokenId() internal view override returns (uint256) {
return 1;
}
function tokenURI(uint256 tokenId)
public
view
override(IERC721A, ERC721A)
returns (string memory)
{
string memory currentBaseURI = baseURI;
return
bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, tokenId.toString(), uriSuffix))
: "";
}
function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
(bool r1,) = payable(owner()).call{value: balance}("");
require(r1);
}
function contractURI() public view returns (string memory) {
return "https://alphainchain.io/contract-metadata.json";
}
}
文件 2 的 10: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 的 10: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");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' 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 if (signature.length == 64) {
bytes32 r;
bytes32 vs;
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} 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);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
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));
}
}
文件 4 的 10: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.selector);
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.selector);
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 _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
return _packedOwnerships[index] != 0;
}
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 == 0) {
if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
for (;;) {
unchecked {
packed = _packedOwnerships[--tokenId];
}
if (packed == 0) continue;
if (packed & _BITMASK_BURNED == 0) return packed;
_revert(OwnerQueryForNonexistentToken.selector);
}
}
if (packed & _BITMASK_BURNED == 0) return packed;
}
_revert(OwnerQueryForNonexistentToken.selector);
}
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.selector);
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 result) {
if (_startTokenId() <= tokenId) {
if (tokenId < _currentIndex) {
uint256 packed;
while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;
result = packed & _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);
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
_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;
}
}
}
}
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
assembly {
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
from,
toMasked,
tokenId
)
}
if (toMasked == 0) _revert(TransferToZeroAddress.selector);
_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.selector);
}
}
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.selector);
}
assembly {
revert(add(32, reason), mload(reason))
}
}
}
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) _revert(MintZeroQuantity.selector);
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
uint256 end = startTokenId + quantity;
uint256 tokenId = startTokenId;
do {
assembly {
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
tokenId
)
}
} while (++tokenId != end);
_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.selector);
if (quantity == 0) _revert(MintZeroQuantity.selector);
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);
_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.selector);
}
} while (index < end);
if (_currentIndex != end) _revert(bytes4(0));
}
}
}
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 && _msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
_revert(ApprovalCallerNotOwnerNorApproved.selector);
}
_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.selector);
}
_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.selector);
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)
}
}
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}
文件 5 的 10: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 ownership)
{
unchecked {
if (tokenId >= _startTokenId()) {
if (tokenId < _nextTokenId()) {
while (!_ownershipIsInitialized(tokenId)) --tokenId;
return _ownershipAt(tokenId);
}
}
}
}
function explicitOwnershipsOf(uint256[] calldata tokenIds)
external
view
virtual
override
returns (TokenOwnership[] memory)
{
TokenOwnership[] memory ownerships;
uint256 i = tokenIds.length;
assembly {
ownerships := mload(0x40)
mstore(ownerships, i)
i := shl(5, i)
mstore(0x40, add(add(ownerships, 0x20), i))
}
while (i != 0) {
uint256 tokenId;
assembly {
i := sub(i, 0x20)
tokenId := calldataload(add(tokenIds.offset, i))
}
TokenOwnership memory ownership = explicitOwnershipOf(tokenId);
assembly {
mstore(add(add(ownerships, 0x20), i), ownership)
}
}
return ownerships;
}
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view virtual override returns (uint256[] memory) {
return _tokensOfOwnerIn(owner, start, stop);
}
function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
uint256 start = _startTokenId();
uint256 stop = _nextTokenId();
uint256[] memory tokenIds;
if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop);
return tokenIds;
}
function _tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) private view returns (uint256[] memory) {
unchecked {
if (start >= stop) _revert(InvalidQueryRange.selector);
if (start < _startTokenId()) {
start = _startTokenId();
}
uint256 stopLimit = _nextTokenId();
if (stop >= stopLimit) {
stop = stopLimit;
}
uint256[] memory tokenIds;
uint256 tokenIdsMaxLength = balanceOf(owner);
bool startLtStop = start < stop;
assembly {
tokenIdsMaxLength := mul(tokenIdsMaxLength, startLtStop)
}
if (tokenIdsMaxLength != 0) {
if (stop - start <= tokenIdsMaxLength) {
tokenIdsMaxLength = stop - start;
}
assembly {
tokenIds := mload(0x40)
mstore(0x40, add(tokenIds, shl(5, add(tokenIdsMaxLength, 1))))
}
TokenOwnership memory ownership = explicitOwnershipOf(start);
address currOwnershipAddr;
if (!ownership.burned) {
currOwnershipAddr = ownership.addr;
}
uint256 tokenIdsIdx;
do {
ownership = _ownershipAt(start);
assembly {
switch mload(add(ownership, 0x40))
case 0 {
if mload(ownership) {
currOwnershipAddr := mload(ownership)
}
if iszero(shl(96, xor(currOwnershipAddr, owner))) {
tokenIdsIdx := add(tokenIdsIdx, 1)
mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)
}
}
default {
currOwnershipAddr := 0
}
start := add(start, 1)
}
} while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));
assembly {
mstore(tokenIds, tokenIdsIdx)
}
}
return tokenIds;
}
}
}
文件 6 的 10: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);
}
文件 7 的 10: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);
}
文件 8 的 10:Ownable.sol
pragma solidity ^0.8.0;
import "Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
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);
}
}
文件 9 的 10: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;
}
}
文件 10 的 10:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
{
"compilationTarget": {
"999KillTimez.sol": "_999KillTimez"
},
"evmVersion": "istanbul",
"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":"MaxMints","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotWL","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"RoundSoldOut","type":"error"},{"inputs":[],"name":"SaleNotStarted","type":"error"},{"inputs":[],"name":"SoldOut","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"},{"inputs":[],"name":"ValueTooLow","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":[{"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":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"ownership","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"giftReceived","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVipMints","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":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publicMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setCommunityManagerPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setCommunityPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setCreatorPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setMarketingPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_wlSupply","type":"uint16"}],"name":"setMaxVipSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_newPrice","type":"uint64"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setPublicStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newSuffix","type":"string"}],"name":"setUriSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setVipAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setVipStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_newPrice","type":"uint64"}],"name":"setWhiteListPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setWhiteListStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setWlAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setdevelopmentPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":[],"name":"uriSuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"vipMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vipMintCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vipMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"uint256","name":"gift","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"whiteListMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"whitelistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wlMintCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wlMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]