Skip to main content
added 34 characters in body
Source Link
Badr Bellaj
  • 18.8k
  • 4
  • 59
  • 75

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();

}

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

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();

}

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();  
      
  }  
added 117 characters in body
Source Link
Gopal ojha
  • 2.2k
  • 2
  • 12
  • 21

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();

}

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 ?

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();

}

Source Link
Gopal ojha
  • 2.2k
  • 2
  • 12
  • 21

assert() in nested function

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 ?