Skip to content

abigen does not recognize error types #23157

Closed
@jannikluhn

Description

@jannikluhn

System information

abigen version: 1.10.5-unstable-3b053185-20210702 (master)

Expected behaviour

abigen should not fail when receiving an ABI that contains error types.

Actual behaviour

It fails.

Steps to reproduce the behaviour

Example contract:

// SPDX-License-Identifier: MIT

pragma solidity =0.8.4;

contract Test {
    error MyError(uint256);
}

Resulting abi (generated with solc version 0.8.4+commit.c7e474f2.Linux.g++):

[
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "name": "MyError",
    "type": "error"
  }
]

Error on abigen --abi Test.abi --pkg main:

Fatal: Failed to generate ABI binding: abi: could not recognize type error of field MyError

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions