Skip to content

[#23] Lorentz multisig contracts

Roman Melnikov requested to merge rvem/#23-lorentz-multisig-contracts into master

Description

In this MR morley-multisig package is created, it consists of various multisig contracts (actually, only generic multisig for now) implemented using Lorentz eDSL.

Generic multisig contract has two versions: with and without human-readable errors. morley-multisig CLI executable is capable in printing both versions of the contract compiled to Michelson and also contract documentation.

In order to make Michelson code compiled from Lorentz similar to reference Michelson implementation variable annotation support was added to Lorentz, they can be used using iWithVarAnnotations wrapper for Lorentz instruction. Note that this wrapper should be applied only to primitive Michelson instructions. Otherwise, annotations will not be presented in generated from Lorentz raw Michelson code. Unfortunately, this required one more almost full patter-match over U.ExpandedInstr datatype in conversion from typed to untyped representation.

Also, compileLorentzContractWithOptions function was added, it can compile Lorentz using various options. For now, we make it possible to optionally perform CAST as a first instruction in the compiled code. It is done for better similarity with reference generic multisig implementation as well.

Once !185 (merged) is resolved, parameter and storage type annotations will be similar to the one used in the reference implementation.

This MR is already quite big, other multisig contracts will be added in other MR.

TODO: Upload documentation

Related issue(s)

Resolves part of #23 (moved)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated the changelog if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Roman Melnikov

Merge request reports