Skip to content

Instantly share code, notes, and snippets.

@onggunhao
Last active July 21, 2019 19:11
Show Gist options
  • Save onggunhao/f2c4407f236c1aa7da94f799dc1d874c to your computer and use it in GitHub Desktop.
Save onggunhao/f2c4407f236c1aa7da94f799dc1d874c to your computer and use it in GitHub Desktop.
Invalid number of parameters for function in Solidity

Possibility 1: Build is outdated Need to recompile all Truffle contracts

Overloaded function

Truffle Release Notes

'Invalid number of parameters for "withdraw". Got 2 expected 0!'

Need to use syntax:

contract.methods["methodName(type)"](params. from:{...})

e.g.

crowdloan.methods['withdraw(uint256)'](contributor.value, {from: borrower}),
await crowdloan.methods['withdraw()']({from: borrower});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment