-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smart contract verification improvements (#6481)
* Refactor smart contract verification form; Add support for smart contract verification without creation bytecode * Add compiler settings for smart contracts verified via standard JSON input or Sourcify * Add verified twin name as fallback name for unverified contract; Fix compiler label
- Loading branch information
1 parent
6a96959
commit a63db41
Showing
25 changed files
with
287 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._scout_web/templates/address_contract_verification_common_fields/_compiler_field.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...eb/templates/address_contract_verification_common_fields/_fetch_constructor_args.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 17 additions & 17 deletions
34
...plates/address_contract_verification_common_fields/_include_nightly_builds_field.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<div class="smart-contract-form-group"> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label @f, "Include nightly builds" %> | ||
<div class="center-column"> | ||
<div class="form-radios-group"> | ||
<div class="radio-big"> | ||
<%= radio_button @f, :nightly_builds, false, checked: true, class: "form-check-input nightly-builds-false" %> | ||
<div class="radio-icon"></div> | ||
<%= label :nightly_builds, :false, gettext("No"), class: "radio-text" %> | ||
</div> | ||
<div class="radio-big"> | ||
<%= radio_button @f, :nightly_builds, true, class: "form-check-input nightly-builds-true", "aria-describedby": "nightly_builds-help-block" %> | ||
<div class="radio-icon"></div> | ||
<%= label :nightly_builds, :true, gettext("Yes"), class: "radio-text" %> | ||
</div> | ||
</div> | ||
<%= error_tag @f, :nightly_builds, id: "nightly_builds-help-block", class: "text-danger form-error" %> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label @f, :nightly_builds, gettext("Include nightly builds") %> | ||
<div class="center-column"> | ||
<div class="form-radios-group"> | ||
<div class="radio-big"> | ||
<%= radio_button @f, :nightly_builds, false, checked: true, class: "form-check-input nightly-builds-false" %> | ||
<div class="radio-icon"></div> | ||
<%= label @f, :nightly_builds_false, gettext("No"), class: "radio-text" %> | ||
</div> | ||
<div class="radio-big"> | ||
<%= radio_button @f, :nightly_builds, true, class: "form-check-input nightly-builds-true", "aria-describedby": "nightly_builds-help-block" %> | ||
<div class="radio-icon"></div> | ||
<%= label @f, :nightly_builds_true, gettext("Yes"), class: "radio-text" %> | ||
</div> | ||
<div class="smart-contract-form-group-tooltip">Select yes if you want to show nightly builds.</div> | ||
</div> | ||
<%= error_tag @f, :nightly_builds, id: "nightly_builds-help-block", class: "text-danger form-error" %> | ||
</div> | ||
<div class="smart-contract-form-group-tooltip"><%= gettext("Select yes if you want to show nightly builds.") %></div> | ||
</div> | ||
</div> |
9 changes: 4 additions & 5 deletions
9
...scout_web/templates/address_contract_verification_common_fields/_libraries_other.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<%= for library_index <- 2..Application.get_env(:block_scout_web, :verification_max_libraries) do %> | ||
<% library = "library" <> to_string(library_index) |> String.to_atom() %> | ||
<div class="contract-library-form-group js-contract-library-form-group"> | ||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", library: library, index: library_index %> | ||
<div class="contract-library-form-group js-contract-library-form-group"> | ||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", index: library_index %> | ||
|
||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: library, index: library_index %> | ||
</div> | ||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", index: library_index %> | ||
</div> | ||
<% end %> |
8 changes: 4 additions & 4 deletions
8
...scout_web/templates/address_contract_verification_common_fields/_library_address.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<% library_address = "library" <> to_string(@index) <> "_address" |> String.to_atom() %> | ||
<div class="smart-contract-form-group"> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label :external_libraries, @library, gettext("Library") <> " " <> to_string(@index) <> " " <> gettext("Address") %> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label :external_libraries, library_address, gettext("Library") <> " " <> to_string(@index) <> " " <> gettext("Address") %> | ||
<div class="center-column"> | ||
<%= text_input :external_libraries, library_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %> | ||
<%= text_input :external_libraries, library_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %> | ||
</div> | ||
<div class="smart-contract-form-group-tooltip"><%= if assigns[:tooltip_text] do @tooltip_text end %></div> | ||
</div> | ||
</div> | ||
</div> |
18 changes: 8 additions & 10 deletions
18
...k_scout_web/templates/address_contract_verification_common_fields/_library_first.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<div class="contract-library-form-group js-contract-library-form-group active"> | ||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", | ||
library: :library1, | ||
index: 1, | ||
tooltip_text: gettext("A library name called in the .sol file. Multiple libraries (up to ") <> to_string(Application.get_env(:block_scout_web, :verification_max_libraries)) <> gettext(") may be added for each contract. Click the Add Library button to add an additional one.") | ||
%> | ||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_name.html", | ||
index: 1, | ||
tooltip_text: gettext("A library name called in the .sol file. Multiple libraries (up to ") <> to_string(Application.get_env(:block_scout_web, :verification_max_libraries)) <> gettext(") may be added for each contract. Click the Add Library button to add an additional one.") | ||
%> | ||
|
||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", | ||
library: :library1, | ||
index: 1, | ||
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_address.html", | ||
index: 1, | ||
tooltip_text: gettext "The 0x library address. This can be found in the generated json file or Truffle output (if using truffle)." | ||
%> | ||
</div> |
14 changes: 7 additions & 7 deletions
14
...ck_scout_web/templates/address_contract_verification_common_fields/_library_name.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<% library_name = "library" <> to_string(@index) <> "_name" |> String.to_atom() %> | ||
<div class="smart-contract-form-group"> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label :external_libraries, @library, gettext("Library") <> " " <> to_string(@index) <> " " <> gettext("Name") %> | ||
<div class="center-column"> | ||
<%= text_input :external_libraries, library_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %> | ||
</div> | ||
<div class="smart-contract-form-group-tooltip"><%= if assigns[:tooltip_text] do @tooltip_text end %></div> | ||
</div> | ||
<div class="smart-contract-form-group-inner-wrapper"> | ||
<%= label :external_libraries, library_name, gettext("Library") <> " " <> to_string(@index) <> " " <> gettext("Name") %> | ||
<div class="center-column"> | ||
<%= text_input :external_libraries, library_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %> | ||
</div> | ||
<div class="smart-contract-form-group-tooltip"><%= if assigns[:tooltip_text] do @tooltip_text end %></div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ck_scout_web/templates/address_contract_verification_via_standard_json_input/new.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.