Skip to content

Error with receive functions #44

Description

@grallc

For some reasons, if the ABI contains a receive payable function with no further arguments, instantiating a new Contract will throw an TypeError: Cannot read property 'type' of null error.
The problem seems to be coming from the Fragment from ethersprojects, but can also be fixed in the library.

Can be reproduced by using this ABI:

  const abi = [
    {
        constant: true,
        inputs: [],
        name: 'totalSupply',
        outputs: [
            {
                internalType: 'uint256',
                name: '',
                type: 'uint256'
            }
        ],
        payable: false,
        stateMutability: 'view',
        type: 'function'
    },
    {
      stateMutability: 'payable',
      type: 'receive'
    }
  ]

in the tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions