1

Googled around and nothing could solve this error.

truffle migrate --network development

Using network 'development'.

Running migration: 2_deploy_contracts.js
1520374082 1522102082 1000 '4000000000000000000000' '0x4b7bebc60d1308b3f1bb15de43e373aecff81092'
  Deploying LUXCoinCrowdsale...
  ... 0x207f8d7293e801e139d01789fa9d9877335335ddb021adc3859f19d73dc9b904
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: VM Exception while processing transaction: revert
    at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:41483:16)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330353:36
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176198:11
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:326008:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:329052:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176427:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176717:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176872:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176832:24)
    at emitNone (events.js:111:20)

Countract: Rewrite getTokenAmount function of Crowdsale from zeppelin-solidity to increase rate by weeks. link:https://github.com/tonywangcn/ContractForLUX/blob/master/contracts/LUXCoinCrowdsale.sol

pragma solidity ^0.4.17;

import './LUXCoin.sol';
import "./CappedCrowdsale.sol";

contract LUXCoinCrowdsale is CappedCrowdsale {
  function LUXCoinCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _cap, address _wallet, MintableToken _token) public 
    CappedCrowdsale(_cap)
    Crowdsale(_startTime, _endTime, _rate, _wallet, _token)
  {
  }
  function createTokenContract() internal returns (MintableToken) {
    return new LUXCoin();
  }
}

truffle.js

link:https://github.com/tonywangcn/ContractForLUX/blob/master/truffle.js

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
    development: {
      network_id: "*",
      host: "127.0.0.1",
      port: 8545,   // Different than the default below
      gas: 6712388,
      gasPrice: 65000000000,
    }
  },
  rpc: {
    host: "127.0.0.1",
    port: 8545
  },
  solc: {
    optimizer: {
      enabled: true,
      runs: 200
    }
  }

};

Check the full repo :https://github.com/tonywangcn/ContractForLUX

Have tested local rpc network with metamask and ganache, works well except the smart contract.

output of testrpc console (testrpc --gasLimit 6721975 --gasPrice 100000000000 -u 0)

eth_getBlockByNumber
net_version
eth_accounts
eth_getBlockByNumber
eth_call
eth_call
eth_accounts
eth_getBlockByNumber
eth_blockNumber
eth_getBlockByNumber
eth_getBlockByNumber
net_version
net_version
eth_sendTransaction

  Transaction: 0xe6e8dfce0b31443d051d6af73fe5b16545e3cb9d83ee5adc7bb9a32b663a8100
  Contract created: 0x132a4a0b27cbb321ba2326f3b1f074f3baabb4bb
  Gas usage: 148559
  Block Number: 3
  Block Time: Mon Feb 05 2018 05:30:49 GMT+0000 (UTC)
  Runtime Error: revert

1 Answer 1

0

I didn't check your code properly but you should check if you implented all abstract functions peoperly. If you haven't then it compiles without any warning but it will be still an abstract contract and trying to deploy it reverts.

Either the compiler or truffle should warn but they dont.. It can be a bit of a pain to hunt it down. It can be caused even by a slight difference, eg. a different arg type or scope declaration of any abstract contract implementation or a wrong parent constuctor call.

You can always try in Remix for faster trial and error cycle.

3
  • It compiled well.Have tried Remix, but it's not convenient for development of multiple contracts.
    – Tony Wang
    Feb 5, 2018 at 3:49
  • were you able to deploy from remix ? abstract contracts compile you just cant deploy them
    – szerte
    Feb 5, 2018 at 7:28
  • how did you manage to solve tihs?
    – Basit
    Apr 8, 2018 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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