oasisprotocol/nexus

index related NFT ID in runtime events

Opened this issue · 0 comments

😭
this is so ugly, and also it's the right thing to do in our circumstances, probably (edit: maybe) :(
A somewhat more involved option would be to pre-extract NFT token IDs (and possibly the emitting contract addr) into a separate DB column at analysis time. That way, we don't need any query-time encoding (here) / decoding (in SQL) shenanigans, and the WHERE-based index is more likely to be correctly detected as useful by postgres, and also we can support non-ERC721 NFTs. But it's not clear when we'll have to support non-EVM NFTs, and also we're hoping to not add more NFT-specific features.

Edit: Non-EVM NFTs are unlikely in the foreseeable future, but non-ERC721 ones are not. ERC-1155 is supposedly quite popular for web3 gaming. So IDK, might well be worth implementing the extra db columns now. The analyzer+migrations code will be longer by 20 lines, and this code will be shorter by 20 lines. And a reindex is upon us, so the timing is good :)

Originally posted by @mitjat in #579 (comment)