In NFTXMintRequestEligibility
, there is the following method.
This method will iterate over multiple tokenIds, taking the amount that can be claim and transfer it. But if it finds one token with amount = 0, it will revert the whole transaction.
I would recommend that instead of reverting if ammount = 0, to just to break the loop. This way we don't need to run again the transaction if we mistake a number.
function reclaimRequestedMint(uint256[] calldata tokenIds)
external
virtual
{
...
for (uint256 i = 0; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
uint256 amount = mintRequests[msg.sender][tokenId];
//FIXME: Should we have one token with amount <= 0, it will revert all the transactions. Reverting all previous transfer
// Why not just break the loop
require(amount > 0, "NFTXVault: nothing to reclaim");
mintRequests[msg.sender][tokenId] = 0;
approvedMints[msg.sender][tokenId] = false;
if (_is1155) {
IERC1155Upgradeable(_assetAddress).safeTransferFrom(
address(this),
msg.sender,
tokenId,
amount,
""
);
} else {
IERC721Upgradeable(_assetAddress).safeTransferFrom(
address(this),
msg.sender,
tokenId
);
}
}
}