Merge pull request #2071 from poanetwork/feature/#1726-changes-for-new-smart-contract-page

(Feature) Changes for new smart contract page
pull/2098/head
Victor Baranov 5 years ago committed by GitHub
commit 3a238c2ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/block_scout_web/assets/css/_mixins.scss
  3. 6
      apps/block_scout_web/assets/css/app.scss
  4. 12
      apps/block_scout_web/assets/css/components/_btn_no_border.scss
  5. 4
      apps/block_scout_web/assets/css/components/_form.scss
  6. 204
      apps/block_scout_web/assets/css/components/_new_smart_contract.scss
  7. 55
      apps/block_scout_web/assets/css/components/_radio_big.scss
  8. 1
      apps/block_scout_web/assets/js/app.js
  9. 28
      apps/block_scout_web/assets/js/lib/smart_contract/new_smart_contract_form.js
  10. 317
      apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification/new.html.eex
  11. 122
      apps/block_scout_web/priv/gettext/default.pot
  12. 122
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  13. 2
      apps/block_scout_web/test/block_scout_web/features/pages/contract_verify_page.ex

@ -1,6 +1,7 @@
## Current
### Features
- [#1726](https://github.com/poanetwork/blockscout/pull/2071) - Updated styles for the new smart contract page.
- [#2081](https://github.com/poanetwork/blockscout/pull/2081) - Tooltip for 'more' button, explorers logos added
- [#1963](https://github.com/poanetwork/blockscout/pull/1963), [#1959](https://github.com/poanetwork/blockscout/pull/1959), [#1948](https://github.com/poanetwork/blockscout/pull/1948), [#1936](https://github.com/poanetwork/blockscout/pull/1936), [#1925](https://github.com/poanetwork/blockscout/pull/1925), [#1922](https://github.com/poanetwork/blockscout/pull/1922), [#1903](https://github.com/poanetwork/blockscout/pull/1903), [#1874](https://github.com/poanetwork/blockscout/pull/1874), [#1895](https://github.com/poanetwork/blockscout/pull/1895), [#2031](https://github.com/poanetwork/blockscout/pull/2031), [#2073](https://github.com/poanetwork/blockscout/pull/2073), [#2074](https://github.com/poanetwork/blockscout/pull/2074), - added new themes and logos for poa, eth, rinkeby, goerli, ropsten, kovan, sokol, xdai, etc, rsk and default theme
- [#2010](https://github.com/poanetwork/blockscout/pull/2010) - added "block not found" and "tx not found pages"

@ -88,6 +88,7 @@
padding: 0 15px;
text-decoration: none;
transition: all 0.15s;
white-space: nowrap;
width: fit-content;
&:hover {
@ -135,6 +136,7 @@
padding: 0 15px;
text-decoration: none;
transition: all 0.15s;
white-space: nowrap;
width: fit-content;
&:hover {

@ -123,6 +123,12 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts";
@import "components/verify_other_explorers";
@import "components/errors";
@import "components/log-search";
@import "components/new_smart_contract";
@import "components/radio_big";
@import "components/btn_no_border";
:export {
dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color;
dashboardLineColorMarket: $dashboard-line-color-market;

@ -0,0 +1,12 @@
$btn-no-border-bg: #fff !default;
$btn-no-border-color: $primary !default;
.btn-no-border {
@include btn-line($btn-no-border-bg, $btn-no-border-color);
border-color: $btn-no-border-bg;
&:hover {
border-color: $btn-no-border-color;
}
}

@ -5,6 +5,10 @@ $form-control-border-color: #e2e5ec !default;
border-radius: 0;
font-size: 14px;
&.border-rounded {
border-radius: 4px;
}
&.n-b-r {
border-right: none;
}

@ -0,0 +1,204 @@
$new-smart-contract-container-tooltips-background-color: #fbfafc !default;
$new-smart-contract-tooltips-width: 300px;
$smart-contract-form-group-tooltip-color: #adb5bd !default;
$new-smart-contract-center-column-margin-right: 30px;
.new-smart-contract-container {
background-color: #fff;
background-image: linear-gradient(
to bottom right,
#{$new-smart-contract-container-tooltips-background-color} 100%,
#{$new-smart-contract-container-tooltips-background-color} 100%
);
background-position: 100% 0;
background-repeat: repeat-y;
background-size: #{$new-smart-contract-tooltips-width} 1px;
box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.15);
margin-bottom: 3rem;
padding: 50px 0 50px 22px;
@include media-breakpoint-down(md) {
background-image: none;
padding-right: 22px;
}
}
.smart-contract-title {
color: #333;
font-size: 18px;
font-weight: normal;
line-height: 1.2;
margin: 0 0 70px 0;
padding: 0;
text-align: left;
@include media-breakpoint-down(md) {
margin-bottom: 30px;
}
&.margin-bottom-md {
margin-bottom: 50px;
@include media-breakpoint-down(md) {
margin-bottom: 15px;
}
}
}
.smart-contract-form-group {
margin-bottom: 30px;
@include media-breakpoint-down(md) {
margin-bottom: 20px;
}
}
.form-radios-group {
display: flex;
justify-content: flex-start;
.radio-big {
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
.smart-contract-form-group-inner-wrapper {
display: flex;
justify-content: space-between;
@include media-breakpoint-down(md) {
flex-direction: column;
}
> label {
color: #333;
flex-grow: 0;
font-size: 14px;
font-weight: normal;
line-height: 1.7;
margin: 0;
padding-right: 15px;
text-align: left;
width: 200px;
@include media-breakpoint-down(md) {
margin-bottom: 10px;
padding-right: 0;
width: auto;
}
}
.center-column {
flex-grow: 1;
margin-right: $new-smart-contract-center-column-margin-right;
@include media-breakpoint-down(md) {
margin: 0;
}
}
textarea.form-control {
min-height: 98px;
}
.form-error {
display: block;
font-size: 13px;
line-height: 1.2;
padding-top: 10px;
}
.smart-contract-form-group-tooltip {
color: $smart-contract-form-group-tooltip-color;
flex-grow: 0;
flex-shrink: 0;
font-size: 12px;
font-weight: normal;
line-height: 1.5;
padding: 0 30px;
text-align: left;
width: #{$new-smart-contract-tooltips-width};
@include media-breakpoint-down(md) {
padding: 10px 0 0 0;
width: auto;
}
&:empty {
@include media-breakpoint-down(md) {
display: none;
}
}
a {
color: $smart-contract-form-group-tooltip-color;
text-decoration: underline;
&:hover {
text-decoration: none;
}
}
}
}
.tooltip-quote {
background: rgba(0, 0, 0, 0.08);
border-radius: 2px;
padding: 0 5px;
}
.add-contract-libraries-wrapper {
border-bottom: 1px solid $base-border-color;
margin-right: $new-smart-contract-center-column-margin-right + $new-smart-contract-tooltips-width;
padding-bottom: 30px;
@include media-breakpoint-down(md) {
margin-right: 0;
}
}
.smart-contract-form-buttons {
align-items: center;
border-top: 1px solid $base-border-color;
display: flex;
margin-right: $new-smart-contract-center-column-margin-right + $new-smart-contract-tooltips-width;
margin-top: -1px;
padding-top: 30px;
position: relative;
@include media-breakpoint-down(md) {
margin-right: 0;
}
[class*="btn-"] {
position: relative;
z-index: 1;
}
.position-absolute {
&,
&:hover {
opacity: 1;
z-index: 12;
}
}
}
.smart-contract-libraries-wrapper {
display: none;
padding-bottom: 30px;
padding-top: 30px;
}
.contract-library-form-group {
display: none;
&.active {
display: block;
}
}

@ -0,0 +1,55 @@
$radio-big-color: $primary !default;
$radio-big-dimensions: 30px !default;
.radio-big {
align-items: center;
display: flex;
position: relative;
input[type="radio"] {
height: 100%;
opacity: 0;
position: absolute;
width: 100%;
z-index: 5;
&:checked + .radio-icon::before {
background-color: $radio-big-color;
border-radius: 50%;
content: "";
height: 12px;
left: 50%;
position: absolute;
top: 50%;
transform: translateX(-50%) translateY(-50%);
width: 12px;
}
&:checked + .radio-icon {
border-color: $radio-big-color;
}
}
.radio-icon {
border: 1px solid $base-border-color;
border-radius: 50%;
flex-grow: 0;
flex-shrink: 0;
height: $radio-big-dimensions;
margin: 0 10px 0 0;
position: relative;
width: $radio-big-dimensions;
z-index: 1;
}
.radio-text {
color: #333;
font-size: 14px;
font-weight: normal;
line-height: 1.2;
margin: 0;
position: relative;
white-space: nowrap;
z-index: 1;
}
}

@ -43,6 +43,7 @@ import './lib/market_history_chart'
import './lib/pending_transactions_toggle'
import './lib/pretty_json'
import './lib/reload_button'
import './lib/smart_contract/new_smart_contract_form'
import './lib/smart_contract/read_only_functions'
import './lib/smart_contract/wei_ether_converter'
import './lib/stop_propagation'

@ -0,0 +1,28 @@
import $ from 'jquery'
$(function () {
$('.js-btn-add-contract-libraries').on('click', function () {
$('.js-smart-contract-libraries-wrapper').show()
$(this).hide()
})
$('.js-smart-contract-form-reset').on('click', function () {
$('.js-contract-library-form-group').removeClass('active')
$('.js-contract-library-form-group').first().addClass('active')
$('.js-smart-contract-libraries-wrapper').hide()
$('.js-btn-add-contract-libraries').show()
$('.js-add-contract-library-wrapper').show()
})
$('.js-btn-add-contract-library').on('click', function () {
let nextContractLibrary = $('.js-contract-library-form-group.active').next('.js-contract-library-form-group')
if (nextContractLibrary) {
nextContractLibrary.addClass('active')
}
if ($('.js-contract-library-form-group.active').length === $('.js-contract-library-form-group').length) {
$('.js-add-contract-library-wrapper').hide()
}
})
})

@ -1,141 +1,256 @@
<section class="container">
<div class="card">
<div class="card-body">
<h1 class="card-title"><%= gettext "New Smart Contract" %></h1>
<section class="container new-smart-contract-container">
<div class="new-smart-contract-form">
<h1 class="smart-contract-title"><%= gettext "New Smart Contract Verification" %></h1>
<%= form_for @changeset,
address_verify_contract_path(@conn, :create, @conn.params["address_id"]),
[],
fn f -> %>
<div class="form-group">
<%= label f, :address_hash, gettext("Contract Address") %>
<%= text_input f, :address_hash, class: "form-control", "aria-describedby": "contract-address-help-block", readonly: true %>
<%= error_tag f, :address_hash, id: "contract-address-help-block", class: "text-danger" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :address_hash, gettext("Contract Address") %>
<div class="center-column">
<%= text_input f, :address_hash, class: "form-control border-rounded", "aria-describedby": "contract-address-help-block", readonly: true %>
<%= error_tag f, :address_hash, id: "contract-address-help-block", class: "text-danger form-error" %>
</div>
<div class="smart-contract-form-group-tooltip">The 0x address supplied on contract creation.</div>
</div>
</div>
<div class="form-group">
<%= label f, :name, gettext("Contract Name") %>
<%= text_input f, :name, class: "form-control", "aria-describedby": "contract-name-help-block", "data-test": "contract_name" %>
<%= error_tag f, :name, id: "contract-name-help-block", class: "text-danger" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :name, gettext("Contract Name") %>
<div class="center-column">
<%= text_input f, :name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block", "data-test": "contract_name" %>
<%= error_tag f, :name, id: "contract-name-help-block", class: "text-danger form-error" %>
</div>
<div class="smart-contract-form-group-tooltip">Must match the name specified in the code. For example, in <span class="tooltip-quote">contract MyContract {..}</span> <strong>MyContract</strong> is the contract name.</div>
</div>
</div>
<div class="form-group mb-4">
<%= label f, :compiler_version, gettext("Compiler") %>
<%= select f, :compiler_version, @compiler_versions, class: "form-control", selected: "latest", "aria-describedby": "compiler-help-block" %>
<%= error_tag f, :compiler_version, id: "compiler-help-block", class: "text-danger" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :compiler_version, gettext("Compiler") %>
<div class="center-column">
<%= select f, :compiler_version, @compiler_versions, class: "form-control border-rounded", selected: "latest", "aria-describedby": "compiler-help-block" %>
<%= error_tag f, :compiler_version, id: "compiler-help-block", class: "text-danger form-error" %>
</div>
<div class="smart-contract-form-group-tooltip">The compiler version is specified in <span class="tooltip-quote">pragma solidity X.X.X</span>. Use the compiler version rather than the nightly build. If using the Solidity compiler, run <span class="tooltip-quote">solc —version</span> to check.</div>
</div>
</div>
<div class="form-group">
<%= label :evm_version, :evm_version, gettext("EVM Version") %>
<%= select :evm_version, :evm_version, @evm_versions, class: "form-control", selected: "petersburg", "aria-describedby": "evm-version-help-block" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :evm_version, :evm_version, gettext("EVM Version") %>
<div class="center-column">
<%= select :evm_version, :evm_version, @evm_versions, class: "form-control border-rounded", selected: "petersburg", "aria-describedby": "evm-version-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip">The EVM version the contract is written for. If the bytecode does not match the version, we try to verify using the latest EVM version. <a href="https://forum.poa.network/t/smart-contract-verification-evm-version-details/2318" target="_blank">EVM version details</a>.</div>
</div>
</div>
<div class="form-group mb-4">
<%= label f, "Optimization" %>
<div class="form-check mb-2">
<%= radio_button f, :optimization, false, checked: true, class: "form-check-input", "aria-describedby": "optimization-help-block" %>
<%= label :smart_contract_optimization, :false, gettext("No"), class: "form-check-label" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, "Optimization" %>
<div class="center-column">
<div class="form-radios-group">
<div class="radio-big">
<%= radio_button f, :optimization, false, checked: true, class: "form-check-input" %>
<div class="radio-icon"></div>
<%= label :smart_contract_optimization, :false, gettext("No"), class: "radio-text" %>
</div>
<div class="radio-big">
<%= radio_button f, :optimization, true, class: "form-check-input", "aria-describedby": "optimization-help-block" %>
<div class="radio-icon"></div>
<%= label :smart_contract_optimization, :true, gettext("Yes"), class: "radio-text" %>
</div>
</div>
<%= error_tag f, :optimization, id: "optimization-help-block", class: "text-danger form-error" %>
</div>
<div class="smart-contract-form-group-tooltip">If you enabled optimization during compilation, select yes.</div>
</div>
</div>
<div class="form-check">
<%= radio_button f, :optimization, true, class: "form-check-input", "aria-describedby": "optimization-help-block" %>
<%= label :smart_contract_optimization, :true, gettext("Yes"), class: "form-check-label" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :name, gettext("Optimization runs") %>
<div class="center-column">
<%= text_input :optimization, :runs, value: 200, class: "form-control border-rounded", "aria-describedby": "optimization-runs-help-block", "data-test": "optimization-runs" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
<%= error_tag f, :optimization, id: "optimization-help-block", class: "text-danger" %>
</div>
<div class="form-group">
<%= label f, :name, gettext("Optimization runs") %>
<%= text_input :optimization, :runs, value: 200, class: "form-control", "aria-describedby": "optimization-runs-help-block", "data-test": "optimization-runs" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :contract_source_code, gettext("Enter the Solidity Contract Code") %>
<div class="center-column">
<%= textarea f, :contract_source_code, class: "form-control border-rounded monospace", rows: 3, "aria-describedby": "contract-source-code-help-block" %>
<%= error_tag f, :contract_source_code, id: "contract-source-code-help-block", class: "text-danger form-error", "data-test": "contract-source-code-error" %>
</div>
<div class="smart-contract-form-group-tooltip">We recommend using flattened code. This is necessary if your code utilizes a library or inherits dependencies. Use the <a href="https://github.com/poanetwork/solidity-flattener" target="_blank">POA solidity flattener or the <a href="https://www.npmjs.com/package/truffle-flattener" target="_blank">truffle flattener</a>.</div>
</div>
</div>
<div class="form-group mb-4">
<%= label f, :contract_source_code, gettext("Enter the Solidity Contract Code below") %>
<%= textarea f, :contract_source_code, class: "form-control monospace", rows: 3, "aria-describedby": "contract-source-code-help-block" %>
<%= error_tag f, :contract_source_code, id: "contract-source-code-help-block", class: "text-danger", "data-test": "contract-source-code-error" %>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :contructor_arguments, gettext("ABI-encoded Constructor Arguments (if required by the contract)") %>
<div class="center-column">
<%= textarea f, :constructor_arguments, class: "form-control border-rounded monospace", rows: 3, "aria-describedby": "contract-constructor-arguments-help-block" %>
<%= error_tag f, :constructor_arguments, id: "contract-constructor-arguments-help-block", class: "text-danger form-error", "data-test": "contract-constructor-arguments-error" %>
</div>
<div class="smart-contract-form-group-tooltip">Add arguments in <a href="https://solidity.readthedocs.io/en/develop/abi-spec.html" target="_blank">ABI hex encoded form</a>. Constructor arguments are written right to left, and will be found at the end of the input created bytecode. They may also be <a href="https://abi.hashex.org/" target="_blank">parsed here.</a></div>
</div>
</div>
<div class="form-group mb-4">
<%= label f, :contructor_arguments, gettext("Enter constructor arguments if the contract had any") %>
<%= textarea f, :constructor_arguments, class: "form-control monospace", rows: 3, "aria-describedby": "contract-constructor-arguments-help-block" %>
<%= error_tag f, :constructor_arguments, id: "contract-constructor-arguments-help-block", class: "text-danger", "data-test": "contract-constructor-arguments-error" %>
<div class="add-contract-libraries-wrapper">
<span class="btn-line js-btn-add-contract-libraries">Add Contract Libraries</span>
</div>
<h3 class="card-title"><%= gettext "Contract Libraries" %></h3>
<div class="smart-contract-libraries-wrapper js-smart-contract-libraries-wrapper">
<h2 class="smart-contract-title margin-bottom-md"><%= gettext "Contract Libraries" %></h2>
<div class="form-group">
<%= label :external_libraries, :library1, gettext("1 Library Name") %>
<%= text_input :external_libraries, :library1_name, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="contract-library-form-group js-contract-library-form-group active">
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library1, gettext("Library Name") %>
<div class="center-column">
<%= text_input :external_libraries, :library1_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip">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.</div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library1, gettext("1 Library Address") %>
<%= text_input :external_libraries, :library1_address, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library1, gettext("Library Address") %>
<div class="center-column">
<%= text_input :external_libraries, :library1_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip">The 0x library address. This can be found in the generated json file or Truffle output (if using truffle).</div>
</div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library2, gettext("2 Library Name") %>
<%= text_input :external_libraries, :library2_name, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="contract-library-form-group js-contract-library-form-group">
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library2, gettext("Library Name") %>
<div class="center-column">
<%= text_input :external_libraries, :library2_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library2, gettext("2 Library Address") %>
<%= text_input :external_libraries, :library2_address, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library2, gettext("Library Address") %>
<div class="center-column">
<%= text_input :external_libraries, :library2_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library3, gettext("3 Library Name") %>
<%= text_input :external_libraries, :library3_name, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="contract-library-form-group js-contract-library-form-group">
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library3, gettext("Library Name") %>
<div class="center-column">
<%= text_input :external_libraries, :library3_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library3, gettext("3 Library Address") %>
<%= text_input :external_libraries, :library3_address, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library3, gettext("Library Address") %>
<div class="center-column">
<%= text_input :external_libraries, :library3_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library4, gettext("4 Library Name") %>
<%= text_input :external_libraries, :library4_name, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="contract-library-form-group js-contract-library-form-group">
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library4, gettext("Library Name") %>
<div class="center-column">
<%= text_input :external_libraries, :library4_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library4, gettext("4 Library Address") %>
<%= text_input :external_libraries, :library4_address, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library4, gettext("Library Address") %>
<div class="center-column">
<%= text_input :external_libraries, :library4_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
</div>
<div class="form-group">
<%= label :external_libraries, :library5, gettext("5 Library Name") %>
<%= text_input :external_libraries, :library5_name, class: "form-control", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="contract-library-form-group js-contract-library-form-group">
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label :external_libraries, :library5, gettext("Library Name") %>
<div class="center-column">
<%= text_input :external_libraries, :library5_name, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
<div class="smart-contract-form-group">
<div class="smart-contract-form-group-inner-wrapper">
<%= label f, :library5, gettext("Library Address") %>
<div class="center-column">
<%= text_input f, :library5_address, class: "form-control border-rounded", "aria-describedby": "contract-name-help-block" %>
</div>
<div class="smart-contract-form-group-tooltip"></div>
</div>
</div>
</div>
<div class="form-group">
<%= label f, :library5, gettext("5 Library Address") %>
<%= text_input f, :library5_address, class: "form-control", "aria-describedby": "contract-name-help-block" %>
<div class="add-contract-library-wrapper js-add-contract-library-wrapper">
<span class="btn-line js-btn-add-contract-library">Add Library</span>
</div>
</div>
<button
type="button"
name="button"
id="loading"
disabled="true"
class="d-none px-4 position-absolute button button-primary button-sm mr-2">
<span class="loading-spinner-small mr-2">
<span class="loading-spinner-block-1"></span>
<span class="loading-spinner-block-2"></span>
</span>
<%= gettext("Loading....") %>
</button>
<%= submit gettext("Verify & publish"), class: "button button-primary button-sm mr-2", "data-loading": "animation" %>
<%= reset gettext("Reset"), class: "button button-secondary button-sm mr-2" %>
<%= link(
gettext("Cancel"),
to: address_contract_path(@conn, :index, @conn.params["address_id"]),
class: "button button-sm") %>
<div class="smart-contract-form-buttons">
<button
class="position-absolute btn-full-primary d-none mr-2"
disabled="true"
id="loading"
name="button"
type="button"
>
<span class="loading-spinner-small mr-2">
<span class="loading-spinner-block-1"></span>
<span class="loading-spinner-block-2"></span>
</span>
<%= gettext("Loading....") %>
</button>
<%= submit gettext("Verify & publish"), class: "btn-full-primary mr-2", "data-loading": "animation" %>
<%= reset gettext("Reset"), class: "btn-line mr-2 js-smart-contract-form-reset" %>
<%=
link(
gettext("Cancel"),
class: "btn-no-border",
to: address_contract_path(@conn, :index, @conn.params["address_id"])
)
%>
</div>
<% end %>
</div>
</div>
</section>

@ -195,7 +195,7 @@ msgid "Blocks Validated"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:135
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:247
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
msgid "Cancel"
msgstr ""
@ -223,7 +223,7 @@ msgid "Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:25
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:34
msgid "Compiler"
msgstr ""
@ -261,7 +261,7 @@ msgid "Contract ABI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:13
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:12
#: lib/block_scout_web/views/address_view.ex:97
msgid "Contract Address"
msgstr ""
@ -284,7 +284,7 @@ msgid "Contract Creation"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:19
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:23
msgid "Contract Name"
msgstr ""
@ -356,11 +356,6 @@ msgstr ""
msgid "ETH"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:57
msgid "Enter the Solidity Contract Code below"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:32
msgid "Error trying to fetch balances."
@ -563,12 +558,7 @@ msgid "Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:5
msgid "New Smart Contract"
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:61
msgid "No"
msgstr ""
@ -659,7 +649,7 @@ msgid "Request URL"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:133
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:244
msgid "Reset"
msgstr ""
@ -949,7 +939,7 @@ msgid "Verify & Publish"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:243
msgid "Verify & publish"
msgstr ""
@ -999,7 +989,7 @@ msgid "Wei"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:45
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:66
msgid "Yes"
msgstr ""
@ -1072,7 +1062,7 @@ msgid "Loading..."
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:130
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:241
msgid "Loading...."
msgstr ""
@ -1435,57 +1425,7 @@ msgid "Genesis Block"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:76
msgid "1 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:71
msgid "1 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:86
msgid "2 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:81
msgid "2 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:96
msgid "3 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:91
msgid "3 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:106
msgid "4 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:101
msgid "4 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:116
msgid "5 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:111
msgid "5 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:68
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:112
msgid "Contract Libraries"
msgstr ""
@ -1547,15 +1487,10 @@ msgid "Search by address, token symbol name, transaction hash, or block number"
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:45
msgid "EVM Version"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:63
msgid "Enter constructor arguments if the contract had any"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:16
msgid "Copy Decompiled Contract Code"
@ -1582,7 +1517,7 @@ msgid "Decompiler version"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:52
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:77
msgid "Optimization runs"
msgstr ""
@ -1726,3 +1661,36 @@ msgstr ""
#: lib/block_scout_web/templates/address_logs/index.html.eex:12
msgid "Topic"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:98
msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:87
msgid "Enter the Solidity Contract Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:127
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:149
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:171
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:193
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:215
msgid "Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:117
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:183
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:205
msgid "Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3
msgid "New Smart Contract Verification"
msgstr ""

@ -195,7 +195,7 @@ msgid "Blocks Validated"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:135
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:247
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:47
msgid "Cancel"
msgstr ""
@ -223,7 +223,7 @@ msgid "Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:25
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:34
msgid "Compiler"
msgstr ""
@ -261,7 +261,7 @@ msgid "Contract ABI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:13
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:12
#: lib/block_scout_web/views/address_view.ex:97
msgid "Contract Address"
msgstr ""
@ -284,7 +284,7 @@ msgid "Contract Creation"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:19
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:23
msgid "Contract Name"
msgstr ""
@ -356,11 +356,6 @@ msgstr ""
msgid "ETH"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:57
msgid "Enter the Solidity Contract Code below"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:32
msgid "Error trying to fetch balances."
@ -563,12 +558,7 @@ msgid "Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:5
msgid "New Smart Contract"
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:61
msgid "No"
msgstr ""
@ -659,7 +649,7 @@ msgid "Request URL"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:133
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:244
msgid "Reset"
msgstr ""
@ -949,7 +939,7 @@ msgid "Verify & Publish"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:132
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:243
msgid "Verify & publish"
msgstr ""
@ -999,7 +989,7 @@ msgid "Wei"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:45
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:66
msgid "Yes"
msgstr ""
@ -1072,7 +1062,7 @@ msgid "Loading..."
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:130
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:241
msgid "Loading...."
msgstr ""
@ -1435,57 +1425,7 @@ msgid "Genesis Block"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:76
msgid "1 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:71
msgid "1 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:86
msgid "2 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:81
msgid "2 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:96
msgid "3 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:91
msgid "3 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:106
msgid "4 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:101
msgid "4 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:116
msgid "5 Library Address"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:111
msgid "5 Library Name"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:68
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:112
msgid "Contract Libraries"
msgstr ""
@ -1547,15 +1487,10 @@ msgid "Search by address, token symbol name, transaction hash, or block number"
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:45
msgid "EVM Version"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:63
msgid "Enter constructor arguments if the contract had any"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_decompiled_contract/index.html.eex:16
msgid "Copy Decompiled Contract Code"
@ -1582,7 +1517,7 @@ msgid "Decompiler version"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:52
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:77
msgid "Optimization runs"
msgstr ""
@ -1726,3 +1661,36 @@ msgstr ""
#: lib/block_scout_web/templates/address_logs/index.html.eex:12
msgid "Topic"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:98
msgid "ABI-encoded Constructor Arguments (if required by the contract)"
msgstr ""
#, elixir-format, fuzzy
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:87
msgid "Enter the Solidity Contract Code"
msgstr ""
#, elixir-format, fuzzy
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:127
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:149
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:171
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:193
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:215
msgid "Library Address"
msgstr ""
#, elixir-format, fuzzy
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:117
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:139
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:161
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:183
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:205
msgid "Library Name"
msgstr ""
#, elixir-format, fuzzy
#: lib/block_scout_web/templates/address_contract_verification/new.html.eex:3
msgid "New Smart Contract Verification"
msgstr ""

@ -18,7 +18,7 @@ defmodule BlockScoutWeb.ContractVerifyPage do
}) do
session
|> fill_in(css("[data-test='contract_name']"), with: contract_name)
|> fill_in(text_field("Enter the Solidity Contract Code below"), with: source_code)
|> fill_in(text_field("Enter the Solidity Contract Code"), with: source_code)
case version do
nil -> nil

Loading…
Cancel
Save