|
|
@ -275,25 +275,29 @@ defmodule BlockScoutWeb.AddressContractVerificationController do |
|
|
|
if Chain.smart_contract_fully_verified?(address_hash_string) do |
|
|
|
if Chain.smart_contract_fully_verified?(address_hash_string) do |
|
|
|
{:ok, :already_fully_verified} |
|
|
|
{:ok, :already_fully_verified} |
|
|
|
else |
|
|
|
else |
|
|
|
if Chain.smart_contract_verified?(address_hash_string) do |
|
|
|
if Application.get_env(:explorer, Explorer.ThirdPartyIntegrations.Sourcify)[:enabled] do |
|
|
|
case Sourcify.check_by_address(address_hash_string) do |
|
|
|
if Chain.smart_contract_verified?(address_hash_string) do |
|
|
|
{:ok, _verified_status} -> |
|
|
|
case Sourcify.check_by_address(address_hash_string) do |
|
|
|
get_metadata_and_publish(address_hash_string, nil) |
|
|
|
{:ok, _verified_status} -> |
|
|
|
|
|
|
|
get_metadata_and_publish(address_hash_string, nil) |
|
|
|
_ -> |
|
|
|
|
|
|
|
{:error, :not_verified} |
|
|
|
_ -> |
|
|
|
end |
|
|
|
{:error, :not_verified} |
|
|
|
else |
|
|
|
end |
|
|
|
case Sourcify.check_by_address_any(address_hash_string) do |
|
|
|
else |
|
|
|
{:ok, "full", metadata} -> |
|
|
|
case Sourcify.check_by_address_any(address_hash_string) do |
|
|
|
proccess_metadata_add_publish(address_hash_string, metadata, false) |
|
|
|
{:ok, "full", metadata} -> |
|
|
|
|
|
|
|
proccess_metadata_add_publish(address_hash_string, metadata, false) |
|
|
|
|
|
|
|
|
|
|
|
{:ok, "partial", metadata} -> |
|
|
|
{:ok, "partial", metadata} -> |
|
|
|
proccess_metadata_add_publish(address_hash_string, metadata, true) |
|
|
|
proccess_metadata_add_publish(address_hash_string, metadata, true) |
|
|
|
|
|
|
|
|
|
|
|
_ -> |
|
|
|
_ -> |
|
|
|
{:error, :not_verified} |
|
|
|
{:error, :not_verified} |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{:error, :sourcify_disabled} |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|