morley: Developer tools for the Michelson Language

[ language, library, mit, program ] [ Propose Tags ]
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.2.0, 0.2.0.1, 0.3.0, 0.3.0.1, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9, 1.10.0, 1.11.0, 1.11.1, 1.12.0, 1.13.0, 1.14.0, 1.15.0, 1.15.1, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.17.0, 1.18.0, 1.19.0, 1.19.1, 1.19.2, 1.20.0
Change log CHANGES.md
Dependencies aeson, aeson-options, aeson-pretty, base-noprelude (>=4.7 && <5), base16-bytestring, base58-bytestring, bifunctors, bytestring, containers, cryptonite, data-default, directory, fmt, formatting, hspec, lens, megaparsec (>=7.0.0), memory, morley, morley-prelude, mtl, named, optparse-applicative, parser-combinators (>=1.0.0), pretty-simple, QuickCheck, singletons, text, time, timerep, transformers-compat (==0.6.2), vinyl [details]
License AGPL-3.0-or-later
Copyright 2018 camlCase, 2019 Tocqueville Group
Author camlCase, Serokell
Maintainer john@camlcase.io
Category Language
Home page https://gitlab.com/camlcase-dev/morley
Bug tracker https://issues.serokell.io/issues/TM
Source repo head: git clone git@gitlab.com:camlcase-dev/morley.git
Uploaded by gromak at 2019-04-01T17:18:49Z
Distributions
Reverse Dependencies 5 direct, 0 indirect [details]
Executables morley
Downloads 13699 total (61 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-04-01 [all 1 reports]

Readme for morley-0.1.0.5

[back to package description]

Morley: Developer tools for the Michelson Language

Morley is a library to make writing smart contracts in Michelson pleasant and effective.

I: A reimplementation of the Michelson Language in Haskell

It consists of the following parts:

  • Tezos.* hierarchy is designed to implement cryptographic primitives, string and byte formats, and any other functionality specific to the Tezos protocol which is required for testing/execution of Michelson contracts, but is used not only by Michelson.
  • Michelson.Untyped and Michelson.Typed hierarchies define Haskell data types that assemble a Michelson contract. See michelsonTypes.md.
  • Michelson.TypeCheck: A typechecker that validates Michelson contracts according to Michelson's typing rules. Essentially it performs conversion from untyped representation to the typed one. See morleyTypechecker.md.
  • Michelson.Intepreter: An intepreter for Michelson contracts which doesn't perform any side effects. See morleyInterpreter.md.
  • Morley.Types: Types for macros, syntactic sugar and other extensions described in the next chapter.
  • Morley.Parser A parser to turn a .tz or .mtz file (.mtz is a Michelson contract with Morley extensions) into a Haskell ADT.
  • Morley.Runtime: A high-level interface to Morley functionality, see morleyRuntime.md.

II: Morley extensions

The Morley Language is a superset of the Michelson language, which means that each Michelson contract is also a valid Morley contract but not vice versa. There are several extensions which make it more convenient to write Michelson contracts and test them. See the document about these extensions. Also there is a transpiler from Morley to Michelson.

III: Morley-to-Michelson transpiler

Coming soon, see TM-58.

IV: Testing EDSL

Coming soon, see TM-77.

Running and building

Morley executable provides following functionality:

  • parse contract and return its representation in haskell types.
  • typecheck contract.
  • run contract. Given contract is being originated first and then transaction is being sent to it
  • originate contract.
  • transfer tokens to given address.
  • print produce .tz contract that can be parsed by the OCaml referenced client from .mtz or .tz contract.

You can get more info about this command by running morley <command> --help

There are two ways to get morley executable:

  • Docker based (preferable). Get script (e. g. using curl https://gitlab.com/camlcase-dev/morley/raw/master/scripts/morley.sh > morley.sh) and run it ./morley.sh <args>. This script will pull docker image that contains latest version of morley executable from master branch and run it with given arguments. Usage example: ./morley.sh to see help message ./morley.sh run --contract add1.tz --storage 1 --parameter 1 --amount 1
  • Stack based. Clone this git repository and run stack build command, after that you can do stack exec -- morley <args> to run morley executable built from source code. Usage example: stack exec -- morley --help to see help message stack exec -- morley originate --contract contracts/add1.tz --storage 1 --verbose

For more information about morley commands check out following docs:

Issue Tracker

We use YouTrack as our issue tracker. You can login using your GitHub account to leave a comment or create a new issue.

For Contributors

Please see CONTRIBUTING.md for more information.