OCamlPro / freeton_wallet

The 'ft' tool is a multi-account terminal wallet for the Free TON blockchain. It is based on the freeton_ocaml_sdk.
https://ocamlpro.github.io/freeton_wallet
Other
14 stars 9 forks source link

Failing to parse ABI #84

Open arozovyk opened 2 years ago

arozovyk commented 2 years ago

Freshly installed ft having

tonos_cli 0.22.28
COMMIT_ID: f4e39699570e00a1863d27e27e284f8b38e9deb8
BUILD_DATE: 2021-11-10 12:26:01 +0100
COMMIT_DATE: 2021-11-10 00:04:07 +0300
GIT_BRANCH: master

tvm_linker v0.13.86
BUILD_GIT_COMMIT: d150d77566e5fa5cd5335fd7d6ab95150ba9f5cf
BUILD_GIT_DATE:   2021-11-10 00:04:24 +0300
BUILD_TIME:       2021-11-10 12:26:58 +0100

solc, the solidity compiler commandline interface
Version: 0.51.0+commit.6fbe04e4.mod.Darwin.appleclang

After following the steps from use-cases.html#experiment-with-hellodebot, the last step

 ft client -- debot fetch %{account:address:my-first-debot}

fails with following error :

Connecting to http://0.0.0.0:7081
Error: failed to parse abi: invalid type: integer `7`, expected struct AbiContract at line 1 column 1
Error: 1
Fatal error: Command '/Users/artemiyrozovyk/.ft/bin/tonos-cli --config 
/Users/artemiyrozovyk/.ft/sandbox1/tonos-cli.config debot fetch 
0:e66a9fe791758c1b9c7c30467bdb28a55041ba7e9a3d0a693d2d5ec4211ff789' exited with error code 1
lefessan commented 2 years ago

It looks like an error caused by changes in the new versions of solc, tvm_linker and tonos-cli. Character '7' is because the ABI file stored using setABI is in hexa, and starts with '7'. However, bytes are automatically converted from hexa, so the problem comes from having the new type string instead of bytes in the ABI, that requires a non-hexa encoding.

I added a new substitution escape:SUBST that can be used to automatically json-escape a string, it could be used instead of the hex:SUBST substitution in the example. However, the new version of ft will only build with the new version of freeton_ocaml_sdk 0.5.0 that needs to be released...