diff --git a/wallet/test.fif b/wallet/test.fif index 46f71ab..d9bc2f8 100644 --- a/wallet/test.fif +++ b/wallet/test.fif @@ -1,19 +1,31 @@ "TonUtil.fif" include "lib.fif" include -{ file>B B>boc } : load-boc { - ."usage: " @' $0 type ." " cr + ."usage: " @' $0 type ." [ ... ]" cr ."Runs the function with ID in the TON VM, using code and storage data from .boc and .boc as message." cr 1 halt } : usage $# 3 < ' usage if -$1 +".boc" load-boc const message-boc -$2 +".boc" load-boc const init-boc -$3 parse-int const function +$1 +".boc" load-boc const init-boc +$# 1- 2 /c const message-count -// message$_ {X:Type} info:CommonMsgInfo -// init:(Maybe (Either StateInit ^StateInit)) -// body:(Either X ^X) = Message X; +variable-set message-boc message-boc! +variable-set function function! +variable-set code code! +variable-set storage storage! + + +// c7 +// [ magic:0x076ef1ea actions:Integer msgs_sent:Integer +// unixtime:Integer block_lt:Integer trans_lt:Integer +// rand_seed:Integer balance_remaining:[Integer (Maybe Cell)] +// myself:MsgAddressInt global_config:(Maybe Cell) +// ] = SmartContractInfo; +0x076ef1ea 0 0 now 0 0 hash 7 tuple 1 tuple const ctx + + // message$_ {X:Type} info:CommonMsgInfo + // init:(Maybe (Either StateInit ^StateInit)) + // body:(Either X ^X) = Message X; init-boc hash 7 tuple 1 tuple constant ctx + message-boc inspect - -message-contents function code storage ctx runvmctx .s -inspect-storage -// rot -// ."Signature: " -// 64 B@ Bx. \ No newline at end of file + message-contents function code storage ctx runvmctx .s + swap + ."Retcode: " . cr + dup storage! + inspect-storage + // rot + // ."Signature: " + // 64 B@ Bx. +} message-count times \ No newline at end of file