diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_contract_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_contract_view.ex
index 3f453e0478..3c51c70342 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_contract_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_contract_view.ex
@@ -2,4 +2,16 @@ defmodule BlockScoutWeb.AddressContractView do
use BlockScoutWeb, :view
def format_smart_contract_abi(abi), do: Poison.encode!(abi, pretty: false)
+
+ @doc """
+ Returns the correct format for the optimization text.
+
+ iex> BlockScoutWeb.AddressContractView.format_optimization_text(true)
+ "true"
+
+ iex> BlockScoutWeb.AddressContractView.format_optimization_text(false)
+ "false"
+ """
+ def format_optimization_text(true), do: gettext("true")
+ def format_optimization_text(false), do: gettext("false")
end
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex
index 29f44d33e9..f242cb2753 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex
@@ -1,9 +1,6 @@
defmodule BlockScoutWeb.AddressInternalTransactionView do
use BlockScoutWeb, :view
- import BlockScoutWeb.AddressView,
- only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1, validator?: 1]
-
def format_current_filter(filter) do
case filter do
"to" -> gettext("To")
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex
index b8c1db4aed..58cdff8db8 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex
@@ -1,8 +1,6 @@
defmodule BlockScoutWeb.AddressReadContractView do
use BlockScoutWeb, :view
- import BlockScoutWeb.AddressView, only: [smart_contract_verified?: 1, validator?: 1]
-
def queryable?(inputs), do: Enum.any?(inputs)
def address?(type), do: type == "address"
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_token_transfer_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_token_transfer_view.ex
index 2c6017d403..5c1f786f22 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_token_transfer_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_token_transfer_view.ex
@@ -1,5 +1,3 @@
defmodule BlockScoutWeb.AddressTokenTransferView do
use BlockScoutWeb, :view
-
- alias BlockScoutWeb.AddressView
end
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_token_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_token_view.ex
index 87343bc76d..527391e0ad 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_token_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_token_view.ex
@@ -1,8 +1,6 @@
defmodule BlockScoutWeb.AddressTokenView do
use BlockScoutWeb, :view
- alias BlockScoutWeb.AddressView
-
def number_of_transfers(token) do
ngettext("%{count} transfer", "%{count} transfers", token.transfers_count)
end
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex
index 759f3df516..279053d5c9 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex
@@ -1,9 +1,6 @@
defmodule BlockScoutWeb.AddressTransactionView do
use BlockScoutWeb, :view
- import BlockScoutWeb.AddressView,
- only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1, validator?: 1]
-
def format_current_filter(filter) do
case filter do
"to" -> gettext("To")
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_view.ex
index 2b0543aeb2..71eb6473be 100644
--- a/apps/block_scout_web/lib/block_scout_web/views/address_view.ex
+++ b/apps/block_scout_web/lib/block_scout_web/views/address_view.ex
@@ -6,6 +6,8 @@ defmodule BlockScoutWeb.AddressView do
@dialyzer :no_match
+ @tabs ["tokens", "transactions", "internal_transactions", "contracts", "read_contract"]
+
def address_partial_selector(struct_to_render_from, direction, current_address, truncate \\ false)
def address_partial_selector(%Address{} = address, _, current_address, truncate) do
@@ -195,4 +197,26 @@ defmodule BlockScoutWeb.AddressView do
truncate: truncate
}
end
+
+ @doc """
+ Get the current tab name/title from the request path and possible tab names.
+
+ The tabs on mobile are represented by a dropdown list, which has a title. This title is the
+ currently selected tab name. This function returns that name, properly gettext'ed.
+
+ The list of possible tab names for this page is repesented by the attribute @tab.
+
+ Raises error if there is no match, so a developer of a new tab must include it in the list.
+ """
+ def current_tab_name(request_path) do
+ @tabs
+ |> Enum.filter(&tab_active?(&1, request_path))
+ |> tab_name()
+ end
+
+ defp tab_name(["tokens"]), do: gettext("Tokens")
+ defp tab_name(["transactions"]), do: gettext("Transactions")
+ defp tab_name(["internal_transactions"]), do: gettext("Internal Transactions")
+ defp tab_name(["contracts"]), do: gettext("Code")
+ defp tab_name(["read_contract"]), do: gettext("Read Contract")
end
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot
index d74b3d718d..b38dda6953 100644
--- a/apps/block_scout_web/priv/gettext/default.pot
+++ b/apps/block_scout_web/priv/gettext/default.pot
@@ -13,7 +13,7 @@ msgstr[0] ""
msgstr[1] ""
#, elixir-format
-#: lib/block_scout_web/views/address_token_view.ex:7
+#: lib/block_scout_web/views/address_token_view.ex:5
msgid "%{count} transfer"
msgid_plural "%{count} transfers"
msgstr[0] ""
@@ -24,11 +24,6 @@ msgstr[1] ""
msgid "%{count} Transactions"
msgstr ""
-#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:137
-msgid "%{}"
-msgstr ""
-
#, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:52
msgid "(Awaiting internal transactions for status)"
@@ -69,7 +64,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction_log/index.html.eex:15
-#: lib/block_scout_web/views/address_view.ex:79
+#: lib/block_scout_web/views/address_view.ex:81
msgid "Address"
msgstr ""
@@ -79,10 +74,10 @@ msgid "Addresses"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:134
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:137
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:11
-#: lib/block_scout_web/views/address_transaction_view.ex:11
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:28
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:29
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:8
+#: lib/block_scout_web/views/address_transaction_view.ex:8
msgid "All"
msgstr ""
@@ -141,16 +136,9 @@ msgid "Blocks"
msgstr ""
#, elixir-format
+#: lib/block_scout_web/templates/address/_tabs.html.eex:31
+#: lib/block_scout_web/templates/address/_tabs.html.eex:88
#: lib/block_scout_web/templates/address/overview.html.eex:31
-#: lib/block_scout_web/templates/address_contract/index.html.eex:35
-#: lib/block_scout_web/templates/address_contract/index.html.eex:93
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:36
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:91
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:35
-#: lib/block_scout_web/templates/address_token/index.html.eex:34
-#: lib/block_scout_web/templates/address_token/index.html.eex:97
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:37
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:91
#: lib/block_scout_web/templates/address_validation/index.html.eex:32
#: lib/block_scout_web/templates/address_validation/index.html.eex:81
#: lib/block_scout_web/templates/address_validation/index.html.eex:114
@@ -177,23 +165,13 @@ msgid "Close"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:46
-#: lib/block_scout_web/templates/address_contract/index.html.eex:68
-#: lib/block_scout_web/templates/address_contract/index.html.eex:102
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:48
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:101
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:46
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:88
-#: lib/block_scout_web/templates/address_token/index.html.eex:46
-#: lib/block_scout_web/templates/address_token/index.html.eex:107
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:39
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:92
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:49
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:101
+#: lib/block_scout_web/templates/address/_tabs.html.eex:44
+#: lib/block_scout_web/templates/address/_tabs.html.eex:98
#: lib/block_scout_web/templates/address_validation/index.html.eex:43
#: lib/block_scout_web/templates/address_validation/index.html.eex:90
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:122
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:141
+#: lib/block_scout_web/views/address_view.ex:220
msgid "Code"
msgstr ""
@@ -203,7 +181,7 @@ msgid "Compiler"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:140
+#: lib/block_scout_web/templates/address_contract/index.html.eex:30
msgid "Compiler version"
msgstr ""
@@ -213,12 +191,12 @@ msgid "Connection Lost, click to load newer blocks"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:124
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:18
msgid "Connection Lost, click to load newer internal transactions"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:127
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:19
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:53
#: lib/block_scout_web/templates/transaction/index.html.eex:53
msgid "Connection Lost, click to load newer transactions"
@@ -230,20 +208,20 @@ msgid "Connection Lost, click to load newer validations"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:163
+#: lib/block_scout_web/templates/address_contract/index.html.eex:53
msgid "Contract ABI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:12
-#: lib/block_scout_web/views/address_view.ex:77
+#: lib/block_scout_web/views/address_view.ex:79
msgid "Contract Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:15
-#: lib/block_scout_web/views/address_view.ex:21
-#: lib/block_scout_web/views/address_view.ex:55
+#: lib/block_scout_web/views/address_view.ex:23
+#: lib/block_scout_web/views/address_view.ex:57
msgid "Contract Address Pending"
msgstr ""
@@ -263,17 +241,17 @@ msgid "Contract Name"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:180
+#: lib/block_scout_web/templates/address_contract/index.html.eex:70
msgid "Contract creation code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:132
+#: lib/block_scout_web/templates/address_contract/index.html.eex:22
msgid "Contract name:"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:147
+#: lib/block_scout_web/templates/address_contract/index.html.eex:37
msgid "Contract source code"
msgstr ""
@@ -286,9 +264,9 @@ msgid "Copy Address"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:149
-#: lib/block_scout_web/templates/address_contract/index.html.eex:165
-#: lib/block_scout_web/templates/address_contract/index.html.eex:182
+#: lib/block_scout_web/templates/address_contract/index.html.eex:39
+#: lib/block_scout_web/templates/address_contract/index.html.eex:55
+#: lib/block_scout_web/templates/address_contract/index.html.eex:72
msgid "Copy Code"
msgstr ""
@@ -389,10 +367,10 @@ msgid "Fetching tokens..."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:151
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:154
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:10
-#: lib/block_scout_web/views/address_transaction_view.ex:10
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:45
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:46
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:7
+#: lib/block_scout_web/views/address_transaction_view.ex:7
msgid "From"
msgstr ""
@@ -451,25 +429,15 @@ msgid "Internal Transaction"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:26
-#: lib/block_scout_web/templates/address_contract/index.html.eex:86
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:70
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:84
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:163
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:26
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:80
-#: lib/block_scout_web/templates/address_token/index.html.eex:25
-#: lib/block_scout_web/templates/address_token/index.html.eex:90
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:27
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:84
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:28
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:84
+#: lib/block_scout_web/templates/address/_tabs.html.eex:21
+#: lib/block_scout_web/templates/address/_tabs.html.eex:81
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:57
#: lib/block_scout_web/templates/address_validation/index.html.eex:24
#: lib/block_scout_web/templates/address_validation/index.html.eex:75
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:14
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:43
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:10
+#: lib/block_scout_web/views/address_view.ex:219
#: lib/block_scout_web/views/transaction_view.ex:170
msgid "Internal Transactions"
msgstr ""
@@ -503,7 +471,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:17
#: lib/block_scout_web/templates/layout/app.html.eex:34
-#: lib/block_scout_web/views/address_view.ex:99
+#: lib/block_scout_web/views/address_view.ex:101
msgid "Market Cap"
msgstr ""
@@ -530,12 +498,12 @@ msgid "Module"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:119
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:13
msgid "More internal transactions have come in"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:122
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:14
#: lib/block_scout_web/templates/chain/show.html.eex:69
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:48
#: lib/block_scout_web/templates/transaction/index.html.eex:48
@@ -571,8 +539,8 @@ msgid "Newer"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token/index.html.eex:140
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:134
+#: lib/block_scout_web/templates/address_token/index.html.eex:25
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:34
msgid "Next"
msgstr ""
@@ -600,8 +568,8 @@ msgid "OUT"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:178
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:181
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:72
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:73
#: lib/block_scout_web/templates/address_validation/index.html.eex:123
#: lib/block_scout_web/templates/block/index.html.eex:20
#: lib/block_scout_web/templates/block_transaction/index.html.eex:50
@@ -613,7 +581,7 @@ msgid "Older"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:136
+#: lib/block_scout_web/templates/address_contract/index.html.eex:26
msgid "Optimization enabled"
msgstr ""
@@ -686,24 +654,12 @@ msgid "Query"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:56
-#: lib/block_scout_web/templates/address_contract/index.html.eex:110
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:59
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:109
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:55
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:66
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:95
-#: lib/block_scout_web/templates/address_token/index.html.eex:57
-#: lib/block_scout_web/templates/address_token/index.html.eex:65
-#: lib/block_scout_web/templates/address_token/index.html.eex:116
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:51
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:59
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:100
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:60
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:110
+#: lib/block_scout_web/templates/address/_tabs.html.eex:56
+#: lib/block_scout_web/templates/address/_tabs.html.eex:107
#: lib/block_scout_web/templates/address_validation/index.html.eex:53
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:33
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:75
+#: lib/block_scout_web/views/address_view.ex:221
#: lib/block_scout_web/views/tokens/overview_view.ex:35
msgid "Read Contract"
msgstr ""
@@ -790,7 +746,7 @@ msgid "There are no holders for this Token."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:172
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:66
msgid "There are no internal transactions for this address."
msgstr ""
@@ -806,7 +762,7 @@ msgid "There are no logs for this transaction."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:128
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:28
msgid "There are no token transfers for this address."
msgstr ""
@@ -816,7 +772,7 @@ msgid "There are no token transfers for this transaction."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token/index.html.eex:133
+#: lib/block_scout_web/templates/address_token/index.html.eex:18
msgid "There are no tokens for this address."
msgstr ""
@@ -826,7 +782,7 @@ msgid "There are no tokens."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:175
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:67
#: lib/block_scout_web/templates/block_transaction/index.html.eex:44
msgid "There are no transactions for this address."
msgstr ""
@@ -847,10 +803,10 @@ msgid "This transaction is pending confirmation."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:140
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:143
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:9
-#: lib/block_scout_web/views/address_transaction_view.ex:9
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:34
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:35
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:6
+#: lib/block_scout_web/views/address_transaction_view.ex:6
msgid "To"
msgstr ""
@@ -897,25 +853,14 @@ msgid "Token Transfers"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:19
-#: lib/block_scout_web/templates/address_contract/index.html.eex:81
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:20
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:79
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:19
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:75
-#: lib/block_scout_web/templates/address_token/index.html.eex:18
-#: lib/block_scout_web/templates/address_token/index.html.eex:76
-#: lib/block_scout_web/templates/address_token/index.html.eex:85
-#: lib/block_scout_web/templates/address_token/index.html.eex:126
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:70
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:79
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:112
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:20
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:79
+#: lib/block_scout_web/templates/address/_tabs.html.eex:13
+#: lib/block_scout_web/templates/address/_tabs.html.eex:76
+#: lib/block_scout_web/templates/address_token/index.html.eex:11
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:12
#: lib/block_scout_web/templates/address_validation/index.html.eex:18
#: lib/block_scout_web/templates/address_validation/index.html.eex:62
#: lib/block_scout_web/templates/address_validation/index.html.eex:70
+#: lib/block_scout_web/views/address_view.ex:217
msgid "Tokens"
msgstr ""
@@ -950,22 +895,11 @@ msgid "Transaction Details"
msgstr ""
#, elixir-format
+#: lib/block_scout_web/templates/address/_tabs.html.eex:5
+#: lib/block_scout_web/templates/address/_tabs.html.eex:71
#: lib/block_scout_web/templates/address/index.html.eex:28
#: lib/block_scout_web/templates/address/overview.html.eex:27
-#: lib/block_scout_web/templates/address_contract/index.html.eex:12
-#: lib/block_scout_web/templates/address_contract/index.html.eex:76
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:13
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:74
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:12
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:70
-#: lib/block_scout_web/templates/address_token/index.html.eex:11
-#: lib/block_scout_web/templates/address_token/index.html.eex:80
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:11
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:74
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:13
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:71
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:74
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:167
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:59
#: lib/block_scout_web/templates/address_validation/index.html.eex:11
#: lib/block_scout_web/templates/address_validation/index.html.eex:65
#: lib/block_scout_web/templates/block_transaction/index.html.eex:13
@@ -976,6 +910,7 @@ msgstr ""
#: lib/block_scout_web/templates/layout/_topnav.html.eex:24
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:56
#: lib/block_scout_web/templates/transaction/index.html.eex:56
+#: lib/block_scout_web/views/address_view.ex:218
msgid "Transactions"
msgstr ""
@@ -1024,7 +959,7 @@ msgid "Value"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:122
+#: lib/block_scout_web/templates/address_contract/index.html.eex:12
msgid "Verify & Publish"
msgstr ""
@@ -1094,7 +1029,7 @@ msgid "decimals"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:105
+#: lib/block_scout_web/templates/address_read_contract/index.html.eex:12
#: lib/block_scout_web/templates/tokens/read_contract/index.html.eex:19
msgid "loading..."
msgstr ""
@@ -1121,3 +1056,13 @@ msgstr ""
#: lib/block_scout_web/templates/address/index.html.eex:8
msgid "total addresses with a balance"
msgstr ""
+
+#, elixir-format
+#: lib/block_scout_web/views/address_contract_view.ex:16
+msgid "false"
+msgstr ""
+
+#, elixir-format
+#: lib/block_scout_web/views/address_contract_view.ex:15
+msgid "true"
+msgstr ""
diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
index 4261742e10..f9c887088b 100644
--- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
+++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
@@ -13,7 +13,7 @@ msgstr[0] ""
msgstr[1] ""
#, elixir-format
-#: lib/block_scout_web/views/address_token_view.ex:7
+#: lib/block_scout_web/views/address_token_view.ex:5
msgid "%{count} transfer"
msgid_plural "%{count} transfers"
msgstr[0] ""
@@ -24,11 +24,6 @@ msgstr[1] ""
msgid "%{count} Transactions"
msgstr ""
-#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:137
-msgid "%{}"
-msgstr ""
-
#, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:52
msgid "(Awaiting internal transactions for status)"
@@ -69,7 +64,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction_log/index.html.eex:15
-#: lib/block_scout_web/views/address_view.ex:79
+#: lib/block_scout_web/views/address_view.ex:81
msgid "Address"
msgstr ""
@@ -79,10 +74,10 @@ msgid "Addresses"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:134
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:137
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:11
-#: lib/block_scout_web/views/address_transaction_view.ex:11
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:28
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:29
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:8
+#: lib/block_scout_web/views/address_transaction_view.ex:8
msgid "All"
msgstr ""
@@ -141,16 +136,9 @@ msgid "Blocks"
msgstr ""
#, elixir-format
+#: lib/block_scout_web/templates/address/_tabs.html.eex:31
+#: lib/block_scout_web/templates/address/_tabs.html.eex:88
#: lib/block_scout_web/templates/address/overview.html.eex:31
-#: lib/block_scout_web/templates/address_contract/index.html.eex:35
-#: lib/block_scout_web/templates/address_contract/index.html.eex:93
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:36
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:91
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:35
-#: lib/block_scout_web/templates/address_token/index.html.eex:34
-#: lib/block_scout_web/templates/address_token/index.html.eex:97
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:37
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:91
#: lib/block_scout_web/templates/address_validation/index.html.eex:32
#: lib/block_scout_web/templates/address_validation/index.html.eex:81
#: lib/block_scout_web/templates/address_validation/index.html.eex:114
@@ -177,23 +165,13 @@ msgid "Close"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:46
-#: lib/block_scout_web/templates/address_contract/index.html.eex:68
-#: lib/block_scout_web/templates/address_contract/index.html.eex:102
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:48
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:101
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:46
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:88
-#: lib/block_scout_web/templates/address_token/index.html.eex:46
-#: lib/block_scout_web/templates/address_token/index.html.eex:107
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:39
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:92
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:49
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:101
+#: lib/block_scout_web/templates/address/_tabs.html.eex:44
+#: lib/block_scout_web/templates/address/_tabs.html.eex:98
#: lib/block_scout_web/templates/address_validation/index.html.eex:43
#: lib/block_scout_web/templates/address_validation/index.html.eex:90
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:122
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:141
+#: lib/block_scout_web/views/address_view.ex:220
msgid "Code"
msgstr ""
@@ -203,7 +181,7 @@ msgid "Compiler"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:140
+#: lib/block_scout_web/templates/address_contract/index.html.eex:30
msgid "Compiler version"
msgstr ""
@@ -213,12 +191,12 @@ msgid "Connection Lost, click to load newer blocks"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:124
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:18
msgid "Connection Lost, click to load newer internal transactions"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:127
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:19
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:53
#: lib/block_scout_web/templates/transaction/index.html.eex:53
msgid "Connection Lost, click to load newer transactions"
@@ -230,20 +208,20 @@ msgid "Connection Lost, click to load newer validations"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:163
+#: lib/block_scout_web/templates/address_contract/index.html.eex:53
msgid "Contract ABI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:12
-#: lib/block_scout_web/views/address_view.ex:77
+#: lib/block_scout_web/views/address_view.ex:79
msgid "Contract Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:15
-#: lib/block_scout_web/views/address_view.ex:21
-#: lib/block_scout_web/views/address_view.ex:55
+#: lib/block_scout_web/views/address_view.ex:23
+#: lib/block_scout_web/views/address_view.ex:57
msgid "Contract Address Pending"
msgstr ""
@@ -263,17 +241,17 @@ msgid "Contract Name"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:180
+#: lib/block_scout_web/templates/address_contract/index.html.eex:70
msgid "Contract creation code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:132
+#: lib/block_scout_web/templates/address_contract/index.html.eex:22
msgid "Contract name:"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:147
+#: lib/block_scout_web/templates/address_contract/index.html.eex:37
msgid "Contract source code"
msgstr ""
@@ -286,9 +264,9 @@ msgid "Copy Address"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:149
-#: lib/block_scout_web/templates/address_contract/index.html.eex:165
-#: lib/block_scout_web/templates/address_contract/index.html.eex:182
+#: lib/block_scout_web/templates/address_contract/index.html.eex:39
+#: lib/block_scout_web/templates/address_contract/index.html.eex:55
+#: lib/block_scout_web/templates/address_contract/index.html.eex:72
msgid "Copy Code"
msgstr ""
@@ -389,10 +367,10 @@ msgid "Fetching tokens..."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:151
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:154
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:10
-#: lib/block_scout_web/views/address_transaction_view.ex:10
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:45
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:46
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:7
+#: lib/block_scout_web/views/address_transaction_view.ex:7
msgid "From"
msgstr ""
@@ -451,25 +429,15 @@ msgid "Internal Transaction"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:26
-#: lib/block_scout_web/templates/address_contract/index.html.eex:86
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:27
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:70
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:84
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:163
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:26
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:80
-#: lib/block_scout_web/templates/address_token/index.html.eex:25
-#: lib/block_scout_web/templates/address_token/index.html.eex:90
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:27
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:84
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:28
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:84
+#: lib/block_scout_web/templates/address/_tabs.html.eex:21
+#: lib/block_scout_web/templates/address/_tabs.html.eex:81
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:57
#: lib/block_scout_web/templates/address_validation/index.html.eex:24
#: lib/block_scout_web/templates/address_validation/index.html.eex:75
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:14
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:43
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:10
+#: lib/block_scout_web/views/address_view.ex:219
#: lib/block_scout_web/views/transaction_view.ex:170
msgid "Internal Transactions"
msgstr ""
@@ -503,7 +471,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:17
#: lib/block_scout_web/templates/layout/app.html.eex:34
-#: lib/block_scout_web/views/address_view.ex:99
+#: lib/block_scout_web/views/address_view.ex:101
msgid "Market Cap"
msgstr ""
@@ -530,12 +498,12 @@ msgid "Module"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:119
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:13
msgid "More internal transactions have come in"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:122
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:14
#: lib/block_scout_web/templates/chain/show.html.eex:69
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:48
#: lib/block_scout_web/templates/transaction/index.html.eex:48
@@ -571,8 +539,8 @@ msgid "Newer"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token/index.html.eex:140
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:134
+#: lib/block_scout_web/templates/address_token/index.html.eex:25
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:34
msgid "Next"
msgstr ""
@@ -600,8 +568,8 @@ msgid "OUT"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:178
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:181
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:72
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:73
#: lib/block_scout_web/templates/address_validation/index.html.eex:123
#: lib/block_scout_web/templates/block/index.html.eex:20
#: lib/block_scout_web/templates/block_transaction/index.html.eex:50
@@ -613,7 +581,7 @@ msgid "Older"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:136
+#: lib/block_scout_web/templates/address_contract/index.html.eex:26
msgid "Optimization enabled"
msgstr ""
@@ -686,24 +654,12 @@ msgid "Query"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:56
-#: lib/block_scout_web/templates/address_contract/index.html.eex:110
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:59
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:109
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:55
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:66
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:95
-#: lib/block_scout_web/templates/address_token/index.html.eex:57
-#: lib/block_scout_web/templates/address_token/index.html.eex:65
-#: lib/block_scout_web/templates/address_token/index.html.eex:116
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:51
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:59
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:100
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:60
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:110
+#: lib/block_scout_web/templates/address/_tabs.html.eex:56
+#: lib/block_scout_web/templates/address/_tabs.html.eex:107
#: lib/block_scout_web/templates/address_validation/index.html.eex:53
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:33
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:75
+#: lib/block_scout_web/views/address_view.ex:221
#: lib/block_scout_web/views/tokens/overview_view.ex:35
msgid "Read Contract"
msgstr ""
@@ -790,7 +746,7 @@ msgid "There are no holders for this Token."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:172
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:66
msgid "There are no internal transactions for this address."
msgstr ""
@@ -806,7 +762,7 @@ msgid "There are no logs for this transaction."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:128
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:28
msgid "There are no token transfers for this address."
msgstr ""
@@ -816,7 +772,7 @@ msgid "There are no token transfers for this transaction."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_token/index.html.eex:133
+#: lib/block_scout_web/templates/address_token/index.html.eex:18
msgid "There are no tokens for this address."
msgstr ""
@@ -826,7 +782,7 @@ msgid "There are no tokens."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:175
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:67
#: lib/block_scout_web/templates/block_transaction/index.html.eex:44
msgid "There are no transactions for this address."
msgstr ""
@@ -847,10 +803,10 @@ msgid "This transaction is pending confirmation."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:140
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:143
-#: lib/block_scout_web/views/address_internal_transaction_view.ex:9
-#: lib/block_scout_web/views/address_transaction_view.ex:9
+#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:34
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:35
+#: lib/block_scout_web/views/address_internal_transaction_view.ex:6
+#: lib/block_scout_web/views/address_transaction_view.ex:6
msgid "To"
msgstr ""
@@ -897,25 +853,14 @@ msgid "Token Transfers"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:19
-#: lib/block_scout_web/templates/address_contract/index.html.eex:81
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:20
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:79
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:19
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:75
-#: lib/block_scout_web/templates/address_token/index.html.eex:18
-#: lib/block_scout_web/templates/address_token/index.html.eex:76
-#: lib/block_scout_web/templates/address_token/index.html.eex:85
-#: lib/block_scout_web/templates/address_token/index.html.eex:126
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:70
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:79
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:112
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:20
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:79
+#: lib/block_scout_web/templates/address/_tabs.html.eex:13
+#: lib/block_scout_web/templates/address/_tabs.html.eex:76
+#: lib/block_scout_web/templates/address_token/index.html.eex:11
+#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:12
#: lib/block_scout_web/templates/address_validation/index.html.eex:18
#: lib/block_scout_web/templates/address_validation/index.html.eex:62
#: lib/block_scout_web/templates/address_validation/index.html.eex:70
+#: lib/block_scout_web/views/address_view.ex:217
msgid "Tokens"
msgstr ""
@@ -950,22 +895,11 @@ msgid "Transaction Details"
msgstr ""
#, elixir-format
+#: lib/block_scout_web/templates/address/_tabs.html.eex:5
+#: lib/block_scout_web/templates/address/_tabs.html.eex:71
#: lib/block_scout_web/templates/address/index.html.eex:28
#: lib/block_scout_web/templates/address/overview.html.eex:27
-#: lib/block_scout_web/templates/address_contract/index.html.eex:12
-#: lib/block_scout_web/templates/address_contract/index.html.eex:76
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:13
-#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:74
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:12
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:70
-#: lib/block_scout_web/templates/address_token/index.html.eex:11
-#: lib/block_scout_web/templates/address_token/index.html.eex:80
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:11
-#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:74
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:13
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:71
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:74
-#: lib/block_scout_web/templates/address_transaction/index.html.eex:167
+#: lib/block_scout_web/templates/address_transaction/index.html.eex:59
#: lib/block_scout_web/templates/address_validation/index.html.eex:11
#: lib/block_scout_web/templates/address_validation/index.html.eex:65
#: lib/block_scout_web/templates/block_transaction/index.html.eex:13
@@ -976,6 +910,7 @@ msgstr ""
#: lib/block_scout_web/templates/layout/_topnav.html.eex:24
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:56
#: lib/block_scout_web/templates/transaction/index.html.eex:56
+#: lib/block_scout_web/views/address_view.ex:218
msgid "Transactions"
msgstr ""
@@ -1024,7 +959,7 @@ msgid "Value"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract/index.html.eex:122
+#: lib/block_scout_web/templates/address_contract/index.html.eex:12
msgid "Verify & Publish"
msgstr ""
@@ -1094,7 +1029,7 @@ msgid "decimals"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_read_contract/index.html.eex:105
+#: lib/block_scout_web/templates/address_read_contract/index.html.eex:12
#: lib/block_scout_web/templates/tokens/read_contract/index.html.eex:19
msgid "loading..."
msgstr ""
@@ -1121,3 +1056,13 @@ msgstr ""
#: lib/block_scout_web/templates/address/index.html.eex:8
msgid "total addresses with a balance"
msgstr ""
+
+#, elixir-format
+#: lib/block_scout_web/views/address_contract_view.ex:16
+msgid "false"
+msgstr ""
+
+#, elixir-format
+#: lib/block_scout_web/views/address_contract_view.ex:15
+msgid "true"
+msgstr ""
diff --git a/apps/block_scout_web/test/block_scout_web/views/address_contract_view_test.exs b/apps/block_scout_web/test/block_scout_web/views/address_contract_view_test.exs
new file mode 100644
index 0000000000..e483bfc7ea
--- /dev/null
+++ b/apps/block_scout_web/test/block_scout_web/views/address_contract_view_test.exs
@@ -0,0 +1,17 @@
+defmodule BlockScoutWeb.AddressContractViewTest do
+ use BlockScoutWeb.ConnCase, async: true
+
+ alias BlockScoutWeb.AddressContractView
+
+ doctest BlockScoutWeb.AddressContractView
+
+ describe "format_optimization_text/1" do
+ test "returns \"true\" for the boolean true" do
+ assert AddressContractView.format_optimization_text(true) == "true"
+ end
+
+ test "returns \"false\" for the boolean false" do
+ assert AddressContractView.format_optimization_text(false) == "false"
+ end
+ end
+end
diff --git a/apps/block_scout_web/test/block_scout_web/views/address_view_test.exs b/apps/block_scout_web/test/block_scout_web/views/address_view_test.exs
index 50a9651dd5..2d8843a680 100644
--- a/apps/block_scout_web/test/block_scout_web/views/address_view_test.exs
+++ b/apps/block_scout_web/test/block_scout_web/views/address_view_test.exs
@@ -2,7 +2,7 @@ defmodule BlockScoutWeb.AddressViewTest do
use BlockScoutWeb.ConnCase, async: true
alias Explorer.Chain.{Address, Data, Hash, Transaction}
- alias BlockScoutWeb.AddressView
+ alias BlockScoutWeb.{AddressView, Endpoint}
describe "address_partial_selector/4" do
test "for a pending transaction contract creation to address" do
@@ -289,4 +289,36 @@ defmodule BlockScoutWeb.AddressViewTest do
assert AddressView.token_title(token) == "super token money (ST$)"
end
end
+
+ describe "current_tab_name/1" do
+ test "generates the correct tab name for the token path" do
+ path = address_token_path(Endpoint, :index, "0x4ddr3s")
+
+ assert AddressView.current_tab_name(path) == "Tokens"
+ end
+
+ test "generates the correct tab name for the transactions path" do
+ path = address_transaction_path(Endpoint, :index, "0x4ddr3s")
+
+ assert AddressView.current_tab_name(path) == "Transactions"
+ end
+
+ test "generates the correct tab name for the internal transactions path" do
+ path = address_internal_transaction_path(Endpoint, :index, "0x4ddr3s")
+
+ assert AddressView.current_tab_name(path) == "Internal Transactions"
+ end
+
+ test "generates the correct tab name for the contracts path" do
+ path = address_contract_path(Endpoint, :index, "0x4ddr3s")
+
+ assert AddressView.current_tab_name(path) == "Code"
+ end
+
+ test "generates the correct tab name for the read_contract path" do
+ path = address_read_contract_path(Endpoint, :index, "0x4ddr3s")
+
+ assert AddressView.current_tab_name(path) == "Read Contract"
+ end
+ end
end