Skip to content

Commit

Permalink
Merge pull request #3173 from poanetwork/vb-implementation-address
Browse files Browse the repository at this point in the history
Display implementation address at read/write proxy tabs
  • Loading branch information
vbaranov committed Jun 30, 2020
2 parents 69fccf5 + cddc58f commit 818f0d5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Current

### 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
- [#3161](https://github.com/poanetwork/blockscout/pull/3161) - Write proxy contracts feature
- [#3160](https://github.com/poanetwork/blockscout/pull/3160) - Write contracts feature
Expand Down
9 changes: 9 additions & 0 deletions apps/block_scout_web/assets/css/components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,13 @@ $card-tab-icon-color-active: #fff !default;
@include media-breakpoint-down(sm) {
margin-left: 15px!important;
}
}

.implementation-title {
float: left;
margin-right: 5px;
}

.implementation-value {
line-height: 30px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ defmodule BlockScoutWeb.SmartContractController do
[]
end

implementation_address_hash_string =
Chain.get_implementation_address_hash(address.hash, address.smart_contract.abi) ||
"0x0000000000000000000000000000000000000000"

conn
|> put_status(200)
|> put_layout(false)
Expand All @@ -48,6 +52,7 @@ defmodule BlockScoutWeb.SmartContractController do
read_only_functions: functions,
address: address,
contract_abi: contract_abi,
implementation_address: implementation_address_hash_string,
implementation_abi: implementation_abi,
contract_type: contract_type
)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %>
<div class="d-flex py-2 border-bottom" data-function>
<div class="py-2 pr-2 text-nowrap">
Expand Down
10 changes: 5 additions & 5 deletions apps/block_scout_web/priv/gettext/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ msgid "ERC-721 "
msgstr ""

#, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:32
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:67
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:40
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:75
msgid "ETH"
msgstr ""

Expand Down Expand Up @@ -1195,7 +1195,7 @@ msgid "QR Code"
msgstr ""

#, 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"
msgstr ""

Expand Down Expand Up @@ -1649,7 +1649,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr ""

#, 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"
msgstr ""

Expand Down Expand Up @@ -1937,7 +1937,7 @@ msgid "Waiting for transaction's confirmation..."
msgstr ""

#, 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"
msgstr ""

Expand Down
10 changes: 5 additions & 5 deletions apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ msgid "ERC-721 "
msgstr ""

#, elixir-format
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:32
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:67
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:40
#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:75
msgid "ETH"
msgstr ""

Expand Down Expand Up @@ -1195,7 +1195,7 @@ msgid "QR Code"
msgstr ""

#, 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"
msgstr ""

Expand Down Expand Up @@ -1649,7 +1649,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr ""

#, 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"
msgstr ""

Expand Down Expand Up @@ -1937,7 +1937,7 @@ msgid "Waiting for transaction's confirmation..."
msgstr ""

#, 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"
msgstr ""

Expand Down

0 comments on commit 818f0d5

Please sign in to comment.