I recently upgraded truffle to the newest version. Now it does not automatically detect overloaded functions anymore. Before, I could just do the following:
await contract.function({
from: accounts[0],
value: web3.utils.toWei("0.5", "Ether")
});
await contract.function(param1, param2, {
from: accounts[0],
value: web3.utils.toWei("0.5", "Ether")
});
Now it seems that I have to specify the parameters in a syntax like the following:
await contract.function['uint256', 'uint256'](param1, param2, {
from: accounts[0],
value: web3.utils.toWei("0.5", "Ether")
});
But how can I declare the first function version without parameters? Doing this: contract.function[''](...)
produces the error contract.function is not a function
. Not declaring anything via []
produces the same error as well.
Also the parameters for the overloaded functions are two arrays. One address[]
array and one uint256[]
array. I already tried:
contract.function["address[]", "uint256[]"](addressList, uintList, {...})
which doesn't work. It produces the same error.
I also didn't find any information about this in the truffle documentation.
$ truffle version
?Truffle v5.0.0-next.26 (core: 5.0.0-beta.2) Solidity - 0.5.4 (solc-js) Node v8.11.4