VanijaDev / rolex_ico

Default implementation of ICO and token contracts. So, it'd take less time to start customization
0 stars 1 forks source link

OpenZeppelin MintableToken issue #1

Open VanijaDev opened 6 years ago

VanijaDev commented 6 years ago

rolex_ico

OpenZeppelin bug

  1. inherit RolexToken token from MintableToken; 1.1 add 'totalSupply_ = 1;' into function RolexToken() public
  2. RolexICO contract inherited from CappedCrowdsale.
  3. Use Truffle 4 for deployment and migration (always with --reset)
  4. Create ICO: RolexICO.deployed().then(res => ico = res)
  5. Create token: ico.token().then(res => t = RolexToken.at(res))
  6. Send ETH to ICO: web3.eth.sendTransaction({from: web3.eth.accounts[0], to:ico.address, value:200}); all is good.
  7. restart the node and skip 1.1 (do not set totalSupply_ value)
  8. during 6 I get error

PS: I have tried switching lines 9 and 10 in RolexICO.sol.

truffle(develop)> t.totalSupply() BigNumber { s: 1, e: 0, c: [ 0 ] } truffle(develop)> web3.eth.sendTransaction({from: web3.eth.accounts[0], to:ico.address, value:200}); Error: VM Exception while processing transaction: revert at Eth.send [as sendTransaction] (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/method.js:145:1) at RequestManager.send (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:61:1) at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1) truffle(develop)> t.totalSupply() BigNumber { s: 1, e: 0, c: [ 0 ] }

screen shot 2018-02-11 at 22 54 07 screen shot 2018-02-11 at 22 55 24
VanijaDev commented 6 years ago

Tests are passed OK, but the issue persists if test manually with web3 (like screenshots above)