Skip to content

exit

Stop script execution immediately.

Smart blocks: cannot be nested. This command performs an immediate wallet, RPC, external-service or control-flow operation and cannot run inside an atomic batch.

exit
# Stop script execution
print "before"
exit
  • exit is a clean stop, not an error: actions produced before it have already executed, everything after it is skipped.
  • It stops the whole script from anywhere — including inside loop blocks and def command bodies. Use loop break to leave just the loop, or def return to leave just the command body.
  • if — conditional execution
  • loop — loop break / loop continue for loop-scoped exits
  • def — def return for command-body exits