2期mint合约增加一个用于标识空投数量的字段

This commit is contained in:
CounterFire2023 2024-06-14 17:24:09 +08:00
parent 9a45a120a9
commit d4acaea8a0
4 changed files with 9 additions and 5 deletions

View File

@ -36,13 +36,15 @@ const mint = {
// 2期mint支付的代币
mintCurrency: '0xFd42bfb03212dA7e1A4608a44d7658641D99CF34',
// 2期mint, 单个nft价格
mintPrice: '100',
mintPrice: '80000000000000000',
// 2期mint接收代币的钱包地址
mintFeeAddress: '0x50A8e60041A206AcaA5F844a1104896224be6F39',
// 2期mint nftid 开始
mintStartNftId: '6240603010000001',
mintStartNftId: '6240603010010001',
// 2期mint 最大可mint数量
maxSupply: 2000,
// 2期mint airdrop数量
airdropCount: 500,
}
var config = {

View File

@ -24,6 +24,7 @@ contract NFTClaimStage2WL is ReentrancyGuard, AccessControl {
address currency; // token address which user must pay to mint
uint256 mintPrice; // in wei
address feeToAddress; // wallet address to receive mint fee
uint256 airdropCount; // airdrop count
}
// parse: 0: not open or end, 1: phase1, 2: phase2
uint256 public mintParse = 0;
@ -101,7 +102,7 @@ contract NFTClaimStage2WL is ReentrancyGuard, AccessControl {
uint256 nftCount
) external nonReentrant whenNotPaused {
require(nftCount > 0, "NFTClaimer: nft count must be greater than 0");
require(nftCount <= mintConfig.maxSupply - totalCount, "NFTClaimer: exceed max supply");
require(nftCount <= mintConfig.maxSupply - mintConfig.airdropCount - totalCount, "NFTClaimer: exceed max supply");
address to = _msgSender();
uint256 _mintedCount = _mintedRecords[to].length();
if (mintParse == 1) {

View File

@ -14,7 +14,8 @@ const deployNFTClaim: DeployFunction =
config.mint.maxSupply,
config.mint.mintCurrency,
config.mint.mintPrice,
config.mint.mintFeeAddress
config.mint.mintFeeAddress,
config.mint.airdropCount
]
const startNftId = config.mint.mintStartNftId
const ret = await hre.deployments.deploy("NFTClaimStage2WL", {

View File

@ -21,7 +21,7 @@
"name": "NFTClaimStage2WL",
"type": "logic",
"json": "assets/contracts/NFTClaimStage2WL.json",
"address": "0x09F2D6CAf92860a1f79049E2552eFa54186c883c"
"address": "0x20204A3df0c3191Ee93f4DB328Ca92aEe148Ce24"
},
{
"name": "CFHero",