Liquidity is a high-level language to program Smart Contracts for Tezos. It is a fully typed functional language, it uses the syntax of OCaml, and strictly complies to Michelson security restrictions.
A formal-method framework for Liquidity is under development, to prove the correctness of smart-contracts written in Liquidity.
The Liquidity language provides the following features:
Liquidity already covers 100% of the Michelson features, and contracts generated with Liquidity can be submitted on the current alphanet.
Liquidity editors will soon be available to program online and submit contracts on Tezos testnet. For now, you can use our Try Liquidity Site to get a taste of the upcoming environment.
A typical example is:
[%%version 0.13] type storage = (string, int) map let%entry main (parameter : string) (storage : storage) : unit * storage = let amount = Current.amount() in if amount < 5.00tz then Current.fail () else match Map.find parameter storage with | None -> Current.fail () | Some x -> let storage = Map.add parameter (x+1) storage in ( (), storage )
The current roadmap is:
0.13 2017-11-30 NEW FEATURES * match%nat construct for int -> nat coercion * abs is now int -> int * Command line options --parse-only, --type-only * Command line options --single-line, --compact to output Michelson on a single line * Support &&, || Boolean connectors * Support Map.add, Map.remove, Set.add, Set.remove * Lambda types are now written as t1 -> t2 instead of (t1, t2) lambda * Constant amounts written as litterals: 1.00tz * Constant keys and key_hashes as litterals: edpk... tz1... * Timestamps as litterals in ISO-8601 format IMPROVEMENTS * Split typechecking and encoding phases * Allow transfers in conditions (for if-then-else and match) * Encode to constants when possible * Better error messages * Accept any name for result of Contract.call * Recover variable names when decompiling BUG FIXES * Fix bug in encoding of closures * Fix bug in compilation of branches with transfers 0.11 2017-10-16 NEW FEATURES * Compilation of Liquidity contracts to OCaml bytecode * Deconstruct tuples in let, fun and pattern matching * Support _ for pattern * OCaml syntax for return type of contract's entry point * Support for type key_hash IMPROVEMENTS * Allow compilation without Tezos * Better error messages * Error location in Michelson source when decompiling * Declare type storage when decompiling * More efficient encoding of closures 0.1 2017-10-05 Initial release