harmony-one / explorer-v2-backend

12 stars 16 forks source link

Indexer does not pick up proxy contracts when processing contracts for the token list #34

Open victaphu opened 2 years ago

victaphu commented 2 years ago

Proxy contract implementing the transparent, uups, and beacon proxy standards that proxy to token standards (20, 721, 1155) are not be processed by the indexer. As such tokens are not showing up in the explorer list. (e.g. https://explorer.harmony.one/tx/0x072f0f568990925ff294c6ade9137c6d1776c64ba5621f3af17e9cbe7eed5cf4)

Proposed solution: 1 how to track proxy: we can check each contract detected to determine if it is a proxy (openzeppelin/upgrades-core has functions for proxy detection) (contractAddressIndexer)

2 how to track transfers transfers check through events fired by the contract consider sync function that we can call as part of the cli if we have out of sync issues

3 how to track state change (between upgrades)

4 ideas how to recalculate explorer storage (is it even needed)

victaphu commented 2 years ago

Note after reviewing the source