Cardinal-Cryptography / bulletin-board-example

Repository with example smart contracts and corresponding frontend
12 stars 5 forks source link

Deployment script throws an `invalid value '0' for '--salt <SALT>'` error #23

Open annaerdi opened 3 weeks ago

annaerdi commented 3 weeks ago

When trying to deploy the contracts with the deploy.sh script, I'm getting the following error:

$ ./scripts/deploy.sh
node=ws://localhost:9944
authority_seed=//Alice
Uploading bulletin_board
Bulletin Board code hash: 0x3a0e3b892522e992fcaa8fec2aebc3e1cfa256902692e758edb98ea3c6592e6d
Uploading highlighted_posts
Highlighted Posts code hash: 0x5bf66a7e7b3f926731b8d4db095924724cb4003d02748b8c2252f3bf61690822
Instantiating Bulletin Board contract (version: 0)
error: invalid value '0' for '--salt <SALT>': Odd number of digits
For more information, try '--help'.

I'm using WSL on Windows 10.

annaerdi commented 3 weeks ago

Converting SALT to a valid hex string fixes the issue. I just had to modify how SALT is defined on line 73:

SALT=$(printf "%02x" ${BULLETIN_BOARD_VERSION:-0})