|
|
@ -6,7 +6,7 @@ defmodule Explorer.SmartContract.Reader do |
|
|
|
[wiki](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI). |
|
|
|
[wiki](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI). |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
alias EthereumJSONRPC.Contract |
|
|
|
alias EthereumJSONRPC.{Contract, Encoder} |
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain.{Hash, SmartContract} |
|
|
|
alias Explorer.Chain.{Hash, SmartContract} |
|
|
|
alias Explorer.SmartContract.Helper |
|
|
|
alias Explorer.SmartContract.Helper |
|
|
@ -503,6 +503,14 @@ defmodule Explorer.SmartContract.Reader do |
|
|
|
Map.put_new(output, "value", bytes_to_string(Enum.at(values, index))) |
|
|
|
Map.put_new(output, "value", bytes_to_string(Enum.at(values, index))) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp new_value(%{"type" => :string} = output, [value], _index) do |
|
|
|
|
|
|
|
Map.put_new(output, "value", Encoder.unescape(value)) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp new_value(%{"type" => "string"} = output, [value], _index) do |
|
|
|
|
|
|
|
Map.put_new(output, "value", Encoder.unescape(value)) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp new_value(output, [value], _index) do |
|
|
|
defp new_value(output, [value], _index) do |
|
|
|
Map.put_new(output, "value", value) |
|
|
|
Map.put_new(output, "value", value) |
|
|
|
end |
|
|
|
end |
|
|
|