mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
minor improvements and bugfixes
This commit is contained in:
parent
eecf05ca59
commit
040df63c98
24 changed files with 665 additions and 344 deletions
|
@ -9,8 +9,7 @@
|
|||
null =: subwallet-id
|
||||
86400 =: expires-in
|
||||
now =: start-at
|
||||
0x5EA62080 =: start-at
|
||||
0x4BA92D8A =: subwallet-base
|
||||
// 0x11EF55AA =: subwallet-base
|
||||
|
||||
begin-options
|
||||
" <creator-filename-base> <public-key> <amount> [-w<workchain>][-r<restrict-mode>][-i<subwallet-id>][-t<start-at>] [<savefile>]" +cr +tab
|
||||
|
@ -27,8 +26,8 @@ begin-options
|
|||
"x" "--expires-in" { parse-int =: expires-in } short-long-option-arg
|
||||
"Expiration time of the initialization message (" expires-in (.) $+
|
||||
+" seconds by default)" option-help
|
||||
"t" "--start-at" { parse-int =: start-at } short-long-option-arg
|
||||
"Restriction start Unixtime (now by default)" option-help
|
||||
"t" "--start-at" { dup "now" $= { drop now } { parse-int } cond =: start-at } short-long-option-arg
|
||||
"Restriction start Unixtime (`now` by default)" option-help
|
||||
"h" "--help" { usage } short-long-option
|
||||
"Shows a help message" option-help
|
||||
parse-options
|
||||
|
@ -50,7 +49,7 @@ wc 8 fits not abort"invalid workchain id"
|
|||
subwallet-id 32 fits not abort"invalid subwallet-id"
|
||||
expires-at 32 ufits not abort"invalid expiration time"
|
||||
start-at 32 ufits not abort"invalid restriction start time"
|
||||
restrict-mode dup 1 < swap 2 > or abort"unknown restriction mode"
|
||||
restrict-mode dup 0 < swap 2 > or abort"unknown restriction mode"
|
||||
filename-base +".pk" load-keypair =: init_pk =: init_pubkey
|
||||
|
||||
."Creating new restricted lockup wallet v3 in workchain " wc .
|
||||
|
@ -79,9 +78,16 @@ filename-base +".pk" load-keypair =: init_pk =: init_pubkey
|
|||
swap .2225 */ 3 years* rdict-entry
|
||||
0 4 years* 86400 + rdict-entry
|
||||
} : make-rdict2
|
||||
{ dictnew
|
||||
swap 31 -1<< rdict-entry
|
||||
0 0 rdict-entry
|
||||
} : make-rdict0
|
||||
|
||||
amount
|
||||
restrict-mode 1 = { make-rdict1 } { make-rdict2 } cond =: rdict
|
||||
restrict-mode ?dup {
|
||||
1 = { make-rdict1 } { make-rdict2 } cond
|
||||
} { make-rdict0 } cond
|
||||
=: rdict
|
||||
|
||||
."Restrictions start at " start-at ._ .": " cr
|
||||
rdict 32 { swap . ."-> " Gram@ .GR cr true } idictforeach cr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue