I am calling address.transfer() from the one of the deployed contract. While, this works fine with remix(JavaScript VM environment), the same fails if I deploy and run the same contract on 'ganache'.

I get the below stack on using ganache,

Error: VM Exception while processing transaction: revert
    at \node_modules\web3-provider-engine\subproviders\provider.js:19:36
    at XMLHttpRequest.request.onreadystatechange (\node_modules\truffle-hdwallet-provider\node_modules\web3\lib\web3\httpprovider.js:118:13)
    at XMLHttpRequestEventTarget.dispatchEvent (\node_modules\xhr2\lib\xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (\node_modules\xhr2\lib\xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (\node_modules\xhr2\lib\xhr2.js:509:12)
    at IncomingMessage.<anonymous> (\node_modules\xhr2\lib\xhr2.js:469:24)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I tried also setting 'gas' with in my contract but, that too did not help


How did you call your contract method? This happens when the contract method is not called properly.

I got mine working following the comment with max thumbs-up. https://github.com/trufflesuite/truffle/issues/748

Another Eg:

myContractInstance.myStateChangingMethod('someParam1', 'anotherParam', {from: someAddress, gas: 3000000});

  • worked like a charm!! thanks.. How does it work on remix though without mentioning 'gas' ? – karts Jun 12 '18 at 15:03
  • In remix, The "Gas limit" is by default shown as 3000000. The minimum gas limit is 21000 and maximum is around 8000000 gas. For transactions with good amount of data in it, may require more gas > 210000. So small contracts will work without specifying the gas. In real-life programs gas needs to be explicitly given. – Neethu Satheesh Jun 13 '18 at 5:08

Your Answer

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

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