Merge pull request #5313 from blockscout/np-implementation-proxy-name

Add name for the proxy implementation on address page
pull/5413/head
Victor Baranov 3 years ago committed by GitHub
commit 095fa5a08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 6
      apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex
  3. 2
      apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex
  4. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/_link.html.eex
  5. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex
  6. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  7. 4
      apps/block_scout_web/lib/block_scout_web/templates/internal_transaction/_tile.html.eex
  8. 3
      apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex
  9. 14
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex
  10. 1
      apps/block_scout_web/lib/block_scout_web/views/transaction_log_view.ex
  11. 38
      apps/block_scout_web/priv/gettext/default.pot
  12. 38
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  13. 14
      apps/explorer/lib/explorer/chain.ex
  14. 5
      apps/explorer/lib/explorer/etherscan/contracts.ex

@ -4,7 +4,7 @@
- [#5491](https://github.com/blockscout/blockscout/pull/5491) - Sequential blocks broadcast on the main page
- [#5312](https://github.com/blockscout/blockscout/pull/5312) - Add OpenZeppelin proxy storage slot
- [#5302](https://github.com/blockscout/blockscout/pull/5302) - Add specific tx receipt fields for the GoQuorum client
- [#5268](https://github.com/blockscout/blockscout/pull/5268) - Contract names display improvement
- [#5268](https://github.com/blockscout/blockscout/pull/5268), [#5313](https://github.com/blockscout/blockscout/pull/5313) - Contract names display improvement
### Fixes
- [#5488](https://github.com/blockscout/blockscout/pull/5488) - Split long contract output to multiple lines

@ -18,8 +18,10 @@ defmodule BlockScoutWeb.SmartContractController do
{:ok, address} <- Chain.find_contract_address(address_hash, address_options, true) do
implementation_address_hash_string =
if contract_type == "proxy" do
Chain.get_implementation_address_hash(address.hash, address.smart_contract.abi) ||
@burn_address
address.hash
|> Chain.get_implementation_address_hash(address.smart_contract.abi)
|> Tuple.to_list()
|> List.first() || @burn_address
else
@burn_address
end

@ -20,6 +20,8 @@ defmodule BlockScoutWeb.TransactionLogController do
Keyword.merge(
[
necessity_by_association: %{
[address: :names] => :optional,
[address: :smart_contract] => :optional,
address: :optional
}
],

@ -1,6 +1,6 @@
<%= if @address do %>
<%= if assigns[:show_full_hash] do %>
<%= if name = implementation_name(@address) || primary_name(@address) do %>
<%= if name = if assigns[:ignore_implementation_name], do: primary_name(@address), else: implementation_name(@address) || primary_name(@address) do %>
<span><%= name %> |
<% end %>
<%= link to: address_path(BlockScoutWeb.Endpoint, :show, @address), "data-test": "address_hash_link", class: assigns[:class] do %>
@ -9,7 +9,7 @@
</span>
<% else %>
<%= link to: address_path(BlockScoutWeb.Endpoint, :show, @address), "data-test": "address_hash_link", class: assigns[:class] do %>
<%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address: @address, contract: @contract, truncate: assigns[:truncate], use_custom_tooltip: @use_custom_tooltip, no_tooltip: assigns[:no_tooltip], custom_classes_tooltip: assigns[:custom_classes_tooltip] %>
<%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address: @address, contract: @contract, truncate: assigns[:truncate], use_custom_tooltip: @use_custom_tooltip, no_tooltip: assigns[:no_tooltip], custom_classes_tooltip: assigns[:custom_classes_tooltip], ignore_implementation_name: assigns[:ignore_implementation_name] %>
<% end %>
<% end %>
<% end %>

@ -1,5 +1,5 @@
<span class="<%= if @contract do %>contract-address<% end %>" data-address-hash="<%= @address %>">
<%= if name = implementation_name(@address) || primary_name(@address) do %>
<%= if name = if assigns[:ignore_implementation_name], do: primary_name(@address), else: implementation_name(@address) || primary_name(@address) do %>
<%= if assigns[:no_tooltip] do %>
<%= if @use_custom_tooltip == true do %>
<span><%= name %> (<%= short_hash(@address) %>...)</span>

@ -141,7 +141,7 @@
<% end %>
<!-- Implementation -->
<%= if @is_proxy do %>
<% implementation_address = Chain.get_implementation_address_hash(@address.hash, @address.smart_contract.abi) || "0x0000000000000000000000000000000000000000" %>
<% {implementation_address, name} = Chain.get_implementation_address_hash(@address.hash, @address.smart_contract.abi) || "0x0000000000000000000000000000000000000000" %>
<dl class="row">
<dt class="col-sm-4 col-md-4 col-lg-3 text-muted">
<%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip_2.html",
@ -150,7 +150,7 @@
</dt>
<dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_contract_implementation">
<%= link(
implementation_address,
(if name, do: name <> " | " <> implementation_address, else: implementation_address),
to: address_path(@conn, :show, implementation_address),
class: "contract-address"
)

@ -15,9 +15,9 @@
<div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0">
<%= render BlockScoutWeb.TransactionView, "_link.html", transaction_hash: @internal_transaction.transaction_hash %>
<span class="text-nowrap">
<%= @internal_transaction |> BlockScoutWeb.AddressView.address_partial_selector(:from, assigns[:current_address]) |> BlockScoutWeb.RenderHelpers.render_partial() %>
<%= @internal_transaction |> BlockScoutWeb.AddressView.address_partial_selector(:from, assigns[:current_address]) |> Keyword.put(:ignore_implementation_name, true) |> BlockScoutWeb.RenderHelpers.render_partial() %>
&rarr;
<%= @internal_transaction |> BlockScoutWeb.AddressView.address_partial_selector(:to, assigns[:current_address]) |> BlockScoutWeb.RenderHelpers.render_partial() %>
<%= @internal_transaction |> BlockScoutWeb.AddressView.address_partial_selector(:to, assigns[:current_address]) |> Keyword.put(:ignore_implementation_name, true) |> BlockScoutWeb.RenderHelpers.render_partial() %>
</span>
<span class="d-flex flex-md-row flex-column mt-3 mt-md-0">
<span class="tile-title">

@ -20,8 +20,9 @@
<dt class="col-lg-2"> <%= gettext "Address" %> </dt>
<dd class="col-lg-10">
<h3 class="logs-hash">
<% name = implementation_name(@log.address) || primary_name(@log.address)%>
<%= link(
@log.address,
(if name, do: name <> " | "<> to_string(@log.address), else: @log.address),
to: address_path(@conn, :show, @log.address),
"data-test": "log_address_link",
"data-address-hash": @log.address

@ -4,7 +4,7 @@ defmodule BlockScoutWeb.AddressView do
require Logger
alias BlockScoutWeb.{AccessHelpers, LayoutView}
alias Explorer.{Chain, CustomContractsHelpers}
alias Explorer.{Chain, CustomContractsHelpers, Repo}
alias Explorer.Chain.{Address, Hash, InternalTransaction, SmartContract, Token, TokenTransfer, Transaction, Wei}
alias Explorer.Chain.Block.Reward
alias Explorer.ExchangeRates.Token, as: TokenExchangeRate
@ -176,9 +176,11 @@ defmodule BlockScoutWeb.AddressView do
end
@doc """
Returns the primary name of an address if available.
Returns the primary name of an address if available. If there is no names on address function performs preload of names association.
"""
def primary_name(%Address{names: [_ | _] = address_names}) do
def primary_name(_, second_time? \\ false)
def primary_name(%Address{names: [_ | _] = address_names}, _second_time?) do
case Enum.find(address_names, &(&1.primary == true)) do
nil ->
%Address.Name{name: name} = Enum.at(address_names, 0)
@ -189,7 +191,11 @@ defmodule BlockScoutWeb.AddressView do
end
end
def primary_name(%Address{names: _}), do: nil
def primary_name(%Address{names: _} = address, false) do
primary_name(Repo.preload(address, [:names]), true)
end
def primary_name(%Address{names: _}, true), do: nil
def implementation_name(%Address{smart_contract: %{implementation_name: implementation_name}}),
do: implementation_name

@ -3,6 +3,7 @@ defmodule BlockScoutWeb.TransactionLogView do
@dialyzer :no_match
alias Explorer.Chain.Log
import BlockScoutWeb.AddressView, only: [implementation_name: 1, primary_name: 1]
def decode(log, transaction) do
Log.decode(log, transaction)

@ -430,7 +430,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:48
#: lib/block_scout_web/templates/address/overview.html.eex:290 lib/block_scout_web/templates/address_validation/index.html.eex:11
#: lib/block_scout_web/views/address_view.ex:365
#: lib/block_scout_web/views/address_view.ex:371
msgid "Blocks Validated"
msgstr ""
@ -569,13 +569,13 @@ msgstr ""
#: lib/block_scout_web/templates/address/_tabs.html.eex:58
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:165 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126 lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:358
#: lib/block_scout_web/views/address_view.ex:364
msgid "Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:34
#: lib/block_scout_web/views/address_view.ex:364
#: lib/block_scout_web/views/address_view.ex:370
msgid "Coin Balance History"
msgstr ""
@ -881,7 +881,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:101
#: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:7 lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:23
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:120
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121
msgid "Data"
msgstr ""
@ -904,13 +904,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:32
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:38 lib/block_scout_web/templates/address_logs/_logs.html.eex:53
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:33 lib/block_scout_web/templates/transaction_log/_logs.html.eex:41
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:56 lib/block_scout_web/templates/transaction_log/_logs.html.eex:72
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:34 lib/block_scout_web/templates/transaction_log/_logs.html.eex:42
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:57 lib/block_scout_web/templates/transaction_log/_logs.html.eex:73
msgid "Decoded"
msgstr ""
#, elixir-format
#: lib/block_scout_web/views/address_view.ex:359
#: lib/block_scout_web/views/address_view.ex:365
msgid "Decompiled Code"
msgstr ""
@ -1154,7 +1154,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:35
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:37
msgid "Failed to decode log data."
msgstr ""
@ -1377,7 +1377,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:28
#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:17 lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 lib/block_scout_web/views/address_view.ex:355
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 lib/block_scout_web/views/address_view.ex:361
#: lib/block_scout_web/views/transaction_view.ex:512
msgid "Internal Transactions"
msgstr ""
@ -1485,14 +1485,14 @@ msgid "Log Data"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:130
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:131
msgid "Log Index"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:41
#: lib/block_scout_web/templates/address_logs/index.html.eex:10 lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 lib/block_scout_web/views/address_view.ex:366
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 lib/block_scout_web/views/address_view.ex:372
#: lib/block_scout_web/views/transaction_view.ex:513
msgid "Logs"
msgstr ""
@ -1933,14 +1933,14 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:81
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:27 lib/block_scout_web/views/address_view.ex:360
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:27 lib/block_scout_web/views/address_view.ex:366
#: lib/block_scout_web/views/tokens/overview_view.ex:43
msgid "Read Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:88
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:41 lib/block_scout_web/views/address_view.ex:361
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:41 lib/block_scout_web/views/address_view.ex:367
msgid "Read Proxy"
msgstr ""
@ -2628,7 +2628,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19 lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:3
#: lib/block_scout_web/templates/tokens/instance/transfer/index.html.eex:16 lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:5
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:14 lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 lib/block_scout_web/views/address_view.ex:357
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 lib/block_scout_web/views/address_view.ex:363
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:195 lib/block_scout_web/views/tokens/overview_view.ex:41
#: lib/block_scout_web/views/transaction_view.ex:511
msgid "Token Transfers"
@ -2649,7 +2649,7 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:191 lib/block_scout_web/templates/address_token/overview.html.eex:58
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:13 lib/block_scout_web/templates/layout/_topnav.html.eex:69
#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 lib/block_scout_web/templates/tokens/index.html.eex:10
#: lib/block_scout_web/views/address_view.ex:354
#: lib/block_scout_web/views/address_view.ex:360
msgid "Tokens"
msgstr ""
@ -2685,7 +2685,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:71
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:90
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91
msgid "Topics"
msgstr ""
@ -2797,7 +2797,7 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:216 lib/block_scout_web/templates/address_transaction/index.html.eex:13
#: lib/block_scout_web/templates/block/overview.html.eex:80 lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:43
#: lib/block_scout_web/views/address_view.ex:356
#: lib/block_scout_web/views/address_view.ex:362
msgid "Transactions"
msgstr ""
@ -3139,13 +3139,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:95
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:34 lib/block_scout_web/views/address_view.ex:362
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:34 lib/block_scout_web/views/address_view.ex:368
msgid "Write Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:102
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:48 lib/block_scout_web/views/address_view.ex:363
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:48 lib/block_scout_web/views/address_view.ex:369
msgid "Write Proxy"
msgstr ""

@ -430,7 +430,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:48
#: lib/block_scout_web/templates/address/overview.html.eex:290 lib/block_scout_web/templates/address_validation/index.html.eex:11
#: lib/block_scout_web/views/address_view.ex:365
#: lib/block_scout_web/views/address_view.ex:371
msgid "Blocks Validated"
msgstr ""
@ -569,13 +569,13 @@ msgstr ""
#: lib/block_scout_web/templates/address/_tabs.html.eex:58
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:165 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126 lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:358
#: lib/block_scout_web/views/address_view.ex:364
msgid "Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:34
#: lib/block_scout_web/views/address_view.ex:364
#: lib/block_scout_web/views/address_view.ex:370
msgid "Coin Balance History"
msgstr ""
@ -881,7 +881,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:101
#: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:7 lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:23
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:120
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121
msgid "Data"
msgstr ""
@ -904,13 +904,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:32
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:38 lib/block_scout_web/templates/address_logs/_logs.html.eex:53
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:33 lib/block_scout_web/templates/transaction_log/_logs.html.eex:41
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:56 lib/block_scout_web/templates/transaction_log/_logs.html.eex:72
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:34 lib/block_scout_web/templates/transaction_log/_logs.html.eex:42
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:57 lib/block_scout_web/templates/transaction_log/_logs.html.eex:73
msgid "Decoded"
msgstr ""
#, elixir-format
#: lib/block_scout_web/views/address_view.ex:359
#: lib/block_scout_web/views/address_view.ex:365
msgid "Decompiled Code"
msgstr ""
@ -1154,7 +1154,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:35
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:37
msgid "Failed to decode log data."
msgstr ""
@ -1377,7 +1377,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:28
#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:17 lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 lib/block_scout_web/views/address_view.ex:355
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 lib/block_scout_web/views/address_view.ex:361
#: lib/block_scout_web/views/transaction_view.ex:512
msgid "Internal Transactions"
msgstr ""
@ -1485,14 +1485,14 @@ msgid "Log Data"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:130
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:131
msgid "Log Index"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:41
#: lib/block_scout_web/templates/address_logs/index.html.eex:10 lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 lib/block_scout_web/views/address_view.ex:366
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 lib/block_scout_web/views/address_view.ex:372
#: lib/block_scout_web/views/transaction_view.ex:513
msgid "Logs"
msgstr ""
@ -1933,14 +1933,14 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:81
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:27 lib/block_scout_web/views/address_view.ex:360
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:27 lib/block_scout_web/views/address_view.ex:366
#: lib/block_scout_web/views/tokens/overview_view.ex:43
msgid "Read Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:88
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:41 lib/block_scout_web/views/address_view.ex:361
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:41 lib/block_scout_web/views/address_view.ex:367
msgid "Read Proxy"
msgstr ""
@ -2628,7 +2628,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19 lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:3
#: lib/block_scout_web/templates/tokens/instance/transfer/index.html.eex:16 lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:5
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:14 lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 lib/block_scout_web/views/address_view.ex:357
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 lib/block_scout_web/views/address_view.ex:363
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:195 lib/block_scout_web/views/tokens/overview_view.ex:41
#: lib/block_scout_web/views/transaction_view.ex:511
msgid "Token Transfers"
@ -2649,7 +2649,7 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:191 lib/block_scout_web/templates/address_token/overview.html.eex:58
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:13 lib/block_scout_web/templates/layout/_topnav.html.eex:69
#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 lib/block_scout_web/templates/tokens/index.html.eex:10
#: lib/block_scout_web/views/address_view.ex:354
#: lib/block_scout_web/views/address_view.ex:360
msgid "Tokens"
msgstr ""
@ -2685,7 +2685,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:71
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:90
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91
msgid "Topics"
msgstr ""
@ -2797,7 +2797,7 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:216 lib/block_scout_web/templates/address_transaction/index.html.eex:13
#: lib/block_scout_web/templates/block/overview.html.eex:80 lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:43
#: lib/block_scout_web/views/address_view.ex:356
#: lib/block_scout_web/views/address_view.ex:362
msgid "Transactions"
msgstr ""
@ -3139,13 +3139,13 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:95
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:34 lib/block_scout_web/views/address_view.ex:362
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:34 lib/block_scout_web/views/address_view.ex:368
msgid "Write Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:102
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:48 lib/block_scout_web/views/address_view.ex:363
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:48 lib/block_scout_web/views/address_view.ex:369
msgid "Write Proxy"
msgstr ""

@ -6667,7 +6667,7 @@ defmodule Explorer.Chain do
def gnosis_safe_contract?(abi) when is_nil(abi), do: false
@spec get_implementation_address_hash(Hash.Address.t(), list()) :: String.t() | nil
@spec get_implementation_address_hash(Hash.Address.t(), list()) :: {String.t() | nil, String.t() | nil}
def get_implementation_address_hash(proxy_address_hash, abi)
when not is_nil(proxy_address_hash) and not is_nil(abi) do
implementation_method_abi =
@ -6698,7 +6698,7 @@ defmodule Explorer.Chain do
end
def get_implementation_address_hash(proxy_address_hash, abi) when is_nil(proxy_address_hash) or is_nil(abi) do
nil
{nil, nil}
end
defp get_implementation_address_hash_eip_1967(proxy_address_hash) do
@ -6855,7 +6855,7 @@ defmodule Explorer.Chain do
"0x0000000000000000000000000000000000000000000000000000000000000000",
@burn_address_hash_str
],
do: empty_address_hash_string
do: {empty_address_hash_string, nil}
defp save_implementation_name(implementation_address_hash_string, proxy_address_hash)
when is_binary(implementation_address_hash_string) do
@ -6866,14 +6866,14 @@ defmodule Explorer.Chain do
|> update(set: [implementation_name: ^name])
|> Repo.update_all([])
implementation_address_hash_string
{implementation_address_hash_string, name}
else
_ ->
implementation_address_hash_string
{implementation_address_hash_string, nil}
end
end
defp save_implementation_name(other, _), do: other
defp save_implementation_name(other, _), do: {other, nil}
defp abi_decode_address_output(nil), do: nil
@ -6924,7 +6924,7 @@ defmodule Explorer.Chain do
def get_implementation_abi_from_proxy(proxy_address_hash, abi)
when not is_nil(proxy_address_hash) and not is_nil(abi) do
implementation_address_hash_string = get_implementation_address_hash(proxy_address_hash, abi)
{implementation_address_hash_string, _name} = get_implementation_address_hash(proxy_address_hash, abi)
get_implementation_abi(implementation_address_hash_string)
end

@ -64,7 +64,10 @@ defmodule Explorer.Etherscan.Contracts do
|> Map.put(:is_proxy, true)
|> Map.put(
:implementation_address_hash_string,
Chain.get_implementation_address_hash(address.hash, smart_contract.abi)
address.hash
|> Chain.get_implementation_address_hash(smart_contract.abi)
|> Tuple.to_list()
|> List.first()
)
else
smart_contract

Loading…
Cancel
Save