Skip to content

Commit

Permalink
0.12.0: appSpec hints and bare_call_config (fixed) (#42)
Browse files Browse the repository at this point in the history
* replace err() with throw Error()

* subroutines for processing tuple elements

* remove scratch.oldTupleElement

* add tsconfig to tests/contracts/

* use Address instead of Account

* remove empty create

* appSpec hints and bare_call_config

* 0.12.0
  • Loading branch information
joe-p authored May 20, 2023
1 parent c7e7737 commit 0e4e96d
Show file tree
Hide file tree
Showing 33 changed files with 12,127 additions and 10,231 deletions.
214 changes: 213 additions & 1 deletion examples/amm/tealscript_artifacts/ConstantProductAMM.json

Large diffs are not rendered by default.

178 changes: 177 additions & 1 deletion examples/arc12/Master.json

Large diffs are not rendered by default.

166 changes: 165 additions & 1 deletion examples/arc12/Vault.json

Large diffs are not rendered by default.

189 changes: 65 additions & 124 deletions examples/arc75/artifacts/ARC75.approval.teal
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
#pragma version 8
b main

process_dynamic_tuple_element:
proto 4 3
frame_dig -4 // tuple head
frame_dig -2 // head offset
concat
frame_bury -4 // tuple head
frame_dig -1 // element
dup
len
frame_dig -2 // head offset
btoi
+
itob
extract 6 2
frame_bury -2 // head offset
frame_dig -3 // tuple tail
swap
concat
frame_bury -3 // tuple tail
frame_dig -4 // tuple head
frame_dig -3 // tuple tail
frame_dig -2 // head offset
retsub

process_static_tuple_element:
proto 4 3
frame_dig -4 // tuple head
frame_dig -1 // element
concat
frame_dig -3 // tuple tail
frame_dig -2 // head offset
retsub

bare_route_create:
txn OnCompletion
int NoOp
Expand Down Expand Up @@ -122,46 +155,23 @@ addAppToWhiteList:

// examples/arc75/arc75.algo.ts:37
// whitelist: Whitelist = { account: this.txn.sender, boxIndex: boxIndex, arc: arc }
byte 0x
dup
store 0 // tuple head
store 1 // tuple tail
byte 0x0024
store 2 // head offset
load 0 // tuple head
byte 0x // initial head
byte 0x // initial tail
byte 0x0024 // initial head offset
txn Sender
concat
store 0 // tuple head
load 0 // tuple head
callsub process_static_tuple_element
frame_dig -2 // boxIndex: uint16
concat
store 0 // tuple head
load 0 // tuple head
load 2 // head offset
concat
store 0 // tuple head
callsub process_static_tuple_element
frame_dig -1 // arc: bytes
dup
len
itob
extract 6 2
swap
concat
dup
len
load 2 // head offset
btoi
+
itob
extract 6 2
store 2 // head offset
load 1 // tuple tail
swap
concat
store 1 // tuple tail
load 0 // tuple head
load 1 // tuple tail
concat
callsub process_dynamic_tuple_element
pop // pop head offset
concat // concat head and tail
frame_bury -6 // whitelist: Whitelist

// if0_condition
Expand Down Expand Up @@ -260,46 +270,23 @@ setAppWhitelist:

// examples/arc75/arc75.algo.ts:59
// whitelist: Whitelist = { account: this.txn.sender, boxIndex: boxIndex, arc: arc }
byte 0x
dup
store 0 // tuple head
store 1 // tuple tail
byte 0x0024
store 2 // head offset
load 0 // tuple head
byte 0x // initial head
byte 0x // initial tail
byte 0x0024 // initial head offset
txn Sender
concat
store 0 // tuple head
load 0 // tuple head
callsub process_static_tuple_element
frame_dig -2 // boxIndex: uint16
concat
store 0 // tuple head
load 0 // tuple head
load 2 // head offset
concat
store 0 // tuple head
callsub process_static_tuple_element
frame_dig -1 // arc: bytes
dup
len
itob
extract 6 2
swap
concat
dup
len
load 2 // head offset
btoi
+
itob
extract 6 2
store 2 // head offset
load 1 // tuple tail
swap
concat
store 1 // tuple tail
load 0 // tuple head
load 1 // tuple tail
concat
callsub process_dynamic_tuple_element
pop // pop head offset
concat // concat head and tail
frame_bury -5 // whitelist: Whitelist

// examples/arc75/arc75.algo.ts:61
Expand Down Expand Up @@ -379,46 +366,23 @@ deleteWhitelist:

// examples/arc75/arc75.algo.ts:81
// whitelist: Whitelist = { account: this.txn.sender, boxIndex: boxIndex, arc: arc }
byte 0x
dup
store 0 // tuple head
store 1 // tuple tail
byte 0x0024
store 2 // head offset
load 0 // tuple head
byte 0x // initial head
byte 0x // initial tail
byte 0x0024 // initial head offset
txn Sender
concat
store 0 // tuple head
load 0 // tuple head
callsub process_static_tuple_element
frame_dig -2 // boxIndex: uint16
concat
store 0 // tuple head
load 0 // tuple head
load 2 // head offset
concat
store 0 // tuple head
callsub process_static_tuple_element
frame_dig -1 // arc: bytes
dup
len
itob
extract 6 2
swap
concat
dup
len
load 2 // head offset
btoi
+
itob
extract 6 2
store 2 // head offset
load 1 // tuple tail
swap
concat
store 1 // tuple tail
load 0 // tuple head
load 1 // tuple tail
concat
callsub process_dynamic_tuple_element
pop // pop head offset
concat // concat head and tail
frame_bury -4 // whitelist: Whitelist

// examples/arc75/arc75.algo.ts:83
Expand Down Expand Up @@ -468,46 +432,23 @@ deleteAppFromWhitelist:

// examples/arc75/arc75.algo.ts:98
// whitelist: Whitelist = { account: this.txn.sender, boxIndex: boxIndex, arc: arc }
byte 0x
dup
store 0 // tuple head
store 1 // tuple tail
byte 0x0024
store 2 // head offset
load 0 // tuple head
byte 0x // initial head
byte 0x // initial tail
byte 0x0024 // initial head offset
txn Sender
concat
store 0 // tuple head
load 0 // tuple head
callsub process_static_tuple_element
frame_dig -2 // boxIndex: uint16
concat
store 0 // tuple head
load 0 // tuple head
load 2 // head offset
concat
store 0 // tuple head
callsub process_static_tuple_element
frame_dig -1 // arc: bytes
dup
len
itob
extract 6 2
swap
concat
dup
len
load 2 // head offset
btoi
+
itob
extract 6 2
store 2 // head offset
load 1 // tuple tail
swap
concat
store 1 // tuple tail
load 0 // tuple head
load 1 // tuple tail
concat
callsub process_dynamic_tuple_element
pop // pop head offset
concat // concat head and tail
frame_bury -6 // whitelist: Whitelist

// examples/arc75/arc75.algo.ts:100
Expand Down
Loading

0 comments on commit 0e4e96d

Please sign in to comment.