nft-snapshot
nft-snapshot copied to clipboard
erc1155 auto ends early
When I run nftsnap erc1155 -n members9-30 -a 0x0170227514a274826685bf81aed06e4218175572 -s 0 -e 49 -f tokensByOwner
it automatically ends after getting the details for 2 tokens even though this contract has tokens 0-50 minted.
@etheria-chan Do you have time to help figure this out?
@augustfr Etheria built the ERC1155 piece and CLI so hopefully she'll be able to troubleshoot.
I know the issue. I will leave it up to you how to address it, because it's kind of funky.
When I wrote this, my assumption was that for collections of length n the first error returned from ownerOf
would be tokenID n+1
However, for large collections that implement a burning mechanic, sometimes the first token that errors has simply been burnt.
To fix this for the individual use case, you could go to erc1155.js, and modify the following lines to remove the break. Then reinstall the package with npm i -g
} catch (err) {
console.log(`auto-detected end of collection at index ${tokenId-1}.`);
break;
}
However, you will need to make sure that when you run the script, you supply an endId
, or it will just keep running forever.
@echanneled Ok so I just did this and yes now it does go through all of the IDs, but the csv still is barely populated. Here is a screenshot of what it created. No tokens have been burned so it's still skipping the ones where it thinks the collection ends.
All tokens 0-50 exist.
