dappuniversity / token_sale

Code Your Own Cryptocurrency & ICO on Ethereum | Tutorial
407 stars 389 forks source link

TokenSale doesn't pay the tokens to the buyer. #8

Closed Chococoin closed 6 years ago

Chococoin commented 6 years ago

I'm testing the tokensale contract in remix and I think this line isn't working as expected.

require(tokenContract.transfer(msg.sender, _numberOfTokens));

Its returns false, because it doesn't complete the transfer. For the same reason

tokensSold += _numberOfTokens

doesn't execute.

I saw all the test you did in truffle, but I'm not really sure if this case was completed. In that case Remix could be the problem.

Regards.

Chococoin commented 6 years ago

I was passing wrongly arguments in the buyTokens function.

Sorry.