-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfoundation_remove.fif
33 lines (28 loc) · 1.03 KB
/
foundation_remove.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
// DONT'T USE THIS FILE. USE THE `foundation.fif` INSTEAD
// invoked as `remove <filename-base> <foundation-name> <seqno> <camp-id>`
// stops the program on invalid params
{
."invalid expiration option" cr
2 halt
} : invalid_expiration
// Parse cmdline
$# 5 < ' invalid_options if
$2 =: filename-base
$3 =: foundation-name
$4 parse-int =: seqnum
$5 parse-int =: camp-id
filename-base +".pk" load-keypair
constant wallet_pk
constant wallet_pubk
foundation-name +".addr" load-address 2constant wallet_addr
."Remove campaign with ID: " camp-id . cr
// CREATE THE MESSAGE:
// msg$_ signature:Signature seqno:uint32 body:ContractBodyRequest
// msg_remove$10 camp_id:uint32 = ContractBodyRequest
<b seqnum 32 u, 2 2 u, camp-id 32 u, b> constant msg-body
msg-body hashu wallet_pk ed25519_sign_uint constant sig-msg-body
<b sig-msg-body B, msg-body <s s, b> constant external-msg
<b b{1000100} s, wallet_addr addr, 0 Gram, b{00} s, external-msg ref, b>
2 boc+>B cr
"remove-campaign-query.boc" tuck B>file
."(Saved creating query to file " type .")" cr