Closed fedor-ivn closed 8 months ago
Recently we came across such a contract, where one of the methods (assumeLastTokenIdMatches) does not have an array of outputs in its ABI:
assumeLastTokenIdMatches
outputs
// ... { "type": "function", "stateMutability": "view", "name": "assumeLastTokenIdMatches", "inputs": [ { "type": "uint256", "name": "lastTokenId", "internalType": "uint256" } ] }, // ...
If I try to parse this ABI using ABI.parse_specification, the function assumeLastTokenIdMatches is skipped:
ABI.parse_specification
iex(1)> File.read!("contract-abi.json") |> Jason.decode! |> ABI.parse_specification |> Enum.filter(fn %ABI.FunctionSelector{function: name} -> name == "assumeLastTokenIdMatches" end) []
contract-abi.json
Possibly, the problem is somewhere here:
https://github.com/poanetwork/ex_abi/blob/5d63e8a7fefc1428b86bb699de53bc4b9bb41744/lib/abi/function_selector.ex#L179-L183
Recently we came across such a contract, where one of the methods (
assumeLastTokenIdMatches
) does not have an array ofoutputs
in its ABI:If I try to parse this ABI using
ABI.parse_specification
, the functionassumeLastTokenIdMatches
is skipped:contract-abi.json
Possibly, the problem is somewhere here:
https://github.com/poanetwork/ex_abi/blob/5d63e8a7fefc1428b86bb699de53bc4b9bb41744/lib/abi/function_selector.ex#L179-L183