Merge pull request #3173 from poanetwork/vb-implementation-address

Display implementation address at read/write proxy tabs
pull/3174/head
Victor Baranov 4 years ago committed by GitHub
commit 818f0d5b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 9
      apps/block_scout_web/assets/css/components/_card.scss
  3. 5
      apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex
  4. 8
      apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex
  5. 10
      apps/block_scout_web/priv/gettext/default.pot
  6. 10
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -1,6 +1,7 @@
## Current ## Current
### Features ### Features
- [#3173](https://github.com/poanetwork/blockscout/pull/3173) - Display implementation address at read/write proxy tabs
- [#3171](https://github.com/poanetwork/blockscout/pull/3171) - Import accounts/contracts/balances from Geth genesis.json - [#3171](https://github.com/poanetwork/blockscout/pull/3171) - Import accounts/contracts/balances from Geth genesis.json
- [#3161](https://github.com/poanetwork/blockscout/pull/3161) - Write proxy contracts feature - [#3161](https://github.com/poanetwork/blockscout/pull/3161) - Write proxy contracts feature
- [#3160](https://github.com/poanetwork/blockscout/pull/3160) - Write contracts feature - [#3160](https://github.com/poanetwork/blockscout/pull/3160) - Write contracts feature

@ -256,4 +256,13 @@ $card-tab-icon-color-active: #fff !default;
@include media-breakpoint-down(sm) { @include media-breakpoint-down(sm) {
margin-left: 15px!important; margin-left: 15px!important;
} }
}
.implementation-title {
float: left;
margin-right: 5px;
}
.implementation-value {
line-height: 30px;
} }

@ -40,6 +40,10 @@ defmodule BlockScoutWeb.SmartContractController do
[] []
end end
implementation_address_hash_string =
Chain.get_implementation_address_hash(address.hash, address.smart_contract.abi) ||
"0x0000000000000000000000000000000000000000"
conn conn
|> put_status(200) |> put_status(200)
|> put_layout(false) |> put_layout(false)
@ -48,6 +52,7 @@ defmodule BlockScoutWeb.SmartContractController do
read_only_functions: functions, read_only_functions: functions,
address: address, address: address,
contract_abi: contract_abi, contract_abi: contract_abi,
implementation_address: implementation_address_hash_string,
implementation_abi: implementation_abi, implementation_abi: implementation_abi,
contract_type: contract_type contract_type: contract_type
) )

@ -1,3 +1,11 @@
<%= if @contract_type == "proxy" do %>
<div>
<h2 class="implementation-title">Implementation address: </h2><h3 class="implementation-value"><%= link(
@implementation_address,
to: address_path(@conn, :show, @implementation_address)
) %></h3>
</div>
<% end %>
<%= for {function, counter} <- Enum.with_index(@read_only_functions, 1) do %> <%= for {function, counter} <- Enum.with_index(@read_only_functions, 1) do %>
<div class="d-flex py-2 border-bottom" data-function> <div class="d-flex py-2 border-bottom" data-function>
<div class="py-2 pr-2 text-nowrap"> <div class="py-2 pr-2 text-nowrap">

@ -568,8 +568,8 @@ msgid "ERC-721 "
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:32 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:40
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:67 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:75
msgid "ETH" msgid "ETH"
msgstr "" msgstr ""
@ -1195,7 +1195,7 @@ msgid "QR Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:36 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:44
msgid "Query" msgid "Query"
msgstr "" msgstr ""
@ -1649,7 +1649,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:66 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:74
msgid "WEI" msgid "WEI"
msgstr "" msgstr ""
@ -1937,7 +1937,7 @@ msgid "Waiting for transaction's confirmation..."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:36 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:44
msgid "Write" msgid "Write"
msgstr "" msgstr ""

@ -568,8 +568,8 @@ msgid "ERC-721 "
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:32 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:40
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:67 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:75
msgid "ETH" msgid "ETH"
msgstr "" msgstr ""
@ -1195,7 +1195,7 @@ msgid "QR Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:36 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:44
msgid "Query" msgid "Query"
msgstr "" msgstr ""
@ -1649,7 +1649,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:66 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:74
msgid "WEI" msgid "WEI"
msgstr "" msgstr ""
@ -1937,7 +1937,7 @@ msgid "Waiting for transaction's confirmation..."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:36 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:44
msgid "Write" msgid "Write"
msgstr "" msgstr ""

Loading…
Cancel
Save