From 33539e8a677408792bd48fbbc7b6c9015f05b5cf Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 5 Oct 2019 17:53:22 +0200 Subject: [PATCH] Compile --- wallet-code.fif | 209 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 144 insertions(+), 65 deletions(-) diff --git a/wallet-code.fif b/wallet-code.fif index 7ca611b..2aa1edb 100644 --- a/wallet-code.fif +++ b/wallet-code.fif @@ -1,36 +1,31 @@ "Asm.fif" include // automatically generated from `/home/daniil/repos/contest/lib/crypto/smartcont/stdlib.fc` `wallet/wallet-code.fc` PROGRAM{ - DECLPROC collect_garbage + DECLPROC ~collect_garbage DECLPROC store_db DECLPROC recv_internal DECLPROC recv_external 85143 DECLMETHOD seqno - collect_garbage PROC:<{ - c4 PUSH - CTOS - 32 LDI - LDDICT - LDDICT - ENDS - 0 PUSHINT + ~collect_garbage PROC:<{ -1 PUSHINT UNTIL:<{ - s2 PUSH + OVER 8 PUSHPOW2 - DICTIGETNEXT + DICTUGETNEXT NULLSWAPIFNOT NULLSWAPIFNOT DUP IF:<{ s0 s2 XCHG - 32 LDU - DROP + SKIPDICT + 32 PLDU NOW LEQ IF:<{ - s2 POP - -1 PUSHINT + 8 PUSHPOW2 + s1 s3 s3 PUXC2 + DICTUDEL + DROP }>ELSE<{ s0 s2 XCHG }> @@ -43,7 +38,6 @@ PROGRAM{ s1 s2 XCHG }> DROP - 3 -ROLL }> store_db PROC:<{ NEWC @@ -60,76 +54,161 @@ PROGRAM{ recv_external PROC:<{ 1 LDU SWAP - 0 NEQINT - 32 THROWIF + 32 THROWIFNOT DUP 1 PLDU - 1 NEQINT - 33 THROWIF + 33 THROWIFNOT LDDICT - NIP DUP 32 LDU 32 LDU + s2 PUSH NOW - s1 s3 XCHG LEQ 34 THROWIF - s0 s2 XCHG + s0 s3 XCHG HASHSU - collect_garbage CALLDICT - NIP - s1 s5 PUXC + c4 PUSH + CTOS + 32 LDU + 4 LDU + LDDICT + LDDICT + ENDS + NEWDICT + s4 s6 PUSH2 EQUAL - NIP IF:<{ - s2 s3 XCHG - 3 BLKDROP + s0 s4 XCHG + INC }>ELSE<{ - s1 s3 XCPU + s5 s1 PUSH2 8 PUSHPOW2 - DICTIGET + DICTUGET NULLSWAPIFNOT + 35 THROWIFNOT + LDREF NIP - s3 POP - s0 s2 XCHG - IFNOT:<{ - SWAP - IF:<{ - }> - 35 THROW - }>ELSE<{ - NIP - }> + ENDS + s0 s4 XCHG }> ACCEPT - 8 LDU - SWAP - 1 EQINT - IF:<{ - LDREF - SWAP - SETCODE - }>ELSE<{ - WHILE:<{ - DUP - SREFS - }>DO: - 8 LDU - LDREF - s0 s2 XCHG - SENDRAWMSG - }> - WHILE:<{ + s0 s8 XCHG + -1 PUSHINT + UNTIL:<{ + s10 PUSH + 4 PUSHINT + DICTUGETNEXT + NULLSWAPIFNOT + NULLSWAPIFNOT DUP - SREFS - }>DO<{ - 8 LDU - LDREF - s0 s2 XCHG - SENDRAWMSG + IF:<{ + s1 s5 PUSH2 + 4 PUSHINT + DICTUGET + NULLSWAPIFNOT + 36 THROWIFNOT + LDREF + SWAP + CTOS + 256 PLDU + s0 s4 XCHG + LDREF + DROP + DUP + CTOS + DUP + ENDS + s0 s2 XCHG + ENDS + s10 s(-1) s4 PUXC2 + CHKSIGNU + 37 THROWIFNOT + s1 s2 XCHG + 4 PUSHINT + s3 s8 s8 PUXC2 + DICTUSETREF + }>ELSE<{ + s1 s7 s7 XCHG3 + DROP + }> + s0 s6 XCHG + NOT }> + DROP + s9 POP + s0 s8 XCHG + 8 LDU + LDREF ENDS + 0 PUSHINT + -1 PUSHINT + UNTIL:<{ + s6 PUSH + 4 PUSHINT + DICTUGETNEXT + NULLSWAPIFNOT + NULLSWAPIFNOT + s2 POP + OVER + IF:<{ + s0 s2 XCHG + INC + s0 s6 PUSH2 + GEQ + IF:<{ + NIP + s2 s3 PUSH2 + SENDRAWMSG + 8 PUSHPOW2 + s8 s12 s12 PUXC2 + DICTUDEL + DROP + 0 PUSHINT + }>ELSE<{ + s12 s12 XCHG2 + }> + }>ELSE<{ + s0 s12 s12 XCHG3 + }> + NOT + s12 s12 s0 XCHG3 + }> + DROP + s4 PUSH + LESS + IF:<{ + NEWC + s1 s5 XCHG + STDICT + s1 s7 XCHG + 32 STU + s1 s5 XCHG + 32 STU + s1 s5 XCHG + 8 STU + STREF + ENDC + s0 s1 s5 XCHG3 + 8 PUSHPOW2 + DICTUSETREF + }>ELSE<{ + s2 s9 XCHG + s3 s7 XCHG + s2 s6 XCHG + 6 BLKDROP + }> + ~collect_garbage CALLDICT + s0 s2 XCHG + INC + NEWC + 32 STU + 4 STU + s1 s2 XCHG + STDICT + STDICT + ENDC + c4 POP }> seqno PROC:<{ c4 PUSH