The Ergo Language for Smart Legal Contracts
mttrbrts Automatic version bump to 0.5.4
Signed-off-by: matt@clause.io <matt@clause.io>
Latest commit eaf93d7 Nov 14, 2018
Permalink
Failed to load latest commit information.
.circleci (fix) Re-enable cache in CircleCI script Sep 1, 2018
.travis Scripts for manual release Jul 2, 2018
backends (feature) Some support for trigo functions in standard library Nov 14, 2018
bin (fix) REPL can now import Jul 16, 2018
ergo.vim (feat) added a vim plugin yay Aug 7, 2018
examples chore: Fix math examples Nov 14, 2018
extraction (feature) Some support for trigo functions in standard library Nov 14, 2018
mechanization (chore) Up 0.5.4 Nov 14, 2018
packages Automatic version bump to 0.5.4 Nov 14, 2018
scripts (update) use composer-concerto Oct 10, 2018
.gitignore (feature) Dependency analysis for modules and CTO files ; new ergodep… Aug 2, 2018
.npmignore Automate Release with Travis (#176) May 24, 2018
.travis.yml (fix) over other fix for triggering deployment from a tagged release Aug 17, 2018
CHANGELOG.md (fix) Clean up of documentation content Jun 7, 2018
CONTRIBUTING.md (doc) READMEs Jun 18, 2018
DEVELOPERS.md (fix) Wrong opam package name Aug 14, 2018
LICENSE Automate Release with Travis (#176) May 24, 2018
Makefile (fix) Bug in array operators ; Add containsAll & in Array Sep 15, 2018
Makefile.config Automate Release with Travis (#176) May 24, 2018
Makefile.coq_modules (feature) Some support for trigo functions in standard library Nov 14, 2018
README.md URL update Sep 29, 2018
ergo.png (fix) Logo Jul 1, 2018
lerna.json Automatic version bump to 0.5.4 Nov 14, 2018
markdown-license.txt Automate Release with Travis (#176) May 24, 2018
package-lock.json (chore) Up 0.5.4 Nov 14, 2018
package.json Automatic version bump to 0.5.4 Nov 14, 2018

README.md

Ergo

Build Status CircleCI lerna npm version

https://docs.accordproject.org/docs/ergo

About

This is the source code for the Ergo compiler. Ergo is the Accord Project language for Smart Legal Contracts.

The Ergo compiler is distributed as an npm package. If you want to install Ergo, consult the getting started section.

The Ergo compiler is written in Coq with a parser and some support code written in OCaml. It makes extensive use of the Q*cert compiler for code generation.

Both the Ergo language and its compiler are in early development phase. If you would like to build from source or to contribute, consult the for developers section.

Try it out

If you simply want to take a peek at Ergo without installing anything, check out the examples on the Ergo Playground.

You can also try the interactive REPL (read-eval-print-loop) for Ergo.

Documentation

The most recent documentation for Ergo is available at https://ergo.accordproject.org/

Getting started

Install Ergo

The easiest way to install Ergo is as a Node.js package. Once you have Node.js installed on your machine, you can get the Ergo compiler and command-line using the Node.js package manager by typing the following in a terminal:

$ npm install -g @accordproject/ergo-cli

This will install the compiler itself (ergoc) and command-line tools (ergorun and ergotop) to create and invoke Ergo contracts. You can check that both have been installed and print the version number by typing the following in a terminal:

$ ergoc --version
$ ergorun --version

Then, to get command line help:

$ ergoc --help
$ ergorun --help

Compiling your first contract

To compile your first Ergo contract to JavaScript:

$ ergoc ./examples/volumediscount/model.cto ./examples/volumediscount/logic.ergo
15:17:08 - info: Logging initialized. 2018-05-24T19:17:08.024Z
Processing file: ./examples/volumediscount/logic.ergo -- compiled to: ./examples/volumediscount/logic.js

By default, Ergo compiles to JavaScript for execution. You can inspect the compiled code for the result in ./examples/volumediscount/logic.js

Invoke a contract

To compile and invoke that contract:

$ ergorun ./examples/volumediscount/model.cto ./examples/volumediscount/logic.ergo --contractname org.accordproject.volumediscount.VolumeDiscount --contract ./examples/volumediscount/contract.json --request ./examples/volumediscount/request.json --state ./examples/volumediscount/state.json
13:40:03 - info: Logging initialized. 2018-06-17T17:40:03.587Z
13:40:03 - info: {"response":{"discountRate":2.8,"$class":"org.accordproject.volumediscount.VolumeDiscountResponse"},"state":{"$class":"org.accordproject.cicero.contract.AccordContractState","stateId":"1"},"emit":[]}

For developers

We welcome contributions. We encourage contributors to consult the following Guidelines

To setup for development, please consult the Developer Guide

License

Accord Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Accord Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.

Copyright 2018 Clause, Inc.