[Ethereum] How to a transaction fail

ethertransactions

Given that a transaction has

  1. A high enough gas limit for the transaction to succeed
  2. A high enough gas price for it to be mined
  3. No contract calls that throws

Is there any way that transaction can fail?

Best Answer

If there's enough gas provided, with the necessary gas price, and no contract calls that throw, then it shouldn't fail.

You should also consider the case where even if a large amount of gas is provided, if the contract contains an unbounded loop, some complex computation or recursive calls, it could fail by running out of gas, even if you provide the maximum possible gas limit.

Related Topic