Techelson

Techelson is a Test Execution Environment (TEE) for Michelson smart contracts. Michelson is the stack-based language used by the tezos blockchain. Techelson is open source and hosted on github, where you can find the build instructions. If you just want to retrieve a binary, head over to releases.

If you have problems or suggestions, help us make Techelson better by opening an issue.

Techelson emulates just enough of the tezos blockchain protocol to be able to create smart contracts and make transfers between contracts. Currently, techelson only aims at testing functional properties of smart contracts. In particular, it does not provide any information about the gas or burn of transfers/contracts. This is because computing the burn, and especially the gas of a transfer is rather complex and would require techelson to drop some of the abstractions it makes over the tezos protocol to run tests faster.

Techelson can be used either as a command-line tool or as an OCaml library. This book focuses on the former use case.

Also, this book assumes the reader is fairly familiar with the michelson language. We will discuss what a contract is and how it behaves, but the reader should know what michelson types and instructions look like, and their semantics.

Michelson is a fairly low-level language which makes it difficult to discuss complex contracts. This book will sometimes give contracts as Liquidity contracts. Liquidity is a higher-level, OCaml-like language for tezos smart contracts which compiles to Michelson.

NB: if you are a Liquidity user, you should probably take a look at this blog post on how to write tests directly in Liquidity, and run these tests using Techelson.

The chapters of this book are

  • Michelson, provides a very brief introduction to michelson smart contracts.
  • Running Tests, describes techelson's workflow for running tests through examples.
  • Test Generation, discusses techelson's test generation features.
  • Quick Reference, quick reminders of techelson's features, such as extensions.

All examples in this book are available in the rsc directory of the github repository.