I'm getting an error when I try to deploy a contract. I run ganache on which I can deploy other contracts without problems. My deployment file:

const Race = artifacts.require("./Race.sol");
const strings = artifacts.require("./strings.sol");

module.exports = function (deployer,  network, accounts) {
    deployer.then(async () => {
        await deployer.deploy(strings);
        await deployer.link(strings, Race);
        await deployer.deploy(Race);

When I run truffle.cmd migrate --network=ganache --reset I got the following error message:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: VM Exception while processing transaction: revert
    at Object.InvalidResponse (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\web3\lib\web3\errors.js:38:1)
    at C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\web3\lib\web3\requestmanager.js:86:1
    at C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:225:1
    at C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\packages\truffle-provider\wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\web3\lib\web3\httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\xhr2\lib\xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\xhr2\lib\xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\xhr2\lib\xhr2.js:509:1)
    at IncomingMessage.<anonymous> (C:\Program Files (x86)\Nodist\bin\node_modules\truffle\build\webpack:\~\xhr2\lib\xhr2.js:469:1)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)

My truffle config is:


module.exports = {
    solc: {
        optimizer: {
            enabled: true,
            runs: 200
    networks: {
        ganache: {
            host: 'localhost',
            port: 8545,
            network_id: '43', // eslint-disable-line camelcase
            gas: 6e6,
            gasPrice: 1e8

What does the error message means?

  • From the error message Error: VM Exception while processing transaction: revert it might be that a constructor is failing. I'd check first what contract is failing strings.sol or Race.sol. – Ismael Jul 23 '18 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.