You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the function checks msg.value as numberOfTokens times price first and you are passing 800.000 as product, I think the raised error comes from incorrect product instead of checked "tokens available" ... am I wrong?
Same question @gwmccubbin.
You wrote this code return tokenSaleInstance.buyTokens(800000, { from: buyer, value: numberOfTokens * tokenPrice })
But I think it should be return tokenSaleInstance.buyTokens(800000)
Hi Gregory,
you are testing bytoken and checking for error:
return tokenSaleInstance.buyTokens(800000, { from: buyer, value: numberOfTokens * tokenPrice }) }).then(assert.fail).catch(function(error) { assert(error.message.indexOf('revert') >= 0, 'cannot purchase more tokens than available');
As the function checks msg.value as numberOfTokens times price first and you are passing 800.000 as product, I think the raised error comes from incorrect product instead of checked "tokens available" ... am I wrong?
require(msg.value == multiply(_numberOfTokens, tokenPrice)); require(tokenContract.balanceOf(this) >= _numberOfTokens);
best
Timo
The text was updated successfully, but these errors were encountered: