Skip to content

Commit

Permalink
Merge pull request #244 from OCamlPro/next
Browse files Browse the repository at this point in the history
Version 2.0 with support for Babylon+
  • Loading branch information
mebsout authored Jun 23, 2020
2 parents 138aaea + fecddd9 commit 6472808
Show file tree
Hide file tree
Showing 269 changed files with 7,610 additions and 5,226 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ _opam*
*-orig
/liquidity
/liquidity-mini
/liquidity-client
/docs/sphinx/src/_extensions/__pycache__/
/docs/sphinx/src/man/liquidity*
/DEVEL
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = dune-network
url = https://gitlab.com/dune-network/dune-network.git
branch = mainnet
[submodule "libs/ezcmd"]
path = libs/ezcmd
url = https://github.com/OCamlPro/ezcmd.git
107 changes: 107 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,110 @@
2.0 2020/06/23
NEW FEATURES
* Support for Babylon+
- Only write entry points' type parameter in signatures [BREAKING CHANGE]
- Multiple entry points (compiler/client)
- Lifting of restictions on big maps
- New instruction `Big_map.create`
- Big map constants
- Use new Michelson instructions `DIP n`, `DROP n`
- Compile DUP n with DIP+DIG instead of DU.UP macro to avoid bubbling
expansion to `DIP { DUP; SWAP }`
- Deprecate `Current.gas`
- Type `chain_id` and instruction `Chain.id : unit -> chain_id`
* Remove contract instances, and use contract handles instead [BREAKING CHANGE]
* Allow polymorphic variants (so as to not have to declare type)
* Allow capitalized entry point names with syntax
`let%entry `Entry = fun param -> fun storage -> body`
* New instruction `Contract.address` returns address without entry point
handle [BREAKING CHANGE]
* Previous behaviour can be accessed with `Contract.untype`
* Addresses can have an entry point handle with syntax
`KT1LLcCCB9Fr1hrkGzfdiJ9u3ZajbdckBFrF%entry_name`

IMPROVEMENTS
* Better simplifications (for sequences) and inlining
* Decompilation of Michelson entry points with arbitrary names
* Modular client in separate executable `liquidity-client`
* Documenation

1.057 2020/01/14
BUG FIXES
* Fix scoping bug in inlining
* Don't use _ as a variable name when decompiling

1.056 2020/01/08
BUG FIXES
* Fix conflicts in internal names with multiple contracts

1.055 2019/11/28
NEW FEATURES
* Estimate fees and storage (burn) in Client

IMPROVEMENTS
* Updated documentation

1.053 2019/10/08
NEW FEATURES
* Fee code (only Dune Network)
* Decompilation of Michelson fee code

IMPROVEMENTS
* Switch to Dune Network backend
* Remove unecessary type annotation in decompiled Liquidity

1.044 2019/09/02
IMPROVEMENTS
* Generate contracts whose parameter is compatible with upcoming version of
Michelson

1.042 2019/07/19
IMPROVEMENTS
* Client update wrt. Tezos protocol

BUG FIXES
* Decompilation of failing branches
* Restriction on timestamp operations

1.041 2019/07/09
NEW FEATURES
* Allow lambdas in constants

1.04 2019/05/24
NEW FEATURES
* GPL license

IMPROVEMENTS
* Client update wrt. Tezos protocol

BUG FIXES
* Occur check with physiscal equality (in inlining phase)

1.03 2019/04/03
NEW FEATURES
* Uncurrying of totally applied functions

IMPROVEMENTS
* Bytes.pack is polymorphic
* Better simplifications
* Better error reporting
* Inlining of closures and constants
* Better name/strucuture recovery when decompiling

BUG FIXES
* Monomorphisation global values/variables
* Dependencies when using sub-contract as main (#201)
* Fix issue in decompilation of sub-contracts
* Fix namespace for first class contract types (#202)

1.02 2019/04/02
IMPROVEMENTS
* Debug information with --verbose

BUG FIXES
* Fix issue in monomophisation
* Normalize types wrt current namesapce (#197)
* Fix issue with module and contract aliases

1.0 2019-03-08
NEW FEATURES
* Revamped module system for function exports
Expand Down
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@ _obuild/liquidity/liquidity.asm: _obuild
_obuild/liquidity-mini/liquidity-mini.asm: _obuild
ocp-build build liquidity-mini

_obuild/liquidity-client/liquidity-client.asm: _obuild
ocp-build build liquidity-client

liquidity-client: _obuild/liquidity-client/liquidity-client.asm
cp -f _obuild/liquidity-client/liquidity-client.asm liquidity-client

liquidity-mini: _obuild/liquidity-mini/liquidity-mini.asm
cp -f _obuild/liquidity-mini/liquidity-mini.asm liquidity-mini

liquidity: _obuild/liquidity/liquidity.asm
cp -f _obuild/liquidity/liquidity.asm liquidity

client: liquidity-mini
mini: liquidity-mini
build: liquidity liquidity-mini
build: liquidity liquidity-mini liquidity-client

install: _obuild
ocp-build install liquidity
Expand Down Expand Up @@ -93,16 +100,20 @@ MORE_TESTS=test_ifcons test_if test_loop test_option test_transfer test_call tes
test_mapmap_closure test_setreduce_closure test_left_match test_loop_left \
test_fold test_iter test_big_map test_map_fold_closure test_inline test_rec_fun \
bug_annot0 inline_fail bug_annot1 test_infer_unpack test_infer_param test_record \
bug187 test_modules lambda_const votes bug_197 curry bug_210 bug_213 bug_213_0 \
bug187 test_modules lambda_const votes bug_197 curry bug_210 bug_213 \
bug_214 bug_216 bug_steven1 bug_steven2 bug_inline2
RE_TESTS=bug202
OTHER_TESTS=others/broker others/demo others/auction others/multisig others/alias others/game others/mist_wallet_current others/token others/token_vote others/token_no_fee
OTHER_TESTS=others/broker others/demo others/auction others/multisig others/alias others/game others/mist_wallet_current others/token others/token_vote others/token_no_fee others/new_token
DOC_TESTS=`cd tests; find doc -regex "[^\.]+.liq" | sort -V`
REV_TESTS=`find tests/reverse -regex "[^\.]+.tz" | sort -V`

NEW_DUNE_TESTS= fail weather_insurance
FAILING_DUNE_TESTS= originator
DUNE_TESTS=`find dune-network/src/bin_client/test/contracts -regex "[^\.]+.tz" ! -path "*concat_hello.tz"| sort -V`
DUNE_TESTS=`find dune-network/src/bin_client/test/contracts -regex "[^\.]+.tz" \
! -path "*concat_hello.tz" \
! -path "*/deprecated/*" \
! -path "*pexec*.tz" \
| sort -V`

TESTS=$(DOC_TESTS) $(SIMPLE_TESTS) $(MORE_TESTS:=.liq) $(RE_TESTS:=.reliq) $(OTHER_TESTS:=.liq)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ next | master
------------ | -------------
[![Travis-CI Build Status](https://travis-ci.org/OCamlPro/liquidity.svg?branch=next)](https://travis-ci.org/OCamlPro/liquidity) | [![Travis-CI Build Status](https://travis-ci.org/OCamlPro/liquidity.svg?branch=master)](https://travis-ci.org/OCamlPro/liquidity)

![Liquidity Logo](docs/sphinx/src/liquidity-dark.svg)

Liquidity: a Smart Contract Language for Dune Network
==============================================
Expand Down
24 changes: 20 additions & 4 deletions docs/sphinx/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SPHINXBUILD = sphinx-build
SPHINXOPTS = -aE -n
SOURCEDIR = src
LIQUIDITY = ../../liquidity
LIQUIDITYCLIENT = ../../liquidity-client

sources := $(shell find $(SOURCEDIR) -type f) Makefile ../../.git/logs/HEAD $(SOURCEDIR)/reference/michelson.rst

Expand All @@ -10,20 +12,34 @@ html: _site
pdf: Liquidity.pdf
epub: Liquidity.epub

_site: $(sources)
manpages:
./mk_man.sh liquidity
./mk_man.sh liquidity-client
./mk_man.sh liquidity-client call
./mk_man.sh liquidity-client call-arg
./mk_man.sh liquidity-client deploy
./mk_man.sh liquidity-client forge-call
./mk_man.sh liquidity-client forge-deploy
./mk_man.sh liquidity-client get-storage
./mk_man.sh liquidity-client init-storage
./mk_man.sh liquidity-client inject
./mk_man.sh liquidity-client pack
./mk_man.sh liquidity-client run

_site: $(sources) manpages
$(SPHINXBUILD) -b html "$(SOURCEDIR)" _site $(SPHINXOPTS)

Liquidity.epub: $(sources)
Liquidity.epub: $(sources) manpages
$(SPHINXBUILD) -b epub "$(SOURCEDIR)" _epub $(SPHINXOPTS)
mv _epub/Liquidity.epub Liquidity.epub

Liquidity.pdf: $(sources)
Liquidity.pdf: $(sources) manpages
$(SPHINXBUILD) -b latex "$(SOURCEDIR)" _pdf $(SPHINXOPTS)
cd _pdf && xelatex Liquidity && xelatex Liquidity
mv _pdf/Liquidity.pdf Liquidity.pdf

clean:
rm -rf _site _epub _pdf *~ Liquidity.pdf Liquidity.epub
rm -rf _site _epub _pdf *~ Liquidity.pdf Liquidity.epub src/man/liquidity*
find . -name '*~' -exec rm -f {} \;

web: _site
Expand Down
14 changes: 14 additions & 0 deletions docs/sphinx/mk_man.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env sh

cmd=$@
file=$(echo $cmd | tr ' ' '-')
dsthtml=src/man/$file.html
dst=src/man/$file.rst

../../$cmd --help=groff | groff -Thtml > $dsthtml
echo "\`\`$cmd\`\`" > $dst
echo "============" >> $dst
echo >> $dst
echo ".. _$file:" >> $dst
echo ".. raw:: html" >> $dst
echo " :file: $file.html" >> $dst
94 changes: 80 additions & 14 deletions docs/sphinx/src/_static/css/fixes.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,85 @@
@media screen and (min-width: 1400px) {
.wy-nav-content-wrap {
background: #fcfcfc;
}
.wy-nav-content {
margin: auto;
background: #fcfcfc;
}
.wy-nav-content-wrap {
background: #fcfcfc;
}
.wy-nav-content {
margin: auto;
background: #fcfcfc;
max-width: unset;
}
}

@media screen and (min-width: 1100px) {
.wy-nav-content-wrap {
background: #fcfcfc;
}
.wy-nav-content {
margin: auto;
background: #fcfcfc;
}
.wy-nav-content-wrap {
background: #fcfcfc;
}
.wy-nav-content {
margin: auto;
background: #fcfcfc;
max-width: unset;
}
}

.document {
max-width: 800px;
margin: auto;
}

.wy-side-nav-search, .wy-nav-top {
background-color: #0f093d;
}

a, a:visited {
color: #553bff
}

a, a:hover {
color: #3e22f8;
}

rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal {
color: #e84fff;
}

.wy-nav-side {
background: #292640;
}

.wy-menu-vertical a {
color: #D7D6E7;
}

.wy-menu-vertical li.on a, .wy-menu-vertical li.current>a {
color: #404040;
}

.wy-menu-vertical header, .wy-menu-vertical p.caption {
color: hsla(247, 84%, 77%, 1)
}

.wy-menu-vertical li.current {
background: #eae9f2;
}


.wy-menu-vertical li.current a:hover {
background: #d6d6d6;
}

.wy-menu-vertical li.current a:hover {
background: hsla(247, 32%, 87%, 1);
}

.wy-menu-vertical a:hover {
background-color: hsla(292, 29%, 46%, 1);
}

.wy-menu-vertical li.toctree-l2.current>a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a {
background: hsla(247, 26%, 88%, 1);
}

.wy-menu-vertical li.on a, .wy-menu-vertical li.current>a {
border-top:none;
border-bottom:none;
}
6 changes: 3 additions & 3 deletions docs/sphinx/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# General information about the project.
project = 'Liquidity'
copyright = '2018, OCamlPro SAS. <contact@ocamlpro.com>'
copyright = '2020, OCamlPro SAS. <contact@ocamlpro.com>'
author = 'OCamlPro SAS. <contact@ocamlpro.com>'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -60,7 +60,7 @@
#
# The short X.Y version.

version = subprocess.check_output("../../../_obuild/liquidity-mini/liquidity-mini.asm -v --version", shell=True).decode("utf-8")
version = subprocess.check_output("grep 'version = \"' ../../../tools/liquidity/build.ocp2 | cut -d'\"' -f 2", shell=True).decode("utf-8")
# version = os.environ.get('CI_COMMIT_REF_NAME', 'v1.0')
# The full version, including alpha/beta/rc tags.
release = version + datetime.datetime.now().strftime(" (%Y/%m/%d %H:%M)")
Expand Down Expand Up @@ -103,7 +103,7 @@
# documentation.
#
html_theme_options = {'logo_only': True}
html_logo = "logo.svg"
html_logo = "liquidity.svg"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
4 changes: 3 additions & 1 deletion docs/sphinx/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ decompiler that can translate Michelson contracts to Liquidity, for
auditing purposes.

.. toctree::
:maxdepth: 2
:maxdepth: 3
:caption: Liquidity Documentation
:glob:

introduction
installation/index
usage/index
tutorial/tutorial
tutorial/examples
reference/liquidity
man/index

.. toctree::
.. :maxdepth: 2
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/src/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The Liquidity project contains:

* A compiler from Liquidity files (.liq extension) to Michelson
* A decompiler from Michelson files (.tz extension) to Liquidity
* A client for Dune Network

See `Examples <http://github.com/OCamlPro/liquidity/tree/master/tests>`__
in the `Github <http://github.com/OCamlPro/liquidity>`__ project.
Loading

0 comments on commit 6472808

Please sign in to comment.