forked from algorandfoundation/beaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
240 additions
and
5 deletions.
There are no files selected for viewing
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 @@ | ||
{"name": "OracleDataCache", "methods": [{"name": "lookup", "args": [{"type": "uint64", "name": "ts"}], "returns": {"type": "(uint64,uint64,uint64)"}}, {"name": "portal_transfer", "args": [{"type": "byte[]", "name": "vaa", "desc": "VAA encoded dynamic byte array"}], "returns": {"type": "byte[]", "desc": "Undefined byte array"}, "desc": "portal_transfer accepts a VAA containing information about the transfer and the payload."}], "networks": {}, "desc": "\n Stores price feed in application state keyed by timestamp\n\n TODO: more than 64 vals lol\n "} |
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,203 @@ | ||
#pragma version 7 | ||
intcblock 0 1 | ||
bytecblock 0x151f7c75 | ||
txn NumAppArgs | ||
intc_0 // 0 | ||
== | ||
bnz main_l6 | ||
txna ApplicationArgs 0 | ||
pushbytes 0x1c18e2e8 // "lookup(uint64)(uint64,uint64,uint64)" | ||
== | ||
bnz main_l5 | ||
txna ApplicationArgs 0 | ||
pushbytes 0x903f4535 // "portal_transfer(byte[])byte[]" | ||
== | ||
bnz main_l4 | ||
err | ||
main_l4: | ||
txn OnCompletion | ||
intc_0 // NoOp | ||
== | ||
txn ApplicationID | ||
intc_0 // 0 | ||
!= | ||
&& | ||
assert | ||
txna ApplicationArgs 1 | ||
callsub portaltransfer_2 | ||
store 4 | ||
bytec_0 // 0x151f7c75 | ||
load 4 | ||
concat | ||
log | ||
intc_1 // 1 | ||
return | ||
main_l5: | ||
txn OnCompletion | ||
intc_0 // NoOp | ||
== | ||
txn ApplicationID | ||
intc_0 // 0 | ||
!= | ||
&& | ||
assert | ||
txna ApplicationArgs 1 | ||
btoi | ||
callsub lookup_1 | ||
store 0 | ||
bytec_0 // 0x151f7c75 | ||
load 0 | ||
concat | ||
log | ||
intc_1 // 1 | ||
return | ||
main_l6: | ||
txn OnCompletion | ||
intc_0 // NoOp | ||
== | ||
bnz main_l8 | ||
err | ||
main_l8: | ||
txn ApplicationID | ||
intc_0 // 0 | ||
== | ||
assert | ||
callsub create_0 | ||
intc_1 // 1 | ||
return | ||
|
||
// create | ||
create_0: | ||
intc_1 // 1 | ||
return | ||
|
||
// lookup | ||
lookup_1: | ||
store 1 | ||
intc_0 // 0 | ||
load 1 | ||
itob | ||
app_global_get_ex | ||
store 3 | ||
store 2 | ||
load 3 | ||
assert | ||
load 2 | ||
retsub | ||
|
||
// portal_transfer | ||
portaltransfer_2: | ||
store 5 | ||
load 5 | ||
extract 2 0 | ||
intc_0 // 0 | ||
getbyte | ||
store 6 | ||
load 5 | ||
extract 2 0 | ||
intc_1 // 1 | ||
extract_uint32 | ||
store 7 | ||
load 5 | ||
extract 2 0 | ||
pushint 5 // 5 | ||
getbyte | ||
store 8 | ||
load 5 | ||
extract 2 0 | ||
pushint 6 // 6 | ||
load 8 | ||
pushint 66 // 66 | ||
* | ||
+ | ||
dig 1 | ||
len | ||
substring3 | ||
store 23 | ||
load 23 | ||
intc_0 // 0 | ||
extract_uint32 | ||
store 9 | ||
load 23 | ||
pushint 4 // 4 | ||
extract_uint32 | ||
store 10 | ||
load 23 | ||
pushint 8 // 8 | ||
extract_uint16 | ||
store 11 | ||
load 23 | ||
extract 10 32 | ||
store 12 | ||
load 23 | ||
pushint 42 // 42 | ||
extract_uint64 | ||
store 13 | ||
load 23 | ||
pushint 50 // 50 | ||
getbyte | ||
store 14 | ||
load 23 | ||
pushint 51 // 51 | ||
getbyte | ||
store 15 | ||
load 23 | ||
extract 52 32 | ||
store 16 | ||
load 23 | ||
extract 84 32 | ||
store 17 | ||
load 23 | ||
pushint 116 // 116 | ||
extract_uint16 | ||
store 18 | ||
load 23 | ||
extract 118 32 | ||
store 19 | ||
load 23 | ||
pushint 150 // 150 | ||
extract_uint16 | ||
store 20 | ||
load 23 | ||
extract 152 32 | ||
store 21 | ||
load 23 | ||
extract 184 0 | ||
store 22 | ||
load 22 | ||
len | ||
itob | ||
extract 6 0 | ||
load 22 | ||
concat | ||
store 22 | ||
load 22 | ||
extract 2 0 | ||
store 24 | ||
load 24 | ||
pushbytes 0x7473 // "ts" | ||
json_ref JSONUint64 | ||
store 25 | ||
load 24 | ||
pushbytes 0x7072696365 // "price" | ||
json_ref JSONUint64 | ||
store 26 | ||
load 24 | ||
pushbytes 0x636f6e666964656e6365 // "confidence" | ||
json_ref JSONUint64 | ||
store 27 | ||
load 25 | ||
itob | ||
load 26 | ||
itob | ||
concat | ||
load 27 | ||
itob | ||
concat | ||
store 28 | ||
load 25 | ||
itob | ||
load 28 | ||
app_global_put | ||
load 22 | ||
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 7 | ||
pushint 0 // 0 | ||
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 @@ | ||
{"name": "OracleDataCache", "methods": [{"name": "lookup", "args": [{"type": "uint64", "name": "ts"}], "returns": {"type": "(uint64,uint64,uint64)"}}, {"name": "portal_transfer", "args": [{"type": "byte[]", "name": "vaa", "desc": "VAA encoded dynamic byte array"}], "returns": {"type": "byte[]", "desc": "Undefined byte array"}, "desc": "portal_transfer accepts a VAA containing information about the transfer and the payload."}], "networks": {}, "desc": "\n Stores price feed in application state keyed by timestamp\n\n TODO: more than 64 vals lol\n "} |
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