-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from algorand-devrel/feature/booleans
Initial boolean
- Loading branch information
Showing
44 changed files
with
1,986 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "ABITestBoolTuple", | ||
"desc": "", | ||
"methods": [ | ||
{ | ||
"name": "boolTuple", | ||
"args": [], | ||
"desc": "", | ||
"returns": { | ||
"type": "(bool,bool,bool,bool,bool,bool,bool,bool,bool)", | ||
"desc": "" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#pragma version 8 | ||
b main | ||
|
||
abi_route_boolTuple: | ||
txn OnCompletion | ||
int NoOp | ||
== | ||
txn ApplicationID | ||
int 0 | ||
!= | ||
&& | ||
assert | ||
byte 0x | ||
callsub boolTuple | ||
int 1 | ||
return | ||
|
||
boolTuple: | ||
proto 1 0 | ||
|
||
// tests/contracts/abi.algo.ts:846 | ||
// a: [boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean] = [ | ||
byte 0x // initial head | ||
byte 0x // initial tail | ||
byte 0x0002 // initial head offset | ||
byte 0x0000 | ||
int 0 | ||
int 1 | ||
setbit | ||
int 1 | ||
int 0 | ||
setbit | ||
int 2 | ||
int 1 | ||
setbit | ||
int 3 | ||
int 1 | ||
setbit | ||
int 4 | ||
int 0 | ||
setbit | ||
int 5 | ||
int 0 | ||
setbit | ||
int 6 | ||
int 1 | ||
setbit | ||
int 7 | ||
int 0 | ||
setbit | ||
int 8 | ||
int 0 | ||
setbit | ||
callsub process_static_tuple_element | ||
pop // pop head offset | ||
concat // concat head and tail | ||
frame_bury -1 // a: [bool,bool,bool,bool,bool,bool,bool,bool,bool] | ||
|
||
// tests/contracts/abi.algo.ts:850 | ||
// return a; | ||
frame_dig -1 // a: [bool,bool,bool,bool,bool,bool,bool,bool,bool] | ||
byte 0x151f7c75 | ||
swap | ||
concat | ||
log | ||
retsub | ||
|
||
main: | ||
txn NumAppArgs | ||
bnz route_abi | ||
|
||
// default createApplication | ||
txn ApplicationID | ||
int 0 | ||
== | ||
txn OnCompletion | ||
int NoOp | ||
== | ||
&& | ||
return | ||
|
||
route_abi: | ||
method "boolTuple()(bool,bool,bool,bool,bool,bool,bool,bool,bool)" | ||
txna ApplicationArgs 0 | ||
match abi_route_boolTuple | ||
err | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma version 8 | ||
int 1 | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"hints": { | ||
"boolTuple()(bool,bool,bool,bool,bool,bool,bool,bool,bool)": { | ||
"call_config": { | ||
"no_op": "CALL" | ||
} | ||
} | ||
}, | ||
"bare_call_config": { | ||
"no_op": "CREATE" | ||
}, | ||
"schema": { | ||
"local": { | ||
"declared": {}, | ||
"reserved": {} | ||
}, | ||
"global": { | ||
"declared": {}, | ||
"reserved": {} | ||
} | ||
}, | ||
"state": { | ||
"global": { | ||
"num_byte_slices": 0, | ||
"num_uints": 0 | ||
}, | ||
"local": { | ||
"num_byte_slices": 0, | ||
"num_uints": 0 | ||
} | ||
}, | ||
"source": { | ||
"approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCWIgbWFpbgoKYWJpX3JvdXRlX2Jvb2xUdXBsZToKCXR4biBPbkNvbXBsZXRpb24KCWludCBOb09wCgk9PQoJdHhuIEFwcGxpY2F0aW9uSUQKCWludCAwCgkhPQoJJiYKCWFzc2VydAoJYnl0ZSAweAoJY2FsbHN1YiBib29sVHVwbGUKCWludCAxCglyZXR1cm4KCmJvb2xUdXBsZToKCXByb3RvIDEgMAoKCS8vIHRlc3RzL2NvbnRyYWN0cy9hYmkuYWxnby50czo4NDYKCS8vIGE6IFtib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuLCBib29sZWFuXSA9IFsKCWJ5dGUgMHggLy8gaW5pdGlhbCBoZWFkCglieXRlIDB4IC8vIGluaXRpYWwgdGFpbAoJYnl0ZSAweDAwMDIgLy8gaW5pdGlhbCBoZWFkIG9mZnNldAoJYnl0ZSAweDAwMDAKCWludCAwCglpbnQgMQoJc2V0Yml0CglpbnQgMQoJaW50IDAKCXNldGJpdAoJaW50IDIKCWludCAxCglzZXRiaXQKCWludCAzCglpbnQgMQoJc2V0Yml0CglpbnQgNAoJaW50IDAKCXNldGJpdAoJaW50IDUKCWludCAwCglzZXRiaXQKCWludCA2CglpbnQgMQoJc2V0Yml0CglpbnQgNwoJaW50IDAKCXNldGJpdAoJaW50IDgKCWludCAwCglzZXRiaXQKCWNhbGx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"contract": { | ||
"name": "ABITestBoolTuple", | ||
"desc": "", | ||
"methods": [ | ||
{ | ||
"name": "boolTuple", | ||
"args": [], | ||
"desc": "", | ||
"returns": { | ||
"type": "(bool,bool,bool,bool,bool,bool,bool,bool,bool)", | ||
"desc": "" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "ABITestBoolTupleAccess", | ||
"desc": "", | ||
"methods": [ | ||
{ | ||
"name": "boolTupleAccess", | ||
"args": [], | ||
"desc": "", | ||
"returns": { | ||
"type": "bool", | ||
"desc": "" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.