From 272ab6dfb7b6a67f4a9b051fbb8e8c17a9701541 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 17 Aug 2020 20:32:01 +0300 Subject: [PATCH] Contract reader fix --- CHANGELOG.md | 1 + apps/explorer/lib/explorer/smart_contract/reader.ex | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8d6e4ccb0..989743c383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#3224](https://github.com/poanetwork/blockscout/pull/3224) - Top tokens page ### Fixes +- [#3249](https://github.com/poanetwork/blockscout/pull/3249) - Fix incorrect ABI decoding of address in tuple output - [#3237](https://github.com/poanetwork/blockscout/pull/3237) - Refine contract method signature detection for read/write feature - [#3235](https://github.com/poanetwork/blockscout/pull/3235) - Fix coin supply api edpoint - [#3233](https://github.com/poanetwork/blockscout/pull/3233) - Fix for the contract verifiaction for solc 0.5 family with experimental features enabled diff --git a/apps/explorer/lib/explorer/smart_contract/reader.ex b/apps/explorer/lib/explorer/smart_contract/reader.ex index de04329147..7073e896b0 100644 --- a/apps/explorer/lib/explorer/smart_contract/reader.ex +++ b/apps/explorer/lib/explorer/smart_contract/reader.ex @@ -321,6 +321,10 @@ defmodule Explorer.SmartContract.Reader do Map.put_new(output, "value", bytes_to_string(value)) end + defp new_value(%{"type" => "address"} = output, values, index) do + Map.put_new(output, "value", bytes_to_string(Enum.at(values, index))) + end + defp new_value(%{"type" => "bytes" <> number_rest} = output, values, index) do if String.contains?(number_rest, "[]") do values_array = Enum.at(values, index)