PyTeal Migration
Classes and Functions
PyTeal | TEALScript |
---|---|
Txn | this.txn |
Global | globals |
Itxn | this.itxn |
Assert | assert |
NamedTuple | See Objects section here |
Gtxn | this.txnGroup |
precompile | See multiple contracts |
Maybe Values
In TEALScript, there is no concept of MaybeValue
. For every opcode that would return a MaybeValue
in PyTeal, TEALScript exposes two methods. One to get the value and one to get whether the value exists. Simply getting the value will always assert that the value exists. For boxes, the means needing to call exist
prior to get
. Otherwise there will be two methods, with one prefixed with has
to indicate it is getting whether the value exists or not.