Smart Contracts SDK Learn how to use the ZP Smart Contract SDK to write, compile and test smart contracts in the ZF* language.
Zen-SDK Repo -> https://github.com/zenprotocol/ZFS-SDK
Installation
From Source
You will need to have mono installed. Instructions for your OS can be found here . For Linux, you will need either the mono-devel
or mono-complete
package. Do not install mono from your package manager - follow the instructions on the mono website.
Linux
Run the following commands. Note that this could take a few minutes.
OSX
Run the following commands. Note that this could take a few minutes.
From NPM
OSX
Install mono-devel . If you choose to install via a package manager, add Mono's own repository first.
Install Nodejs
Recommended to install using NVM
Recommended to install Node LTS nvm install 8.9.4
Windows
Linux
Install mono-devel . If you choose to install via a package manager, add Mono's own repository first.
Install Nodejs (Version >= 6)
Recommended to install using NVM
Recommended to install Node LTS (8.9.4) nvm install --lts
Point your npm directory to our repository
Run the following commands in the Terminal / Command Prompt:
Copy npm config set @zen:registry https://www.myget.org/F/zenprotocol/npm/
Installing / Updating
Run the following commands in the Terminal / Command Prompt:
Copy npm install @zen/zebra -g
Usage
Copy USAGE: zebra [--help] [ < subcommand > [ < options > ]]
SUBCOMMANDS:
create < option s > Create a new template contract
elaborate, e < option s >
Elaborate the source File and verify
verify, v < option s > Verify the source file
extract, x < option s > Extract the source file
compile, c < option s > Compile from source file
pack, p < option s > Pack the contract to be activated on zen blockchain
generate-fsx, g < option s >
Generate a .fsx file to test the contract with
run-fsx, r < option s > Run the given .fsx file, automatically loading Zen dlls.
contractid, cid < option s >
Compute contract ID.
acost, ac < option s > Compute activation cost.
info, i < option s > Get contract information
Use 'zebra <subcommand> --help' for additional information.
OPTIONS:
--help display this list of options.
create
Copy USAGE: zebra create [--help] < filename >
FILENAME:
< filename > File name of the generated contract
OPTIONS:
--help display this list of options.
elaborate
Copy USAGE: zebra elaborate [--help] [--z3rlimit < rlimit > ] [--log-types] < filename >
FILENAME:
< filename > File name of the contract to elaborate
OPTIONS:
--z3rlimit, -z < rlimi t >
Z3 rlimit
--log-types, -t Log types
--help display this list of options.
verify
Copy USAGE: zebra verify [--help] [--z3rlimit < rlimit > ] [--log-types] < filename >
FILENAME:
< filename > File name of the contract to verify
OPTIONS:
--z3rlimit, -z < rlimi t >
Z3 rlimit
--log-types, -t Log types
--help display this list of options.
Copy USAGE: zebra extract [--help] [--z3rlimit < rlimit > ] [--log-types] < filename >
FILENAME:
< filename > File name of the contract to extract
OPTIONS:
--z3rlimit, -z < rlimi t >
Z3 rlimit
--log-types, -t Log types
--help display this list of options.
compile
Copy USAGE: zebra compile [--help] [--z3rlimit < rlimit > ] [--log-types] < filename >
FILENAME:
< filename > File name of the contract to compile
OPTIONS:
--z3rlimit, -z < rlimi t >
Z3 rlimit
--log-types, -t Log types
--help display this list of options.
pack
Copy USAGE: zebra pack [--help] < filename >
FILENAME:
< filename > File name of the contract to pack
OPTIONS:
--help display this list of options.
generate-fsx
Copy USAGE: zebra generate-fsx [--help] < filename >
FILENAME:
< filename > File name of the source contract to generate FSX script from
OPTIONS:
--help display this list of options.
run-fsx
Copy USAGE: zebra run-fsx [--help] < filename >
FILENAME:
< filename > File name of the FSX script
OPTIONS:
--help display this list of options.
contractid
Copy USAGE: zebra contractid [--help] < filename >
FILENAME:
< filename > File name of the contract
OPTIONS:
--help display this list of options.
acost
Copy USAGE: zebra acost [--help] [--numofblocks < uint > ] [--z3rlimit < rlimit > ] < filename >
FILENAME:
< filename > File name of the contract
OPTIONS:
--numofblocks, -n < uin t >
Number of blocks
--z3rlimit, -z < rlimi t >
Z3 rlimit
--help display this list of options.
info
Copy USAGE: zebra info [--help] [--z3rlimit < rlimit > ] < filename >
FILENAME:
< filename > File name of the contract
OPTIONS:
--z3rlimit, -z < rlimi t >
Z3 rlimit
--help display this list of options.