diff --git a/CHANGELOG.md b/CHANGELOG.md index 328b70a62a..45a71bcfb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Features - [#2835](https://github.com/poanetwork/blockscout/pull/2835), [#2871](https://github.com/poanetwork/blockscout/pull/2871), [#2872](https://github.com/poanetwork/blockscout/pull/2872), [#2886](https://github.com/poanetwork/blockscout/pull/2886), [#2925](https://github.com/poanetwork/blockscout/pull/2925), [#2936](https://github.com/poanetwork/blockscout/pull/2936), [#2949](https://github.com/poanetwork/blockscout/pull/2949), [#2940](https://github.com/poanetwork/blockscout/pull/2940), [#2958](https://github.com/poanetwork/blockscout/pull/2958) - Add "block_hash" to logs, token_transfers and internal transactions and "pending blocks operations" approach +- [#2975](https://github.com/poanetwork/blockscout/pull/2975) - Refine UX of contracts verification - [#2926](https://github.com/poanetwork/blockscout/pull/2926) - API endpoint: sum balances except burnt address - [#2918](https://github.com/poanetwork/blockscout/pull/2918) - Add tokenID for tokentx API action explicitly diff --git a/apps/block_scout_web/assets/js/pages/verification_form.js b/apps/block_scout_web/assets/js/pages/verification_form.js index 1267d12c39..795cbf757b 100644 --- a/apps/block_scout_web/assets/js/pages/verification_form.js +++ b/apps/block_scout_web/assets/js/pages/verification_form.js @@ -88,6 +88,26 @@ const elements = { const $contractVerificationPage = $('[data-page="contract-verification"]') +function filterNightlyBuilds (filter) { + var select, options + select = document.getElementById('smart_contract_compiler_version') + options = select.getElementsByTagName('option') + for (const option of options) { + var txtValue = option.textContent || option.innerText + if (filter) { + if (txtValue.toLowerCase().indexOf('nightly') > -1) { + option.style.display = 'none' + } else { + option.style.display = '' + } + } else { + if (txtValue.toLowerCase().indexOf('nightly') > -1) { + option.style.display = '' + } + } + } +} + if ($contractVerificationPage.length) { const store = createStore(reducer) const addressHash = $('#smart_contract_address_hash').val() @@ -116,6 +136,10 @@ if ($contractVerificationPage.length) { }) $(function () { + setTimeout(function () { + $('.nightly-builds-false').trigger('click') + }, 10) + $('.js-btn-add-contract-libraries').on('click', function () { $('.js-smart-contract-libraries-wrapper').show() $(this).hide() @@ -129,6 +153,22 @@ if ($contractVerificationPage.length) { if ($(this).prop('checked')) { $('.constructor-arguments').hide() } }) + $('.nightly-builds-true').on('click', function () { + if ($(this).prop('checked')) { filterNightlyBuilds(false) } + }) + + $('.nightly-builds-false').on('click', function () { + if ($(this).prop('checked')) { filterNightlyBuilds(true) } + }) + + $('.optimization-false').on('click', function () { + if ($(this).prop('checked')) { $('.optimization-runs').hide() } + }) + + $('.optimization-true').on('click', function () { + if ($(this).prop('checked')) { $('.optimization-runs').show() } + }) + $('.js-smart-contract-form-reset').on('click', function () { $('.js-contract-library-form-group').removeClass('active') $('.js-contract-library-form-group').first().addClass('active') diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex index ddaa85a18b..1002375ac2 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex @@ -35,6 +35,28 @@ +
+
+ <%= label f, "Include nightly builds" %> +
+
+
+ <%= radio_button f, :nightly_builds, false, checked: true, class: "form-check-input nightly-builds-false" %> +
+ <%= label :nightly_builds, :false, gettext("No"), class: "radio-text" %> +
+
+ <%= radio_button f, :nightly_builds, true, class: "form-check-input nightly-builds-true", "aria-describedby": "nightly_builds-help-block" %> +
+ <%= label :nightly_builds, :true, gettext("Yes"), class: "radio-text" %> +
+
+ <%= error_tag f, :nightly_builds, id: "nightly_builds-help-block", class: "text-danger form-error" %> +
+
Select yes if you want to show nightly builds.
+
+
+
<%= label f, :compiler_version, gettext("Compiler") %> @@ -62,12 +84,12 @@
- <%= radio_button f, :optimization, false, checked: true, class: "form-check-input" %> + <%= radio_button f, :optimization, false, class: "form-check-input optimization-false" %>
<%= label :smart_contract_optimization, :false, gettext("No"), class: "radio-text" %>
- <%= radio_button f, :optimization, true, class: "form-check-input", "aria-describedby": "optimization-help-block" %> + <%= radio_button f, :optimization, true, checked: true, class: "form-check-input optimization-true", "aria-describedby": "optimization-help-block" %>
<%= label :smart_contract_optimization, :true, gettext("Yes"), class: "radio-text" %>
@@ -78,7 +100,7 @@
-
+
<%= label f, :name, gettext("Optimization runs") %>
@@ -110,12 +132,12 @@ <%= label :autodetect_contructor_args, :false, gettext("No"), class: "radio-text" %>
- <%= radio_button f, :autodetect_contructor_args, true, class: "form-check-input autodetecttrue", "aria-describedby": "optimization-help-block" %> + <%= radio_button f, :autodetect_contructor_args, true, class: "form-check-input autodetecttrue", "aria-describedby": "autodetect_contructor_args-help-block" %>
<%= label :autodetect_contructor_args, :true, gettext("Yes"), class: "radio-text" %>
- <%= error_tag f, :autodetect_contructor_args, id: "optimization-help-block", class: "text-danger form-error" %> + <%= error_tag f, :autodetect_contructor_args, id: "autodetect_contructor_args-help-block", class: "text-danger form-error" %>
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index e49e104647..1e2f2ccea3 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:125 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:147 msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgstr "" @@ -266,7 +266,7 @@ msgid "Call Code" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:274 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:296 #: 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" @@ -289,7 +289,7 @@ msgid "Clear" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:40 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:62 msgid "Compiler" msgstr "" @@ -370,7 +370,7 @@ msgid "Contract Creation Code" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161 msgid "Contract Libraries" msgstr "" @@ -579,7 +579,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract/index.html.eex:45 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73 msgid "EVM Version" msgstr "" @@ -599,7 +599,7 @@ msgid "Emission Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:93 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 msgid "Enter the Solidity Contract Code" msgstr "" @@ -971,20 +971,20 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:154 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:264 msgid "Library Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:144 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:254 msgid "Library Name" msgstr "" @@ -1010,7 +1010,7 @@ msgid "Loading..." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:268 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:290 msgid "Loading...." msgstr "" @@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:67 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:110 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132 msgid "No" msgstr "" @@ -1114,7 +1115,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract/index.html.eex:39 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:83 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105 msgid "Optimization runs" msgstr "" @@ -1218,7 +1219,7 @@ msgid "Request URL" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:271 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:293 msgid "Reset" msgstr "" @@ -1580,7 +1581,7 @@ msgid "Verify & Publish" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:270 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:292 msgid "Verify & publish" msgstr "" @@ -1654,8 +1655,9 @@ msgid "Wei" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:72 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:94 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:137 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 e49e104647..1e2f2ccea3 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 @@ -87,7 +87,7 @@ msgid "A string with the name of the module to be invoked." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:125 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:147 msgid "ABI-encoded Constructor Arguments (if required by the contract)" msgstr "" @@ -266,7 +266,7 @@ msgid "Call Code" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:274 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:296 #: 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" @@ -289,7 +289,7 @@ msgid "Clear" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:40 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:62 msgid "Compiler" msgstr "" @@ -370,7 +370,7 @@ msgid "Contract Creation Code" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161 msgid "Contract Libraries" msgstr "" @@ -579,7 +579,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract/index.html.eex:45 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:73 msgid "EVM Version" msgstr "" @@ -599,7 +599,7 @@ msgid "Emission Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:93 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 msgid "Enter the Solidity Contract Code" msgstr "" @@ -971,20 +971,20 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:154 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:176 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:198 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:220 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:242 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:264 msgid "Library Address" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:144 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:166 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:188 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:210 #: lib/block_scout_web/templates/address_contract_verification/new.html.eex:232 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:254 msgid "Library Name" msgstr "" @@ -1010,7 +1010,7 @@ msgid "Loading..." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:268 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:290 msgid "Loading...." msgstr "" @@ -1096,8 +1096,9 @@ msgid "New Smart Contract Verification" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:67 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:110 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:46 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:89 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132 msgid "No" msgstr "" @@ -1114,7 +1115,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_contract/index.html.eex:39 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:83 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:105 msgid "Optimization runs" msgstr "" @@ -1218,7 +1219,7 @@ msgid "Request URL" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:271 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:293 msgid "Reset" msgstr "" @@ -1580,7 +1581,7 @@ msgid "Verify & Publish" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:270 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:292 msgid "Verify & publish" msgstr "" @@ -1654,8 +1655,9 @@ msgid "Wei" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:72 -#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:115 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:51 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:94 +#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:137 msgid "Yes" msgstr ""