3

What will happen if I use assert() inside the function inside() which is called from the function main() ?
If condition is true then control returns to function main() . What if condition is false? Do it return back to function main() or exit from the contract execution ?
As far as I know if the condition is false then It throws. This throws exit the function or exit the contract execution ?

function inside(){  
      assert(x>y);  

  }  
  function main(){  
      inside();  

  }  
  • Sharing some code would help us understand the issue better. – Sanchit Jul 20 '17 at 7:19
0

in short : the function assert(bool condition) : throws if the condition is not met.thus in your code if the condition is false the inside function will throw and stop the contract execution.

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.