diff --git a/.dialyzer-ignore b/.dialyzer-ignore index d45a57f55c..7f7f8757a4 100644 --- a/.dialyzer-ignore +++ b/.dialyzer-ignore @@ -18,7 +18,7 @@ lib/phoenix/router.ex:402 lib/block_scout_web/views/layout_view.ex:145: The call 'Elixir.Poison.Parser':'parse!' lib/block_scout_web/views/layout_view.ex:237: The call 'Elixir.Poison.Parser':'parse!' lib/block_scout_web/controllers/api/rpc/transaction_controller.ex:22 -lib/explorer/smart_contract/reader.ex:435 +lib/explorer/smart_contract/reader.ex:436 lib/indexer/fetcher/token_total_supply_on_demand.ex:16 lib/explorer/exchange_rates/source.ex:110 lib/explorer/exchange_rates/source.ex:113 diff --git a/CHANGELOG.md b/CHANGELOG.md index 36efde3752..eec752ab24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Features ### Fixes +- [#5066](https://github.com/blockscout/blockscout/pull/5066) - Fix read contract page bug - [#5071](https://github.com/blockscout/blockscout/pull/5071) - Fix write page contract tuple input - [#5034](https://github.com/blockscout/blockscout/pull/5034) - Fix broken functions input at transation page - [#5025](https://github.com/blockscout/blockscout/pull/5025) - Add standard input JSON files validation diff --git a/apps/explorer/lib/explorer/smart_contract/reader.ex b/apps/explorer/lib/explorer/smart_contract/reader.ex index 466a4655ab..fd07294a00 100644 --- a/apps/explorer/lib/explorer/smart_contract/reader.ex +++ b/apps/explorer/lib/explorer/smart_contract/reader.ex @@ -298,13 +298,14 @@ defmodule Explorer.SmartContract.Reader do defp get_abi_with_method_id(abi) do abi |> Enum.map(fn method -> - parsed_method = [method] |> ABI.parse_specification() |> Enum.at(0) - - if is_map(parsed_method) do - method_id = Map.get(parsed_method, :method_id) + with parsed_method <- [method] |> ABI.parse_specification() |> Enum.at(0), + true <- is_map(parsed_method), + method_id <- Map.get(parsed_method, :method_id), + true <- !is_nil(method_id) do Map.put(method, "method_id", Base.encode16(method_id, case: :lower)) else - method + _ -> + method end end) end