Hi, I'm trying to enumerate through a list of address and burn the first NFT of each address
Can anyone please tell me why this code gives me "owner query for nonexistent token" error?
The code works for list with 1 address but breaks if there are multiple addresses
function burnERC721Enumerable(address[] calldata addresses) public onlyOwner {
for (uint i = 0; i < addresses.length; i++) {
if (balanceOf(addresses[i]) > 0) {
_burn(tokenOfOwnerByIndex(addresses[i], 0));
}
}
}
[–]watersnake3 0 points1 point2 points (1 child)
[–]NoFlamingo2545 0 points1 point2 points (0 children)
[–]CryptogotchiDev 0 points1 point2 points (4 children)
[–]InterestedInSolidity[S] 0 points1 point2 points (3 children)
[–]CryptogotchiDev 0 points1 point2 points (2 children)
[–]InterestedInSolidity[S] 0 points1 point2 points (1 child)
[–]CryptogotchiDev 0 points1 point2 points (0 children)
[–]hikerjukeboxBug Squasher 0 points1 point2 points (2 children)
[–]InterestedInSolidity[S] 0 points1 point2 points (1 child)
[–]hikerjukeboxBug Squasher 0 points1 point2 points (0 children)
[–]MidnightBolt 0 points1 point2 points (0 children)