dethcrypto / dethcrypto/TypeChain

Undefined overrides causes 'too many arguments' error in contract

Open
#805 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

typechain generated this method:

```
getAddLiquidityOut(
tokenAmountsIn: PromiseOrValue[],
overrides?: CallOverrides
): Promise;
```

If you call it like this;
```
contract.getAddLiquidityOut(tokens, undefined);
```

Ether's throws this error:
```
Error: too many arguments: passed to contract (count=2, expectedCount=1, code=UNEXPECTED_ARGUMENT, version=contracts/5.7.0)
```

However, it does work if you pass in overrides:
```
contract.getAddLiquidityOut(tokens, {from: address});
```

This feels like a bug, I would expect the generated code to handle this instead of forcing me to check for overrides before calling the method.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.