|
|
@ -7,8 +7,6 @@ defmodule Explorer.Chain.SmartContract.Proxy.EIP1167 do |
|
|
|
alias Explorer.Chain.{Address, Hash, SmartContract} |
|
|
|
alias Explorer.Chain.{Address, Hash, SmartContract} |
|
|
|
alias Explorer.Chain.SmartContract.Proxy |
|
|
|
alias Explorer.Chain.SmartContract.Proxy |
|
|
|
|
|
|
|
|
|
|
|
import Ecto.Query, only: [from: 2] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
|
Get implementation address following EIP-1167 |
|
|
|
Get implementation address following EIP-1167 |
|
|
|
""" |
|
|
|
""" |
|
|
@ -56,13 +54,8 @@ defmodule Explorer.Chain.SmartContract.Proxy.EIP1167 do |
|
|
|
defp implementation_to_smart_contract(nil, _options), do: nil |
|
|
|
defp implementation_to_smart_contract(nil, _options), do: nil |
|
|
|
|
|
|
|
|
|
|
|
defp implementation_to_smart_contract(address_hash, options) do |
|
|
|
defp implementation_to_smart_contract(address_hash, options) do |
|
|
|
query = |
|
|
|
address_hash |
|
|
|
from( |
|
|
|
|> SmartContract.get_smart_contract_query() |
|
|
|
smart_contract in SmartContract, |
|
|
|
|
|
|
|
where: smart_contract.address_hash == ^address_hash |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query |
|
|
|
|
|
|
|
|> Chain.select_repo(options).one(timeout: 10_000) |
|
|
|
|> Chain.select_repo(options).one(timeout: 10_000) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|