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