<%= form_for @changeset,
address_contract_verification_path(@conn, :create),
- [id: "json-dropzone-form"],
+ [id: "standard-json-dropzone-form"],
fn f -> %>
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_contract_address_field.html", address_hash: @address_hash, f: f %>
@@ -53,7 +49,7 @@
>
<%= render BlockScoutWeb.CommonComponentsView, "_loading_spinner.html", loading_text: gettext("Loading...") %>
-
<%= reset gettext("Reset"), class: "btn-line mr-2 js-smart-contract-form-reset" %>
<%=
link(
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex
index fd5a919e8c..327343e0d4 100644
--- a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex
+++ b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex
@@ -13,38 +13,11 @@
[],
fn f -> %>
-
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_contract_address_field.html", address_hash: @address_hash, f: f %>
-
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_contract_name_field.html", f: f, tooltip: "Must match the name specified in the code. For example, in
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_compiler_field.html", f: f, compiler_version: compiler_version, compiler_versions: @compiler_versions %>
-
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_constructor_args.html", f: f, display_constructor_arguments_text_area: "block" %>
+
+
+
diff --git a/apps/block_scout_web/lib/block_scout_web/web_router.ex b/apps/block_scout_web/lib/block_scout_web/web_router.ex
index 401432c10b..4b58f3ec96 100644
--- a/apps/block_scout_web/lib/block_scout_web/web_router.ex
+++ b/apps/block_scout_web/lib/block_scout_web/web_router.ex
@@ -140,7 +140,7 @@ defmodule BlockScoutWeb.WebRouter do
)
resources(
- "/verify-via-json",
+ "/verify-via-metadata-json",
AddressContractVerificationViaJsonController,
only: [:new],
as: :verify_contract_via_json
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot
index 0eb7d65dc1..5db15c800c 100644
--- a/apps/block_scout_web/priv/gettext/default.pot
+++ b/apps/block_scout_web/priv/gettext/default.pot
@@ -135,7 +135,6 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_constructor_args.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:62
msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr ""
@@ -488,11 +487,11 @@ msgid "Call Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:114
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:231
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:48
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:60
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:85 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:150
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:41
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:56
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:53 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel"
msgstr ""
@@ -587,7 +586,6 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_compiler_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:40
msgid "Compiler"
msgstr ""
@@ -615,7 +613,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:2
#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:11
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:2
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:9
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:7
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:6 lib/block_scout_web/templates/tokens/holder/index.html.eex:15
msgid "Connection Lost"
msgstr ""
@@ -659,11 +657,7 @@ msgid "Contract ABI"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:14
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_address_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:23
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:9
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:18 lib/block_scout_web/views/address_view.ex:102
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_address_field.html.eex:3 lib/block_scout_web/views/address_view.ex:102
msgid "Contract Address"
msgstr ""
@@ -690,14 +684,13 @@ msgid "Contract Creation Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:100
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:91
msgid "Contract Libraries"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:93
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_name_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:29
msgid "Contract Name"
msgstr ""
@@ -992,12 +985,12 @@ msgid "Download"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:26
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:18
msgid "Drop sources and metadata JSON file or click here"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:33
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:29
msgid "Drop the standard input JSON file or click here"
msgstr ""
@@ -1040,7 +1033,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:76
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:40
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:31
msgid "EVM Version"
msgstr ""
@@ -1060,12 +1053,12 @@ msgid "Emission Reward"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:82
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:73
msgid "Enter the Solidity Contract Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:51
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:24
msgid "Enter the Vyper Contract Code"
msgstr ""
@@ -1426,20 +1419,12 @@ msgid "Less than"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:115
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:137
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:159
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:181
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:203
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:3
msgid "Library Address"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:105
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:127
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:149
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:171
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:193
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:3
msgid "Library Name"
msgstr ""
@@ -1484,11 +1469,11 @@ msgid "Loading chart..."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:79
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:225
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:42
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:54
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:79 lib/block_scout_web/templates/address_read_contract/index.html.eex:12
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:70
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:144
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:35
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:50
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:47 lib/block_scout_web/templates/address_read_contract/index.html.eex:12
#: lib/block_scout_web/templates/address_read_proxy/index.html.eex:12 lib/block_scout_web/templates/address_write_contract/index.html.eex:12
#: lib/block_scout_web/templates/address_write_proxy/index.html.eex:12 lib/block_scout_web/templates/tokens/contract/index.html.eex:16
msgid "Loading..."
@@ -1672,7 +1657,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:5
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:5
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:14
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:10
msgid "New Smart Contract Verification"
msgstr ""
@@ -1687,9 +1672,9 @@ msgid "New Vyper Smart Contract Verification"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:82
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89 lib/block_scout_web/templates/address_contract_verification/new.html.eex:97
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:80 lib/block_scout_web/templates/address_contract_verification/new.html.eex:88
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:96
msgid "Next"
msgstr ""
@@ -1701,7 +1686,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_fetch_constructor_args.html.eex:9
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_include_nightly_builds_field.html.eex:9
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:56 lib/block_scout_web/templates/stakes/_rows.html.eex:24
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:47 lib/block_scout_web/templates/stakes/_rows.html.eex:24
msgid "No"
msgstr ""
@@ -1769,7 +1754,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:70
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:72
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:63
msgid "Optimization runs"
msgstr ""
@@ -1990,10 +1975,10 @@ msgid "Request URL"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:228
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:45
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:57
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:82
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:147
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:38
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:53
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:50
msgid "Reset"
msgstr ""
@@ -2178,7 +2163,7 @@ msgid "Source Pool"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:19
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:14
msgid "Sources and Metadata JSON"
msgstr ""
@@ -2245,7 +2230,7 @@ msgid "Staking epochs are not specified or not in the allowed range"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:29
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:25
msgid "Standard Input JSON"
msgstr ""
@@ -3003,10 +2988,10 @@ msgid "Verify & Publish"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:227
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:44
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:56
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:81
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:146
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:37
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:52
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:49
msgid "Verify & publish"
msgstr ""
@@ -3022,17 +3007,17 @@ msgid "Version"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:42
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:33
msgid "Via Sourcify: Sources and metadata JSON file"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:36
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:27
msgid "Via Standard Input JSON"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:31
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:22
msgid "Via flattened source code"
msgstr ""
@@ -3088,7 +3073,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:48
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:39
msgid "Vyper contract"
msgstr ""
@@ -3167,7 +3152,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_fetch_constructor_args.html.eex:14
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_include_nightly_builds_field.html.eex:14
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:61 lib/block_scout_web/templates/stakes/_rows.html.eex:24
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:52 lib/block_scout_web/templates/stakes/_rows.html.eex:24
msgid "Yes"
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 0eb7d65dc1..5db15c800c 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
@@ -135,7 +135,6 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_constructor_args.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:62
msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr ""
@@ -488,11 +487,11 @@ msgid "Call Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:114
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:231
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:48
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:60
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:85 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:150
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:41
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:56
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:53 lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:54
msgid "Cancel"
msgstr ""
@@ -587,7 +586,6 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_compiler_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:40
msgid "Compiler"
msgstr ""
@@ -615,7 +613,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:2
#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:11
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:2
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:9
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:7
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:6 lib/block_scout_web/templates/tokens/holder/index.html.eex:15
msgid "Connection Lost"
msgstr ""
@@ -659,11 +657,7 @@ msgid "Contract ABI"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:14
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_address_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:23
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:9
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:18 lib/block_scout_web/views/address_view.ex:102
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_address_field.html.eex:3 lib/block_scout_web/views/address_view.ex:102
msgid "Contract Address"
msgstr ""
@@ -690,14 +684,13 @@ msgid "Contract Creation Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:100
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:91
msgid "Contract Libraries"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:93
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_contract_name_field.html.eex:3
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:29
msgid "Contract Name"
msgstr ""
@@ -992,12 +985,12 @@ msgid "Download"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:26
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:18
msgid "Drop sources and metadata JSON file or click here"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:33
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:29
msgid "Drop the standard input JSON file or click here"
msgstr ""
@@ -1040,7 +1033,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:76
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:40
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:31
msgid "EVM Version"
msgstr ""
@@ -1060,12 +1053,12 @@ msgid "Emission Reward"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:82
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:73
msgid "Enter the Solidity Contract Code"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:51
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:24
msgid "Enter the Vyper Contract Code"
msgstr ""
@@ -1426,20 +1419,12 @@ msgid "Less than"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:115
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:137
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:159
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:181
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:203
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:3
msgid "Library Address"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:105
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:127
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:149
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:171
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:193
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:3
msgid "Library Name"
msgstr ""
@@ -1484,11 +1469,11 @@ msgid "Loading chart..."
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:79
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:225
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:42
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:54
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:79 lib/block_scout_web/templates/address_read_contract/index.html.eex:12
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:70
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:144
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:35
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:50
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:47 lib/block_scout_web/templates/address_read_contract/index.html.eex:12
#: lib/block_scout_web/templates/address_read_proxy/index.html.eex:12 lib/block_scout_web/templates/address_write_contract/index.html.eex:12
#: lib/block_scout_web/templates/address_write_proxy/index.html.eex:12 lib/block_scout_web/templates/tokens/contract/index.html.eex:16
msgid "Loading..."
@@ -1672,7 +1657,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:5
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:5
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:14
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:10
msgid "New Smart Contract Verification"
msgstr ""
@@ -1687,9 +1672,9 @@ msgid "New Vyper Smart Contract Verification"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:82
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89 lib/block_scout_web/templates/address_contract_verification/new.html.eex:97
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:80 lib/block_scout_web/templates/address_contract_verification/new.html.eex:88
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:96
msgid "Next"
msgstr ""
@@ -1701,7 +1686,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_fetch_constructor_args.html.eex:9
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_include_nightly_builds_field.html.eex:9
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:56 lib/block_scout_web/templates/stakes/_rows.html.eex:24
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:47 lib/block_scout_web/templates/stakes/_rows.html.eex:24
msgid "No"
msgstr ""
@@ -1769,7 +1754,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract/index.html.eex:70
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:72
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:63
msgid "Optimization runs"
msgstr ""
@@ -1990,10 +1975,10 @@ msgid "Request URL"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:228
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:45
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:57
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:82
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:147
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:38
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:53
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:50
msgid "Reset"
msgstr ""
@@ -2178,7 +2163,7 @@ msgid "Source Pool"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:19
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:14
msgid "Sources and Metadata JSON"
msgstr ""
@@ -2245,7 +2230,7 @@ msgid "Staking epochs are not specified or not in the allowed range"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:29
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:25
msgid "Standard Input JSON"
msgstr ""
@@ -3003,10 +2988,10 @@ msgid "Verify & Publish"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:227
-#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:44
-#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:56
-#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:81
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:146
+#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:37
+#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:52
+#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:49
msgid "Verify & publish"
msgstr ""
@@ -3022,17 +3007,17 @@ msgid "Version"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:42
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:33
msgid "Via Sourcify: Sources and metadata JSON file"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:36
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:27
msgid "Via Standard Input JSON"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:31
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:22
msgid "Via flattened source code"
msgstr ""
@@ -3088,7 +3073,7 @@ msgid "View transaction %{transaction} on %{subnetwork}"
msgstr ""
#, elixir-format
-#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:48
+#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:39
msgid "Vyper contract"
msgstr ""
@@ -3167,7 +3152,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_fetch_constructor_args.html.eex:14
#: lib/block_scout_web/templates/address_contract_verification_common_fields/_include_nightly_builds_field.html.eex:14
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:61 lib/block_scout_web/templates/stakes/_rows.html.eex:24
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:52 lib/block_scout_web/templates/stakes/_rows.html.eex:24
msgid "Yes"
msgstr ""
diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex
index fc5d6efd27..53f05fbf9e 100644
--- a/apps/explorer/lib/explorer/chain.ex
+++ b/apps/explorer/lib/explorer/chain.ex
@@ -4152,47 +4152,48 @@ defmodule Explorer.Chain do
Finds metadata for verification of a contract from verified twins: contracts with the same bytecode
which were verified previously, returns a single t:SmartContract.t/0
"""
- def get_address_verified_twin_contract(address_hash) do
- case Repo.get(Address, address_hash) do
- nil ->
- %{:verified_contract => nil, :additional_sources => nil}
+ def get_address_verified_twin_contract(hash) when is_binary(hash) do
+ case string_to_address_hash(hash) do
+ {:ok, address_hash} -> get_address_verified_twin_contract(address_hash)
+ _ -> %{:verified_contract => nil, :additional_sources => nil}
+ end
+ end
- target_address ->
- target_address_hash = target_address.hash
- contract_code = target_address.contract_code
+ def get_address_verified_twin_contract(%Explorer.Chain.Hash{} = address_hash) do
+ with target_address <- Repo.get(Address, address_hash),
+ false <- is_nil(target_address),
+ %{contract_code: %Chain.Data{bytes: contract_code_bytes}} <- target_address do
+ target_address_hash = target_address.hash
- case contract_code do
- %Chain.Data{bytes: contract_code_bytes} ->
- contract_code_md5 =
- Base.encode16(:crypto.hash(:md5, "\\x" <> Base.encode16(contract_code_bytes, case: :lower)),
- case: :lower
- )
-
- verified_contract_twin_query =
- from(
- address in Address,
- inner_join: smart_contract in SmartContract,
- on: address.hash == smart_contract.address_hash,
- where: fragment("md5(contract_code::text)") == ^contract_code_md5,
- where: address.hash != ^target_address_hash,
- select: smart_contract,
- limit: 1
- )
+ contract_code_md5 =
+ Base.encode16(:crypto.hash(:md5, "\\x" <> Base.encode16(contract_code_bytes, case: :lower)),
+ case: :lower
+ )
- verified_contract_twin =
- verified_contract_twin_query
- |> Repo.one(timeout: 10_000)
+ verified_contract_twin_query =
+ from(
+ address in Address,
+ inner_join: smart_contract in SmartContract,
+ on: address.hash == smart_contract.address_hash,
+ where: fragment("md5(contract_code::text)") == ^contract_code_md5,
+ where: address.hash != ^target_address_hash,
+ select: smart_contract,
+ limit: 1
+ )
- verified_contract_twin_additional_sources = get_contract_additional_sources(verified_contract_twin)
+ verified_contract_twin =
+ verified_contract_twin_query
+ |> Repo.one(timeout: 10_000)
- %{
- :verified_contract => verified_contract_twin,
- :additional_sources => verified_contract_twin_additional_sources
- }
+ verified_contract_twin_additional_sources = get_contract_additional_sources(verified_contract_twin)
- _ ->
- %{:verified_contract => nil, :additional_sources => nil}
- end
+ %{
+ :verified_contract => verified_contract_twin,
+ :additional_sources => verified_contract_twin_additional_sources
+ }
+ else
+ _ ->
+ %{:verified_contract => nil, :additional_sources => nil}
end
end
diff --git a/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex b/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
index e312f88ebf..e947461b11 100644
--- a/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
+++ b/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
@@ -45,7 +45,7 @@ defmodule Explorer.SmartContract.Solidity.Publisher do
end
end
- def publish_with_standart_json_input(%{"address_hash" => address_hash} = params, json_input) do
+ def publish_with_standard_json_input(%{"address_hash" => address_hash} = params, json_input) do
case Verifier.evaluate_authenticity_via_standard_json_input(address_hash, params, json_input) do
{:ok, %{abi: abi, constructor_arguments: constructor_arguments}, additional_params} ->
params_with_constructor_arguments =
diff --git a/apps/explorer/lib/explorer/smart_contract/solidity/publisher_worker.ex b/apps/explorer/lib/explorer/smart_contract/solidity/publisher_worker.ex
index de7962d107..893d5a7934 100644
--- a/apps/explorer/lib/explorer/smart_contract/solidity/publisher_worker.ex
+++ b/apps/explorer/lib/explorer/smart_contract/solidity/publisher_worker.ex
@@ -25,7 +25,7 @@ defmodule Explorer.SmartContract.Solidity.PublisherWorker do
def perform({%{"address_hash" => address_hash} = params, json_input, uid}) when is_binary(uid) do
VerificationStatus.insert_status(uid, :pending, address_hash)
- case Publisher.publish_with_standart_json_input(params, json_input) do
+ case Publisher.publish_with_standard_json_input(params, json_input) do
{:ok, _contract} ->
VerificationStatus.update_status(uid, :pass)
@@ -36,7 +36,7 @@ defmodule Explorer.SmartContract.Solidity.PublisherWorker do
def perform({%{"address_hash" => address_hash} = params, json_input, conn}) do
result =
- case Publisher.publish_with_standart_json_input(params, json_input) do
+ case Publisher.publish_with_standard_json_input(params, json_input) do
{:ok, _contract} = result ->
result