From 36e89a35b2c8982c43033ca84e8d24a90113bb06 Mon Sep 17 00:00:00 2001 From: yuexin Date: Tue, 18 Apr 2023 18:26:59 +0800 Subject: [PATCH] repair a index bug --- contracts/logic/NftDistributor.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/logic/NftDistributor.sol b/contracts/logic/NftDistributor.sol index 7c20d92..dd4ae05 100644 --- a/contracts/logic/NftDistributor.sol +++ b/contracts/logic/NftDistributor.sol @@ -99,12 +99,12 @@ contract NftDistributor is AccessControlEnumerable { if (!nftMinted[nftSId]) { // If the NFT is mintable, add it to the list to be minted uint256 nftId = _nftIds[index]; - index++; + // Add the NFT's source ID to the list of sources + nftSource[index] = nftSId; nftMinted[nftSId] = true; // Mint the NFT to the user's address nft.mint(_user, nftId); - // Add the NFT's source ID to the list of sources - nftSource[index] = (nftSId); + index++; } } // Emit event with details of the minting operation