From f5e5f6b0e7955f31fa87b70666adbb10b23a4fb0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 29 Sep 2019 14:08:38 +0200 Subject: [PATCH] Update --- .gitignore | 1 + toolchain/bin/fift | 2 +- toolchain/bin/funcompile | 7 ++++- toolchain/bin/lite-client | 3 ++ toolchain/build.sh | 7 +++++ wallet-code.fif | 66 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100755 toolchain/bin/lite-client create mode 100644 wallet-code.fif diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e46bf51 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ton-db-dir diff --git a/toolchain/bin/fift b/toolchain/bin/fift index 85850ad..b37d1c8 100755 --- a/toolchain/bin/fift +++ b/toolchain/bin/fift @@ -1,3 +1,3 @@ #!/bin/bash -e -$TONLIB_HOME/build/fift "$@" +$TONLIB_HOME/build/crypto/fift "$@" diff --git a/toolchain/bin/funcompile b/toolchain/bin/funcompile index 6ba67d7..328a4ef 100755 --- a/toolchain/bin/funcompile +++ b/toolchain/bin/funcompile @@ -1,3 +1,8 @@ #!/bin/bash -e -/home/daniil/repos/ton/build/crypto/func -WRS -o "$(basename $1 .fc).fif" "$TONLIB_HOME/crypto/smartcont/stdlib.fc" "$@" +[ $# -eq 0 ] && { + echo "No arguments provided!" + exit 1 +} + +$TONLIB_HOME/build/crypto/func -WRS -o "$(basename $1 .fc 2>/dev/null).fif" "$TONLIB_HOME/crypto/smartcont/stdlib.fc" "$@" diff --git a/toolchain/bin/lite-client b/toolchain/bin/lite-client new file mode 100755 index 0000000..3e84b5a --- /dev/null +++ b/toolchain/bin/lite-client @@ -0,0 +1,3 @@ +#!/bin/bash -e + +$TONLIB_HOME/build/crypto/lite-client/lite-client -C $TONLIB_HOME/build/ton-lite-client-test1.config.json -D $TONLIB_HOME/../ton-db-dir "$@" diff --git a/toolchain/build.sh b/toolchain/build.sh index e8f67d4..f118c41 100755 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -24,4 +24,11 @@ cmake --build . --target lite-client cmake --build . --target fift cmake --build . --target func +rm -f ton-lite-client-test1.config.json +wget https://test.ton.org/ton-lite-client-test1.config.json + cd ../.. + +echo "" +echo "DONE! Restart your shell to apply changes and use the new fift, funcompile and lite-client commands." +echo "" diff --git a/wallet-code.fif b/wallet-code.fif new file mode 100644 index 0000000..0dc9a9d --- /dev/null +++ b/wallet-code.fif @@ -0,0 +1,66 @@ +"Asm.fif" include +// automatically generated from `/home/daniil/repos/contest/lib/crypto/smartcont/stdlib.fc` `wallet-code.fc` +PROGRAM{ + DECLPROC recv_internal + DECLPROC recv_external + 85143 DECLMETHOD seqno + recv_internal PROC:<{ + DROP + }> + recv_external PROC:<{ + 9 PUSHPOW2 + LDSLICEX + DUP + 32 LDU + 32 LDU + NOW + s1 s2 XCHG + LEQ + 35 THROWIF + c4 PUSH + CTOS + 32 LDU + 256 LDU + ENDS + s3 s1 XCPU + EQUAL + 33 THROWIFNOT + s0 s3 XCHG + HASHSU + s0 s4 s2 XC2PU + CHKSIGNU + 34 THROWIFNOT + ACCEPT + s0 s2 XCHG + 8 LDU + SWAP + 1 EQINT + IF:<{ + LDREF + SWAP + SETCODE + }>ELSE<{ + WHILEEND:<{ + DUP + SREFS + }> + 8 LDU + LDREF + s0 s2 XCHG + SENDRAWMSG + }> + ENDS + INC + NEWC + 32 STU + 256 STU + ENDC + c4 POP + }> + seqno PROC:<{ + c4 PUSH + CTOS + 32 PLDU + }> +}END>c +2 boc+>B "RS" B>file