np-sourcify-constructor-args
Nikita Pozdniakov 1 year ago
parent 348a8acc1e
commit fda97f53c2
No known key found for this signature in database
GPG Key ID: F344106F9804FE5F
  1. 1
      CHANGELOG.md
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_contract/index.html.eex
  3. 5
      apps/explorer/lib/explorer/chain.ex

@ -4,6 +4,7 @@
### Features ### Features
- [#7952](https://github.com/blockscout/blockscout/pull/7952) - Add parsing constructor arguments for sourcify contracts
- [#6190](https://github.com/blockscout/blockscout/pull/6190) - Add EIP-1559 support to gas price oracle - [#6190](https://github.com/blockscout/blockscout/pull/6190) - Add EIP-1559 support to gas price oracle
- [#7977](https://github.com/blockscout/blockscout/pull/7977) - GraphQL: extend schema with new field for existing objects - [#7977](https://github.com/blockscout/blockscout/pull/7977) - GraphQL: extend schema with new field for existing objects

@ -43,7 +43,7 @@
<% end %> <% end %>
<%= if smart_contract_verified || (!smart_contract_verified && metadata_for_verification) do %> <%= if smart_contract_verified || (!smart_contract_verified && metadata_for_verification) do %>
<% target_contract = if smart_contract_verified, do: @address.smart_contract, else: metadata_for_verification %> <% target_contract = if smart_contract_verified, do: @address.smart_contract, else: metadata_for_verification %>
<%= if @address.smart_contract.partially_verified && smart_contract_verified do %> <%= if @address.smart_contract.verified_via_sourcify && @address.smart_contract.partially_verified && smart_contract_verified do %>
<div class="mb-4"> <div class="mb-4">
<i style="color: #f7b32b;" class="fa fa-info-circle"></i><span> <%= gettext("This contract has been partially verified via Sourcify.") %> <i style="color: #f7b32b;" class="fa fa-info-circle"></i><span> <%= gettext("This contract has been partially verified via Sourcify.") %>
<% else %> <% else %>

@ -1938,7 +1938,8 @@ defmodule Explorer.Chain do
end end
defp check_and_update_constructor_args( defp check_and_update_constructor_args(
%SmartContract{address_hash: address_hash, constructor_arguments: nil} = smart_contract %SmartContract{address_hash: address_hash, constructor_arguments: nil, verified_via_sourcify: true} =
smart_contract
) do ) do
if args = Verifier.parse_constructor_arguments_for_sourcify_contract(address_hash, smart_contract.abi) do if args = Verifier.parse_constructor_arguments_for_sourcify_contract(address_hash, smart_contract.abi) do
smart_contract |> SmartContract.changeset(%{constructor_arguments: args}) |> Repo.update() smart_contract |> SmartContract.changeset(%{constructor_arguments: args}) |> Repo.update()
@ -1952,7 +1953,7 @@ defmodule Explorer.Chain do
%Address{ %Address{
hash: address_hash, hash: address_hash,
contract_code: deployed_bytecode, contract_code: deployed_bytecode,
smart_contract: %SmartContract{constructor_arguments: nil} = smart_contract smart_contract: %SmartContract{constructor_arguments: nil, verified_via_sourcify: true} = smart_contract
} = address } = address
) do ) do
if args = if args =

Loading…
Cancel
Save