Merge pull request #4388 from blockscout/np-fix-poa-sourcify

Fix sourcify bug
pull/4384/head
Victor Baranov 3 years ago committed by GitHub
commit d3d0d672c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex

@ -3,6 +3,7 @@
### Features
### Fixes
- [#4388](https://github.com/blockscout/blockscout/pull/4388) - Fix internal server error on contract page for insctances without sourcify envs
### Chore
- [#4382](https://github.com/blockscout/blockscout/pull/4382) - Replace awesomplete with autocomplete.js

@ -275,6 +275,7 @@ defmodule BlockScoutWeb.AddressContractVerificationController do
if Chain.smart_contract_fully_verified?(address_hash_string) do
{:ok, :already_fully_verified}
else
if Application.get_env(:explorer, Explorer.ThirdPartyIntegrations.Sourcify)[:enabled] do
if Chain.smart_contract_verified?(address_hash_string) do
case Sourcify.check_by_address(address_hash_string) do
{:ok, _verified_status} ->
@ -295,6 +296,9 @@ defmodule BlockScoutWeb.AddressContractVerificationController do
{:error, :not_verified}
end
end
else
{:error, :sourcify_disabled}
end
end
end
end

Loading…
Cancel
Save