Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on purchase #21

Open
Nicholasw22 opened this issue Apr 9, 2019 · 2 comments
Open

Issue on purchase #21

Nicholasw22 opened this issue Apr 9, 2019 · 2 comments

Comments

@Nicholasw22
Copy link

After I select a token for purchase, I get the below error

ALERT: [ethjs-rpc] rpc error with payload {"id":8115156641523,"jsonrpc":"2.0","params":["0xf892058504a817c8008307a12094fc4878e9ab8e9e9278ab6927d9b7b1a73502fe2887038d7ea4c68000a43610724e0000000000000000000000000000000000000000000000000000000000000001822d45a0d540ee24845101bce60f0e962406b5a7a7c18576bea9fa7311287a76bb52c433a0594c832caa47e93b5041fca934938ca23a078ed2cea0b6813d7279b454baf876"],"method":"eth_sendRawTransaction"} Error: VM Exception while processing transaction: revert

@Nicholasw22 Nicholasw22 changed the title Issue on purcase Issue on purchase Apr 10, 2019
@officialfrancismendoza
Copy link

Did you load tokens into your smart contract first? You have to go into truffle console and type in certain commands to load it first. It's roughly in 6:36:00 in the video tutorial

@anonymity12
Copy link

thanks to fmendoz7

so here are what shall we do, when we want to test buyTokens on our local browser:

truffle(development)> 

DappTokenSale.deployed().then(function(i) { tokenSale = i;})

DappToken.deployed().then(function(i) { token = i;})


ruffle(development)> tokensAvailable = 750000;
750000
truffle(development)> accAddrs = await web3.eth.getAccounts()
undefined
truffle(development)> admin = accAddrs[0]
'0x9F156845Ed0ae8362094cE68DbFD68B25EEba7B4'
truffle(development)>token.transfer(tokenSale.address, tokensAvailable, {from: admin})


then you can buyTokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants