let result = await instance.joinQuiz({
from: accounts[1],
value: web3.utils.toWei(10, "wei")
});
[Ethereum] Error: Please pass numbers as strings or BigNumber objects to avoid precision errors
bignumbergo-ethereumtruffletruffle-testweb3js
Best Answer
The signature of the toWei method is (can be found in the docs.
So you should provide the number as either a String or a BigNumber (Web3 0.2x) / BN (Web3 1.x).
Your code should then be:
However, in your code you're converting from wei to wei, which might not be what you want, so keep in mind that the second parameter is the unit you're converting from.