forked from keyloggerini/OracleHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-hub.fif
29 lines (20 loc) · 864 Bytes
/
init-hub.fif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/fift -s
"TonUtil.fif" include
"Asm.fif" include
$1 parse-int =: public_key
"hub.fif" include <s =: contract_code
// we use `now` here to make contract_storage and thus address unique
// it will be overwritten upon processing of init message
<b public_key 256 u, 0 32 u, dictnew dict, dictnew dict, now 32 u, b> =: contract_storage
0 =: wc
<b b{00110} s, <b contract_code s, b> ref, contract_storage ref, b>
dup =: state_init
dup hashu wc swap 2constant hub_addr
."OracleHub address = " hub_addr .addr cr
."Non-bounceable address (for init): " hub_addr 7 .Addr cr
."Bounceable address (for later access): " hub_addr 6 .Addr cr
<b b> <s =: init_message
<b b{1000100} s, hub_addr addr, b{000010} s, state_init <s s, b{0} s, init_message s, b>
2 boc+>B
"hub-init.boc" tuck B>file
."(Saved oracle hub contract creating query to file " type .")" cr