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

Undefined overrides causes 'too many arguments' error in contract #805

Open
0xalecks opened this issue Feb 10, 2023 · 0 comments
Open

Undefined overrides causes 'too many arguments' error in contract #805

0xalecks opened this issue Feb 10, 2023 · 0 comments

Comments

@0xalecks
Copy link

typechain generated this method:

  getAddLiquidityOut(
    tokenAmountsIn: PromiseOrValue<BigNumberish>[],
    overrides?: CallOverrides
  ): Promise<BigNumber>;

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.

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

1 participant