You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/transactions/logic/README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ Starting from version 2 TEAL evaluator can run programs in two modes:
36
36
2. Application run (stateful)
37
37
38
38
Differences between modes include:
39
-
1. Max program length (consensus parameters LogicSigMaxSize, MaxApprovalProgramLen and MaxClearStateProgramLen)
39
+
1. Max program length (consensus parameters LogicSigMaxSize, MaxAppProgramLen & MaxExtraAppProgramPages)
40
40
2. Max program cost (consensus parameters LogicSigMaxCost, MaxAppProgramCost)
41
-
3.Opcodes availability. For example, all stateful operations are only available in stateful mode. Refer to [opcodes document](TEAL_opcodes.md) for details.
41
+
3.Opcode availability. For example, all stateful operations are only available in stateful mode. Refer to [opcodes document](TEAL_opcodes.md) for details.
42
42
43
43
## Constants
44
44
@@ -345,19 +345,19 @@ Asset fields include `AssetHolding` and `AssetParam` fields that are used in `as
345
345
346
346
| Op | Description |
347
347
| --- | --- |
348
-
|`balance`| get balance for the requested account specified by Txn.Accounts[A] in microalgos. A is specified as an account index in the Accounts field of the ApplicationCall transaction, zero index means the sender. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. |
349
-
|`min_balance`| get minimum required balance for the requested account specified by Txn.Accounts[A] in microalgos. A is specified as an account index in the Accounts field of the ApplicationCall transaction, zero index means the sender. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. |
350
-
|`app_opted_in`| check if account specified by Txn.Accounts[A] opted in for the application B => {0 or 1} |
351
-
|`app_local_get`| read from account specified by Txn.Accounts[A] from local state of the current application key B => value |
352
-
|`app_local_get_ex`| read from account specified by Txn.Accounts[A] from local state of the application B key C => [*... stack*, value, 0 or 1]|
348
+
|`balance`| get balance account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. |
349
+
|`min_balance`| get minimum required balance account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. |
350
+
|`app_opted_in`| check if account A opted in for the application B => {0 or 1} |
351
+
|`app_local_get`| read from account A from local state of the current application key B => value |
352
+
|`app_local_get_ex`| read from account A from local state of the application B key C => [*... stack*, value, 0 or 1]|
353
353
|`app_global_get`| read key A from global state of a current application => value |
354
-
|`app_global_get_ex`| read from application Txn.ForeignApps[A] global state key B => [*... stack*, value, 0 or 1]. A is specified as an account index in the ForeignApps field of the ApplicationCall transaction, zero index means this app|
355
-
|`app_local_put`| write to account specified by Txn.Accounts[A] to local state of a current application key B with value C |
354
+
|`app_global_get_ex`| read from application A global state key B => [*... stack*, value, 0 or 1]|
355
+
|`app_local_put`| write to account specified by A to local state of a current application key B with value C |
356
356
|`app_global_put`| write key A and value B to global state of the current application |
357
-
|`app_local_del`| delete from account specified by Txn.Accounts[A] local state key B of the current application |
357
+
|`app_local_del`| delete from account A local state key B of the current application |
358
358
|`app_global_del`| delete key A from a global state of the current application |
359
-
|`asset_holding_get i`| read from account specified by Txn.Accounts[A] and asset B holding field X (imm arg) => {0 or 1 (top), value} |
360
-
|`asset_params_get i`| read from asset Txn.ForeignAssets[A] params field X (imm arg) => {0 or 1 (top), value} |
359
+
|`asset_holding_get i`| read from account A and asset B holding field X (imm arg) => {0 or 1 (top), value} |
360
+
|`asset_params_get i`| read from asset A params field X (imm arg) => {0 or 1 (top), value} |
Copy file name to clipboardExpand all lines: data/transactions/logic/TEAL_opcodes.md
+30-26Lines changed: 30 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -702,44 +702,46 @@ bit indexing begins with low-order bits in integers. Setting bit 4 to 1 on the i
702
702
## balance
703
703
704
704
- Opcode: 0x60
705
-
- Pops: *... stack*, uint64
705
+
- Pops: *... stack*, any
706
706
- Pushes: uint64
707
-
- get balance for the requested account specified by Txn.Accounts[A] in microalgos. A is specified as an account index in the Accounts field of the ApplicationCall transaction, zero index means the sender. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.
707
+
- get balance account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.
708
708
- LogicSigVersion >= 2
709
709
- Mode: Application
710
710
711
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.
712
+
711
713
## app_opted_in
712
714
713
715
- Opcode: 0x61
714
-
- Pops: *... stack*, {uint64 A}, {uint64 B}
716
+
- Pops: *... stack*, {any A}, {uint64 B}
715
717
- Pushes: uint64
716
-
- check if account specified by Txn.Accounts[A] opted in for the application B => {0 or 1}
718
+
- check if account A opted in for the application B => {0 or 1}
717
719
- LogicSigVersion >= 2
718
720
- Mode: Application
719
721
720
-
params: account index, application id (top of the stack on opcode entry). Return: 1 if opted in and 0 otherwise.
722
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.
721
723
722
724
## app_local_get
723
725
724
726
- Opcode: 0x62
725
-
- Pops: *... stack*, {uint64 A}, {[]byte B}
727
+
- Pops: *... stack*, {any A}, {[]byte B}
726
728
- Pushes: any
727
-
- read from account specified by Txn.Accounts[A] from local state of the current application key B => value
729
+
- read from account A from local state of the current application key B => value
728
730
- LogicSigVersion >= 2
729
731
- Mode: Application
730
732
731
-
params: account index, state key. Return: value. The value is zero (of type uint64) if the key does not exist.
733
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key. Return: value. The value is zero (of type uint64) if the key does not exist.
- read from account specified by Txn.Accounts[A] from local state of the application B key C => [*... stack*, value, 0 or 1]
740
+
- read from account A from local state of the application B key C => [*... stack*, value, 0 or 1]
739
741
- LogicSigVersion >= 2
740
742
- Mode: Application
741
743
742
-
params: account index, application id, state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.
744
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.
743
745
744
746
## app_global_get
745
747
@@ -757,22 +759,22 @@ params: state key. Return: value. The value is zero (of type uint64) if the key
757
759
- Opcode: 0x65
758
760
- Pops: *... stack*, {uint64 A}, {[]byte B}
759
761
- Pushes: *... stack*, any, uint64
760
-
- read from application Txn.ForeignApps[A] global state key B => [*... stack*, value, 0 or 1]. A is specified as an account index in the ForeignApps field of the ApplicationCall transaction, zero index means this app
762
+
- read from application A global state key B => [*... stack*, value, 0 or 1]
761
763
- LogicSigVersion >= 2
762
764
- Mode: Application
763
765
764
-
params: application index, state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.
766
+
params: Txn.ForeignApps offset (or, since v4, an application id that appears in Txn.ForeignApps or is the CurrentApplicationID), state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.
- write to account specified by Txn.Accounts[A] to local state of a current application key B with value C
773
+
- write to account specified by A to local state of a current application key B with value C
772
774
- LogicSigVersion >= 2
773
775
- Mode: Application
774
776
775
-
params: account index, state key, value.
777
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key, value.
776
778
777
779
## app_global_put
778
780
@@ -786,13 +788,13 @@ params: account index, state key, value.
786
788
## app_local_del
787
789
788
790
- Opcode: 0x68
789
-
- Pops: *... stack*, {uint64 A}, {[]byte B}
791
+
- Pops: *... stack*, {any A}, {[]byte B}
790
792
- Pushes: _None_
791
-
- delete from account specified by Txn.Accounts[A] local state key B of the current application
793
+
- delete from account A local state key B of the current application
792
794
- LogicSigVersion >= 2
793
795
- Mode: Application
794
796
795
-
params: account index, state key.
797
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key.
796
798
797
799
Deleting a key which is already absent has no effect on the application local state. (In particular, it does _not_ cause the program to fail.)
798
800
@@ -812,9 +814,9 @@ Deleting a key which is already absent has no effect on the application global s
812
814
## asset_holding_get i
813
815
814
816
- Opcode: 0x70 {uint8 asset holding field index}
815
-
- Pops: *... stack*, {uint64 A}, {uint64 B}
817
+
- Pops: *... stack*, {any A}, {uint64 B}
816
818
- Pushes: *... stack*, any, uint64
817
-
- read from account specified by Txn.Accounts[A] and asset B holding field X (imm arg) => {0 or 1 (top), value}
819
+
- read from account A and asset B holding field X (imm arg) => {0 or 1 (top), value}
818
820
- LogicSigVersion >= 2
819
821
- Mode: Application
820
822
@@ -826,14 +828,14 @@ Deleting a key which is already absent has no effect on the application global s
826
828
| 1 | AssetFrozen | uint64 | Is the asset frozen or not |
827
829
828
830
829
-
params: account index, asset id. Return: did_exist flag (1 if exist and 0 otherwise), value.
831
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if exist and 0 otherwise), value.
830
832
831
833
## asset_params_get i
832
834
833
835
- Opcode: 0x71 {uint8 asset params field index}
834
836
- Pops: *... stack*, uint64
835
837
- Pushes: *... stack*, any, uint64
836
-
- read from asset Txn.ForeignAssets[A] params field X (imm arg) => {0 or 1 (top), value}
838
+
- read from asset A params field X (imm arg) => {0 or 1 (top), value}
837
839
- LogicSigVersion >= 2
838
840
- Mode: Application
839
841
@@ -854,17 +856,19 @@ params: account index, asset id. Return: did_exist flag (1 if exist and 0 otherw
854
856
| 10 | AssetClawback |[]byte | Clawback address |
855
857
856
858
857
-
params: txn.ForeignAssets offset. Return: did_exist flag (1 if exist and 0 otherwise), value.
859
+
params: Txn.ForeignAssets offset (or, since v4, an asset id that appears in Txn.ForeignAssets) . Return: did_exist flag (1 if exist and 0 otherwise), value.
858
860
859
861
## min_balance
860
862
861
863
- Opcode: 0x78
862
-
- Pops: *... stack*, uint64
864
+
- Pops: *... stack*, any
863
865
- Pushes: uint64
864
-
- get minimum required balance for the requested account specified by Txn.Accounts[A] in microalgos. A is specified as an account index in the Accounts field of the ApplicationCall transaction, zero index means the sender. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.
866
+
- get minimum required balance account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.
865
867
- LogicSigVersion >= 3
866
868
- Mode: Application
867
869
870
+
params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.
0 commit comments