-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
enhancementNew feature or improvement.New feature or improvement.v6Issues regarding v6Issues regarding v6
Description
Describe the Feature
Currently, if there is an invalid argument count, then ethers v6 throws an error that says "no matching function". However, it can point the dev to look in the wrong direction, i.e. check if ABI being passed is correct.
Error: no matching fragment (operation="fragment", code=UNSUPPORTED_OPERATION, version=6.0.5)
But if a more helpful error is thrown, it can be helpful to immediately point out that the issue is in the arguments somewhere, similar to the error in ethers v5 which says expected argument count is 1 but passed is 2.
Error: too many arguments: passed to contract (count=2, expectedCount=1, code=UNEXPECTED_ARGUMENT, version=contracts/5.5.0)
Code Example
await dai.balanceOf(ZeroAddress)
// works
await dai.balanceOf(ZeroAddress, 0)
// Error: no matching fragment (operation="fragment", code=UNSUPPORTED_OPERATION, version=6.0.5)
await dai.balanceOf()
// Error: no matching fragment (operation="fragment", code=UNSUPPORTED_OPERATION, version=6.0.5)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvement.New feature or improvement.v6Issues regarding v6Issues regarding v6