Refactor contract libs render, CONTRACT_VERIFICATION_MAX_LIBRARIES, refactor parsing integer env vars in config
parent
9b6b480495
commit
e4ffc16589
@ -0,0 +1,8 @@ |
||||
<%= 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 %> |
||||
|
||||
<%= render BlockScoutWeb.AddressContractVerificationCommonFieldsView, "_library_address.html", library: library, index: library_index %> |
||||
</div> |
||||
<% end %> |
@ -1,8 +1,9 @@ |
||||
<% 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 Address") %> |
||||
<%= label :external_libraries, @library, 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> |
||||
|
@ -0,0 +1,13 @@ |
||||
<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_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)." |
||||
%> |
||||
</div> |
@ -1,8 +1,9 @@ |
||||
<% 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 Name") %> |
||||
<%= 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" %> |
||||
<%= 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> |
||||
|
Loading…
Reference in new issue