1
0
mirror of https://github.com/danog/toncontest.git synced 2024-12-03 09:57:57 +01:00
toncontest/wallet/wallet-code.fif

464 lines
6.6 KiB
Plaintext
Raw Normal View History

2019-10-03 21:54:25 +02:00
"Asm.fif" include
// automatically generated from `/home/daniil/repos/contest/lib/crypto/smartcont/stdlib.fc` `wallet-code.fc`
PROGRAM{
2019-10-04 19:09:10 +02:00
DECLPROC ~collect_garbage
2019-10-07 14:24:08 +02:00
DECLPROC ~load_keys
2019-10-07 17:08:09 +02:00
DECLPROC preload_keys
DECLPROC skip_keys
2019-10-07 14:24:08 +02:00
DECLPROC store_keys
2019-10-04 16:12:48 +02:00
DECLPROC store_db
2019-10-03 21:54:25 +02:00
DECLPROC recv_internal
DECLPROC recv_external
85143 DECLMETHOD seqno
2019-10-07 17:08:09 +02:00
119659 DECLMETHOD getKey
66593 DECLMETHOD getId
124239 DECLMETHOD getPartials
87848 DECLMETHOD getPartialsById
110845 DECLMETHOD getPartialsByKey
2019-10-04 19:09:10 +02:00
~collect_garbage PROC:<{
2019-10-04 16:12:48 +02:00
-1 PUSHINT
UNTIL:<{
OVER
8 PUSHPOW2
DICTUGETNEXT
NULLSWAPIFNOT
NULLSWAPIFNOT
2019-10-03 21:54:25 +02:00
DUP
2019-10-04 16:12:48 +02:00
IF:<{
s0 s2 XCHG
2019-10-04 19:09:10 +02:00
SKIPDICT
32 PLDU
2019-10-04 16:12:48 +02:00
NOW
LEQ
IF:<{
2019-10-04 18:00:14 +02:00
8 PUSHPOW2
s1 s3 s3 PUXC2
DICTUDEL
DROP
}>ELSE<{
s0 s2 XCHG
2019-10-04 16:12:48 +02:00
}>
}>ELSE<{
2019-10-04 18:00:14 +02:00
2SWAP
DROP
2019-10-04 16:12:48 +02:00
}>
SWAP
NOT
2019-10-04 18:00:14 +02:00
s1 s2 XCHG
2019-10-03 21:54:25 +02:00
}>
2019-10-04 16:12:48 +02:00
DROP
}>
2019-10-07 14:24:08 +02:00
~load_keys PROC:<{
4 LDU
0 PUSHINT
PUSHNULL
PUSHNULL
s0 s3 XCHG
LDREF
s4 s1 XCPU
0 PUSHINT
SETINDEXVARQ
SWAP
CTOS
UNTIL:<{
s3 PUSH
3 PUSHINT
MOD
0 EQINT
IF:<{
s3 PUSH
9 LESSINT
s4 PUSH
0 GTINT
AND
IF:<{
DUP
ENDS
s0 s4 XCHG
LDREF
s4 PUSH
3 PUSHINT
DIV
s3 s2 s(-1) XCPUXC
SETINDEXVARQ
NIP
}>ELSE<{
DUP
PLDREF
CTOS
SWAP
ENDS
s4 s4 XCHG2
}>
}>ELSE<{
s4 s4 XCHG2
}>
s4 PUSH
256 PLDU
s3 s0 s4 XC2PU
SETINDEXVARQ
s0 s3 XCHG
INC
s0 s5 PUSH2
EQUAL
s5 s4 s0 XCHG3
s3 s3 s0 XCHG3
}>
s3 POP
s4 POP
SWAP
ENDS
ROT
}>
2019-10-07 17:08:09 +02:00
preload_keys PROC:<{
4 LDU
0 PUSHINT
PUSHNULL
s0 s2 XCHG
LDREF
DROP
CTOS
UNTIL:<{
OVER
3 PUSHINT
MOD
0 EQINT
IF:<{
OVER
9 LESSINT
s2 PUSH
0 GTINT
AND
IF:<{
}>ELSE<{
}>
}>
256 LDU
s3 s3 s2 XC2PU
SETINDEXVARQ
SWAP
INC
s0 s3 PUSH2
EQUAL
s1 s3 s0 XCHG3
}>
s2 s3 XCHG
3 BLKDROP
}>
skip_keys PROC:<{
4 LDU
SWAP
3 PUSHINT
DIV
3 PUSHINT
MIN
UNTIL:<{
SWAP
LDREF
NIP
OVER
0 EQINT
s1 s2 XCHG
}>
DROP
}>
2019-10-07 14:24:08 +02:00
store_keys PROC:<{
4 PUSHINT
2SWAP
STUX
OVER
TLEN
s2 POP
0 PUSHINT
UNTIL:<{
INC
s0 s2 PUSH2
EQUAL
}>
DROP
NIP
}>
2019-10-04 16:12:48 +02:00
store_db PROC:<{
2019-10-03 21:54:25 +02:00
NEWC
2019-10-04 16:12:48 +02:00
s1 s3 XCHG
2019-10-03 21:54:25 +02:00
32 STU
2019-10-04 16:12:48 +02:00
STDICT
STDICT
2019-10-03 21:54:25 +02:00
ENDC
c4 POP
}>
2019-10-04 16:12:48 +02:00
recv_internal PROC:<{
DROP
}>
2019-10-04 18:00:14 +02:00
recv_external PROC:<{
1 LDU
SWAP
32 THROWIFNOT
DUP
1 PLDU
33 THROWIFNOT
LDDICT
DUP
32 LDU
32 LDU
s2 PUSH
NOW
LEQ
34 THROWIF
s0 s3 XCHG
HASHSU
c4 PUSH
CTOS
32 LDU
4 LDU
2019-10-07 14:24:08 +02:00
~load_keys CALLDICT
s0 s2 XCHG
2019-10-04 18:00:14 +02:00
LDDICT
ENDS
NEWDICT
2019-10-07 14:24:08 +02:00
s5 s7 PUSH2
2019-10-04 18:00:14 +02:00
EQUAL
IF:<{
2019-10-07 14:24:08 +02:00
s0 s5 XCHG
2019-10-04 18:00:14 +02:00
INC
}>ELSE<{
2019-10-07 14:24:08 +02:00
s6 s1 PUSH2
2019-10-04 18:00:14 +02:00
8 PUSHPOW2
DICTUGET
NULLSWAPIFNOT
35 THROWIFNOT
LDREF
NIP
ENDS
2019-10-07 14:24:08 +02:00
s0 s5 XCHG
2019-10-04 18:00:14 +02:00
}>
ACCEPT
2019-10-07 14:24:08 +02:00
s0 s9 XCHG
2019-10-07 17:08:09 +02:00
0 PUSHINT
2019-10-04 18:00:14 +02:00
UNTIL:<{
2019-10-07 14:24:08 +02:00
s11 PUSH
2019-10-04 18:00:14 +02:00
4 PUSHINT
DICTUGETNEXT
NULLSWAPIFNOT
NULLSWAPIFNOT
DUP
IF:<{
2019-10-07 14:24:08 +02:00
s5 s1 PUSH2
INDEXVAR
s0 s3 XCHG
2019-10-04 18:00:14 +02:00
LDREF
DROP
DUP
CTOS
DUP
ENDS
2019-10-07 14:24:08 +02:00
s11 s0 s4 PUXC2
2019-10-04 18:00:14 +02:00
CHKSIGNU
37 THROWIFNOT
s1 s2 XCHG
4 PUSHINT
2019-10-07 14:24:08 +02:00
s3 s9 s9 PUXC2
2019-10-04 18:00:14 +02:00
DICTUSETREF
}>ELSE<{
2019-10-07 14:24:08 +02:00
s1 s8 s8 XCHG3
2019-10-04 18:00:14 +02:00
DROP
}>
2019-10-07 14:24:08 +02:00
s0 s7 XCHG
2019-10-04 18:00:14 +02:00
NOT
}>
DROP
2019-10-07 14:24:08 +02:00
s10 POP
s0 s9 XCHG
2019-10-04 18:00:14 +02:00
8 LDU
LDREF
ENDS
0 PUSHINT
2019-10-07 17:08:09 +02:00
DUP
2019-10-04 18:00:14 +02:00
UNTIL:<{
2019-10-07 14:24:08 +02:00
s7 PUSH
2019-10-04 18:00:14 +02:00
4 PUSHINT
DICTUGETNEXT
NULLSWAPIFNOT
NULLSWAPIFNOT
s2 POP
OVER
IF:<{
s0 s2 XCHG
INC
2019-10-07 14:24:08 +02:00
s0 s7 PUSH2
2019-10-04 18:00:14 +02:00
GEQ
IF:<{
NIP
s2 s3 PUSH2
SENDRAWMSG
8 PUSHPOW2
2019-10-07 14:24:08 +02:00
s9 s13 s13 PUXC2
2019-10-04 18:00:14 +02:00
DICTUDEL
DROP
0 PUSHINT
}>ELSE<{
2019-10-07 14:24:08 +02:00
s13 s13 XCHG2
2019-10-04 18:00:14 +02:00
}>
}>ELSE<{
2019-10-07 14:24:08 +02:00
s0 s13 s13 XCHG3
2019-10-04 18:00:14 +02:00
}>
NOT
2019-10-07 14:24:08 +02:00
s13 s13 s0 XCHG3
2019-10-04 18:00:14 +02:00
}>
2019-10-04 19:09:10 +02:00
DROP
2019-10-07 14:24:08 +02:00
s5 PUSH
2019-10-04 18:00:14 +02:00
LESS
IF:<{
NEWC
2019-10-07 14:24:08 +02:00
s1 s6 XCHG
2019-10-04 18:00:14 +02:00
STDICT
2019-10-07 14:24:08 +02:00
s1 s8 XCHG
2019-10-04 19:09:10 +02:00
32 STU
2019-10-07 14:24:08 +02:00
s1 s6 XCHG
2019-10-04 19:09:10 +02:00
32 STU
2019-10-07 14:24:08 +02:00
s1 s6 XCHG
2019-10-04 19:09:10 +02:00
8 STU
2019-10-07 14:24:08 +02:00
s1 s2 XCHG
2019-10-04 19:09:10 +02:00
STREF
2019-10-04 18:00:14 +02:00
ENDC
2019-10-07 14:24:08 +02:00
s0 s0 s6 XCHG3
2019-10-04 18:00:14 +02:00
8 PUSHPOW2
DICTUSETREF
}>ELSE<{
2019-10-07 14:24:08 +02:00
s4 s10 XCHG
s3 s8 XCHG
s2 s7 XCHG
s4 s6 XCHG
2019-10-04 19:09:10 +02:00
6 BLKDROP
2019-10-04 18:00:14 +02:00
}>
2019-10-04 19:09:10 +02:00
~collect_garbage CALLDICT
2019-10-07 14:24:08 +02:00
s0 s3 XCHG
2019-10-04 18:00:14 +02:00
INC
NEWC
32 STU
2019-10-07 14:24:08 +02:00
s1 s4 XCHG
2019-10-04 18:00:14 +02:00
4 STU
2019-10-07 14:24:08 +02:00
s0 s3 XCHG
TLEN
s2 s3 XCHG
SWAP
store_keys CALLDICT
2019-10-04 18:00:14 +02:00
STDICT
ENDC
c4 POP
}>
2019-10-03 21:54:25 +02:00
seqno PROC:<{
c4 PUSH
CTOS
32 PLDU
}>
2019-10-07 17:08:09 +02:00
getKey PROC:<{
c4 PUSH
CTOS
36 PUSHINT
SDSKIPFIRST
preload_keys CALLDICT
SWAP
INDEXVAR
DUP
ISNULL
IFJMP:<{
DROP
0 PUSHINT
DUP
}>
-1 PUSHINT
SWAP
}>
getId PROC:<{
c4 PUSH
CTOS
36 PUSHINT
SDSKIPFIRST
preload_keys CALLDICT
0 PUSHINT
OVER
TLEN
UNTIL:<{
s2 PUSH
0 INDEX
s4 PUSH
EQUAL
IFJMP:<{
s1 s3 XCHG
3 BLKDROP
-1 PUSHINT
SWAP
}>
2DUP
EQUAL
}>
4 BLKDROP
0 PUSHINT
DUP
}>
getPartials PROC:<{
c4 PUSH
CTOS
36 PUSHINT
SDSKIPFIRST
skip_keys CALLDICT
PLDDICT
}>
getPartialsById PROC:<{
c4 PUSH
CTOS
36 PUSHINT
SDSKIPFIRST
skip_keys CALLDICT
PLDDICT
NEWDICT
0 PUSHINT
UNTIL:<{
s2 PUSH
8 PUSHPOW2
DICTUGETNEXT
NULLSWAPIFNOT
NULLSWAPIFNOT
DUP
IF:<{
s0 s2 XCHG
PLDREF
DUP
CTOS
PLDDICT
s6 s(-1) PUXC
4 PUSHINT
DICTUGET
NIP
IF:<{
SWAP
8 PUSHPOW2
s1 s4 s4 PUXC2
DICTUSETREF
}>ELSE<{
s1 s3 XCHG
DROP
}>
}>ELSE<{
2SWAP
DROP
}>
SWAP
NOT
s1 s2 XCHG
}>
s1 s3 XCHG
3 BLKDROP
}>
getPartialsByKey PROC:<{
getId CALLDICT
SWAP
IFNOTJMP:<{
DROP
NEWDICT
}>
getPartialsById CALLDICT
}>
2019-10-03 21:54:25 +02:00
}END>c