@ -8,9 +8,8 @@ defmodule Explorer.Account.Notifier.ForbiddenAddress do
" 0x000000000000000000000000000000000000dEaD "
]
alias Explorer.AccessHelpers
alias Explorer . { AccessHelpers , Repo }
alias Explorer.Chain.Token
alias Explorer.Repo
import Ecto.Query , only : [ from : 2 ]
import Explorer.Chain , only : [ string_to_address_hash : 1 ]
@ -21,11 +20,11 @@ defmodule Explorer.Account.Notifier.ForbiddenAddress do
{ :error , message }
address_hash ->
check ( address_hash , address_string )
check ( address_hash )
end
end
def check ( % Explorer.Chain.Hash { } = address_hash , address_hash_string ) do
def check ( % Explorer.Chain.Hash { } = address_hash ) do
cond do
address_hash in blacklist ( ) ->
{ :error , " This address is blacklisted " }
@ -33,7 +32,7 @@ defmodule Explorer.Account.Notifier.ForbiddenAddress do
is_contract ( address_hash ) ->
{ :error , " This address isn't personal " }
match? ( { :restricted_access , true } , AccessHelpers . restricted_access? ( address_hash_string , %{ } ) ) ->
match? ( { :restricted_access , true } , AccessHelpers . restricted_access? ( to_string ( address_hash ) , %{ } ) ) ->
{ :error , " This address has restricted access " }
address_hash ->