-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinalize.fif
executable file
·69 lines (57 loc) · 1.41 KB
/
finalize.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env fift -s
"Asm.fif" include
"TonUtil.fif" include
"../Constants.fif" include
"alice.pk" load-generate-keypair
constant alice_pk
constant alice_pub
0x10 constant alice_addr // mock address for withdraw
"bob.pk" load-generate-keypair
constant bob_pk
constant bob_pub
0x11 constant bob_addr // mock address for withdraw
PROGRAM{
"../lightning.fif" include
}END>c constant code
5 constant Xa
7 constant Xb
0 constant pool_address // address is zero in vm
0xc298bcd3 constant method
<b
1 1 u, // init
86400 32 u, // timeout
0 48 u, // timestamp
alice_pub B, // alice pubkey
bob_pub B, // bob pubkey
1 1 u, // lockA
1 1 u, // lockB
Xa 214 u, // Xa
Xb 214 u, // Xb
b> constant storage
<b
SEND_PAYADDR_CODE 8 u,
pool_address 256 u,
alice_addr 256 u,
b> constant alice_message
<b
SEND_PAYADDR_CODE 8 u,
pool_address 256 u,
bob_addr 256 u,
b> constant bob_message
alice_message hash alice_pk ed25519_sign_uint constant alice_signature
bob_message hash bob_pk ed25519_sign_uint constant bob_signature
<b
bob_signature B,
bob_addr 256 u,
b> constant bob_addr_cell
<b
method 32 u,
alice_signature B,
alice_addr 256 u,
bob_addr_cell ref,
b> constant body
body <s recv_external code <s storage runvm .s
constant updated_storage
constant exit_code
."Exit code " exit_code . cr
."Updated storage: " cr updated_storage <s csr. cr