TokenFlowInsights / EDW-Feedback

A repo for reporting issues and tracking progress on resolution
1 stars 0 forks source link

Wrong storage location for ‘create’ calls #5

Open ArranKitson opened 1 year ago

ArranKitson commented 1 year ago

Changes in the storage resulting from constructor calls were improperly recorded as happening on the factory contract storage instead of created contract.

This is already fixed for new data and most probably can be fixed for existing records just by database update

garythung commented 1 year ago

hey I am digging into some data. I want to confirm, is the issue listed above the issue you can see in this behavior? This query gets you EIP1967 proxy implementation storage changes for this specific TX: https://etherscan.io/tx/0x000e12b1fa94c545b4a67393a5ca6be2b9e3bcaa32f00c3b6d370fbc05ea59d7

In this TX, user is creating an ERC721 proxy via a factory that is itself a proxy. We should expect that the storage should change for address=ERC721 proxy from value 0x to the ERC721 implementation address.

Query:

select 'ethereum' as chain, contract as address, 'eip-1967' as proxy_type, block, timestamp, tx_hash, order_index, location as storage_slot, prev_value as prev_address, curr_value as curr_address from edw.raw.storage_diffs
where (location ILIKE '%0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc%'
or location ILIKE '%0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50%')
and tx_hash = '0x000e12b1fa94c545b4a67393a5ca6be2b9e3bcaa32f00c3b6d370fbc05ea59d7'

The problem is that it attributes storage change to address 0x073e06e3a316c59c53b905bf2bf8112475ffca08 when it should be the user's newly created ERC721 proxy 0xf4870e52852e49e2015187be684d0ce6ec1fa5f5

image

See internal call trace here: https://etherscan.io/tx/0x000e12b1fa94c545b4a67393a5ca6be2b9e3bcaa32f00c3b6d370fbc05ea59d7/advanced#internal

kchojn commented 1 year ago

@garythung I wanted to confirm that you are right. I also confirm that all the bugs have been fixed in the new edw, where the release is really very close 🫡

garythung commented 1 year ago

This looks fixed!

CHAIN   ADDRESS PROXY_TYPE  BLOCK   TIMESTAMP   TX_HASH ORDER_INDEX STORAGE_SLOT    PREV_ADDRESS    CURR_ADDRESS
ethereum    0xf4870e52852e49e2015187be684d0ce6ec1fa5f5  eip-1967    15,319,096  2022-08-11 06:17:55.000 0x000e12b1fa94c545b4a67393a5ca6be2b9e3bcaa32f00c3b6d370fbc05ea59d7  3,901   0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc  0x  0xe87a68de82204bfa63e4d626d4c5194481cf3b59