I am running into a very strange bug while interacting with my OpenZepplin crowdsale.

Here is my repo for context https://github.com/GenusDev/crossfit-coin-backend

Here is what I have working so far:

  1. Deploy a Crowdsale contract: success
  2. Deploy a MintableToken: success
  3. Transfer ownership of MintableToken to Crowdsale: success
  4. Attempt to buyTokens from front-end app (line 76 of app.js): FAIL...but then,if I run the same buyTokens command once through the Truffle CLI, I can then refresh the page of my front-end app and run the exact same code (line 76 of app.js) and successfully buyTokens.

Its not a timing issue. I have waited several minutes after deployment, and step 4 works from the front-end immediately after running the same command through the CLI. Can anyone offer advice here?

| improve this question | | | | |
  • Are you testing against ganache, geth or parity? Does buyTokens fails with any error message? – Ismael Mar 16 '18 at 20:06
  • I am testing on Ganache. The error I get is: "Error: VM Exception while processing transaction: revert" – Test1 Test2 Mar 16 '18 at 21:32

The error is: The buyTokens() call did not specify the gas limit. Original function call: buyTokens(<<0xaccountAddress>>, { from: <<0xaccountAddress>>, value: web3.toWei(5, "ether") }) should be: buyTokens(0xaccountAddress>>, { from: <<0xaccountAddress>>, value: web3.toWei(5, "ether"), gas: '1000000' })

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.