blockscout / frontend

Front-end application for Blockscout
https://blockscout.com
GNU General Public License v3.0
146 stars 383 forks source link

Add support for Diamond proxy standard #1946

Closed vbaranov closed 1 month ago

vbaranov commented 1 month ago

Related backend task

Starting from release 6.6.0, /api/v2/addresses/ API v2 endpoint starts returning an array of implementations for proxy contracts in the prop implementations. Single props implementation_address and implementation_name are yet returned for backward compatibility, but will be removed in the future.

Notes:

An example of diamond proxy at staging environment: /api/v2/addresses/0x013Cb2854daAD8203C6686682f5d876e5D3de4a2.

The response is:

{"block_number_balance_updated_at":5955098,"coin_balance":"3063385000000000000","creation_tx_hash":"0x2de468dd36a4b2d81b844ec07323540c36493019ab6c590605ee64d1b12ed9bf","creator_address_hash":"0x30f1A8c6f6f99984fceC4e9D59B3b2409BE975AE","ens_domain_name":null,"exchange_rate":null,"has_beacon_chain_withdrawals":false,"has_decompiled_code":false,"has_logs":true,"has_token_transfers":false,"has_tokens":false,"has_validated_blocks":false,"hash":"0x013Cb2854daAD8203C6686682f5d876e5D3de4a2","implementation_address":"0x321d5682ca2ef09f262204e9348e17B5dD2042C5","implementation_addresses":["0x321d5682ca2ef09f262204e9348e17B5dD2042C5","0x013Cb2854daAD8203C6686682f5d876e5D3de4a2"],"implementation_name":"MagicTestnetFacet","implementation_names":["MagicTestnetFacet","MagicProxy"],"is_contract":true,"is_verified":true,"metadata":null,"name":"MagicProxy","private_tags":[],"public_tags":[],"token":{"address":"0x013Cb2854daAD8203C6686682f5d876e5D3de4a2","circulating_market_cap":null,"decimals":"18","exchange_rate":null,"holders":"53634","icon_url":null,"name":"MAGIC","symbol":"MAGIC","total_supply":"3240185383000000000000000","type":"ERC-20","volume_24h":null},"watchlist_address_id":null,"watchlist_names":[]}

An example at prod environment: https://eth.blockscout.com/address/0xc9e91eDeA9DC16604022e4E5b437Df9c64EdB05A

tom2drum commented 1 month ago

We will add support for showing information about proxy contract(s) (including diamond proxy) in the list in this task - https://github.com/blockscout/frontend/issues/1798