Why I use aepp-cli-js deploy contract got error "Unbound variable String.sha3"?


Then testnet already update to 1.2.0 version, It support String.sha3, Why this error happened ?

I use the https://testnet.contracts.aepps.com/, it can deploy it, but use the command line, it got error.

Thank you !


Hey @chenn,

Our devs are informed about this issue and will provide some support soon :wink:



Whatever error you get should not have anything to do with deploy, but String.sha3 was added to the compiler in version 1.2.0.


Hey @chenn, can you please provide the contract source code which you try to deploy.

contract C = 
  function f(x : string) = String.sha3(x)

is enough to provoke these problems.


@hanssv Actually i using that for test’s and it’s working. Also we don’t have this error in cli or sdk .
So i think the problem can be in source code of contract or int cli command(connect to wrong node).


Hi @nduchak
When use the cli command to deploy it to testnet, it will got error too

contract Identity =
  type state = ()
  function main(x : string) = String.sha3(x)

This works for me. Please try with this one.


How do you compile and deploy it ? What version cli do you use ?

And I don’t just use it this way, I embed it in other function.


We have a solution: https://forum.aeternity.com/t/hi-nduchak-i-use-string-sha3-in-my-project-it-must-be-find-out-what-happened-thanks-for-you-help/2318


@chenn So i will find the problem and it’s related to the compiling of contract. For compiling we use internal API that by default is main-net(which do not support String.sha3 ) so all that you need to provide internal url.
./bin/aecli.js contract deploy ./testnet --password testnet ./A.aes -u https://sdk-testnet.aepps.com --internalUrl https://sdk-testnet.aepps.com .


This statement is wrong. Main-net has the necessary byte code instructions for this. Whether a particular node can compile the contract depends on whether it is up to date or not.