5

I have update Mist-wallet to latest 0.8.6 version and I was trying to execute a contract on my Test-network before working on Public net with this version. When I execute contract with fee suggested by Mist, it says

It seems your transaction will fail. If you submit it, it may consume all the gas you send.

I even provided the max available fee in Mist i.e 1.0541272 ether, And on confirmation page I see provide max fee as 0.02550988 ether (121000 gas). But still getting hit by same error message on confirmation page.

Prashant Prabhakar Singh
  • 8,026
  • 5
  • 40
  • 79

1 Answers1

3

This is normally an error detected by the eth.estimateGas(...) function call, where this call returns back a result that gasUsed==gas as you have found in your answer to How to estimate gas for a function without any input parameter?.

You can see the Mist error message at mist.en.i18n.json#L193:

"estimatedGasError": "It seems this transaction will fail. If you submit it, it may consume all the gas you send.",

And this estimatedGasError error message is displayed by the code at sendTransactionConfirmation.html#L56-L66:

{{#if transactionInvalid}}
    <p class="info dapp-error"> {{{i18n "mist.popupWindows.sendTransactionConfirmation.estimatedGasError"}}} </p>
{{else}}
...
{{/if}}

The transactionInvalid status is computed by the code at sendTransactionConfirmation.js#L259-L263:

'transactionInvalid': function() {
    return TemplateVar.get('estimatedGas') == 'invalid' 
            || TemplateVar.get('estimatedGas') == 0
            || typeof TemplateVar.get('estimatedGas') == 'undefined';
}

You may want to check your smart contract code to work out why the an error is being thrown.

BokkyPooBah
  • 40,274
  • 14
  • 123
  • 193
  • 1
    Thanks for elaborated answer, but I don't think there is any issue with my contract code. I have deployed same contract code on previous versions of Mist including 0.8.5. So why this version won't let me execute my contract if contract code is fine. – Prashant Prabhakar Singh Oct 17 '16 at 05:18
  • I have 3 versions of Mist, 0.8.1, 0.8.5 and latest 0.8.6. My contract code gets deployed onv 0.8. but gives same error message on v 0.8.5 and v 0.8.6. There is no syntax error obviously otherwise compiler would have detected it, so what is there is latest versions that is preventing my contract from deployment.One more thing, I am pretty sure I deployed same code on v0.8.5 3 days ago and it worked fine. But now I am getting hit by same error in this version too. Quite confused. – Prashant Prabhakar Singh Oct 17 '16 at 05:40
  • 1
    Got the issue, was a typo. The account from which transaction was being send in latest version was different from main account, so was throwing error. I updated the from while deploying contract to main address and worked fine. – Prashant Prabhakar Singh Oct 17 '16 at 05:50