I have code which transfer the ether to another address. And below that, I have require() condition will be failing. so will that execute the ether transfer or it will not transfer?

function ethTransfer(){


  require((1==5), 'error');   // ever reverting!!!


Any idea will be helpful. Thanks

  • 1
    Does this code even compile??? 1=5 is an assignment, not a boolean expression. Also, address is a key word, so address.transfer doesn't look like something which can compile. Please post a working example. Side note: instead of asking the question, you could simply run your code and check the balance of the account. Feb 18, 2019 at 8:31
  • 1
    I was thinking exactly the same. However, I think perhaps what is actually being asked is more of a conceptual question, rather than a code question: i.e. If a transfer has already been made, do failures further down the codepath cause that transfer to be reverted or not? Feb 18, 2019 at 12:38

2 Answers 2


Yes. If you revert within a call frame, all previous actions in that call frame (including sub-call frames) will be reverted.


A part the coding errors in the example code, your question is clear.

Answer: yes they will be transferred executing your transfer instruction. When your require shall be hit, it will revert all done before and the transferring as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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