ContractPen: Viewing Accord Project Contracts

contractpen.com

The Accord Project is an useful emerging software stack for smart legal contracts which has logic in the form of the Ergo language and data models in the form of Hyperledger Composer Concerto (.CTO file extension) model files. The combination of code and legal contract templates allows for smart legal contracts to be created and as such this is a completely new and exciting area in blockchain technology.

To explore how Accord Project integrates with ContractPen lets consider how Accord Project sample templates from Accords Cicero Template Github repository can be imported into ContractPen to execute or view. By exploring these contracts this can give a perspective on how the Accord Project works with data models and templates.

Here are some example Accord Project templates which have already been imported:

Hello World https://contractpen.com/share/af73b7d1-7c15-4a27-b3b7-d17c151a27b5
Hello World State https://contractpen.com/share/397adbba-1de3-4673-badb-ba1de3867327
Acceptance of Delivery https://contractpen.com/share/5a462dbc-a047-4878-862d-bca047687823
Demand Forecast https://contractpen.com/share/10acdca3-95c7-4496-acdc-a395c7a4961d
Eat Apples https://contractpen.com/share/489a054d-d63a-42ce-9a05-4dd63a62ce48
Service Level Agreement https://contractpen.com/share/b3cda6c3-2f8a-487a-8da6-c32f8ac87a23
Volume Discount https://contractpen.com/share/fc19641f-f196-47ca-9964-1ff196c7ca98

There are also many other models available for the Accord Project at https://models.accordproject.org/ and templates at https://templates.accordproject.org/. These will be further integrated into ContractPen in the near future.

What can be achieved with Accord Project Templates in ContractPen?

  1. DATA + TEMPLATE generate CONTRACT
    Accord templates can be be combined with data to render a final contract. Data in the form of data models can have values and these values are used within the legal contract template.
  2. DATA MODELS generate CODE GENERATION
    Data models edited within ContractPen can be visually edited via forms to generate CTO model files in computer code. This means there is no need to write code for data models as the models created in ContractPen will be automatically converted into CTO model code.
  3. Execution of Accord Clause
    The Accord Clause can be executed and a result produced.
  4. Downloadable code generation
    Code generated from the data models can be downloaded as a Accord Project ZIP file to be used outside of ContractPen with the accord projects tooling.

Let us consider one of the most simple examples, Hello World State https://contractpen.com/share/397adbba-1de3-4673-badb-ba1de3867327, here click on the contract to view it and use the left menu to click on Create Contract. You can see here the final contract rendered, but how did it get produced?
DATA + TEMPLATE generate CONTRACT

The explanation for how the above contract was generated is shown in the below image. The Contract Template menu contains the template for the contract and its template is combined with the data from the model HelloWorldClause. The two menu items below show the data which is combined together to result in the above contract. This uses the template system of Accord Project, for example template values are expressed using the [{name}] notation and behind the scenes the accord project is being used as a library.
Although this is a very simple template case, it can be imagined that many data models and many data template values can be combined for a more complex case.

Now to execute the Accord clause associated with the contract then click on the Accord Project menu on the left and then the tab on the top as Execute Accord Project. Click on the “Click to Execute” button to execute this Accord Clause. Here the request, response and state involved is shown. In this case as it is a stateful clause the counter will increment on each execution of the clause.

Although this is a simple example it demonstrates the integration of the Accord Project within ContractPen to facilitate smart legal contracts.

This article will be continued in a part 2.