repair a index bug

This commit is contained in:
yuexin 2023-04-18 18:26:59 +08:00
parent 98a1cc6bae
commit 36e89a35b2

View File

@ -99,12 +99,12 @@ contract NftDistributor is AccessControlEnumerable {
if (!nftMinted[nftSId]) { if (!nftMinted[nftSId]) {
// If the NFT is mintable, add it to the list to be minted // If the NFT is mintable, add it to the list to be minted
uint256 nftId = _nftIds[index]; uint256 nftId = _nftIds[index];
index++; // Add the NFT's source ID to the list of sources
nftSource[index] = nftSId;
nftMinted[nftSId] = true; nftMinted[nftSId] = true;
// Mint the NFT to the user's address // Mint the NFT to the user's address
nft.mint(_user, nftId); nft.mint(_user, nftId);
// Add the NFT's source ID to the list of sources index++;
nftSource[index] = (nftSId);
} }
} }
// Emit event with details of the minting operation // Emit event with details of the minting operation