Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with receive functions #44

Open
grallc opened this issue Aug 19, 2022 · 1 comment
Open

Error with receive functions #44

grallc opened this issue Aug 19, 2022 · 1 comment

Comments

@grallc
Copy link

grallc commented Aug 19, 2022

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.

grallc added a commit to grallc/ethers-multicall that referenced this issue Aug 19, 2022
@roffett
Copy link

roffett commented Sep 27, 2022

Met the same issues, fallback() payable throw the same err as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants