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)
see (4)
4 ideas how to recalculate explorer storage (is it even needed)
we can revalidate all accounts (slow)
mark in the browser that contract last upgrade status for user to manually check their balances
[x] Add two new columns in the Contracts table - proxyAddress and proxyCode
[x] Add proxy detection logic that looks at storageAt for proxy, uups, and beacon proxy contracts
[x] Iterate through existing contracts in the table and flag the proxies for each contract
[x] Update indexer logic for tokens (addContract) to support new proxies (if contract is a proxy, use the proxy bytecode)
[ ] Update cli event processor to iterate the events for each newly identified proxy contract; update balances by iterating events if they are tokens
[ ] Add upgrade event handler to update the proxy contract address and contract code when an upgrade is detected
[ ] Add storage comparison logic to check if the before and after upgrades of storage has been modified (i,e, do we need to modify the balances, etc)
[ ] Add unit tests to verify the newly added logic to address the proxy contracts indexer (create new smart contracts, deploy, and verify that they are properly upgraded)
[ ] Deploy solution onto test-net indexer and verify it functions as expected (deploy contracts and have the indexer run against the new contracts with existing and new source code)
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)