Merge pull request #4063 from blockscout/vb-contract-creation-dont-display-4bytes-signature

Do not display 4bytes signature in the tx tile for contract creation
pull/4067/head
Victor Baranov 4 years ago committed by GitHub
commit d994d9c258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex
  3. 12
      apps/block_scout_web/priv/gettext/default.pot
  4. 12
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  5. 30
      apps/explorer/lib/explorer/chain/transaction.ex

@ -9,6 +9,7 @@
- [#3888](https://github.com/blockscout/blockscout/pull/3888) - EIP-1967 contract proxy pattern detection fix - [#3888](https://github.com/blockscout/blockscout/pull/3888) - EIP-1967 contract proxy pattern detection fix
### Chore ### Chore
- [#4063](https://github.com/blockscout/blockscout/pull/4063) - Do not display 4bytes signature in the tx tile for contract creation
- [#3934](https://github.com/blockscout/blockscout/pull/3934) - Update nimble_csv package - [#3934](https://github.com/blockscout/blockscout/pull/3934) - Update nimble_csv package
- [#3902](https://github.com/blockscout/blockscout/pull/3902) - Increase number of left symbols in short address view - [#3902](https://github.com/blockscout/blockscout/pull/3902) - Increase number of left symbols in short address view
- [#3894](https://github.com/blockscout/blockscout/pull/3894) - Refactoring: replace inline style display: none with d-none class - [#3894](https://github.com/blockscout/blockscout/pull/3894) - Refactoring: replace inline style display: none with d-none class

@ -21,7 +21,9 @@
<span> <span>
<%= render "_link.html", transaction_hash: @transaction.hash %> <%= render "_link.html", transaction_hash: @transaction.hash %>
<% method_name = Transaction.get_method_name(@transaction) %> <% method_name = Transaction.get_method_name(@transaction) %>
<%= render BlockScoutWeb.FormView, "_tag.html", text: method_name, additional_classes: ["method", "ml-1"] %> <%= if method_name do %>
<%= render BlockScoutWeb.FormView, "_tag.html", text: method_name, additional_classes: ["method", "ml-1"] %>
<% end %>
</span> </span>
<span> <span>
<%= @transaction |> BlockScoutWeb.AddressView.address_partial_selector(:from, assigns[:current_address]) |> BlockScoutWeb.RenderHelpers.render_partial() %> <%= @transaction |> BlockScoutWeb.AddressView.address_partial_selector(:from, assigns[:current_address]) |> BlockScoutWeb.RenderHelpers.render_partial() %>

@ -645,7 +645,7 @@ msgstr ""
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:20 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:20
#: lib/block_scout_web/templates/layout/app.html.eex:33 #: lib/block_scout_web/templates/layout/app.html.eex:33
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20
#: lib/block_scout_web/templates/transaction/_tile.html.eex:33 #: lib/block_scout_web/templates/transaction/_tile.html.eex:35
#: lib/block_scout_web/templates/transaction/overview.html.eex:214 #: lib/block_scout_web/templates/transaction/overview.html.eex:214
#: lib/block_scout_web/templates/transaction/overview.html.eex:267 #: lib/block_scout_web/templates/transaction/overview.html.eex:267
#: lib/block_scout_web/views/wei_helpers.ex:78 #: lib/block_scout_web/views/wei_helpers.ex:78
@ -771,7 +771,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:38 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:38
#: lib/block_scout_web/templates/transaction/_tile.html.eex:76 #: lib/block_scout_web/templates/transaction/_tile.html.eex:78
msgid "IN" msgid "IN"
msgstr "" msgstr ""
@ -789,7 +789,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:21 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:21
#: lib/block_scout_web/templates/transaction/_tile.html.eex:36 #: lib/block_scout_web/templates/transaction/_tile.html.eex:38
#: lib/block_scout_web/templates/transaction/overview.html.eex:118 #: lib/block_scout_web/templates/transaction/overview.html.eex:118
msgid "TX Fee" msgid "TX Fee"
msgstr "" msgstr ""
@ -1113,7 +1113,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:36 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:36
#: lib/block_scout_web/templates/transaction/_tile.html.eex:72 #: lib/block_scout_web/templates/transaction/_tile.html.eex:74
msgid "OUT" msgid "OUT"
msgstr "" msgstr ""
@ -1623,12 +1623,12 @@ msgid "View Contract"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tile.html.eex:57 #: lib/block_scout_web/templates/transaction/_tile.html.eex:59
msgid "View Less Transfers" msgid "View Less Transfers"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tile.html.eex:56 #: lib/block_scout_web/templates/transaction/_tile.html.eex:58
msgid "View More Transfers" msgid "View More Transfers"
msgstr "" msgstr ""

@ -645,7 +645,7 @@ msgstr ""
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:20 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:20
#: lib/block_scout_web/templates/layout/app.html.eex:33 #: lib/block_scout_web/templates/layout/app.html.eex:33
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20
#: lib/block_scout_web/templates/transaction/_tile.html.eex:33 #: lib/block_scout_web/templates/transaction/_tile.html.eex:35
#: lib/block_scout_web/templates/transaction/overview.html.eex:214 #: lib/block_scout_web/templates/transaction/overview.html.eex:214
#: lib/block_scout_web/templates/transaction/overview.html.eex:267 #: lib/block_scout_web/templates/transaction/overview.html.eex:267
#: lib/block_scout_web/views/wei_helpers.ex:78 #: lib/block_scout_web/views/wei_helpers.ex:78
@ -771,7 +771,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:38 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:38
#: lib/block_scout_web/templates/transaction/_tile.html.eex:76 #: lib/block_scout_web/templates/transaction/_tile.html.eex:78
msgid "IN" msgid "IN"
msgstr "" msgstr ""
@ -789,7 +789,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:21 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:21
#: lib/block_scout_web/templates/transaction/_tile.html.eex:36 #: lib/block_scout_web/templates/transaction/_tile.html.eex:38
#: lib/block_scout_web/templates/transaction/overview.html.eex:118 #: lib/block_scout_web/templates/transaction/overview.html.eex:118
msgid "TX Fee" msgid "TX Fee"
msgstr "" msgstr ""
@ -1113,7 +1113,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:36 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:36
#: lib/block_scout_web/templates/transaction/_tile.html.eex:72 #: lib/block_scout_web/templates/transaction/_tile.html.eex:74
msgid "OUT" msgid "OUT"
msgstr "" msgstr ""
@ -1623,12 +1623,12 @@ msgid "View Contract"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tile.html.eex:57 #: lib/block_scout_web/templates/transaction/_tile.html.eex:59
msgid "View Less Transfers" msgid "View Less Transfers"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tile.html.eex:56 #: lib/block_scout_web/templates/transaction/_tile.html.eex:58
msgid "View More Transfers" msgid "View More Transfers"
msgstr "" msgstr ""

@ -481,19 +481,23 @@ defmodule Explorer.Chain.Transaction do
input: %{bytes: <<method_id::binary-size(4), _::binary>>} input: %{bytes: <<method_id::binary-size(4), _::binary>>}
} = transaction } = transaction
) do ) do
case Transaction.decoded_input_data(%__MODULE__{ if transaction.created_contract_address_hash do
to_address: %{smart_contract: nil}, nil
input: transaction.input, else
hash: transaction.hash case Transaction.decoded_input_data(%__MODULE__{
}) do to_address: %{smart_contract: nil},
{:error, :contract_not_verified, [{:ok, _method_id, decoded_func, _}]} -> input: transaction.input,
parse_method_name(decoded_func) hash: transaction.hash
}) do
{:error, :contract_not_verified, []} -> {:error, :contract_not_verified, [{:ok, _method_id, decoded_func, _}]} ->
"0x" <> Base.encode16(method_id, case: :lower) parse_method_name(decoded_func)
_ -> {:error, :contract_not_verified, []} ->
"Transfer" "0x" <> Base.encode16(method_id, case: :lower)
_ ->
"Transfer"
end
end end
end end

Loading…
Cancel
Save