chore: Remove deprecated single implementation property of the smart-contract from the API response (#10715)

pull/10985/head
Victor Baranov 1 week ago committed by GitHub
parent f3e279d853
commit 1b2232a88c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      apps/block_scout_web/lib/block_scout_web/views/api/v2/smart_contract_view.ex
  2. 3
      apps/explorer/lib/explorer/chain/address.ex

@ -162,7 +162,6 @@ defmodule BlockScoutWeb.API.V2.SmartContractView do
conn conn
) do ) do
bytecode_twin = SmartContract.get_address_verified_bytecode_twin_contract(address.hash, @api_true) bytecode_twin = SmartContract.get_address_verified_bytecode_twin_contract(address.hash, @api_true)
minimal_proxy_address_hash = address.implementation
bytecode_twin_contract = bytecode_twin.verified_contract bytecode_twin_contract = bytecode_twin.verified_contract
smart_contract_verified = AddressView.smart_contract_verified?(address) smart_contract_verified = AddressView.smart_contract_verified?(address)
fully_verified = SmartContract.verified_with_full_match?(address.hash, @api_true) fully_verified = SmartContract.verified_with_full_match?(address.hash, @api_true)
@ -203,9 +202,6 @@ defmodule BlockScoutWeb.API.V2.SmartContractView do
"has_methods_write" => write_methods?, "has_methods_write" => write_methods?,
"has_methods_read_proxy" => is_proxy, "has_methods_read_proxy" => is_proxy,
"has_methods_write_proxy" => is_proxy && write_methods?, "has_methods_write_proxy" => is_proxy && write_methods?,
# todo: remove this property once frontend is bound to "implementations"
"minimal_proxy_address_hash" =>
minimal_proxy_address_hash && Address.checksum(minimal_proxy_address_hash.address_hash),
"proxy_type" => proxy_type, "proxy_type" => proxy_type,
"implementations" => implementations, "implementations" => implementations,
"sourcify_repo_url" => "sourcify_repo_url" =>

@ -82,9 +82,6 @@ defmodule Explorer.Chain.Address.Schema do
field(:ens_domain_name, :string, virtual: true) field(:ens_domain_name, :string, virtual: true)
field(:metadata, :any, virtual: true) field(:metadata, :any, virtual: true)
# todo: remove virtual field for a single implementation when frontend is bound to "implementations" object value in API
field(:implementation, :any, virtual: true)
has_one(:smart_contract, SmartContract, references: :hash) has_one(:smart_contract, SmartContract, references: :hash)
has_one(:token, Token, foreign_key: :contract_address_hash, references: :hash) has_one(:token, Token, foreign_key: :contract_address_hash, references: :hash)
has_one(:proxy_implementations, Implementation, foreign_key: :proxy_address_hash, references: :hash) has_one(:proxy_implementations, Implementation, foreign_key: :proxy_address_hash, references: :hash)

Loading…
Cancel
Save