|
|
@ -27,9 +27,10 @@ defmodule BlockScoutWeb.AddressContractView do |
|
|
|
|
|
|
|
|
|
|
|
input_types = Enum.map(constructor_abi["inputs"], &FunctionSelector.parse_specification_type/1) |
|
|
|
input_types = Enum.map(constructor_abi["inputs"], &FunctionSelector.parse_specification_type/1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{_, result} = |
|
|
|
contract.constructor_arguments |
|
|
|
contract.constructor_arguments |
|
|
|
|> decode_data(input_types) |
|
|
|
|> decode_data(input_types) |
|
|
|
|> Enum.reduce("", fn val, acc -> |
|
|
|
|> Enum.reduce({0, "#{contract.constructor_arguments}\n\n"}, fn val, {count, acc} -> |
|
|
|
formatted_val = |
|
|
|
formatted_val = |
|
|
|
if is_binary(val) do |
|
|
|
if is_binary(val) do |
|
|
|
Base.encode16(val) |
|
|
|
Base.encode16(val) |
|
|
@ -37,8 +38,10 @@ defmodule BlockScoutWeb.AddressContractView do |
|
|
|
val |
|
|
|
val |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
"#{acc}#{formatted_val}\n" |
|
|
|
{count + 1, "#{acc}Arg [#{count}] : #{formatted_val}\n"} |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result |
|
|
|
rescue |
|
|
|
rescue |
|
|
|
_ -> contract.constructor_arguments |
|
|
|
_ -> contract.constructor_arguments |
|
|
|
end |
|
|
|
end |
|
|
|