Question about ApplicationCreateTxn

When looking at the ApplicationCreateTxn examples on the Algorand GitHub repository, I noticed something peculiar.

# declare on_complete as NoOp
on_complete = transaction.OnComplete.NoOpOC.real

# create unsigned transaction
txn = transaction.ApplicationCreateTxn(

Right before creating the ApplicationCreateTxn, the on_complete is declared as a NoOp: on_complete = transaction.OnComplete.NoOpOC.real.

What is the purpose of this?

The on_complete specifies what application should do on run completion. If set as NoOps no special effect happens upon Application run completion. You could have different behaviours on App Creation completion though: like OptIn, CloseOut, CleareState, UpdateApplication or DeleteApplication.

As @jasonpaulos confirmed me: “you could opt in during the App Creation, or even delete the App immediately after it’s created if you want to have a simple throw-away execution environment”.

1 Like