diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9b706ad9..00f847e53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - [#1639](https://github.com/poanetwork/blockscout/pull/1614) - Optimize token holder count updates when importing address current balances - [#1643](https://github.com/poanetwork/blockscout/pull/1643) - Set internal_transactions_indexed_at for empty blocks - [#1647](https://github.com/poanetwork/blockscout/pull/1647) - Fix typo in view + - [#1650](https://github.com/poanetwork/blockscout/pull/1650) - Add petersburg evm version to smart contract verifier ### Chore diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex index e67f7f0e53..75cda8c965 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex @@ -2,9 +2,7 @@ defmodule BlockScoutWeb.AddressContractVerificationController do use BlockScoutWeb, :controller alias Explorer.Chain.SmartContract - alias Explorer.SmartContract.{Publisher, Solidity.CompilerVersion} - - @evm_versions ["homestead", "tangerineWhistle", "spuriousDragon", "byzantium", "constantinople"] + alias Explorer.SmartContract.{Publisher, Solidity.CodeCompiler, Solidity.CompilerVersion} def new(conn, %{"address_id" => address_hash_string}) do changeset = @@ -15,7 +13,11 @@ defmodule BlockScoutWeb.AddressContractVerificationController do {:ok, compiler_versions} = CompilerVersion.fetch_versions() - render(conn, "new.html", changeset: changeset, compiler_versions: compiler_versions, evm_versions: @evm_versions) + render(conn, "new.html", + changeset: changeset, + compiler_versions: compiler_versions, + evm_versions: CodeCompiler.allowed_evm_versions() + ) end def create( @@ -27,7 +29,7 @@ defmodule BlockScoutWeb.AddressContractVerificationController do "evm_version" => evm_version } ) do - smart_sontact_with_evm_version = Map.put(smart_contract, "evm_version", evm_version) + smart_sontact_with_evm_version = Map.put(smart_contract, "evm_version", evm_version["evm_version"]) case Publisher.publish(address_hash_string, smart_sontact_with_evm_version, external_libraries) do {:ok, _smart_contract} -> @@ -36,7 +38,11 @@ defmodule BlockScoutWeb.AddressContractVerificationController do {:error, changeset} -> {:ok, compiler_versions} = CompilerVersion.fetch_versions() - render(conn, "new.html", changeset: changeset, compiler_versions: compiler_versions, evm_versions: @evm_versions) + render(conn, "new.html", + changeset: changeset, + compiler_versions: compiler_versions, + evm_versions: CodeCompiler.allowed_evm_versions() + ) end end end 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 7ce3645a73..ff0aec3423 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 @@ -29,7 +29,7 @@