morley: Developer tools for the Michelson Language

[ language, library, mit, program ] [ Propose Tags ]

A library to make writing smart contracts in Michelson — the smart contract language of the Tezos blockchain — pleasant and effective.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

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-casing, aeson-pretty, base-noprelude (>=4.7 && <5), base58-bytestring, bimap, binary, bytestring, constraints (>=0.11), containers, crypto-sodium (>=0.0.5.0), cryptonite, data-default, Diff, elliptic-curve, first-class-families (>=0.5.0.0), fmt (>=0.6.3.0), galois-field, generic-deriving, gitrev, haskeline, hex-text, lens, megaparsec (>=7.0.0), memory, MonadRandom, morley, morley-prelude (>=0.3.0), mtl, named, optparse-applicative, pairing, parser-combinators (>=1.0.0), scientific, semigroups (>=0.19.1), show-type, singletons, singletons-base, syb, template-haskell, text, text-manipulate, th-lift-instances, th-reify-many, time, timerep, uncaught-exception, unordered-containers, vector, vinyl (>=0.13.1), with-utf8, wl-pprint-text [details]
License MIT
Copyright 2018 camlCase, 2019-2021 Tocqueville Group, 2021-2022 Oxhead Alpha
Author camlCase, Serokell, Tocqueville Group
Maintainer Serokell <hi@serokell.io>
Category Language
Home page https://gitlab.com/morley-framework/morley
Bug tracker https://gitlab.com/morley-framework/morley/-/issues
Source repo head: git clone git@gitlab.com:morley-framework/morley.git
Uploaded by pasqu4le at 2022-09-21T13:34:13Z
Distributions
Reverse Dependencies 5 direct, 0 indirect [details]
Executables morley
Downloads 13640 total (96 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for morley-1.18.0

[back to package description]

Morley: Developer tools for the Michelson Language

Hackage

Morley aims to make writing smart contracts in Michelson pleasant and effective. It contains 2 major things:

  1. An executable that lets you perform various operations on Michelson smart contracts.
  2. A library with core Tezos and Michelson data types, and functions such as Michelson typechecker and interpreter.

Morley executable

How to install

There are three ways to get Morley executable:

  • Docker based (preferable).
    • Get script (e. g. using curl https://gitlab.com/morley-framework/morley/raw/master/scripts/morley.sh > morley.sh) and run it ./morley.sh <args>. This script will pull a docker image that contains the latest version of Morley executable from the production branch and run it with the given arguments. You'll need coreutils to be installed in order to use morley.sh.
    • 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 the source code.
    • Usage example:
      • stack exec -- morley --help to see help message
      • stack exec -- morley originate --contract contracts/tezos_examples/attic/add1.tz --storage 1 --verbose
  • Cabal based.
    • Clone this git repository, go to this directory and run cabal new-update && cabal new-build command, after that you can do cabal new-run -- morley <args> to run morley executable built from the source code.
    • Usage example:
      • cabal new-run -- morley --help to see help message
      • cabal new-run -- morley originate --contract contracts/tezos_examples/attic/add1.tz --storage 1 --verbose

Usage

Morley executable does not interact with Tezos node and Tezos network. It works in emulated environment which is stored in a simple JSON file on disk. The following commands depend on environment and may modify it:

  • emulate originate a contract.
  • emulate transfer tokens to a given address (and call a smart contract if it's the destination).
  • emulate run a contract. A given contract is being originated first, and then the transaction is being sent to it.

The following commands don't depend on environment:

  • optimize a contract by replacing certain sequences of instructions with equivalent but more efficient ones.
  • typecheck a contract.
  • repl starts a REPL where you can type Michelson instructions and interpret them.
  • analyze a contract and print some statistics about it.
  • print a contract in vanilla Michelson format. It can be useful in some cases:
    • You have a contract with inconsistent/ugly formatting and want to format it in uniform style.
    • You want to print a contract on a single line.
  • parse a contract and return its representation in Haskell types.

You can get more info about these commands by running morley <command> --help. Run morley --help to get the list of all commands.

Morley library

Morley-the library is available on Hackage. It consists of the following parts: