diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex
index 85e7d38055..1cee4b5c11 100644
--- a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex
+++ b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex
@@ -79,43 +79,9 @@
<%= gettext "Contract Libraries" %>
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html",
- library: :library1,
- library_name: :library1_name,
- tooltip_text: gettext "A library name called in the .sol file. Multiple libraries (up to 5) may be added for each contract. Click the Add Library button to add an additional one."
- %>
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_first.html" %>
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html",
- library: :library1,
- library_address: :library1_address,
- tooltip_text: gettext "The 0x library address. This can be found in the generated json file or Truffle output (if using truffle)."
- %>
-
-
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", library: :library2, library_name: :library2_name %>
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: :library2, library_address: :library2_address %>
-
-
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", library: :library3, library_name: :library3_name %>
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: :library3, library_address: :library3_address %>
-
-
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", library: :library4, library_name: :library4_name %>
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: :library4, library_address: :library4_address %>
-
-
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", library: :library5, library_name: :library5_name %>
-
- <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: :library5, library_address: :library5_address %>
-
+ <%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_libraries_other.html" %>
<%= gettext "Add Library" %>
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot
index 65482ecf33..380a4bfc19 100644
--- a/apps/block_scout_web/priv/gettext/default.pot
+++ b/apps/block_scout_web/priv/gettext/default.pot
@@ -91,12 +91,6 @@ msgstr ""
msgid "A block producer who successfully included the block onto the blockchain."
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:92
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:86
-#, elixir-autogen, elixir-format
-msgid "A library name called in the .sol file. Multiple libraries (up to 5) may be added for each contract. Click the Add Library button to add an additional one."
-msgstr ""
-
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:73
#, elixir-autogen, elixir-format
msgid "A string with the name of the action to be invoked."
@@ -192,8 +186,8 @@ msgstr ""
msgid "Add Custom ABI"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:127
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:121
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:93
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:87
#, elixir-autogen, elixir-format
msgid "Add Library"
msgstr ""
@@ -225,6 +219,7 @@ msgstr ""
#: lib/block_scout_web/templates/account/watchlist/show.html.eex:23
#: lib/block_scout_web/templates/account/watchlist_address/form.html.eex:12
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:16
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:4
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:20
#: lib/block_scout_web/views/address_view.ex:107
#, elixir-autogen, elixir-format
@@ -501,9 +496,9 @@ msgstr ""
#: lib/block_scout_web/templates/account/public_tags_request/form.html.eex:62
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:120
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:145
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:111
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:41
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:141
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:107
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:55
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:51
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
@@ -1472,16 +1467,6 @@ msgstr ""
msgid "Less than"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:3
-#, elixir-autogen, elixir-format
-msgid "Library Address"
-msgstr ""
-
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:3
-#, elixir-autogen, elixir-format
-msgid "Library Name"
-msgstr ""
-
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:24
#, elixir-autogen, elixir-format
msgid "License Expires"
@@ -1518,9 +1503,9 @@ msgid "Loading chart..."
msgstr ""
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:77
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:139
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:105
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:35
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:133
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:99
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:49
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:45
#: lib/block_scout_web/templates/address_read_contract/index.html.eex:41
@@ -1676,6 +1661,7 @@ msgstr ""
#: lib/block_scout_web/templates/account/tag_transaction/index.html.eex:22
#: lib/block_scout_web/templates/account/watchlist/show.html.eex:22
#: lib/block_scout_web/templates/account/watchlist_address/form.html.eex:19
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:4
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:59
#: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:4
@@ -2047,9 +2033,9 @@ msgstr ""
msgid "Request to edit a public tag/label"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:142
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:108
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:38
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:138
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:104
#: 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:48
#, elixir-autogen, elixir-format
@@ -2292,8 +2278,7 @@ msgstr ""
msgid "Test Networks"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:98
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:92
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:11
#, elixir-autogen, elixir-format
msgid "The 0x library address. This can be found in the generated json file or Truffle output (if using truffle)."
msgstr ""
@@ -2940,9 +2925,9 @@ msgstr ""
msgid "Verify & Publish"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:141
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:107
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:37
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:137
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:103
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:51
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:47
#, elixir-autogen, elixir-format
@@ -3261,3 +3246,19 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Indexing Internal Transactions"
msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:5
+#, elixir-autogen, elixir-format
+msgid ") may be added for each contract. Click the Add Library button to add an additional one."
+msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:5
+#, elixir-autogen, elixir-format
+msgid "A library name called in the .sol file. Multiple libraries (up to "
+msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:4
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:4
+#, elixir-autogen, elixir-format
+msgid "Library"
+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 0046a950b0..ba25c24644 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
@@ -91,12 +91,6 @@ msgstr ""
msgid "A block producer who successfully included the block onto the blockchain."
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:92
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:86
-#, elixir-autogen, elixir-format
-msgid "A library name called in the .sol file. Multiple libraries (up to 5) may be added for each contract. Click the Add Library button to add an additional one."
-msgstr ""
-
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:73
#, elixir-autogen, elixir-format
msgid "A string with the name of the action to be invoked."
@@ -192,8 +186,8 @@ msgstr ""
msgid "Add Custom ABI"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:127
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:121
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:93
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:87
#, elixir-autogen, elixir-format
msgid "Add Library"
msgstr ""
@@ -225,6 +219,7 @@ msgstr ""
#: lib/block_scout_web/templates/account/watchlist/show.html.eex:23
#: lib/block_scout_web/templates/account/watchlist_address/form.html.eex:12
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:16
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:4
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:20
#: lib/block_scout_web/views/address_view.ex:107
#, elixir-autogen, elixir-format
@@ -501,9 +496,9 @@ msgstr ""
#: lib/block_scout_web/templates/account/public_tags_request/form.html.eex:62
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:120
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:145
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:111
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:41
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:141
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:107
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:55
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:51
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
@@ -1472,16 +1467,6 @@ msgstr ""
msgid "Less than"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:3
-#, elixir-autogen, elixir-format
-msgid "Library Address"
-msgstr ""
-
-#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:3
-#, elixir-autogen, elixir-format
-msgid "Library Name"
-msgstr ""
-
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:24
#, elixir-autogen, elixir-format
msgid "License Expires"
@@ -1518,9 +1503,9 @@ msgid "Loading chart..."
msgstr ""
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:77
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:139
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:105
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:35
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:133
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:99
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:49
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:45
#: lib/block_scout_web/templates/address_read_contract/index.html.eex:41
@@ -1676,6 +1661,7 @@ msgstr ""
#: lib/block_scout_web/templates/account/tag_transaction/index.html.eex:22
#: lib/block_scout_web/templates/account/watchlist/show.html.eex:22
#: lib/block_scout_web/templates/account/watchlist_address/form.html.eex:19
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:4
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:59
#: lib/block_scout_web/templates/log/_data_decoded_view.html.eex:4
@@ -2047,9 +2033,9 @@ msgstr ""
msgid "Request to edit a public tag/label"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:142
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:108
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:38
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:138
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:104
#: 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:48
#, elixir-autogen, elixir-format
@@ -2292,8 +2278,7 @@ msgstr ""
msgid "Test Networks"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:98
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:92
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:11
#, elixir-autogen, elixir-format
msgid "The 0x library address. This can be found in the generated json file or Truffle output (if using truffle)."
msgstr ""
@@ -2940,9 +2925,9 @@ msgstr ""
msgid "Verify & Publish"
msgstr ""
-#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:141
+#: lib/block_scout_web/templates/address_contract_verification_via_flattened_code/new.html.eex:107
#: lib/block_scout_web/templates/address_contract_verification_via_json/new.html.eex:37
-#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:137
+#: lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex:103
#: lib/block_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex:51
#: lib/block_scout_web/templates/address_contract_verification_vyper/new.html.eex:47
#, elixir-autogen, elixir-format
@@ -3261,3 +3246,19 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Indexing Internal Transactions"
msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:5
+#, elixir-autogen, elixir-format
+msgid ") may be added for each contract. Click the Add Library button to add an additional one."
+msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex:5
+#, elixir-autogen, elixir-format, fuzzy
+msgid "A library name called in the .sol file. Multiple libraries (up to "
+msgstr ""
+
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex:4
+#: lib/block_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex:4
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Library"
+msgstr ""
diff --git a/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex b/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
index 094d7ed761..e01e780f04 100644
--- a/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
+++ b/apps/explorer/lib/explorer/smart_contract/solidity/publisher.ex
@@ -260,7 +260,7 @@ defmodule Explorer.SmartContract.Solidity.Publisher do
defp add_external_libraries(params, external_libraries) do
clean_external_libraries =
- Enum.reduce(1..10, %{}, fn number, acc ->
+ Enum.reduce(1..Application.get_env(:block_scout_web, :verification_max_libraries), %{}, fn number, acc ->
address_key = "library#{number}_address"
name_key = "library#{number}_name"
diff --git a/config/runtime.exs b/config/runtime.exs
index 67dc3c7d30..5b7209626f 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -2,26 +2,29 @@ import Config
import Bitwise
+indexer_memory_limit_default = 1
+
indexer_memory_limit =
"INDEXER_MEMORY_LIMIT"
- |> System.get_env("1")
+ |> System.get_env(to_string(indexer_memory_limit_default))
|> Integer.parse()
|> case do
{integer, ""} -> integer
- _ -> 1
+ _ -> indexer_memory_limit_default
end
config :indexer,
memory_limit: indexer_memory_limit <<< 30
+indexer_empty_blocks_sanitizer_batch_size_default = 100
+
indexer_empty_blocks_sanitizer_batch_size =
- if System.get_env("INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE") do
- case Integer.parse(System.get_env("INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE")) do
- {integer, ""} -> integer
- _ -> 100
- end
- else
- 100
+ "INDEXER_EMPTY_BLOCKS_SANITIZER_BATCH_SIZE"
+ |> System.get_env(to_string(indexer_empty_blocks_sanitizer_batch_size_default))
+ |> Integer.parse()
+ |> case do
+ {integer, ""} -> integer
+ _ -> indexer_empty_blocks_sanitizer_batch_size_default
end
config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer, batch_size: indexer_empty_blocks_sanitizer_batch_size
@@ -65,6 +68,17 @@ config :block_scout_web, BlockScoutWeb.Chain,
enable_testnet_label: System.get_env("SHOW_TESTNET_LABEL", "false") == "true",
testnet_label_text: System.get_env("TESTNET_LABEL_TEXT", "Testnet")
+verification_max_libraries_default = 10
+
+verification_max_libraries =
+ "CONTRACT_VERIFICATION_MAX_LIBRARIES"
+ |> System.get_env(to_string(verification_max_libraries_default))
+ |> Integer.parse()
+ |> case do
+ {integer, ""} -> integer
+ _ -> verification_max_libraries_default
+ end
+
config :block_scout_web,
link_to_other_explorers: System.get_env("LINK_TO_OTHER_EXPLORERS") == "true",
other_explorers: System.get_env("OTHER_EXPLORERS"),
@@ -85,7 +99,8 @@ config :block_scout_web,
re_captcha_secret_key: System.get_env("RE_CAPTCHA_SECRET_KEY", nil),
re_captcha_client_key: System.get_env("RE_CAPTCHA_CLIENT_KEY", nil),
chain_id: System.get_env("CHAIN_ID"),
- json_rpc: System.get_env("JSON_RPC")
+ json_rpc: System.get_env("JSON_RPC"),
+ verification_max_libraries: verification_max_libraries
default_api_rate_limit = 50
default_api_rate_limit_str = Integer.to_string(default_api_rate_limit)
@@ -217,9 +232,10 @@ address_sum_global_ttl =
|> System.get_env("")
|> Integer.parse()
|> case do
- {integer, ""} -> :timer.seconds(integer)
- _ -> :timer.minutes(60)
+ {integer, ""} -> integer
+ _ -> 3600
end
+ |> :timer.seconds()
config :explorer, Explorer.Chain.Cache.AddressSum, global_ttl: address_sum_global_ttl