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

Buy token in localhost:7545 #9

Open
Nghialm opened this issue Aug 24, 2018 · 7 comments
Open

Buy token in localhost:7545 #9

Nghialm opened this issue Aug 24, 2018 · 7 comments

Comments

@Nghialm
Copy link

Nghialm commented Aug 24, 2018

Hi, I get you solution and run buy tokens in web.
It has error below,
Please check for me
20token_erro

Thanks

@ZainaliSyed
Copy link

@gwmccubbin I am also facing same issue , please guide us what i am missing
screen shot 2018-09-04 at 9 22 12 pm

@gwmccubbin
Copy link
Contributor

@ZainaliSyed @Nghialm Hey there! Have you all tried resetting your Metamask account? You always need to do this after restarting ganache:

https://consensys.zendesk.com/hc/en-us/articles/360004177531-Resetting-an-Account-New-UI-

Also, do you still get this issue of you clone the code from the master branch?

@ZainaliSyed
Copy link

ZainaliSyed commented Sep 5, 2018

@gwmccubbin

Thank you for your time , Still facing same i had , failure in MetaMask transaction

  1. git pull origin master
  2. reset my MetaMask Account as well
  3. truffle compile
  4. truffle migtate --network=development --reset

Meta MAsk Version: 4.9.3
Ganache version : 1.2.1

@gwmccubbin
Copy link
Contributor

@ZainaliSyed Try this order?

git pull origin master
truffle compile
truffle migtate --network=development --reset
reset my MetaMask Account as well

@joaocarlosleme
Copy link

joaocarlosleme commented Jan 4, 2019

Same problem here. Solved by commenting out //require(tokenContract.balanceOf(this) >= _numberOfTokens); on DappTokenSale.sol (tokens are on Admin account, not ContractAccount I guess), and also commenting out //require(balanceOf[msg.sender] >= _value); on DappToken.sol, because sender may start with 0 dapps.

@gwmccubbin please check it out and let me know.

@ahsidd96
Copy link

@joaocarlosleme yes commenting out the required lines do solve the problem but is it really safe (in terms of coding) to do this?
@gwmccubbin Please help us out.

@joaocarlosleme
Copy link

joaocarlosleme commented Mar 11, 2019

@joaocarlosleme yes commenting out the required lines do solve the problem but is it really safe (in terms of coding) to do this?
@gwmccubbin Please help us out.

Commenting out those lines was a workaround to build but the actual solution is to transfer tokens from the account creator to the DappTokenSale.address as I mentioned on this answer on stackexchange.

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

5 participants