Smart Contracts SDK
Learn how to use the ZP Smart Contract SDK to write, compile and test smart contracts in the ZF* language.

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

  • Clone this repo
  • Run the following commands. Note that this could take a few minutes.
  • cd ZFS-SDK
  • ./paket restore
  • ./build.sh

OSX

  • Clone this repo
  • Run the following commands. Note that this could take a few minutes.
  • cd ZFS-SDK
  • mono paket restore
  • ./build.sh

From NPM

OSX

  1. 1.
    Install mono-devel. If you choose to install via a package manager, add Mono's own repository first.
  2. 2.
    1. 1.
      Recommended to install using NVM
    2. 2.
      Recommended to install Node LTS nvm install 8.9.4

Windows

  1. 2.
    Install Nodejs (LTS version recommended)
  2. 3.
    Open the Command Prompt

Linux

  1. 1.
    Install mono-devel. If you choose to install via a package manager, add Mono's own repository first.
  2. 2.
    Install Nodejs (Version >= 6)
    1. 1.
      Recommended to install using NVM
    2. 2.
      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:
1
npm config set @zen:registry https://www.myget.org/F/zenprotocol/npm/
Copied!

Installing / Updating

Run the following commands in the Terminal / Command Prompt:
1
npm install @zen/zebra -g
Copied!

Usage

1
USAGE: zebra [--help] [<subcommand> [<options>]]
2
3
SUBCOMMANDS:
4
5
create <options> Create a new template contract
6
elaborate, e <options>
7
Elaborate the source File and verify
8
verify, v <options> Verify the source file
9
extract, x <options> Extract the source file
10
compile, c <options> Compile from source file
11
pack, p <options> Pack the contract to be activated on zen blockchain
12
generate-fsx, g <options>
13
Generate a .fsx file to test the contract with
14
run-fsx, r <options> Run the given .fsx file, automatically loading Zen dlls.
15
contractid, cid <options>
16
Compute contract ID.
17
acost, ac <options> Compute activation cost.
18
info, i <options> Get contract information
19
20
Use 'zebra <subcommand> --help' for additional information.
21
22
OPTIONS:
23
24
--help display this list of options.
Copied!

create

1
USAGE: zebra create [--help] <filename>
2
3
FILENAME:
4
5
<filename> File name of the generated contract
6
7
OPTIONS:
8
9
--help display this list of options.
Copied!

elaborate

1
USAGE: zebra elaborate [--help] [--z3rlimit <rlimit>] [--log-types] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract to elaborate
6
7
OPTIONS:
8
9
--z3rlimit, -z <rlimit>
10
Z3 rlimit
11
--log-types, -t Log types
12
--help display this list of options.
Copied!

verify

1
USAGE: zebra verify [--help] [--z3rlimit <rlimit>] [--log-types] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract to verify
6
7
OPTIONS:
8
9
--z3rlimit, -z <rlimit>
10
Z3 rlimit
11
--log-types, -t Log types
12
--help display this list of options.
Copied!

extract

1
USAGE: zebra extract [--help] [--z3rlimit <rlimit>] [--log-types] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract to extract
6
7
OPTIONS:
8
9
--z3rlimit, -z <rlimit>
10
Z3 rlimit
11
--log-types, -t Log types
12
--help display this list of options.
Copied!

compile

1
USAGE: zebra compile [--help] [--z3rlimit <rlimit>] [--log-types] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract to compile
6
7
OPTIONS:
8
9
--z3rlimit, -z <rlimit>
10
Z3 rlimit
11
--log-types, -t Log types
12
--help display this list of options.
Copied!

pack

1
USAGE: zebra pack [--help] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract to pack
6
7
OPTIONS:
8
9
--help display this list of options.
Copied!

generate-fsx

1
USAGE: zebra generate-fsx [--help] <filename>
2
3
FILENAME:
4
5
<filename> File name of the source contract to generate FSX script from
6
7
OPTIONS:
8
9
--help display this list of options.
Copied!

run-fsx

1
USAGE: zebra run-fsx [--help] <filename>
2
3
FILENAME:
4
5
<filename> File name of the FSX script
6
7
OPTIONS:
8
9
--help display this list of options.
Copied!

contractid

1
USAGE: zebra contractid [--help] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract
6
7
OPTIONS:
8
9
--help display this list of options.
Copied!

acost

1
USAGE: zebra acost [--help] [--numofblocks <uint>] [--z3rlimit <rlimit>] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract
6
7
OPTIONS:
8
9
--numofblocks, -n <uint>
10
Number of blocks
11
--z3rlimit, -z <rlimit>
12
Z3 rlimit
13
--help display this list of options.
Copied!

info

1
USAGE: zebra info [--help] [--z3rlimit <rlimit>] <filename>
2
3
FILENAME:
4
5
<filename> File name of the contract
6
7
OPTIONS:
8
9
--z3rlimit, -z <rlimit>
10
Z3 rlimit
11
--help display this list of options.
Copied!
Last modified 2mo ago