algosdk 1.10.1 → 1.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +17 -6
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/src/abi/abi_type.js +665 -0
  5. package/dist/cjs/src/abi/abi_type.js.map +1 -0
  6. package/dist/cjs/src/abi/contract.js +25 -0
  7. package/dist/cjs/src/abi/contract.js.map +1 -0
  8. package/dist/cjs/src/abi/index.js +17 -0
  9. package/dist/cjs/src/abi/index.js.map +1 -0
  10. package/dist/cjs/src/abi/interface.js +21 -0
  11. package/dist/cjs/src/abi/interface.js.map +1 -0
  12. package/dist/cjs/src/abi/method.js +117 -0
  13. package/dist/cjs/src/abi/method.js.map +1 -0
  14. package/dist/cjs/src/client/v2/algod/models/types.js +18 -12
  15. package/dist/cjs/src/client/v2/algod/models/types.js.map +1 -1
  16. package/dist/cjs/src/client/v2/indexer/indexer.js +8 -0
  17. package/dist/cjs/src/client/v2/indexer/indexer.js.map +1 -1
  18. package/dist/cjs/src/client/v2/indexer/lookupApplicationLogs.js +48 -0
  19. package/dist/cjs/src/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
  20. package/dist/cjs/src/composer.js +319 -0
  21. package/dist/cjs/src/composer.js.map +1 -0
  22. package/dist/cjs/src/encoding/address.js +14 -1
  23. package/dist/cjs/src/encoding/address.js.map +1 -1
  24. package/dist/cjs/src/encoding/bigint.js +38 -0
  25. package/dist/cjs/src/encoding/bigint.js.map +1 -0
  26. package/dist/cjs/src/logic/langspec.json +392 -77
  27. package/dist/cjs/src/logic/logic.js.map +1 -1
  28. package/dist/cjs/src/logicsig.js +207 -49
  29. package/dist/cjs/src/logicsig.js.map +1 -1
  30. package/dist/cjs/src/main.js +18 -99
  31. package/dist/cjs/src/main.js.map +1 -1
  32. package/dist/cjs/src/makeTxn.js +29 -1
  33. package/dist/cjs/src/makeTxn.js.map +1 -1
  34. package/dist/cjs/src/multisig.js +115 -21
  35. package/dist/cjs/src/multisig.js.map +1 -1
  36. package/dist/cjs/src/signer.js +66 -0
  37. package/dist/cjs/src/signer.js.map +1 -0
  38. package/dist/cjs/src/transaction.js +49 -8
  39. package/dist/cjs/src/transaction.js.map +1 -1
  40. package/dist/cjs/src/types/intDecoding.js +0 -2
  41. package/dist/cjs/src/types/intDecoding.js.map +1 -1
  42. package/dist/cjs/src/types/transactions/base.js +0 -1
  43. package/dist/cjs/src/types/transactions/base.js.map +1 -1
  44. package/dist/cjs/src/wait.js +40 -0
  45. package/dist/cjs/src/wait.js.map +1 -0
  46. package/dist/esm/src/abi/abi_type.js +652 -0
  47. package/dist/esm/src/abi/abi_type.js.map +1 -0
  48. package/dist/esm/src/abi/contract.js +21 -0
  49. package/dist/esm/src/abi/contract.js.map +1 -0
  50. package/dist/esm/src/abi/index.js +5 -0
  51. package/dist/esm/src/abi/index.js.map +1 -0
  52. package/dist/esm/src/abi/interface.js +17 -0
  53. package/dist/esm/src/abi/interface.js.map +1 -0
  54. package/dist/esm/src/abi/method.js +112 -0
  55. package/dist/esm/src/abi/method.js.map +1 -0
  56. package/dist/esm/src/client/v2/algod/models/types.js +18 -12
  57. package/dist/esm/src/client/v2/algod/models/types.js.map +1 -1
  58. package/dist/esm/src/client/v2/indexer/indexer.js +8 -0
  59. package/dist/esm/src/client/v2/indexer/indexer.js.map +1 -1
  60. package/dist/esm/src/client/v2/indexer/lookupApplicationLogs.js +42 -0
  61. package/dist/esm/src/client/v2/indexer/lookupApplicationLogs.js.map +1 -0
  62. package/dist/esm/src/composer.js +315 -0
  63. package/dist/esm/src/composer.js.map +1 -0
  64. package/dist/esm/src/encoding/address.js +12 -0
  65. package/dist/esm/src/encoding/address.js.map +1 -1
  66. package/dist/esm/src/encoding/bigint.js +33 -0
  67. package/dist/esm/src/encoding/bigint.js.map +1 -0
  68. package/dist/esm/src/logic/langspec.json +392 -77
  69. package/dist/esm/src/logic/logic.js.map +1 -1
  70. package/dist/esm/src/logicsig.js +205 -48
  71. package/dist/esm/src/logicsig.js.map +1 -1
  72. package/dist/esm/src/main.js +8 -94
  73. package/dist/esm/src/main.js.map +1 -1
  74. package/dist/esm/src/makeTxn.js +27 -0
  75. package/dist/esm/src/makeTxn.js.map +1 -1
  76. package/dist/esm/src/multisig.js +111 -20
  77. package/dist/esm/src/multisig.js.map +1 -1
  78. package/dist/esm/src/signer.js +59 -0
  79. package/dist/esm/src/signer.js.map +1 -0
  80. package/dist/esm/src/transaction.js +49 -8
  81. package/dist/esm/src/transaction.js.map +1 -1
  82. package/dist/esm/src/types/intDecoding.js +0 -2
  83. package/dist/esm/src/types/intDecoding.js.map +1 -1
  84. package/dist/esm/src/types/transactions/base.js +0 -1
  85. package/dist/esm/src/types/transactions/base.js.map +1 -1
  86. package/dist/esm/src/wait.js +36 -0
  87. package/dist/esm/src/wait.js.map +1 -0
  88. package/dist/types/src/abi/abi_type.d.ts +102 -0
  89. package/dist/types/src/abi/contract.d.ts +13 -0
  90. package/dist/types/src/abi/index.d.ts +4 -0
  91. package/dist/types/src/abi/interface.d.ts +11 -0
  92. package/dist/types/src/abi/method.d.ts +37 -0
  93. package/dist/types/src/client/v2/algod/models/types.d.ts +29 -14
  94. package/dist/types/src/client/v2/indexer/indexer.d.ts +6 -0
  95. package/dist/types/src/client/v2/indexer/lookupApplicationLogs.d.ts +20 -0
  96. package/dist/types/src/composer.d.ts +146 -0
  97. package/dist/types/src/encoding/address.d.ts +6 -0
  98. package/dist/types/src/encoding/bigint.d.ts +14 -0
  99. package/dist/types/src/logic/logic.d.ts +1 -1
  100. package/dist/types/src/logicsig.d.ts +100 -14
  101. package/dist/types/src/main.d.ts +8 -49
  102. package/dist/types/src/makeTxn.d.ts +18 -1
  103. package/dist/types/src/multisig.d.ts +40 -1
  104. package/dist/types/src/signer.d.ts +40 -0
  105. package/dist/types/src/types/transactions/encoded.d.ts +12 -0
  106. package/dist/types/src/wait.d.ts +11 -0
  107. package/package.json +2 -2
@@ -1,13 +1,13 @@
1
1
  {
2
- "EvalMaxVersion": 4,
3
- "LogicSigVersion": 3,
2
+ "EvalMaxVersion": 5,
3
+ "LogicSigVersion": 5,
4
4
  "Ops": [
5
5
  {
6
6
  "Opcode": 0,
7
7
  "Name": "err",
8
8
  "Cost": 1,
9
9
  "Size": 1,
10
- "Doc": "Error. Panic immediately. This is primarily a fencepost against accidental zero bytes getting compiled into programs.",
10
+ "Doc": "Error. Fail immediately. This is primarily a fencepost against accidental zero bytes getting compiled into programs.",
11
11
  "Groups": ["Flow Control"]
12
12
  },
13
13
  {
@@ -51,6 +51,42 @@
51
51
  "DocExtra": "The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.",
52
52
  "Groups": ["Arithmetic"]
53
53
  },
54
+ {
55
+ "Opcode": 5,
56
+ "Name": "ecdsa_verify",
57
+ "Args": "BBBBB",
58
+ "Returns": "U",
59
+ "Cost": 1700,
60
+ "Size": 2,
61
+ "Doc": "for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey =\u003e {0 or 1}",
62
+ "DocExtra": "The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.",
63
+ "ImmediateNote": "{uint8 curve index}",
64
+ "Groups": ["Arithmetic"]
65
+ },
66
+ {
67
+ "Opcode": 6,
68
+ "Name": "ecdsa_pk_decompress",
69
+ "Args": "B",
70
+ "Returns": "BB",
71
+ "Cost": 650,
72
+ "Size": 2,
73
+ "Doc": "decompress pubkey A into components X, Y =\u003e [*... stack*, X, Y]",
74
+ "DocExtra": "The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.",
75
+ "ImmediateNote": "{uint8 curve index}",
76
+ "Groups": ["Arithmetic"]
77
+ },
78
+ {
79
+ "Opcode": 7,
80
+ "Name": "ecdsa_pk_recover",
81
+ "Args": "BUBB",
82
+ "Returns": "BB",
83
+ "Cost": 2000,
84
+ "Size": 2,
85
+ "Doc": "for (data A, recovery id B, signature C, D) recover a public key =\u003e [*... stack*, X, Y]",
86
+ "DocExtra": "S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.",
87
+ "ImmediateNote": "{uint8 curve index}",
88
+ "Groups": ["Arithmetic"]
89
+ },
54
90
  {
55
91
  "Opcode": 8,
56
92
  "Name": "+",
@@ -58,7 +94,7 @@
58
94
  "Returns": "U",
59
95
  "Cost": 1,
60
96
  "Size": 1,
61
- "Doc": "A plus B. Panic on overflow.",
97
+ "Doc": "A plus B. Fail on overflow.",
62
98
  "DocExtra": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `addw`.",
63
99
  "Groups": ["Arithmetic"]
64
100
  },
@@ -69,7 +105,7 @@
69
105
  "Returns": "U",
70
106
  "Cost": 1,
71
107
  "Size": 1,
72
- "Doc": "A minus B. Panic if B \u003e A.",
108
+ "Doc": "A minus B. Fail if B \u003e A.",
73
109
  "Groups": ["Arithmetic"]
74
110
  },
75
111
  {
@@ -79,7 +115,7 @@
79
115
  "Returns": "U",
80
116
  "Cost": 1,
81
117
  "Size": 1,
82
- "Doc": "A divided by B. Panic if B == 0.",
118
+ "Doc": "A divided by B (truncated division). Fail if B == 0.",
83
119
  "DocExtra": "`divmodw` is available to divide the two-element values produced by `mulw` and `addw`.",
84
120
  "Groups": ["Arithmetic"]
85
121
  },
@@ -90,7 +126,7 @@
90
126
  "Returns": "U",
91
127
  "Cost": 1,
92
128
  "Size": 1,
93
- "Doc": "A times B. Panic on overflow.",
129
+ "Doc": "A times B. Fail on overflow.",
94
130
  "DocExtra": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `mulw`.",
95
131
  "Groups": ["Arithmetic"]
96
132
  },
@@ -212,7 +248,7 @@
212
248
  "Cost": 1,
213
249
  "Size": 1,
214
250
  "Doc": "converts bytes X as big endian to uint64",
215
- "DocExtra": "`btoi` panics if the input is longer than 8 bytes.",
251
+ "DocExtra": "`btoi` fails if the input is longer than 8 bytes.",
216
252
  "Groups": ["Arithmetic"]
217
253
  },
218
254
  {
@@ -222,7 +258,7 @@
222
258
  "Returns": "U",
223
259
  "Cost": 1,
224
260
  "Size": 1,
225
- "Doc": "A modulo B. Panic if B == 0.",
261
+ "Doc": "A modulo B. Fail if B == 0.",
226
262
  "Groups": ["Arithmetic"]
227
263
  },
228
264
  {
@@ -516,9 +552,14 @@
516
552
  "GlobalNumByteSlice",
517
553
  "LocalNumUint",
518
554
  "LocalNumByteSlice",
519
- "ExtraProgramPages"
555
+ "ExtraProgramPages",
556
+ "Nonparticipation",
557
+ "Logs",
558
+ "NumLogs",
559
+ "CreatedAssetID",
560
+ "CreatedApplicationID"
520
561
  ],
521
- "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUU",
562
+ "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU",
522
563
  "Doc": "push field F of current transaction to stack",
523
564
  "DocExtra": "FirstValidTime causes the program to fail. The field is reserved for future use.",
524
565
  "ImmediateNote": "{uint8 transaction field index}",
@@ -540,9 +581,11 @@
540
581
  "Round",
541
582
  "LatestTimestamp",
542
583
  "CurrentApplicationID",
543
- "CreatorAddress"
584
+ "CreatorAddress",
585
+ "CurrentApplicationAddress",
586
+ "GroupID"
544
587
  ],
545
- "ArgEnumTypes": "UUUBUUUUUB",
588
+ "ArgEnumTypes": "UUUBUUUUUBBB",
546
589
  "Doc": "push value from globals to stack",
547
590
  "ImmediateNote": "{uint8 global field index}",
548
591
  "Groups": ["Loading Values"]
@@ -610,9 +653,14 @@
610
653
  "GlobalNumByteSlice",
611
654
  "LocalNumUint",
612
655
  "LocalNumByteSlice",
613
- "ExtraProgramPages"
656
+ "ExtraProgramPages",
657
+ "Nonparticipation",
658
+ "Logs",
659
+ "NumLogs",
660
+ "CreatedAssetID",
661
+ "CreatedApplicationID"
614
662
  ],
615
- "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUU",
663
+ "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU",
616
664
  "Doc": "push field F of the Tth transaction in the current group",
617
665
  "DocExtra": "for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.",
618
666
  "ImmediateNote": "{uint8 transaction group index} {uint8 transaction field index}",
@@ -624,7 +672,7 @@
624
672
  "Returns": ".",
625
673
  "Cost": 1,
626
674
  "Size": 2,
627
- "Doc": "copy a value from scratch space to the stack",
675
+ "Doc": "copy a value from scratch space to the stack. All scratch spaces are 0 at program start.",
628
676
  "ImmediateNote": "{uint8 position in scratch space to load from}",
629
677
  "Groups": ["Loading Values"]
630
678
  },
@@ -634,7 +682,7 @@
634
682
  "Args": ".",
635
683
  "Cost": 1,
636
684
  "Size": 2,
637
- "Doc": "pop a value from the stack and store to scratch space",
685
+ "Doc": "pop value X. store X to the Ith scratch space",
638
686
  "ImmediateNote": "{uint8 position in scratch space to store to}",
639
687
  "Groups": ["Loading Values"]
640
688
  },
@@ -644,8 +692,14 @@
644
692
  "Returns": ".",
645
693
  "Cost": 1,
646
694
  "Size": 3,
647
- "ArgEnum": ["ApplicationArgs", "Accounts"],
648
- "ArgEnumTypes": "BBUU",
695
+ "ArgEnum": [
696
+ "ApplicationArgs",
697
+ "Accounts",
698
+ "Assets",
699
+ "Applications",
700
+ "Logs"
701
+ ],
702
+ "ArgEnumTypes": "BBUUB",
649
703
  "Doc": "push Ith value of the array field F of the current transaction",
650
704
  "ImmediateNote": "{uint8 transaction field index} {uint8 transaction field array index}",
651
705
  "Groups": ["Loading Values"]
@@ -656,8 +710,14 @@
656
710
  "Returns": ".",
657
711
  "Cost": 1,
658
712
  "Size": 4,
659
- "ArgEnum": ["ApplicationArgs", "Accounts"],
660
- "ArgEnumTypes": "BBUU",
713
+ "ArgEnum": [
714
+ "ApplicationArgs",
715
+ "Accounts",
716
+ "Assets",
717
+ "Applications",
718
+ "Logs"
719
+ ],
720
+ "ArgEnumTypes": "BBUUB",
661
721
  "Doc": "push Ith value of the array field F from the Tth transaction in the current group",
662
722
  "ImmediateNote": "{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}",
663
723
  "Groups": ["Loading Values"]
@@ -726,10 +786,15 @@
726
786
  "GlobalNumByteSlice",
727
787
  "LocalNumUint",
728
788
  "LocalNumByteSlice",
729
- "ExtraProgramPages"
789
+ "ExtraProgramPages",
790
+ "Nonparticipation",
791
+ "Logs",
792
+ "NumLogs",
793
+ "CreatedAssetID",
794
+ "CreatedApplicationID"
730
795
  ],
731
- "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUU",
732
- "Doc": "push field F of the Ath transaction in the current group",
796
+ "ArgEnumTypes": "BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUU",
797
+ "Doc": "push field F of the Xth transaction in the current group",
733
798
  "DocExtra": "for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction.",
734
799
  "ImmediateNote": "{uint8 transaction field index}",
735
800
  "Groups": ["Loading Values"]
@@ -741,9 +806,15 @@
741
806
  "Returns": ".",
742
807
  "Cost": 1,
743
808
  "Size": 3,
744
- "ArgEnum": ["ApplicationArgs", "Accounts"],
745
- "ArgEnumTypes": "BBUU",
746
- "Doc": "push Ith value of the array field F from the Ath transaction in the current group",
809
+ "ArgEnum": [
810
+ "ApplicationArgs",
811
+ "Accounts",
812
+ "Assets",
813
+ "Applications",
814
+ "Logs"
815
+ ],
816
+ "ArgEnumTypes": "BBUUB",
817
+ "Doc": "push Ith value of the array field F from the Xth transaction in the current group",
747
818
  "ImmediateNote": "{uint8 transaction field index} {uint8 transaction field array index}",
748
819
  "Groups": ["Loading Values"]
749
820
  },
@@ -754,7 +825,7 @@
754
825
  "Cost": 1,
755
826
  "Size": 3,
756
827
  "Doc": "push Ith scratch space index of the Tth transaction in the current group",
757
- "DocExtra": "The `gload` opcode can only access scratch spaces of previous app calls contained in the current group.",
828
+ "DocExtra": "`gload` fails unless the requested transaction is an ApplicationCall and T \u003c GroupIndex.",
758
829
  "ImmediateNote": "{uint8 transaction group index} {uint8 position in scratch space to load from}",
759
830
  "Groups": ["Loading Values"]
760
831
  },
@@ -765,8 +836,8 @@
765
836
  "Returns": ".",
766
837
  "Cost": 1,
767
838
  "Size": 2,
768
- "Doc": "push Ith scratch space index of the Ath transaction in the current group",
769
- "DocExtra": "The `gloads` opcode can only access scratch spaces of previous app calls contained in the current group.",
839
+ "Doc": "push Ith scratch space index of the Xth transaction in the current group",
840
+ "DocExtra": "`gloads` fails unless the requested transaction is an ApplicationCall and X \u003c GroupIndex.",
770
841
  "ImmediateNote": "{uint8 position in scratch space to load from}",
771
842
  "Groups": ["Loading Values"]
772
843
  },
@@ -777,7 +848,8 @@
777
848
  "Cost": 1,
778
849
  "Size": 2,
779
850
  "Doc": "push the ID of the asset or application created in the Tth transaction of the current group",
780
- "DocExtra": "The `gaid` opcode can only access the ID of assets or applications created by previous txns in the current group.",
851
+ "DocExtra": "`gaid` fails unless the requested transaction created an asset or application and T \u003c GroupIndex.",
852
+ "ImmediateNote": "{uint8 transaction group index}",
781
853
  "Groups": ["Loading Values"]
782
854
  },
783
855
  {
@@ -787,8 +859,27 @@
787
859
  "Returns": "U",
788
860
  "Cost": 1,
789
861
  "Size": 1,
790
- "Doc": "push the ID of the asset or application created in the Ath transaction of the current group",
791
- "DocExtra": "The `gaids` opcode can only access the ID of assets or applications created by previous txns in the current group.",
862
+ "Doc": "push the ID of the asset or application created in the Xth transaction of the current group",
863
+ "DocExtra": "`gaids` fails unless the requested transaction created an asset or application and X \u003c GroupIndex.",
864
+ "Groups": ["Loading Values"]
865
+ },
866
+ {
867
+ "Opcode": 62,
868
+ "Name": "loads",
869
+ "Args": "U",
870
+ "Returns": ".",
871
+ "Cost": 1,
872
+ "Size": 1,
873
+ "Doc": "copy a value from the Xth scratch space to the stack. All scratch spaces are 0 at program start.",
874
+ "Groups": ["Loading Values"]
875
+ },
876
+ {
877
+ "Opcode": 63,
878
+ "Name": "stores",
879
+ "Args": "U.",
880
+ "Cost": 1,
881
+ "Size": 1,
882
+ "Doc": "pop indexes A and B. store B to the Ath scratch space",
792
883
  "Groups": ["Loading Values"]
793
884
  },
794
885
  {
@@ -798,8 +889,8 @@
798
889
  "Cost": 1,
799
890
  "Size": 3,
800
891
  "Doc": "branch to TARGET if value X is not zero",
801
- "DocExtra": "The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be well aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Branch offsets are limited to forward branches only, 0-0x7fff until v4. v4 treats offset as a signed 16 bit integer allowing for backward branches and looping.\n\nAt LogicSigVersion 2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before LogicSigVersion 2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)",
802
- "ImmediateNote": "{int16 branch offset, big endian. (negative offsets are illegal before v4)}",
892
+ "DocExtra": "The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Starting at v4, the offset is treated as a signed 16 bit integer allowing for backward branches and looping. In prior version (v1 to v3), branch offsets are limited to forward branches only, 0-0x7fff.\n\nAt v2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before v2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)",
893
+ "ImmediateNote": "{int16 branch offset, big endian}",
803
894
  "Groups": ["Flow Control"]
804
895
  },
805
896
  {
@@ -810,7 +901,7 @@
810
901
  "Size": 3,
811
902
  "Doc": "branch to TARGET if value X is zero",
812
903
  "DocExtra": "See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`.",
813
- "ImmediateNote": "{int16 branch offset, big endian. (negative offsets are illegal before v4)}",
904
+ "ImmediateNote": "{int16 branch offset, big endian}",
814
905
  "Groups": ["Flow Control"]
815
906
  },
816
907
  {
@@ -820,7 +911,7 @@
820
911
  "Size": 3,
821
912
  "Doc": "branch unconditionally to TARGET",
822
913
  "DocExtra": "See `bnz` for details on how branches work. `b` always jumps to the offset.",
823
- "ImmediateNote": "{int16 branch offset, big endian. (negative offsets are illegal before v4)}",
914
+ "ImmediateNote": "{int16 branch offset, big endian}",
824
915
  "Groups": ["Flow Control"]
825
916
  },
826
917
  {
@@ -901,6 +992,28 @@
901
992
  "Doc": "selects one of two values based on top-of-stack: A, B, C -\u003e (if C != 0 then B else A)",
902
993
  "Groups": ["Flow Control"]
903
994
  },
995
+ {
996
+ "Opcode": 78,
997
+ "Name": "cover",
998
+ "Args": ".",
999
+ "Returns": ".",
1000
+ "Cost": 1,
1001
+ "Size": 2,
1002
+ "Doc": "remove top of stack, and place it deeper in the stack such that N elements are above it. Fails if stack depth \u003c= N.",
1003
+ "ImmediateNote": "{uint8 depth}",
1004
+ "Groups": ["Flow Control"]
1005
+ },
1006
+ {
1007
+ "Opcode": 79,
1008
+ "Name": "uncover",
1009
+ "Args": ".",
1010
+ "Returns": ".",
1011
+ "Cost": 1,
1012
+ "Size": 2,
1013
+ "Doc": "remove the value at depth N in the stack and shift above items down so the Nth deep value is on top of the stack. Fails if stack depth \u003c= N.",
1014
+ "ImmediateNote": "{uint8 depth}",
1015
+ "Groups": ["Flow Control"]
1016
+ },
904
1017
  {
905
1018
  "Opcode": 80,
906
1019
  "Name": "concat",
@@ -909,7 +1022,7 @@
909
1022
  "Cost": 1,
910
1023
  "Size": 1,
911
1024
  "Doc": "pop two byte-arrays A and B and join them, push the result",
912
- "DocExtra": "`concat` panics if the result would be greater than 4096 bytes.",
1025
+ "DocExtra": "`concat` fails if the result would be greater than 4096 bytes.",
913
1026
  "Groups": ["Arithmetic"]
914
1027
  },
915
1028
  {
@@ -921,7 +1034,7 @@
921
1034
  "Size": 3,
922
1035
  "Doc": "pop a byte-array A. For immediate values in 0..255 S and E: extract a range of bytes from A starting at S up to but not including E, push the substring result. If E \u003c S, or either is larger than the array length, the program fails",
923
1036
  "ImmediateNote": "{uint8 start position} {uint8 end position}",
924
- "Groups": ["Arithmetic"]
1037
+ "Groups": ["Byte Array Slicing"]
925
1038
  },
926
1039
  {
927
1040
  "Opcode": 82,
@@ -931,7 +1044,7 @@
931
1044
  "Cost": 1,
932
1045
  "Size": 1,
933
1046
  "Doc": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including C, push the substring result. If C \u003c B, or either is larger than the array length, the program fails",
934
- "Groups": ["Arithmetic"]
1047
+ "Groups": ["Byte Array Slicing"]
935
1048
  },
936
1049
  {
937
1050
  "Opcode": 83,
@@ -952,7 +1065,7 @@
952
1065
  "Cost": 1,
953
1066
  "Size": 1,
954
1067
  "Doc": "pop a target A, index B, and bit C. Set the Bth bit of A to C, and push the result",
955
- "DocExtra": "bit indexing begins with low-order bits in integers. Setting bit 4 to 1 on the integer 0 yields 16 (`int 0x0010`, or 2^4). Indexing begins in the first bytes of a byte-string (as seen in getbyte and substring). Setting bits 0 through 11 to 1 in a 4 byte-array of 0s yields `byte 0xfff00000`",
1068
+ "DocExtra": "When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.",
956
1069
  "Groups": ["Arithmetic"]
957
1070
  },
958
1071
  {
@@ -975,6 +1088,57 @@
975
1088
  "Doc": "pop a byte-array A, integer B, and small integer C (between 0..255). Set the Bth byte of A to C, and push the result",
976
1089
  "Groups": ["Arithmetic"]
977
1090
  },
1091
+ {
1092
+ "Opcode": 87,
1093
+ "Name": "extract",
1094
+ "Args": "B",
1095
+ "Returns": "B",
1096
+ "Cost": 1,
1097
+ "Size": 3,
1098
+ "Doc": "pop a byte-array A. For immediate values in 0..255 S and L: extract a range of bytes from A starting at S up to but not including S+L, push the substring result. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails",
1099
+ "ImmediateNote": "{uint8 start position} {uint8 length}",
1100
+ "Groups": ["Byte Array Slicing"]
1101
+ },
1102
+ {
1103
+ "Opcode": 88,
1104
+ "Name": "extract3",
1105
+ "Args": "BUU",
1106
+ "Returns": "B",
1107
+ "Cost": 1,
1108
+ "Size": 1,
1109
+ "Doc": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including B+C, push the substring result. If B+C is larger than the array length, the program fails",
1110
+ "Groups": ["Byte Array Slicing"]
1111
+ },
1112
+ {
1113
+ "Opcode": 89,
1114
+ "Name": "extract_uint16",
1115
+ "Args": "BU",
1116
+ "Returns": "U",
1117
+ "Cost": 1,
1118
+ "Size": 1,
1119
+ "Doc": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+2, convert bytes as big endian and push the uint64 result. If B+2 is larger than the array length, the program fails",
1120
+ "Groups": ["Byte Array Slicing"]
1121
+ },
1122
+ {
1123
+ "Opcode": 90,
1124
+ "Name": "extract_uint32",
1125
+ "Args": "BU",
1126
+ "Returns": "U",
1127
+ "Cost": 1,
1128
+ "Size": 1,
1129
+ "Doc": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+4, convert bytes as big endian and push the uint64 result. If B+4 is larger than the array length, the program fails",
1130
+ "Groups": ["Byte Array Slicing"]
1131
+ },
1132
+ {
1133
+ "Opcode": 91,
1134
+ "Name": "extract_uint64",
1135
+ "Args": "BU",
1136
+ "Returns": "U",
1137
+ "Cost": 1,
1138
+ "Size": 1,
1139
+ "Doc": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B+8 is larger than the array length, the program fails",
1140
+ "Groups": ["Byte Array Slicing"]
1141
+ },
978
1142
  {
979
1143
  "Opcode": 96,
980
1144
  "Name": "balance",
@@ -982,8 +1146,8 @@
982
1146
  "Returns": "U",
983
1147
  "Cost": 1,
984
1148
  "Size": 1,
985
- "Doc": "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.",
986
- "DocExtra": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
1149
+ "Doc": "get balance for 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.",
1150
+ "DocExtra": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
987
1151
  "Groups": ["State Access"]
988
1152
  },
989
1153
  {
@@ -1016,7 +1180,7 @@
1016
1180
  "Cost": 1,
1017
1181
  "Size": 1,
1018
1182
  "Doc": "read from account A from local state of the application B key C =\u003e [*... stack*, value, 0 or 1]",
1019
- "DocExtra": "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.",
1183
+ "DocExtra": "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 the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
1020
1184
  "Groups": ["State Access"]
1021
1185
  },
1022
1186
  {
@@ -1038,7 +1202,7 @@
1038
1202
  "Cost": 1,
1039
1203
  "Size": 1,
1040
1204
  "Doc": "read from application A global state key B =\u003e [*... stack*, value, 0 or 1]",
1041
- "DocExtra": "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.",
1205
+ "DocExtra": "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 the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
1042
1206
  "Groups": ["State Access"]
1043
1207
  },
1044
1208
  {
@@ -1090,7 +1254,7 @@
1090
1254
  "ArgEnum": ["AssetBalance", "AssetFrozen"],
1091
1255
  "ArgEnumTypes": "UU",
1092
1256
  "Doc": "read from account A and asset B holding field X (imm arg) =\u003e {0 or 1 (top), value}",
1093
- "DocExtra": "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.",
1257
+ "DocExtra": "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 the asset existed and 0 otherwise), value.",
1094
1258
  "ImmediateNote": "{uint8 asset holding field index}",
1095
1259
  "Groups": ["State Access"]
1096
1260
  },
@@ -1112,14 +1276,39 @@
1112
1276
  "AssetManager",
1113
1277
  "AssetReserve",
1114
1278
  "AssetFreeze",
1115
- "AssetClawback"
1279
+ "AssetClawback",
1280
+ "AssetCreator"
1116
1281
  ],
1117
- "ArgEnumTypes": "UUUBBBBBBBB",
1282
+ "ArgEnumTypes": "UUUBBBBBBBBB",
1118
1283
  "Doc": "read from asset A params field X (imm arg) =\u003e {0 or 1 (top), value}",
1119
- "DocExtra": "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.",
1284
+ "DocExtra": "params: Before v4, Txn.ForeignAssets offset. Since v4, Txn.ForeignAssets offset or an asset id that appears in Txn.ForeignAssets. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.",
1120
1285
  "ImmediateNote": "{uint8 asset params field index}",
1121
1286
  "Groups": ["State Access"]
1122
1287
  },
1288
+ {
1289
+ "Opcode": 114,
1290
+ "Name": "app_params_get",
1291
+ "Args": "U",
1292
+ "Returns": ".U",
1293
+ "Cost": 1,
1294
+ "Size": 2,
1295
+ "ArgEnum": [
1296
+ "AppApprovalProgram",
1297
+ "AppClearStateProgram",
1298
+ "AppGlobalNumUint",
1299
+ "AppGlobalNumByteSlice",
1300
+ "AppLocalNumUint",
1301
+ "AppLocalNumByteSlice",
1302
+ "AppExtraProgramPages",
1303
+ "AppCreator",
1304
+ "AppAddress"
1305
+ ],
1306
+ "ArgEnumTypes": "BBUUUUUBB",
1307
+ "Doc": "read from app A params field X (imm arg) =\u003e {0 or 1 (top), value}",
1308
+ "DocExtra": "params: Txn.ForeignApps offset or an app id that appears in Txn.ForeignApps. Return: did_exist flag (1 if the application existed and 0 otherwise), value.",
1309
+ "ImmediateNote": "{uint8 app params field index}",
1310
+ "Groups": ["State Access"]
1311
+ },
1123
1312
  {
1124
1313
  "Opcode": 120,
1125
1314
  "Name": "min_balance",
@@ -1127,8 +1316,8 @@
1127
1316
  "Returns": "U",
1128
1317
  "Cost": 1,
1129
1318
  "Size": 1,
1130
- "Doc": "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.",
1131
- "DocExtra": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
1319
+ "Doc": "get minimum required balance for 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.",
1320
+ "DocExtra": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
1132
1321
  "Groups": ["State Access"]
1133
1322
  },
1134
1323
  {
@@ -1159,7 +1348,8 @@
1159
1348
  "Cost": 1,
1160
1349
  "Size": 3,
1161
1350
  "Doc": "branch unconditionally to TARGET, saving the next instruction on the call stack",
1162
- "DocExtra": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.`",
1351
+ "DocExtra": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
1352
+ "ImmediateNote": "{int16 branch offset, big endian}",
1163
1353
  "Groups": ["Flow Control"]
1164
1354
  },
1165
1355
  {
@@ -1168,7 +1358,7 @@
1168
1358
  "Cost": 1,
1169
1359
  "Size": 1,
1170
1360
  "Doc": "pop the top instruction from the call stack and branch to it",
1171
- "DocExtra": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.`",
1361
+ "DocExtra": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
1172
1362
  "Groups": ["Flow Control"]
1173
1363
  },
1174
1364
  {
@@ -1198,7 +1388,7 @@
1198
1388
  "Returns": "U",
1199
1389
  "Cost": 4,
1200
1390
  "Size": 1,
1201
- "Doc": "The largest integer X such that X^2 \u003c= A",
1391
+ "Doc": "The largest integer B such that B^2 \u003c= X",
1202
1392
  "Groups": ["Arithmetic"]
1203
1393
  },
1204
1394
  {
@@ -1208,7 +1398,7 @@
1208
1398
  "Returns": "U",
1209
1399
  "Cost": 1,
1210
1400
  "Size": 1,
1211
- "Doc": "The index of the highest bit in A. If A is a byte-array, it is interpreted as a big-endian unsigned integer",
1401
+ "Doc": "The highest set bit in X. If X is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4",
1212
1402
  "DocExtra": "bitlen interprets arrays as big-endian integers, unlike setbit/getbit",
1213
1403
  "Groups": ["Arithmetic"]
1214
1404
  },
@@ -1219,7 +1409,7 @@
1219
1409
  "Returns": "U",
1220
1410
  "Cost": 1,
1221
1411
  "Size": 1,
1222
- "Doc": "A raised to the Bth power. Panic if A == B == 0 and on overflow",
1412
+ "Doc": "A raised to the Bth power. Fail if A == B == 0 and on overflow",
1223
1413
  "Groups": ["Arithmetic"]
1224
1414
  },
1225
1415
  {
@@ -1229,7 +1419,7 @@
1229
1419
  "Returns": "UU",
1230
1420
  "Cost": 10,
1231
1421
  "Size": 1,
1232
- "Doc": "A raised to the Bth power as a 128-bit long result as low (top) and high uint64 values on the stack. Panic if A == B == 0 or if the results exceeds 2^128-1",
1422
+ "Doc": "A raised to the Bth power as a 128-bit long result as low (top) and high uint64 values on the stack. Fail if A == B == 0 or if the results exceeds 2^128-1",
1233
1423
  "Groups": ["Arithmetic"]
1234
1424
  },
1235
1425
  {
@@ -1240,7 +1430,7 @@
1240
1430
  "Cost": 10,
1241
1431
  "Size": 1,
1242
1432
  "Doc": "A plus B, where A and B are byte-arrays interpreted as big-endian unsigned integers",
1243
- "Groups": ["Byteslice Arithmetic"]
1433
+ "Groups": ["Byte Array Arithmetic"]
1244
1434
  },
1245
1435
  {
1246
1436
  "Opcode": 161,
@@ -1249,8 +1439,8 @@
1249
1439
  "Returns": "B",
1250
1440
  "Cost": 10,
1251
1441
  "Size": 1,
1252
- "Doc": "A minus B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic on underflow.",
1253
- "Groups": ["Byteslice Arithmetic"]
1442
+ "Doc": "A minus B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail on underflow.",
1443
+ "Groups": ["Byte Array Arithmetic"]
1254
1444
  },
1255
1445
  {
1256
1446
  "Opcode": 162,
@@ -1259,8 +1449,8 @@
1259
1449
  "Returns": "B",
1260
1450
  "Cost": 20,
1261
1451
  "Size": 1,
1262
- "Doc": "A divided by B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic if B is zero.",
1263
- "Groups": ["Byteslice Arithmetic"]
1452
+ "Doc": "A divided by B (truncated division), where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.",
1453
+ "Groups": ["Byte Array Arithmetic"]
1264
1454
  },
1265
1455
  {
1266
1456
  "Opcode": 163,
@@ -1270,7 +1460,7 @@
1270
1460
  "Cost": 20,
1271
1461
  "Size": 1,
1272
1462
  "Doc": "A times B, where A and B are byte-arrays interpreted as big-endian unsigned integers.",
1273
- "Groups": ["Byteslice Arithmetic"]
1463
+ "Groups": ["Byte Array Arithmetic"]
1274
1464
  },
1275
1465
  {
1276
1466
  "Opcode": 164,
@@ -1280,7 +1470,7 @@
1280
1470
  "Cost": 1,
1281
1471
  "Size": 1,
1282
1472
  "Doc": "A is less than B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1283
- "Groups": ["Byteslice Arithmetic"]
1473
+ "Groups": ["Byte Array Arithmetic"]
1284
1474
  },
1285
1475
  {
1286
1476
  "Opcode": 165,
@@ -1290,7 +1480,7 @@
1290
1480
  "Cost": 1,
1291
1481
  "Size": 1,
1292
1482
  "Doc": "A is greater than B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1293
- "Groups": ["Byteslice Arithmetic"]
1483
+ "Groups": ["Byte Array Arithmetic"]
1294
1484
  },
1295
1485
  {
1296
1486
  "Opcode": 166,
@@ -1300,7 +1490,7 @@
1300
1490
  "Cost": 1,
1301
1491
  "Size": 1,
1302
1492
  "Doc": "A is less than or equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1303
- "Groups": ["Byteslice Arithmetic"]
1493
+ "Groups": ["Byte Array Arithmetic"]
1304
1494
  },
1305
1495
  {
1306
1496
  "Opcode": 167,
@@ -1310,7 +1500,7 @@
1310
1500
  "Cost": 1,
1311
1501
  "Size": 1,
1312
1502
  "Doc": "A is greater than or equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1313
- "Groups": ["Byteslice Arithmetic"]
1503
+ "Groups": ["Byte Array Arithmetic"]
1314
1504
  },
1315
1505
  {
1316
1506
  "Opcode": 168,
@@ -1320,7 +1510,7 @@
1320
1510
  "Cost": 1,
1321
1511
  "Size": 1,
1322
1512
  "Doc": "A is equals to B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1323
- "Groups": ["Byteslice Arithmetic"]
1513
+ "Groups": ["Byte Array Arithmetic"]
1324
1514
  },
1325
1515
  {
1326
1516
  "Opcode": 169,
@@ -1330,7 +1520,7 @@
1330
1520
  "Cost": 1,
1331
1521
  "Size": 1,
1332
1522
  "Doc": "A is not equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers =\u003e { 0 or 1}",
1333
- "Groups": ["Byteslice Arithmetic"]
1523
+ "Groups": ["Byte Array Arithmetic"]
1334
1524
  },
1335
1525
  {
1336
1526
  "Opcode": 170,
@@ -1339,8 +1529,8 @@
1339
1529
  "Returns": "B",
1340
1530
  "Cost": 20,
1341
1531
  "Size": 1,
1342
- "Doc": "A modulo B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic if B is zero.",
1343
- "Groups": ["Byteslice Arithmetic"]
1532
+ "Doc": "A modulo B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.",
1533
+ "Groups": ["Byte Array Arithmetic"]
1344
1534
  },
1345
1535
  {
1346
1536
  "Opcode": 171,
@@ -1350,7 +1540,7 @@
1350
1540
  "Cost": 6,
1351
1541
  "Size": 1,
1352
1542
  "Doc": "A bitwise-or B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
1353
- "Groups": ["Byteslice Logic"]
1543
+ "Groups": ["Byte Array Logic"]
1354
1544
  },
1355
1545
  {
1356
1546
  "Opcode": 172,
@@ -1360,7 +1550,7 @@
1360
1550
  "Cost": 6,
1361
1551
  "Size": 1,
1362
1552
  "Doc": "A bitwise-and B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
1363
- "Groups": ["Byteslice Logic"]
1553
+ "Groups": ["Byte Array Logic"]
1364
1554
  },
1365
1555
  {
1366
1556
  "Opcode": 173,
@@ -1370,7 +1560,7 @@
1370
1560
  "Cost": 6,
1371
1561
  "Size": 1,
1372
1562
  "Doc": "A bitwise-xor B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
1373
- "Groups": ["Byteslice Logic"]
1563
+ "Groups": ["Byte Array Logic"]
1374
1564
  },
1375
1565
  {
1376
1566
  "Opcode": 174,
@@ -1379,8 +1569,8 @@
1379
1569
  "Returns": "B",
1380
1570
  "Cost": 4,
1381
1571
  "Size": 1,
1382
- "Doc": "A with all bits inverted",
1383
- "Groups": ["Byteslice Logic"]
1572
+ "Doc": "X with all bits inverted",
1573
+ "Groups": ["Byte Array Logic"]
1384
1574
  },
1385
1575
  {
1386
1576
  "Opcode": 175,
@@ -1389,7 +1579,132 @@
1389
1579
  "Returns": "B",
1390
1580
  "Cost": 1,
1391
1581
  "Size": 1,
1392
- "Doc": "push a byte-array of length A, containing all zero bytes",
1582
+ "Doc": "push a byte-array of length X, containing all zero bytes",
1583
+ "Groups": ["Loading Values"]
1584
+ },
1585
+ {
1586
+ "Opcode": 176,
1587
+ "Name": "log",
1588
+ "Args": "B",
1589
+ "Cost": 1,
1590
+ "Size": 1,
1591
+ "Doc": "write bytes to log state of the current application",
1592
+ "DocExtra": "`log` fails if called more than MaxLogCalls times in a program, or if the sum of logged bytes exceeds 1024 bytes.",
1593
+ "Groups": ["State Access"]
1594
+ },
1595
+ {
1596
+ "Opcode": 177,
1597
+ "Name": "itxn_begin",
1598
+ "Cost": 1,
1599
+ "Size": 1,
1600
+ "Doc": "Begin preparation of a new inner transaction",
1601
+ "DocExtra": "`itxn_begin` initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the top-level transaction, and all other fields to zero values.",
1602
+ "Groups": ["Inner Transactions"]
1603
+ },
1604
+ {
1605
+ "Opcode": 178,
1606
+ "Name": "itxn_field",
1607
+ "Args": ".",
1608
+ "Cost": 1,
1609
+ "Size": 2,
1610
+ "Doc": "Set field F of the current inner transaction to X",
1611
+ "DocExtra": "`itxn_field` fails if X is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if X is an account or asset that does not appear in `txn.Accounts` or `txn.ForeignAssets` of the top-level transaction. (Setting addresses in asset creation are exempted from this requirement.)",
1612
+ "ImmediateNote": "{uint8 transaction field index}",
1613
+ "Groups": ["Inner Transactions"]
1614
+ },
1615
+ {
1616
+ "Opcode": 179,
1617
+ "Name": "itxn_submit",
1618
+ "Cost": 1,
1619
+ "Size": 1,
1620
+ "Doc": "Execute the current inner transaction. Fail if 16 inner transactions have already been executed, or if the transaction itself fails.",
1621
+ "Groups": ["Inner Transactions"]
1622
+ },
1623
+ {
1624
+ "Opcode": 180,
1625
+ "Name": "itxn",
1626
+ "Returns": ".",
1627
+ "Cost": 1,
1628
+ "Size": 2,
1629
+ "Doc": "push field F of the last inner transaction to stack",
1630
+ "ImmediateNote": "{uint8 transaction field index}",
1631
+ "Groups": ["Inner Transactions"]
1632
+ },
1633
+ {
1634
+ "Opcode": 181,
1635
+ "Name": "itxna",
1636
+ "Returns": ".",
1637
+ "Cost": 1,
1638
+ "Size": 3,
1639
+ "Doc": "push Ith value of the array field F of the last inner transaction to stack",
1640
+ "ImmediateNote": "{uint8 transaction field index} {uint8 transaction field array index}",
1641
+ "Groups": ["Inner Transactions"]
1642
+ },
1643
+ {
1644
+ "Opcode": 192,
1645
+ "Name": "txnas",
1646
+ "Args": "U",
1647
+ "Returns": ".",
1648
+ "Cost": 1,
1649
+ "Size": 2,
1650
+ "ArgEnum": [
1651
+ "ApplicationArgs",
1652
+ "Accounts",
1653
+ "Assets",
1654
+ "Applications",
1655
+ "Logs"
1656
+ ],
1657
+ "ArgEnumTypes": "BBUUB",
1658
+ "Doc": "push Xth value of the array field F of the current transaction",
1659
+ "ImmediateNote": "{uint8 transaction field index}",
1660
+ "Groups": ["Loading Values"]
1661
+ },
1662
+ {
1663
+ "Opcode": 193,
1664
+ "Name": "gtxnas",
1665
+ "Args": "U",
1666
+ "Returns": ".",
1667
+ "Cost": 1,
1668
+ "Size": 3,
1669
+ "ArgEnum": [
1670
+ "ApplicationArgs",
1671
+ "Accounts",
1672
+ "Assets",
1673
+ "Applications",
1674
+ "Logs"
1675
+ ],
1676
+ "ArgEnumTypes": "BBUUB",
1677
+ "Doc": "push Xth value of the array field F from the Tth transaction in the current group",
1678
+ "ImmediateNote": "{uint8 transaction group index} {uint8 transaction field index}",
1679
+ "Groups": ["Loading Values"]
1680
+ },
1681
+ {
1682
+ "Opcode": 194,
1683
+ "Name": "gtxnsas",
1684
+ "Args": "UU",
1685
+ "Returns": ".",
1686
+ "Cost": 1,
1687
+ "Size": 2,
1688
+ "ArgEnum": [
1689
+ "ApplicationArgs",
1690
+ "Accounts",
1691
+ "Assets",
1692
+ "Applications",
1693
+ "Logs"
1694
+ ],
1695
+ "ArgEnumTypes": "BBUUB",
1696
+ "Doc": "pop an index A and an index B. push Bth value of the array field F from the Ath transaction in the current group",
1697
+ "ImmediateNote": "{uint8 transaction field index}",
1698
+ "Groups": ["Loading Values"]
1699
+ },
1700
+ {
1701
+ "Opcode": 195,
1702
+ "Name": "args",
1703
+ "Args": "U",
1704
+ "Returns": "B",
1705
+ "Cost": 1,
1706
+ "Size": 1,
1707
+ "Doc": "push Xth LogicSig argument to stack",
1393
1708
  "Groups": ["Loading Values"]
1394
1709
  }
1395
1710
  ]