├── .all-contributorsrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom-issue.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ └── build-and-publish.yml ├── .gitignore ├── CHARTER.md ├── CONTRIBUTING.md ├── DEVELOPERS.md ├── LICENSE ├── README.md ├── assets ├── APLogo.png ├── APStack.png ├── Accord Project - Intro Overview 2020.pdf ├── POWEREDBY-MARK-AND-TEXT.svg └── contributors.png ├── docs ├── accordproject-faq.md ├── accordproject-slc.md ├── accordproject-template.md ├── accordproject-tour.md ├── accordproject.md ├── assets │ ├── 020 │ │ ├── ergo.png │ │ ├── grammar.png │ │ ├── studio.png │ │ ├── template.png │ │ ├── template_logic.png │ │ ├── template_model.png │ │ └── template_text.png │ ├── acceptance-of-delivery.png │ ├── advanced │ │ ├── hlf1.png │ │ ├── hlf2.png │ │ ├── hlf3.png │ │ ├── hlf4.png │ │ ├── late1.png │ │ ├── late10.png │ │ ├── late11.png │ │ ├── late12.png │ │ ├── late13.png │ │ ├── late14.png │ │ ├── late15.png │ │ ├── late16.png │ │ ├── late17.png │ │ ├── late2.png │ │ ├── late3.png │ │ ├── late4.png │ │ ├── late5.png │ │ ├── late6.png │ │ ├── late7.png │ │ ├── late8.png │ │ ├── late9.png │ │ ├── minilatedeliveryandpenalty-capped@0.1.1.cta │ │ ├── minilatedeliveryandpenalty-payment@0.1.1.cta │ │ └── minilatedeliveryandpenalty@0.1.1.cta │ ├── architecture │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── cleansvg.ts │ │ ├── codegen-coq.tex │ │ ├── codegen.pdf │ │ ├── codegen.png │ │ ├── codegen.svg │ │ ├── codegen.tex │ │ ├── frontend-coq.tex │ │ ├── frontend.pdf │ │ ├── frontend.png │ │ ├── frontend.svg │ │ ├── frontend.tex │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── tikzmacros.tex │ │ ├── tsconfig.json │ │ ├── types-coq.tex │ │ ├── types.pdf │ │ ├── types.png │ │ ├── types.svg │ │ └── types.tex │ ├── basic │ │ ├── library1.png │ │ ├── use1.png │ │ ├── use2.png │ │ └── use3.png │ ├── bond-model.png │ ├── cicero-spec-overview.png │ ├── cicero-spec-uml.png │ ├── dingus1.png │ ├── dingus2.png │ ├── dingus3.png │ ├── dingus4.png │ ├── exceptions.png │ ├── execution_context.png │ ├── grammar.png │ ├── image1.png │ ├── image2.png │ ├── image3.png │ ├── perishable-goods.png │ ├── reference │ │ └── tsv2.png │ ├── specification │ │ ├── ErgoSpec.Backend.Component.DateTimeComponent.html │ │ ├── ErgoSpec.Backend.Component.LogComponent.html │ │ ├── ErgoSpec.Backend.Component.MathComponent.html │ │ ├── ErgoSpec.Backend.ForeignErgo.html │ │ ├── ErgoSpec.Backend.ForeignModel.html │ │ ├── ErgoSpec.Backend.Lib.QBackendModel.html │ │ ├── ErgoSpec.Backend.Lib.QBackendRuntime.html │ │ ├── ErgoSpec.Backend.Lib.QCodeGen.html │ │ ├── ErgoSpec.Backend.Lib.QData.html │ │ ├── ErgoSpec.Backend.Lib.QOps.html │ │ ├── ErgoSpec.Backend.Lib.QType.html │ │ ├── ErgoSpec.Backend.QLib.html │ │ ├── ErgoSpec.Backend.Qcert.QcertCompiler.html │ │ ├── ErgoSpec.Backend.Qcert.QcertData.html │ │ ├── ErgoSpec.Backend.Qcert.QcertDataToEJson.html │ │ ├── ErgoSpec.Backend.Qcert.QcertDataTyping.html │ │ ├── ErgoSpec.Backend.Qcert.QcertEJson.html │ │ ├── ErgoSpec.Backend.Qcert.QcertEJsonToJSON.html │ │ ├── ErgoSpec.Backend.Qcert.QcertModel.html │ │ ├── ErgoSpec.Backend.Qcert.QcertReduceOps.html │ │ ├── ErgoSpec.Backend.Qcert.QcertRuntime.html │ │ ├── ErgoSpec.Backend.Qcert.QcertToJava.html │ │ ├── ErgoSpec.Backend.Qcert.QcertToJavascriptAst.html │ │ ├── ErgoSpec.Backend.Qcert.QcertToReduceOps.html │ │ ├── ErgoSpec.Backend.Qcert.QcertToScala.html │ │ ├── ErgoSpec.Backend.Qcert.QcertToSpark.html │ │ ├── ErgoSpec.Backend.Qcert.QcertType.html │ │ ├── ErgoSpec.Backend.Qcert.QcertTypeToJSON.html │ │ ├── ErgoSpec.Backend.Qcert.QcertTyping.html │ │ ├── ErgoSpec.Common.Ast.html │ │ ├── ErgoSpec.Common.Names.html │ │ ├── ErgoSpec.Common.NamespaceContext.html │ │ ├── ErgoSpec.Common.PrintTypedData.html │ │ ├── ErgoSpec.Common.Provenance.html │ │ ├── ErgoSpec.Common.Result.html │ │ ├── ErgoSpec.Compiler.ErgoCompiler.html │ │ ├── ErgoSpec.Compiler.ErgoDriver.html │ │ ├── ErgoSpec.Ergo.Lang.Ergo.html │ │ ├── ErgoSpec.Ergo.Lang.ErgoMap.html │ │ ├── ErgoSpec.Ergo.Lang.ErgoSem.html │ │ ├── ErgoSpec.Ergo.Lang.ErgoSugar.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoC.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCEval.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCEvalContext.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCExpand.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCOverloaded.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCStdlib.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCSugar.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCT.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCTypecheck.html │ │ ├── ErgoSpec.ErgoC.Lang.ErgoCTypecheckContext.html │ │ ├── ErgoSpec.ErgoNNRC.Lang.ErgoNNRC.html │ │ ├── ErgoSpec.ErgoNNRC.Lang.ErgoNNRCSugar.html │ │ ├── ErgoSpec.Tests.HelloWorld.html │ │ ├── ErgoSpec.Translation.CTOtoErgo.html │ │ ├── ErgoSpec.Translation.ErgoAssembly.html │ │ ├── ErgoSpec.Translation.ErgoCInline.html │ │ ├── ErgoSpec.Translation.ErgoCTtoErgoNNRC.html │ │ ├── ErgoSpec.Translation.ErgoCompContext.html │ │ ├── ErgoSpec.Translation.ErgoNNRCtoCicero.html │ │ ├── ErgoSpec.Translation.ErgoNNRCtoJava.html │ │ ├── ErgoSpec.Translation.ErgoNNRCtoJavaScript.html │ │ ├── ErgoSpec.Translation.ErgoNameResolve.html │ │ ├── ErgoSpec.Translation.ErgotoErgoC.html │ │ ├── ErgoSpec.Types.CTO.html │ │ ├── ErgoSpec.Types.ErgoCTypeUtil.html │ │ ├── ErgoSpec.Types.ErgoType.html │ │ ├── ErgoSpec.Types.ErgoTypetoErgoCType.html │ │ ├── ErgoSpec.Utils.Misc.html │ │ ├── ErgoSpec.Version.html │ │ ├── coq2html.css │ │ └── coq2html.js │ └── template.png ├── ergo-tutorial.md ├── example-eatapple.md ├── logic-advanced-expr.md ├── logic-complex-type.md ├── logic-decl.md ├── logic-ergo.md ├── logic-module.md ├── logic-simple-expr.md ├── logic-simple-type.md ├── logic-stmt.md ├── markup-ciceromark.md ├── markup-commonmark.md ├── markup-preliminaries.md ├── markup-templatemark.md ├── ref-cicero-api.md ├── ref-cicero-cli.md ├── ref-cicero-testing.md ├── ref-concerto-api.md ├── ref-concerto-cli.md ├── ref-concerto-decorators.md ├── ref-ergo-api.md ├── ref-ergo-cli.md ├── ref-ergo-repl.md ├── ref-ergo-spec.md ├── ref-ergo-stdlib.md ├── ref-errors.md ├── ref-glossary.md ├── ref-markus-cli.md ├── ref-migrate-0.13-0.20.md ├── ref-migrate-0.20-0.21.md ├── ref-migrate-0.21-0.22.md ├── ref-web-components-overview.md ├── started-hello.md ├── started-installation.md ├── started-resources.md ├── tutorial-create.md ├── tutorial-hyperledger.md ├── tutorial-library.md ├── tutorial-nodejs.md ├── tutorial-studio.md ├── tutorial-templates.md └── tutorial-vscode.md ├── scripts ├── get_contributors.sh └── seed_contributors.sh └── website ├── blog └── 2018-05-18-blog-post.md ├── core └── Footer.js ├── i18n └── en.json ├── package-lock.json ├── package.json ├── pages └── en │ ├── index.js │ ├── users.js │ └── versions.js ├── scripts ├── build_api_md.sh ├── cicero-api.hbs ├── cicero-jsdoc.conf ├── concerto-api.hbs ├── concerto-jsdoc.conf ├── ergo-api.hbs └── ergo-jsdoc.conf ├── sidebars.json ├── siteConfig.js ├── static ├── css │ └── main.css ├── fonts │ ├── Graphik-100-Italic.otf │ ├── Graphik-100-Italic.woff │ ├── Graphik-100-Italic.woff2 │ ├── Graphik-100.otf │ ├── Graphik-100.woff │ ├── Graphik-100.woff2 │ ├── Graphik-200-Italic.otf │ ├── Graphik-200-Italic.woff │ ├── Graphik-200-Italic.woff2 │ ├── Graphik-200.otf │ ├── Graphik-200.woff │ ├── Graphik-200.woff2 │ ├── Graphik-300-Italic.otf │ ├── Graphik-300-Italic.woff │ ├── Graphik-300-Italic.woff2 │ ├── Graphik-300.otf │ ├── Graphik-300.woff │ ├── Graphik-300.woff2 │ ├── Graphik-400-Italic.otf │ ├── Graphik-400-Italic.woff │ ├── Graphik-400-Italic.woff2 │ ├── Graphik-400.otf │ ├── Graphik-400.woff │ ├── Graphik-400.woff2 │ ├── Graphik-500-Italic.otf │ ├── Graphik-500-Italic.woff │ ├── Graphik-500-Italic.woff2 │ ├── Graphik-500.otf │ ├── Graphik-500.woff │ ├── Graphik-500.woff2 │ ├── Graphik-600-Italic.otf │ ├── Graphik-600-Italic.woff │ ├── Graphik-600-Italic.woff2 │ ├── Graphik-600.otf │ ├── Graphik-600.woff │ ├── Graphik-600.woff2 │ ├── Graphik-700-Italic.otf │ ├── Graphik-700-Italic.woff │ ├── Graphik-700-Italic.woff2 │ ├── Graphik-700.otf │ ├── Graphik-700.woff │ ├── Graphik-700.woff2 │ ├── Graphik-800-Italic.otf │ ├── Graphik-800-Italic.woff │ ├── Graphik-800-Italic.woff2 │ ├── Graphik-800.otf │ ├── Graphik-800.woff │ ├── Graphik-800.woff2 │ ├── Graphik-900-Italic.otf │ ├── Graphik-900-Italic.woff │ ├── Graphik-900-Italic.woff2 │ ├── Graphik-900.otf │ ├── Graphik-900.woff │ └── Graphik-900.woff2 ├── img │ ├── A-MARK-ACCORDPROJECT-ONELINE-white.svg │ ├── Accord-Project-logo-small.svg │ ├── LF-logo.png │ ├── accord_icon.png │ ├── accord_icon_white.png │ ├── accord_logo.png │ ├── accord_logo_white.png │ ├── background.jpg │ ├── cicero-logo.svg │ ├── clause-logo-sm.png │ ├── contractpen-logo-sm.png │ ├── docusaurus.svg │ ├── ergo-logo.svg │ ├── ergo-vscode.png │ ├── favicon.png │ ├── github-brands.svg │ ├── grammar.png │ ├── microsoft-word-logo.png │ ├── model-uml.png │ ├── model-vscode.png │ ├── modelrepo_logo.png │ ├── noise.png │ ├── oss_logo.png │ ├── playground.png │ └── studio.png └── js │ └── code-block-buttons.js ├── versioned_docs ├── version-0.12 │ ├── accordproject-installation.md │ ├── accordproject-models.md │ ├── accordproject-resources.md │ ├── accordproject-studio.md │ ├── accordproject-templates.md │ ├── accordproject-tooling.md │ ├── accordproject.md │ ├── advanced-hyperledger.md │ ├── advanced-latedelivery.md │ ├── advanced-nodejs.md │ ├── basic-create.md │ ├── basic-library.md │ ├── basic-templates.md │ ├── basic-use.md │ ├── cicero-api.md │ ├── cicero-cli.md │ ├── ergo-api.md │ ├── ergo-cli.md │ ├── ergo-tutorial.md │ ├── example-eatapple.md │ ├── logic-advanced-expr.md │ ├── logic-complex-type.md │ ├── logic-decl.md │ ├── logic-ergo.md │ ├── logic-module.md │ ├── logic-simple-expr.md │ ├── logic-simple-type.md │ ├── logic-stmt.md │ ├── ref-logic-specification.md │ ├── ref-logic-stdlib.md │ ├── ref-logic.md │ ├── ref-markup.md │ ├── ref-testing.md │ ├── spec-concepts.md │ ├── spec-example.md │ ├── spec-execution.md │ ├── spec-instance.md │ ├── spec-overview.md │ ├── spec-packaging.md │ └── spec-template.md ├── version-0.13 │ ├── accordproject-installation.md │ ├── basic-create.md │ ├── basic-use.md │ ├── ergo-cli.md │ ├── ergo-tutorial.md │ ├── logic-complex-type.md │ ├── logic-stmt.md │ ├── ref-errors.md │ ├── ref-logic-stdlib.md │ └── spec-packaging.md ├── version-0.20 │ ├── accordproject-business.md │ ├── accordproject-concepts.md │ ├── accordproject-developers.md │ ├── accordproject.md │ ├── cicero-api.md │ ├── cicero-cli.md │ ├── concerto-api.md │ ├── concerto-cli.md │ ├── ergo-api.md │ ├── ergo-cli.md │ ├── ergo-repl.md │ ├── ergo-tutorial.md │ ├── example-eatapple.md │ ├── logic-advanced-expr.md │ ├── logic-complex-type.md │ ├── logic-decl.md │ ├── logic-ergo.md │ ├── logic-module.md │ ├── logic-simple-expr.md │ ├── logic-simple-type.md │ ├── logic-stmt.md │ ├── markup-blocks.md │ ├── markup-cicero.md │ ├── markup-commonmark.md │ ├── markup-ergo.md │ ├── markup-variables.md │ ├── markus-cli.md │ ├── model-api.md │ ├── model-classes.md │ ├── model-concerto.md │ ├── model-decorators.md │ ├── model-enums.md │ ├── model-namespaces.md │ ├── model-properties.md │ ├── model-relationships.md │ ├── ref-cicero-ui.md │ ├── ref-glossary.md │ ├── ref-logic-specification.md │ ├── ref-logic-stdlib.md │ ├── ref-logic.md │ ├── ref-migrate-0.13-0.20.md │ ├── ref-testing.md │ ├── started-hello.md │ ├── started-installation.md │ ├── started-resources.md │ ├── started-studio.md │ ├── tutorial-create.md │ ├── tutorial-hyperledger.md │ ├── tutorial-latedelivery.md │ ├── tutorial-library.md │ ├── tutorial-nodejs.md │ └── tutorial-templates.md ├── version-0.21 │ ├── accordproject-faq.md │ ├── accordproject-slc.md │ ├── accordproject-template.md │ ├── accordproject-tour.md │ ├── accordproject.md │ ├── ergo-tutorial.md │ ├── logic-advanced-expr.md │ ├── logic-complex-type.md │ ├── logic-ergo.md │ ├── logic-simple-expr.md │ ├── logic-stmt.md │ ├── markup-ciceromark.md │ ├── markup-commonmark.md │ ├── markup-preliminaries.md │ ├── markup-templatemark.md │ ├── model-api.md │ ├── model-classes.md │ ├── model-concerto.md │ ├── model-decorators.md │ ├── model-properties.md │ ├── model-relationships.md │ ├── ref-cicero-api.md │ ├── ref-cicero-cli.md │ ├── ref-cicero-testing.md │ ├── ref-concerto-api.md │ ├── ref-concerto-cli.md │ ├── ref-concerto-decorators.md │ ├── ref-ergo-api.md │ ├── ref-ergo-cli.md │ ├── ref-ergo-repl.md │ ├── ref-ergo-spec.md │ ├── ref-ergo-stdlib.md │ ├── ref-errors.md │ ├── ref-markus-cli.md │ ├── ref-migrate-0.13-0.20.md │ ├── ref-migrate-0.20-0.21.md │ ├── ref-migrate-concerto-0.82-1.0.md │ ├── ref-web-components-overview.md │ ├── started-hello.md │ ├── started-installation.md │ ├── started-resources.md │ ├── tutorial-create.md │ ├── tutorial-hyperledger.md │ ├── tutorial-library.md │ ├── tutorial-nodejs.md │ ├── tutorial-studio.md │ ├── tutorial-templates.md │ └── tutorial-vscode.md ├── version-0.22 │ ├── markup-preliminaries.md │ ├── ref-cicero-api.md │ ├── ref-cicero-cli.md │ ├── ref-concerto-api.md │ ├── ref-concerto-cli.md │ ├── ref-ergo-api.md │ ├── ref-ergo-cli.md │ ├── ref-migrate-0.21-0.22.md │ ├── started-hello.md │ ├── tutorial-create.md │ ├── tutorial-library.md │ ├── tutorial-nodejs.md │ ├── tutorial-studio.md │ └── tutorial-templates.md ├── version-0.23.0 │ ├── accordproject.md │ ├── markup-preliminaries.md │ ├── model-classes.md │ ├── model-properties.md │ ├── model-vocabulary.md │ ├── ref-cicero-api.md │ ├── ref-concerto-api.md │ ├── ref-ergo-api.md │ └── ref-migrate-concerto-1.0-2.0.md ├── version-0.30.0 │ ├── markup-commonmark.md │ ├── model-api.md │ ├── model-namespaces.md │ ├── ref-concerto-api.md │ ├── ref-concerto-cli.md │ └── ref-migrate-concerto-2.0-3.0.md └── version-0.30.1 │ ├── accordproject-faq.md │ ├── accordproject-slc.md │ ├── accordproject-template.md │ ├── accordproject.md │ ├── ergo-tutorial.md │ ├── logic-advanced-expr.md │ ├── logic-complex-type.md │ ├── logic-ergo.md │ ├── logic-simple-type.md │ ├── markup-preliminaries.md │ ├── markup-templatemark.md │ ├── ref-migrate-0.13-0.20.md │ ├── ref-migrate-0.20-0.21.md │ ├── ref-migrate-0.21-0.22.md │ ├── ref-web-components-overview.md │ └── started-resources.md ├── versioned_sidebars ├── version-0.12-sidebars.json ├── version-0.13-sidebars.json ├── version-0.20-sidebars.json ├── version-0.21-sidebars.json ├── version-0.22-sidebars.json ├── version-0.23.0-sidebars.json └── version-0.30.0-sidebars.json └── versions.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | # Bug Report 🐛 12 | 13 | 14 | ## Expected Behavior 15 | 16 | 17 | ## Current Behavior 18 | 19 | 20 | ## Possible Solution 21 | 22 | 23 | ## Steps to Reproduce 24 | 25 | 26 | 1. 27 | 2. 28 | 3. 29 | 4. 30 | 31 | ## Context (Environment) 32 | 33 | 34 | ### Desktop 35 | - OS: [e.g. macOS] 36 | - Browser: [e.g. Chrome, Safari] 37 | - Version: [e.g. 0.22.15] 38 | 39 | ## Detailed Description 40 | 41 | 42 | ## Possible Implementation 43 | 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom Issue 3 | about: For miscellaneous, such as questions, discussions, etc. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | # Discussion 🗣 12 | 13 | 14 | ## Context 15 | 16 | 17 | ## Detailed Description 18 | 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | # Feature Request 🛍️ 12 | 13 | 14 | ## Use Case 15 | 16 | 17 | ## Possible Solution 18 | 19 | 20 | ## Context 21 | 22 | 23 | 24 | ## Detailed Description 25 | 26 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Closes # 5 | 6 | 7 | ### Changes 8 | 9 | 10 | - 11 | - 12 | 13 | ### Flags 14 | 15 | - 16 | - 17 | 18 | ### Screenshots or Video 19 | 20 | 21 | ### Related Issues 22 | - Issue # 23 | - Pull Request # 24 | 25 | ### Author Checklist 26 | - [ ] Ensure you provide a [DCO sign-off](https://github.com/probot/dco#how-it-works) for your commits using the `--signoff` option of git commit. 27 | - [ ] Vital features and changes captured in unit and/or integration tests 28 | - [ ] Commits messages follow [AP format](https://github.com/accordproject/techdocs/blob/master/DEVELOPERS.md#commit-message-format) 29 | - [ ] Extend the documentation, if necessary 30 | - [ ] Merging to `master` from `fork:branchname` 31 | - [ ] Manual accessibility test performed 32 | - [ ] Keyboard-only access, including forms 33 | - [ ] Contrast at least WCAG Level A 34 | - [ ] Appropriate labels, alt text, and instructions 35 | -------------------------------------------------------------------------------- /.github/workflows/build-and-publish.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | env: 14 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 15 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 16 | 17 | strategy: 18 | matrix: 19 | node-version: [14.x] 20 | 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v2 24 | 25 | - name: Use Node.js ${{ matrix.node-version }} 26 | uses: actions/setup-node@v1 27 | with: 28 | node-version: ${{ matrix.node-version }} 29 | 30 | - name: NPM Install 31 | if: github.ref == 'refs/heads/main' 32 | run: | 33 | cd ./website 34 | pwd 35 | npm install 36 | 37 | - name: NPM Build 38 | if: github.ref == 'refs/heads/main' 39 | run: | 40 | cd ./website 41 | pwd 42 | npm run build 43 | 44 | - name: Set S3 45 | if: github.ref == 'refs/heads/main' 46 | run: | 47 | echo "AWS_S3_BUCKET=${{secrets.AWS_S3_BUCKET}}" >> $GITHUB_ENV 48 | 49 | - name: Deploy to S3 50 | if: github.ref == 'refs/heads/main' 51 | uses: jakejarvis/s3-sync-action@master 52 | with: 53 | args: --acl public-read --follow-symlinks --delete 54 | env: 55 | SOURCE_DIR: 'website/build/techdocs' 56 | 57 | - name: Invalidate Cloudfront 58 | uses: chetan/invalidate-cloudfront-action@master 59 | env: 60 | DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} 61 | PATHS: '/*' 62 | AWS_REGION: ${{ secrets.AWS_REGION }} 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | node_modules 4 | 5 | lib/core/metadata.js 6 | lib/core/MetadataBlog.js 7 | 8 | website/translated_docs 9 | website/build/ 10 | website/yarn.lock 11 | website/node_modules 12 | website/i18n/* 13 | !website/i18n/en.json 14 | 15 | thumbs.db 16 | -------------------------------------------------------------------------------- /DEVELOPERS.md: -------------------------------------------------------------------------------- 1 | # Cicero Development Guide 2 | 3 | ## ❗ Accord Project Development Guide ❗ 4 | We'd love for you to help develop improvements to Accord Project technology! Please refer to these Accord Project Development guidelines we'd like you to follow. 5 | 6 | ## Installation 7 | 8 | To build the documentation locally: 9 | ``` 10 | cd ./website 11 | npm install 12 | npm run start 13 | ``` 14 | If you want to re-generate the JSDoc API: 15 | ``` 16 | npm run build:api 17 | ``` 18 | 19 | ## Creating a new version of the documentation 20 | 21 | ``` 22 | cd ./website 23 | npm install 24 | npm run version `0.23.0` 25 | ``` 26 | If you want to re-generate the JSDoc API: 27 | ``` 28 | npm run build:api 29 | ``` 30 | 31 | ## Commits 32 | When commiting your changes, it is required you adhere to the [commit message conventions]. This is important because the release notes are automatically generated from these messages. 33 | 34 | [commit message conventions]: https://www.conventionalcommits.org/en/v1.0.0/ 35 | -------------------------------------------------------------------------------- /assets/APLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/assets/APLogo.png -------------------------------------------------------------------------------- /assets/APStack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/assets/APStack.png -------------------------------------------------------------------------------- /assets/Accord Project - Intro Overview 2020.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/assets/Accord Project - Intro Overview 2020.pdf -------------------------------------------------------------------------------- /assets/contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/assets/contributors.png -------------------------------------------------------------------------------- /docs/accordproject-tour.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: accordproject-tour 3 | title: Online Tour 4 | --- 5 | 6 | To get better acquainted with Accord Project templates, the easiest way is through the online [Template Studio](https://studio.accordproject.org) editor. 7 | 8 | :::tip 9 | You can open template studio from anywhere in this documentation by clicking the [Try Online!](https://studio.accordproject.org) button located in the top-right of the page. 10 | ::: 11 | 12 | The following video offers a tour of Template Studio and an introduction to the key concepts behind the Accord Project technology. 13 | 14 | 15 | 16 | Here is a timestamp of what is covered in the video: 17 | 18 | - **00:08** : Introduction to template Studio & pointers the other parts of the docs / AP website 19 | - **03:51** : Helloworld template tutorial start 20 | - **04:48** : Template Studio - Metadata 21 | - **06:56** : Template Studio - Contract Text 22 | - **07:52** : The 'live' nature of the text; how to read errors 23 | - **08:39** : Changing the template text itself 24 | - **09:17** : Changing the variables in the template text 25 | - **10:00** : Template Studio - Model update 26 | - **11:28** : Template Studio - Logic update 27 | - **13:17** : Explanation about request types / response types 28 | - **14:44** : Template Studio - Logic - Test Execution (request, response) 29 | - **15:57** : Test Execution - contract state 30 | - **16:49** : Test Execution - obligations 31 | - **18:20** : Wrap-up 32 | 33 | -------------------------------------------------------------------------------- /docs/assets/020/ergo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/ergo.png -------------------------------------------------------------------------------- /docs/assets/020/grammar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/grammar.png -------------------------------------------------------------------------------- /docs/assets/020/studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/studio.png -------------------------------------------------------------------------------- /docs/assets/020/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/template.png -------------------------------------------------------------------------------- /docs/assets/020/template_logic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/template_logic.png -------------------------------------------------------------------------------- /docs/assets/020/template_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/template_model.png -------------------------------------------------------------------------------- /docs/assets/020/template_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/020/template_text.png -------------------------------------------------------------------------------- /docs/assets/acceptance-of-delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/acceptance-of-delivery.png -------------------------------------------------------------------------------- /docs/assets/advanced/hlf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/hlf1.png -------------------------------------------------------------------------------- /docs/assets/advanced/hlf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/hlf2.png -------------------------------------------------------------------------------- /docs/assets/advanced/hlf3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/hlf3.png -------------------------------------------------------------------------------- /docs/assets/advanced/hlf4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/hlf4.png -------------------------------------------------------------------------------- /docs/assets/advanced/late1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late1.png -------------------------------------------------------------------------------- /docs/assets/advanced/late10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late10.png -------------------------------------------------------------------------------- /docs/assets/advanced/late11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late11.png -------------------------------------------------------------------------------- /docs/assets/advanced/late12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late12.png -------------------------------------------------------------------------------- /docs/assets/advanced/late13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late13.png -------------------------------------------------------------------------------- /docs/assets/advanced/late14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late14.png -------------------------------------------------------------------------------- /docs/assets/advanced/late15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late15.png -------------------------------------------------------------------------------- /docs/assets/advanced/late16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late16.png -------------------------------------------------------------------------------- /docs/assets/advanced/late17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late17.png -------------------------------------------------------------------------------- /docs/assets/advanced/late2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late2.png -------------------------------------------------------------------------------- /docs/assets/advanced/late3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late3.png -------------------------------------------------------------------------------- /docs/assets/advanced/late4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late4.png -------------------------------------------------------------------------------- /docs/assets/advanced/late5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late5.png -------------------------------------------------------------------------------- /docs/assets/advanced/late6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late6.png -------------------------------------------------------------------------------- /docs/assets/advanced/late7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late7.png -------------------------------------------------------------------------------- /docs/assets/advanced/late8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late8.png -------------------------------------------------------------------------------- /docs/assets/advanced/late9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/late9.png -------------------------------------------------------------------------------- /docs/assets/advanced/minilatedeliveryandpenalty-capped@0.1.1.cta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/minilatedeliveryandpenalty-capped@0.1.1.cta -------------------------------------------------------------------------------- /docs/assets/advanced/minilatedeliveryandpenalty-payment@0.1.1.cta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/minilatedeliveryandpenalty-payment@0.1.1.cta -------------------------------------------------------------------------------- /docs/assets/advanced/minilatedeliveryandpenalty@0.1.1.cta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/advanced/minilatedeliveryandpenalty@0.1.1.cta -------------------------------------------------------------------------------- /docs/assets/architecture/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.log 3 | *.aux 4 | *.dvi 5 | *.svg.gen 6 | *.map 7 | cleansvg.js 8 | node_modules/ 9 | *~ 10 | -------------------------------------------------------------------------------- /docs/assets/architecture/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | # 14 | 15 | PDF2SVG=pdf2svg 16 | 17 | all: frontend.pdf frontend.svg frontend.png types.pdf types.svg types.png codegen.pdf codegen.svg codegen.png 18 | 19 | %.svg.gen: %.dvi 20 | dvisvgm $< -o "%f.svg.gen" 21 | 22 | node_modules: 23 | npm install 24 | 25 | %.js %.js.map: %.ts node_modules 26 | ./node_modules/.bin/tsc 27 | 28 | %.svg: %.svg.gen cleansvg.js 29 | node ./cleansvg.js $< > $@ 30 | 31 | %.png: %.pdf 32 | convert $< $@ 33 | 34 | %.pdf: %.tex %-coq.tex tikzmacros.tex 35 | pdflatex --shell-escape $< 36 | pdflatex --shell-escape $< 37 | pdflatex --shell-escape $< 38 | 39 | %.dvi: %.tex %-coq.tex tikzmacros.tex 40 | latex $< 41 | latex $< 42 | 43 | clean: 44 | rm -f *~ frontend.out frontend.log frontend.aux frontend.dvi frontend.svg.gen frontend.lg frontend.js frontend.js.map 45 | rm -f *~ types.out types.log types.aux types.dvi types.svg.gen types.lg types.js types.js.map 46 | rm -f *~ codegen.out codegen.log codegen.aux codegen.dvi codegen.svg.gen codegen.lg codegen.js codegen.js.map 47 | 48 | cleanall: clean 49 | rm -f frontend.pdf frontend.png frontend.svg 50 | rm -f types.pdf types.png types.svg 51 | rm -f codegen.pdf codegen.png codegen.svg 52 | 53 | cleandist: cleanall 54 | rm -rf node_modules 55 | 56 | PRECIOUS: *.gen.svg *.dvi 57 | -------------------------------------------------------------------------------- /docs/assets/architecture/cleansvg.ts: -------------------------------------------------------------------------------- 1 | // Note: this entire script is a huge, somewhat fragile hack to get a svg of our figure with working hyperlinks 2 | 3 | import * as FS from 'fs'; 4 | 5 | const inputFile = process.argv[2] 6 | 7 | let array = FS.readFileSync(inputFile).toString().split("\n"); 8 | 9 | function isSelfClosingLink(line:string) { 10 | return /^$/.test(line) 11 | } 12 | 13 | function isTranslationLink(line:string) { 14 | return /Qcert[.]Translation[.]/.test(line) 15 | } 16 | 17 | function isOptimLink(line:string) { 18 | return /Optim/.test(line) 19 | } 20 | 21 | function isPath(line:string) { 22 | return /\"," fill='"+color+"'/>"); 33 | } 34 | 35 | function isTextual(line:string) { 36 | return /<\/?text/.test(line)||/<\/?tspan/.test(line) 37 | } 38 | 39 | function widen(array:string[], i:number, offset:number) { 40 | const line = array[i] 41 | array[i] = "" 42 | array.splice(i-offset, 0, line.replace("/>", ">")) 43 | } 44 | 45 | // first, let us remove duplicate link lines 46 | for(let i = 0; i < array.length; ) { 47 | const line = array[i] 48 | i++; 49 | if(isSelfClosingLink(line)) { 50 | for(; i < array.length && line === array[i]; i++) { 51 | array[i] = undefined 52 | } 53 | } 54 | } 55 | array = array.filter(line => line !== undefined) 56 | 57 | // next, lets widen the links. 58 | // for some reason, they are output as self closing tags at the end of the span they should contain 59 | // so we move the beginning tag earlier so that it covers the desired span 60 | for(let i = 0; i < array.length; i++) { 61 | const line = array[i]; 62 | if(isSelfClosingLink(line)) { 63 | if(isTranslationLink(line) || isOptimLink(line)) { 64 | // for translation links, we move two lines (path statements) earlier 65 | if(i >= 2) { 66 | if(isPath(array[i-1]) && isPath(array[i-2])) { 67 | const color = getColor(array[i-2]); 68 | addColor(array,i-1,color); 69 | widen(array, i, 2) 70 | } 71 | i++ 72 | } 73 | } else { 74 | // for non-translation links, we move before any "textual" tags 75 | let prev = i-1; 76 | while(prev > 0 && isTextual(array[prev])) { 77 | prev-- 78 | } 79 | prev++ 80 | widen(array, i, i-prev) 81 | i++ 82 | } 83 | } 84 | } 85 | 86 | // finally, lets rewrite all of our links so they target a new page 87 | const fullSVG = array.join('\n') 88 | const outputSVG = fullSVG.replace(/=8", 14 | "typescript": "^2.8.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs/assets/architecture/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "noImplicitAny": false, 6 | "sourceMap": false 7 | }, 8 | "include": [ 9 | "./cleansvg.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docs/assets/architecture/types-coq.tex: -------------------------------------------------------------------------------- 1 | \begin{tikzpicture}[ 2 | align=center, 3 | node distance=0.4em and 0.8em, 4 | font=\footnotesize, 5 | every loop/.style={latex-}, 6 | ] 7 | 8 | % AST 9 | \node[lang, coqc, hyperlink node=\coqurl{Common.CTO}{CTO}{cto_type}] 10 | (cto_type) {CTO Types\\~}; 11 | 12 | % Transition 13 | \node[lang, 14 | above=1em of cto_type] 15 | (parsing) {Parsing}; 16 | 17 | % Source 18 | \node[lang, source, 19 | above=1em of parsing] 20 | (cto) {CTO}; 21 | 22 | % Transition 23 | 24 | \node[lang, hyperlink node=\coqurl{Common.CTO}{CTO}{cto_resolved_tbl_for_package}, 25 | right=of cto_type] 26 | (naming) {Type Name\\Resolution}; 27 | 28 | % AST 29 | \node[lang, coqc, hyperlink node=\coqurl{Common.CTO}{CTO}{cto_type}, 30 | right=of naming] 31 | (cto_typeresolved) {Resolved\\CTO Type}; 32 | 33 | \node[lang, coqc, 34 | below=3em of cto_typeresolved] 35 | (ergonaming) {Name\\Resolution}; 36 | 37 | % Transition 38 | 39 | \node[lang, hyperlink node=\coqurl{Common.CTO}{CTO}{cto_type_to_etype}, 40 | right=of cto_typeresolved] 41 | (modeling) {Model Construction}; 42 | 43 | % Calculus 44 | \node[lang, coqc, hyperlink node=\coqurl{Common.TypeSystem}{ErgoType}{ergo_type}, 45 | right=of modeling] 46 | (ergo_type) {Ergo\\Types}; 47 | 48 | \node[lang, coqc, 49 | below=3em of ergo_type] 50 | (typing) {Type\\Checking}; 51 | 52 | \path[-,thick] (cto.south) edge (parsing.north); 53 | \path[trans] (parsing.south) -- (cto_type.north); 54 | \path[-,thick] (cto_type.east) edge (naming.west); 55 | \path[trans] (naming.east) -- (cto_typeresolved.west); 56 | \path[-,thick] (cto_typeresolved.east) edge (modeling.west); 57 | \path[trans] (modeling.east) -- (ergo_type.west); 58 | \path[trans,dashed] (cto_typeresolved.south) -- (ergonaming.north); 59 | \path[trans,dashed] (ergo_type.south) -- (typing.north); 60 | % Loops 61 | %\tikzloop[ccoqc]{ergoast}{\coqurl{Ergo.Lang}{Ergo}{run_nraenv_optims}}{Namespace\\ Resolution} 62 | \end{tikzpicture} 63 | 64 | -------------------------------------------------------------------------------- /docs/assets/architecture/types.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/architecture/types.pdf -------------------------------------------------------------------------------- /docs/assets/architecture/types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/architecture/types.png -------------------------------------------------------------------------------- /docs/assets/architecture/types.tex: -------------------------------------------------------------------------------- 1 | \documentclass{standalone} 2 | \usepackage[utf8]{inputenc} 3 | \usepackage{xspace} 4 | \usepackage{pifont} % for \fleur macro 5 | \usepackage{ifpdf} 6 | \usepackage{tikz} 7 | \usepackage{calc} 8 | \usetikzlibrary{automata} 9 | \usetikzlibrary{positioning,calc,decorations.markings,shapes,graphs} 10 | 11 | \newcommand{\coqHTMLBase}{https://ergo.accordproject.org} 12 | \newcommand{\coqBaseModule}{specification} 13 | \newcommand{\coqurl}[3]{\coqHTMLBase/\coqBaseModule/ErgoSpec.#1.#2.html\##3} 14 | \newcommand{\projectname}{Q*cert} 15 | 16 | \newcommand{\fleur}{\ding{95}} 17 | \newcommand{\coqtop}{{\href{\coqHTMLBase}{\fleur}}\xspace} 18 | \newcommand{\coqdef}[3]{{\href{\coqurl{#1}{#2}{#3}}{\fleur}}\xspace} 19 | 20 | \newcommand{\NRAEnv}{\texorpdfstring{NRA$^{\!\mbox{\it e}}$}{NRAe}\xspace} 21 | \newcommand{\NRALambda}{\texorpdfstring{$\lambda$-NRA}{λ-NRA}\xspace} 22 | 23 | \ifpdf 24 | \usepackage[hidelinks]{hyperref} 25 | \else 26 | \usepackage[hidelinks,hypertex]{hyperref} 27 | \fi 28 | \input{tikzmacros} 29 | \begin{document} 30 | \input{types-coq} 31 | \end{document} 32 | -------------------------------------------------------------------------------- /docs/assets/basic/library1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/basic/library1.png -------------------------------------------------------------------------------- /docs/assets/basic/use1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/basic/use1.png -------------------------------------------------------------------------------- /docs/assets/basic/use2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/basic/use2.png -------------------------------------------------------------------------------- /docs/assets/basic/use3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/basic/use3.png -------------------------------------------------------------------------------- /docs/assets/bond-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/bond-model.png -------------------------------------------------------------------------------- /docs/assets/cicero-spec-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/cicero-spec-overview.png -------------------------------------------------------------------------------- /docs/assets/cicero-spec-uml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/cicero-spec-uml.png -------------------------------------------------------------------------------- /docs/assets/dingus1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/dingus1.png -------------------------------------------------------------------------------- /docs/assets/dingus2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/dingus2.png -------------------------------------------------------------------------------- /docs/assets/dingus3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/dingus3.png -------------------------------------------------------------------------------- /docs/assets/dingus4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/dingus4.png -------------------------------------------------------------------------------- /docs/assets/exceptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/exceptions.png -------------------------------------------------------------------------------- /docs/assets/execution_context.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/execution_context.png -------------------------------------------------------------------------------- /docs/assets/grammar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/grammar.png -------------------------------------------------------------------------------- /docs/assets/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/image1.png -------------------------------------------------------------------------------- /docs/assets/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/image2.png -------------------------------------------------------------------------------- /docs/assets/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/image3.png -------------------------------------------------------------------------------- /docs/assets/perishable-goods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/perishable-goods.png -------------------------------------------------------------------------------- /docs/assets/reference/tsv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/docs/assets/reference/tsv2.png -------------------------------------------------------------------------------- /docs/assets/specification/ErgoSpec.Backend.ForeignModel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module ErgoSpec.Backend.ForeignModel 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Module ErgoSpec.Backend.ForeignModel

15 |
16 |
17 | Require Export
Qcert.Data.DataSystem.
18 |
19 | Record typing_runtime
20 |        {ftype:foreign_type}
21 |   : Type
22 |   := mk_typing_runtime {
23 |          typing_runtime_brand_model : @brand_model ftype;
24 |        }.
25 |
26 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/assets/specification/ErgoSpec.Backend.Lib.QBackendModel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module ErgoSpec.Backend.Lib.QBackendModel 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Module ErgoSpec.Backend.Lib.QBackendModel

15 |
16 |
17 | Require Import
Qcert.Data.DataSystem.
18 |
19 | Require Import ErgoSpec.Backend.Qcert.QcertModel.
20 | Require Import ErgoSpec.Backend.ForeignErgo.
21 |
22 | Module Type QBackendModel.
23 |   Definition ergo_foreign_data : foreign_data := enhanced_foreign_data.
24 |   Definition ergo_foreign_type : foreign_type := enhanced_foreign_type.
25 | End QBackendModel.
26 |
27 | 28 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/assets/specification/ErgoSpec.Backend.Lib.QBackendRuntime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module ErgoSpec.Backend.Lib.QBackendRuntime 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Module ErgoSpec.Backend.Lib.QBackendRuntime

15 |
16 |
17 | Require Import
String.
18 | Require Import List.
19 |
20 | Require Import ErgoSpec.Backend.Qcert.QcertModel.
21 | Require Import QBackendModel.
22 |
23 | Module QBackendRuntime <: QBackendModel.
24 |   Local Open Scope string.
25 |
26 |   Definition ergo_foreign_data := enhanced_foreign_data.
27 |   Definition ergo_foreign_type := enhanced_foreign_type.
28 |
29 | End QBackendRuntime.
30 | 31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/assets/specification/ErgoSpec.Backend.Qcert.QcertCompiler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module ErgoSpec.Backend.Qcert.QcertCompiler 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Module ErgoSpec.Backend.Qcert.QcertCompiler

15 |
16 |
17 | Require
Qcert.Compiler.QLib.
18 | Require QcertRuntime.
19 | Require QcertModel.
20 |
21 | Module QcertCompiler
22 |   := QLib.QLib(QcertRuntime.EnhancedRuntime)
23 |                       <+ QcertModel.CompEnhanced.
24 |
25 | 26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/assets/specification/ErgoSpec.Version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module ErgoSpec.Version 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Module ErgoSpec.Version

15 |
16 |
17 |
This module defines Ergo version number
18 |
19 | Require Import
String.
20 |
21 | Section Version.
22 |     Definition ergo_version := "0.20.7"%string.
23 |
24 | End Version.
25 |
26 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/assets/specification/coq2html.css: -------------------------------------------------------------------------------- 1 | 2 | /* Classes: 3 | h1.title the title of the page 4 | div.coq encloses all generated body 5 | div.doc contents of (** *) comments 6 | div.footer footer 7 | div.togglescript "Proof." line 8 | div.proofscript contents of proof script 9 | span.docright contents of (**r *) comments 10 | span.bracket contents of [ ] within comments 11 | span.comment contents of (* *) comments 12 | span.kwd Coq keyword 13 | span.tactic Coq tactic 14 | span.id any other identifier 15 | */ 16 | 17 | body { 18 | color: black; 19 | background: white; 20 | } 21 | 22 | h1.title { 23 | font-size: 2em; 24 | text-align: center 25 | } 26 | 27 | h1 { 28 | font-size: 1.5em; 29 | } 30 | h2 { 31 | font-size: 1.17em; 32 | } 33 | h3 { 34 | font-size: 1em; 35 | } 36 | 37 | h1, h2, h3 { 38 | font-family: sans-serif; 39 | margin-left: -5%; 40 | } 41 | 42 | div.coq { 43 | margin-left: 15%; 44 | margin-right: 5%; 45 | font-family: monospace; 46 | } 47 | 48 | div.doc { 49 | margin-left: -5%; 50 | margin-top: 0.2em; 51 | margin-bottom: 0.5em; 52 | font-family: serif; 53 | } 54 | 55 | div.toggleproof { 56 | font-size: 0.8em; 57 | text-decoration: underline; 58 | } 59 | 60 | div.toggleproof:hover { 61 | cursor: pointer; 62 | } 63 | 64 | div.proofscript { 65 | font-size: 0.8em; 66 | } 67 | 68 | div.footer { 69 | margin-top: 1em; 70 | margin-bottom: 1em; 71 | font-size: 0.8em; 72 | font-style: italic; 73 | } 74 | 75 | span.docright { 76 | position: absolute; 77 | left: 60%; 78 | width: 40%; 79 | font-family: serif; 80 | } 81 | 82 | span.bracket { 83 | font-family: monospace; 84 | color: #008000; 85 | } 86 | 87 | span.kwd { 88 | color: #cf1d1d; 89 | } 90 | 91 | span.comment { 92 | color: #008000; 93 | } 94 | 95 | a:visited {color : #416DFF; text-decoration : none; } 96 | a:link {color : #416DFF; text-decoration : none; } 97 | a:hover {text-decoration : none; } 98 | a:active {text-decoration : none; } 99 | -------------------------------------------------------------------------------- /docs/assets/specification/coq2html.js: -------------------------------------------------------------------------------- 1 | 2 | function toggleDisplay(id) 3 | { 4 | var elt = document.getElementById(id); 5 | if (elt.style.display == 'none') { 6 | elt.style.display = 'block'; 7 | } else { 8 | elt.style.display = 'none'; 9 | } 10 | } 11 | 12 | function hideAll(cls) 13 | { 14 | var testClass = new RegExp("(^|s)" + cls + "(s|$)"); 15 | var tag = tag || "*"; 16 | var elements = document.getElementsByTagName("div"); 17 | var current; 18 | var length = elements.length; 19 | for(var i=0; i= 0.0; 41 | enforce contract.amount.doubleValue >= 0.0; 42 | let outstanding = contract.amount.doubleValue - request.amountPaid.doubleValue; 43 | enforce outstanding >= 0.0; 44 | 45 | let numberOfDays = 46 | diffDurationAs( 47 | dateTime("17 May 2018 13:53:33 EST"), 48 | contract.date, 49 | ~org.accordproject.time.TemporalUnit.days).amount; 50 | 51 | enforce numberOfDays >= 0; 52 | 53 | let compounded = outstanding 54 | * compoundInterestMultiple(interestRate, numberOfDays); // Defined in ergo.money module 55 | 56 | return Result{ 57 | outstandingBalance: compounded 58 | } 59 | } 60 | } 61 | ``` 62 | 63 | > **TechNote:** the namespace and import handling in Ergo allows you to access either existing CTO models or Ergo libraries in the same way. 64 | 65 | -------------------------------------------------------------------------------- /docs/markup-ciceromark.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: markup-ciceromark 3 | title: CiceroMark 4 | --- 5 | 6 | CiceroMark is an extension to CommonMark used to write the text in Accord Project contracts. The extension is limited in scope, and designed to help with parsing clauses inside contracts and the result of formulas. 7 | 8 | ## Blocks 9 | 10 | ### Clause Blocks 11 | 12 | Clause blocks can be used to identify a specific clause within a contract. Contract blocks are written: 13 | ``` 14 | {{#clause clauseName}} 15 | ...Markdown of the clause... 16 | {{/clause}} 17 | ``` 18 | 19 | ### Example 20 | 21 | For instance, the following is a valid contract text containing a payment clause: 22 | 23 | ```tem 24 | ## Copyright Notices. 25 | 26 | Licensee shall ensure that its use of the Work is marked with the appropriate copyright notices specified by Licensor in a reasonably prominent position in the order and manner provided by Licensor. Licensee shall abide by the copyright laws and what are considered to be sound practices for copyright notice provisions in the Territory. Licensee shall not use any copyright notices that conflict with, confuse, or negate the notices Licensor provides and requires hereunder. 27 | 28 | {{#clause payment}} 29 | Payment 30 | ------- 31 | As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time 32 | fee in the amount of "one hundred US Dollars" (100.0 USD) upon execution of this Agreement, payable as 33 | follows: "bank transfer". 34 | {{/clause}} 35 | 36 | ## General. 37 | 38 | ### Interpretation. 39 | 40 | For purposes of this Agreement, (a) the words "include," "includes," and "including" are deemed to be followed by the words "without limitation"; (b) the word "or" is not exclusive; and (c) the words "herein," "hereof," "hereby," "hereto," and "hereunder" refer to this Agreement as a whole. This Agreement is intended to be construed without regard to any presumption or rule requiring construction or interpretation against the party drafting an instrument or causing any instrument to be drafted. 41 | ``` 42 | 43 | ## Ergo Formulas 44 | 45 | Ergo formulas in template text are essentially similar to Excel formulas. They let you create legal text dynamically based on the other variables in your contract. 46 | 47 | If your contract contains the result of evaluating a formula, the corresponding text should be written `{{% resultOfFormula %}}` where `resultOfFormula` is the expected result of that formula. 48 | 49 | ### Example 50 | 51 | For instance, the following is a valid contract text for the [fixed rate loan](https://templates.accordproject.org/fixed-interests@0.5.2.html) template: 52 | 53 | ```tem 54 | ## Fixed rate loan 55 | 56 | This is a _fixed interest_ loan to the amount of £100,000.00 57 | at the yearly interest rate of 2.5% 58 | with a loan term of 15, 59 | and monthly payments of {{%£667.00%}} 60 | ``` 61 | -------------------------------------------------------------------------------- /docs/ref-concerto-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-concerto-api 3 | title: Concerto API 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /docs/ref-errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-errors 3 | title: Errors 4 | --- 5 | 6 | As much as possible, errors returned by all projects (notably Cicero and the Ergo compiler) are normalized and categorized in order to facilitate handling of those error by the application code. Those errors are raised as JavaScript _exceptions_. 7 | 8 | ## Errors Hierarchy 9 | 10 | The hierarchy of errors (or exceptions) is shown on the following diagram: 11 | 12 | ![Error Hierarchy](assets/exceptions.png) 13 | 14 | ## Errors Model 15 | 16 | For reference, those can also be described using the following Concerto model: 17 | 18 | ```ergo 19 | namespace org.accordproject.errors 20 | /** Common */ 21 | concept LocationPoint { 22 | o Integer line 23 | o Integer column 24 | o Integer offset optional 25 | } 26 | concept FileLocation { 27 | o LocationPoint start 28 | o LocationPoint end 29 | } 30 | concept BaseException { 31 | o String component // Node component the error originates from 32 | o String name // name of the class 33 | o String message 34 | } 35 | concept BaseFileException extends BaseException { 36 | o FileLocation fileLocation 37 | o String shortMessage 38 | o String fileName 39 | } 40 | concept ParseException extends BaseFileException { 41 | } 42 | /* Model errors */ 43 | concept ValidationException extends BaseException { 44 | } 45 | concept TypeNotFoundException extends BaseException { 46 | o String typeName 47 | } 48 | concept IllegalModelException extends BaseFileException { 49 | o String modelFile 50 | } 51 | /* Ergo errors */ 52 | concept CompilerException extends BaseFileException { 53 | } 54 | concept TypeException extends BaseFileException { 55 | } 56 | concept SystemException extends BaseFileException { 57 | } 58 | /* Cicero errors */ 59 | concept TemplateException extends ParseException { 60 | } 61 | ``` -------------------------------------------------------------------------------- /docs/ref-glossary.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-glossary 3 | title: Glossary 4 | --- 5 | 6 | ## Variable 7 | 8 | Variables function as ‘placeholders’ for information to be added when a template is used. Variables are the information that will change between usages of a Template. Here as an example of the text of a contract with three Variables defined: 9 | 10 | ``` 11 | Upon the signing of this Agreement, {{buyer}} shall pay {{amount}} to {{seller}}. 12 | ``` 13 | 14 | ## Data Model 15 | 16 | A Data Model is used to express the variables that are contained within a Template in a structured way. A Data Model provides us with the structure of the ‘fields’ in the contract which are completed when the templated is used for an agreement. For example, ‘Price’ would be a variable name against which a value, say $100, is entered. This enables us to create a contract document that has a definite structure underlying it rather than simply lines of text. 17 | 18 | The Data Model is used to create a machine-readable representation of the text of the contract. It does this by creating a link with the text of the contract by defining the Variables that should exist within the contract along with an associated data type. The linkage between the text and the data model is created by referencing the variable in both the model and the text. 19 | 20 | 21 | For example, if the text is: 22 | ``` 23 | Upon the signing of this Agreement, {{buyer}} shall pay {{amount}} to {{seller}}. 24 | ``` 25 | 26 | The model will include `buyer`, `amount`, and `seller`. A data type and a value is assigned against each of these variables. 27 | 28 | ### Components of Data Models 29 | 30 | Data models consist of two core components: 31 | 32 | - Variable Name: The name of the ‘placeholder’ for data to be added into a template to create an instance of the contract. By naming variables, we are able to specify what data should be entered into that placeholder in the contract. 33 | - Data Type: The data type defines what type, or format, of data should be inserted in the ‘placeholder’. 34 | 35 | 36 | The **value** is the actual data that is input into the ‘placeholder’. The value is displayed instead of the name of the variable in the Text. For example: 37 | 38 | ```md 39 | Upon the signing of this Agreement, "Steve" shall pay 100.0 USD to "Dan". 40 | ``` 41 | 42 | In the model, this is represented as: 43 | 44 | | Variable Name | Data type | Value | 45 | |---------------|-----------|-------| 46 | | buyer | `String` | Steve | 47 | | amount | `MonetaryAmount` | 100.0 USD | 48 | | seller | `String` | Dan | 49 | 50 | Here, `amount` should be a combination of a decimalized value (a double) and a currency code, as opposed to an alphanumeric value, and `buyer` and `seller` should be a combination of alphanumeric characters. This ensures that invalid data cannot be added into the contract, much like letters cannot be added into a credit card section of a web form. 51 | -------------------------------------------------------------------------------- /docs/ref-web-components-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-web-components-overview 3 | title: Overview 4 | --- 5 | 6 | Accord Project publishes [React](https://reactjs.org) user interface components for use in web applications. Please refer to the web-components project [on GitHub](https://github.com/accordproject/web-components) for detailed usage instructions. 7 | 8 | You can preview these components in [the project's storybook](https://ap-web-components.netlify.app/). 9 | 10 | ## Contract Editor 11 | 12 | The Contract Editor component provides a rich-text content editor for contract text with embedded clauses. 13 | 14 | > Note that the contract editor does not currently support the full expressiveness of Cicero Templates. Please refer to the Limitations section for details. 15 | 16 | ### Limitations 17 | 18 | The contract editor does not support templates which use the following CiceroMark features: 19 | 20 | * Lists containing [nested lists](markup-commonmark.md#nested-lists) 21 | * List blocks [list blocks](markup-commonmark.md#list-blocks) 22 | 23 | ## Error Logger 24 | 25 | The Error Logger component is used to display structured error messages from the Contract Editor. 26 | 27 | ## Navigation 28 | 29 | The Navigation component displays an outline view for a contract, allowing the user to quickly navigate between sections. 30 | 31 | ## Library 32 | 33 | The Library component displays a vertical list of library item metadata, and allows the user to add an instance of a library item to a contract. 34 | -------------------------------------------------------------------------------- /docs/started-installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: started-installation 3 | title: Install Cicero 4 | --- 5 | 6 | To experiment with Accord Project, you can install the Cicero command-line. This will let you author, validate, and run Accord Project templates on your own machine. 7 | 8 | ## Prerequisites 9 | 10 | You must first obtain and configure the following dependency: 11 | 12 | * [Node.js (LTS)](http://nodejs.org): We use Node.js to run cicero, generate the documentation, run a development web server, testing, and produce distributable files. Depending on your system, you can install Node either from source or as a pre-packaged bundle. 13 | 14 | > We recommend using [nvm](https://github.com/creationix/nvm) (or [nvm-windows](https://github.com/coreybutler/nvm-windows)) to manage and install Node.js, which makes it easy to change the version of Node.js per project. 15 | 16 | ## Installing Cicero 17 | 18 | To install the latest version of the Cicero command-line tools: 19 | 20 | ```bash 21 | npm install -g @accordproject/cicero-cli 22 | ``` 23 | 24 | :::note 25 | You can install a specific version by appending `@version` at the end of the `npm install` command. For instance to install version `0.20.3` or version `0.13.4`: 26 | ```bash 27 | npm install -g @accordproject/cicero-cli@0.20.3 28 | npm install -g @accordproject/cicero-cli@0.13.4 29 | ``` 30 | ::: 31 | 32 | To check that Cicero has been properly installed, and display the version number: 33 | ```bash 34 | cicero --version 35 | ``` 36 | 37 | To get command line help: 38 | ```bash 39 | cicero --help 40 | cicero parse --help // To parse a sample clause/contract 41 | cicero draft --help // To draft a sample clause/contract 42 | cicero trigger --help // To send a request to a clause/contract 43 | ``` 44 | 45 | ## Optional Packages 46 | 47 | ### Template Generator 48 | 49 | You may also want to install the template generator tool, which you can use to create an empty template: 50 | 51 | ```bash 52 | npm install -g yo 53 | npm install -g @accordproject/generator-cicero-template 54 | ``` 55 | 56 | ## What next? 57 | 58 | That's it! Go to the next page to see how to use your new installation of Cicero on a real Accord Project template. 59 | 60 | -------------------------------------------------------------------------------- /docs/started-resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: started-resources 3 | title: Resources 4 | --- 5 | 6 | ## Accord Project Resources 7 | 8 | - The Main Web site includes latest news, links to working groups, organizational announcements, etc. : https://www.accordproject.org 9 | - This Technical Documentation: https://docs.accordproject.org 10 | - Recording of Working Group discussions, Tutorial Videos are available on Vimeo: https://vimeo.com/accordproject 11 | - Join the [Accord Project Discord](https://discord.com/invite/Zm99SKhhtA) to get involved! 12 | 13 | ## User Content 14 | 15 | Accord Project also maintains libraries containing open source, community-contributed content to help you when authoring your own templates: 16 | 17 | - [Model Repository](https://models.accordproject.org/) : a repository of open source Concerto data models for use in templates 18 | - [Template Library](https://templates.accordproject.org/) : a library of open source Clause and Contract templates for various legal domains (supply-chain, loans, intellectual property, etc.) 19 | 20 | ## Ecosystem & Tools 21 | 22 | Accord Project is also developing tools to help with authoring, testing and running accord project templates. 23 | 24 | ### Editors 25 | 26 | - [Template Studio](https://studio.accordproject.org/): a Web-based editor for Accord Project templates 27 | - [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=accordproject.cicero-vscode-extension): an Accord Project extension to the popular [Visual Studio Code](https://visualstudio.microsoft.com/) Editor 28 | - [Emacs Mode](https://github.com/accordproject/ergo/tree/master/ergo.emacs): Emacs Major mode for Ergo (alpha) 29 | - [VIM Plugin](https://github.com/accordproject/ergo/tree/master/ergo.vim): VIM plugin for Ergo (alpha) 30 | 31 | ### User Interface Components 32 | 33 | - [Markdown Editor](https://github.com/accordproject/markdown-editor): a general purpose react component for markdown rendering and editing 34 | - [Cicero UI](https://github.com/accordproject/cicero-ui): a library of react components for visualizing, creating and editing Accord Project templates 35 | 36 | ## Developers Resources 37 | 38 | All the Accord Project technology is being developed as open source. The software packages are being actively maintained on [GitHub](https://github.com/accordproject) and we encourage organizations and individuals to contribute requirements, documentation, issues, new templates, and code. 39 | 40 | Join us on the [#technology-wg Discord channel](https://discord.com/invite/Zm99SKhhtA) for technical discussions and weekly updates. 41 | 42 | ### Cicero 43 | 44 | - GitHub: https://github.com/accordproject/cicero 45 | - Technical Questions and Answers on [Stack Overflow](https://stackoverflow.com/questions/tagged/cicero) 46 | 47 | ### Ergo 48 | 49 | - GitHub: https://github.com/accordproject/ergo 50 | - The [Ergo Language Guide](logic-ergo.md) is a good place to get started with Ergo. -------------------------------------------------------------------------------- /docs/tutorial-hyperledger.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: tutorial-hyperledger 3 | title: With Hyperledger Fabric 4 | --- 5 | 6 | ## Hyperledger Fabric 2.2 7 | 8 | Sample chaincode for Hyperledger Fabric that shows how to execute a Cicero template: 9 | https://github.com/accordproject/hlf-cicero-contract 10 | 11 | Please refer to the project README for detailed instructions on installation and submitting transactions. 12 | 13 | -------------------------------------------------------------------------------- /docs/tutorial-nodejs.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: tutorial-nodejs 3 | title: With Node.js 4 | --- 5 | 6 | ## Cicero Node.js API 7 | 8 | You can work with Accord Project templates directly in JavaScript using Node.js. 9 | 10 | Documentation for the API can be found in [Cicero API](ref-cicero-api.html). 11 | 12 | ## Working with Templates 13 | 14 | ### Import the Template class 15 | 16 | To import the Cicero classes for templates and clauses, we'll also import the Cicero engine and some helper utilities 17 | 18 | ```js 19 | const fs = require("fs"); 20 | const path = require("path"); 21 | const { Template, Clause } = require("@accordproject/cicero-core"); 22 | const { Engine } = require("@accordproject/cicero-engine"); 23 | ``` 24 | 25 | ### Load a Template 26 | 27 | To create a Template instance in memory call the `fromDirectory`, `fromArchive` or `fromUrl` methods: 28 | 29 | ```js 30 | const template = await Template.fromDirectory( 31 | "./test/data/latedeliveryandpenalty" 32 | ); 33 | ``` 34 | 35 | These methods are asynchronous and return a `Promise`, so you should use `await` to wait for the promise to be resolved. 36 | 37 | > Note that you'll need to wrap this `await` inside an `async` function or use a [top-level await inside a module](https://v8.dev/features/top-level-await) 38 | 39 | ### Instantiate a Template 40 | 41 | Once a Template has been loaded, you can create a Clause based on the Template. You can either instantiate 42 | the Clause using source DSL text (by calling `parse`), or you can set an instance of the template model 43 | as JSON data (by calling `setData`): 44 | 45 | ```js 46 | // load the DSL text for the template 47 | const testLatePenaltyInput = fs.readFileSync( 48 | path.resolve(__dirname, "text/", "sample.md"), 49 | "utf8" 50 | ); 51 | 52 | const clause = new Clause(template); 53 | clause.parse(testLatePenaltyInput); 54 | 55 | // get the JSON object created from the parse 56 | const data = clause.getData(); 57 | ``` 58 | 59 | ## Executing a Template Instance 60 | 61 | Once you have instantiated a clause or contract instance, you can execute it. 62 | 63 | ### Import the Engine class 64 | 65 | To execute a Clause you first need to create an instance of the `Engine` class: 66 | 67 | ```js 68 | const engine = new Engine(); 69 | ``` 70 | 71 | ### Send a request to the contract 72 | 73 | You can then call `execute` on it, passing in the clause or contract instance, and the request: 74 | 75 | ```js 76 | const request = { 77 | $class: 78 | "org.accordproject.latedeliveryandpenalty.LateDeliveryAndPenaltyRequest", 79 | forceMajeure: false, 80 | agreedDelivery: "2017-10-07T16:38:01.412Z", 81 | goodsValue: 200, 82 | }; 83 | const state = { 84 | $class: "org.accordproject.runtime.State", 85 | }; 86 | 87 | const result = await engine.trigger(clause, request, state); 88 | console.log(result); 89 | ``` 90 | -------------------------------------------------------------------------------- /docs/tutorial-vscode.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: tutorial-vscode 3 | title: With VS Code 4 | --- 5 | 6 | Cicero comes with a VS Code extension for easier development and testing. It includes support for syntax highlighting, allows you to test your template (contract parsing and logic) and to create template archives directly within VS Code. 7 | 8 | ## Prerequisites 9 | 10 | To follow this tutorial on how to use the Cicero VS Code extension, we recommend you install the following: 11 | 12 | 1. [Node, LTS version](nodejs.org) 13 | 1. [VS Code](https://code.visualstudio.com) 14 | 1. [Yeoman](https://yeoman.io) 15 | 1. [Accord Project Yeoman Generator](https://github.com/accordproject/cicero/tree/master/packages/generator-cicero-template) 16 | 1. [Camel Tooling Yeoman VS Code extension](https://marketplace.visualstudio.com/items?itemName=camel-tooling.yo) 17 | 1. [Accord Project VS Code extension](https://marketplace.visualstudio.com/items?itemName=accordproject.cicero-vscode-extension) 18 | 19 | ## Video Tutorial 20 | 21 | 22 | -------------------------------------------------------------------------------- /scripts/get_contributors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | USER=$1 3 | TOKEN=$2 4 | ORGANIZATION=accordproject 5 | 6 | # Get all public AP repos 7 | REPOS=( $(curl -u ${USER}:${TOKEN} -s https://api.github.com/orgs/${ORGANIZATION}/repos | jq -r '.[] | select (.fork == false) | .name') ) 8 | 9 | # Get contributors for each repo 10 | CONTRIBUTORS=() 11 | for repo in "${REPOS[@]}"; do 12 | echo "${repo}" 13 | REPO_CONTRIBUTORS=( $(curl -u ${USER}:${TOKEN} -s https://api.github.com/repos/${ORGANIZATION}/${repo}/stats/contributors | jq -r '.[] | .author.id') ) 14 | 15 | # Concatenate the existing contributors with the new ones 16 | CONTRIBUTORS=("${CONTRIBUTORS[@]}" "${REPO_CONTRIBUTORS[@]}") 17 | done 18 | 19 | # Remove duplicates 20 | CONTRIBUTORS=($( echo "${CONTRIBUTORS[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) 21 | 22 | for i in "${!CONTRIBUTORS[@]}"; do 23 | if [ $(($i % 20)) -eq 0 ]; then 24 | echo "" 25 | fi 26 | echo " "; 27 | 28 | done > CONTRIBUTORS.md 29 | -------------------------------------------------------------------------------- /scripts/seed_contributors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | USER=$1 3 | TOKEN=$2 4 | CURRENT_REPO=$3 5 | ORGANIZATION=accordproject 6 | 7 | # needed to avoid the rate limit 8 | export PRIVATE_TOKEN=$TOKEN 9 | 10 | CONTRIBUTORS=() 11 | 12 | # Get contributors for each repo 13 | REPO_CONTRIBUTORS=( $(curl -u ${USER}:${TOKEN} -s https://api.github.com/repos/${ORGANIZATION}/${CURRENT_REPO}/stats/contributors | jq -r '.[] | .author.login') ) 14 | 15 | # Concatenate the existing contributors with the new ones 16 | CONTRIBUTORS=("${CONTRIBUTORS[@]}" "${REPO_CONTRIBUTORS[@]}") 17 | 18 | # Remove duplicates 19 | CONTRIBUTORS=($( echo "${CONTRIBUTORS[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) 20 | 21 | for i in "${!CONTRIBUTORS[@]}"; do 22 | echo "${CONTRIBUTORS[$i]}" 23 | node "./node_modules/all-contributors-cli/dist/cli.js" add ${CONTRIBUTORS[$i]} doc 24 | done 25 | 26 | node "./node_modules/all-contributors-cli/dist/cli.js" generate -------------------------------------------------------------------------------- /website/blog/2018-05-18-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Welcome! 3 | author: Dan Selman 4 | authorURL: http://twitter.com/danielselman 5 | --- 6 | 7 | This is a test. 8 | 9 | 10 | 11 | Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut. 12 | -------------------------------------------------------------------------------- /website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "examples": "docusaurus-examples", 4 | "start": "docusaurus-start", 5 | "build": "docusaurus-build", 6 | "build:api": "./scripts/build_api_md.sh", 7 | "publish-gh-pages": "docusaurus-publish", 8 | "write-translations": "docusaurus-write-translations", 9 | "version": "docusaurus-version", 10 | "rename-version": "docusaurus-rename-version" 11 | }, 12 | "description": "Technical Documentation for the Accord Project", 13 | "license": "Apache-2.0", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/accordproject/techdocs.git" 17 | }, 18 | "dependencies": { 19 | "axios": "^0.21.2", 20 | "docusaurus": "^1.14.7", 21 | "qs": "^6.9.6", 22 | "remarkable-admonitions": "^0.2.2" 23 | }, 24 | "devDependencies": { 25 | "jsdoc-to-markdown": "^7.1.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /website/pages/en/users.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const React = require('react'); 9 | 10 | const CompLibrary = require('../../core/CompLibrary.js'); 11 | const Container = CompLibrary.Container; 12 | 13 | const siteConfig = require(process.cwd() + '/siteConfig.js'); 14 | 15 | class Users extends React.Component { 16 | render() { 17 | if ((siteConfig.users || []).length === 0) { 18 | return null; 19 | } 20 | const editUrl = 'https://github.com/accordproject/techdocs/edit/master/website/siteConfig.js'; 21 | const showcase = siteConfig.users.map((user, i) => { 22 | return ( 23 | 24 | {user.caption} 25 | 26 | ); 27 | }); 28 | 29 | return ( 30 |
31 | 32 |
33 |
34 |

Who's Using This?

35 |

This project is used by the following companies

36 |
37 |
{showcase}
38 |

Are you using this project?

39 | 40 | Add your company 41 | 42 |
43 |
44 |
45 | ); 46 | } 47 | } 48 | 49 | module.exports = Users; 50 | -------------------------------------------------------------------------------- /website/scripts/build_api_md.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | cd .. 17 | # Build the Cicero API 18 | git clone https://github.com/accordproject/cicero.git 19 | ./website/node_modules/.bin/jsdoc2md -c ./website/scripts/cicero-jsdoc.conf --files ./cicero/packages/cicero-engine/{*,lib/*,lib/**/*}.js ./cicero/packages/cicero-core/{*,src/*,src/**/*}.js > ./docs/ref-cicero-api.md 20 | ./website/node_modules/.bin/jsdoc2md --template ./website/scripts/cicero-api.hbs -c ./website/scripts/cicero-jsdoc.conf --files ./cicero/packages/cicero-engine/{*,lib/*,lib/**/*}.js ./cicero/packages/cicero-core/{*,src/*,src/**/*}.js > ./docs/ref-cicero-api.md 21 | rm -rf cicero 22 | 23 | # Build the Ergo API 24 | git clone https://github.com/accordproject/ergo.git 25 | ./website/node_modules/.bin/jsdoc2md -c ./website/scripts/ergo-jsdoc.conf --files ./ergo/packages/**/lib/*.js > ./docs/ref-ergo-api.md 26 | ./website/node_modules/.bin/jsdoc2md --template ./website/scripts/ergo-api.hbs -c ./website/scripts/ergo-jsdoc.conf --files ./ergo/packages/**/lib/*.js > ./docs/ref-ergo-api.md 27 | rm -rf ergo 28 | 29 | ## Build the Concerto Core API 30 | git clone https://github.com/accordproject/concerto.git 31 | ./website/node_modules/.bin/jsdoc2md -c ./website/scripts/concerto-jsdoc.conf --files ./concerto/**/*.js > ./docs/ref-concerto-api.md 32 | ./website/node_modules/.bin/jsdoc2md --template ./website/scripts/concerto-api.hbs -c ./website/scripts/concerto-jsdoc.conf --files ./concerto/**/*.js > ./docs/ref-concerto-api.md 33 | rm -rf concerto 34 | 35 | cd ./website 36 | -------------------------------------------------------------------------------- /website/scripts/cicero-api.hbs: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-cicero-api 3 | title: Cicero API 4 | --- 5 | 6 | {{>main}} 7 | -------------------------------------------------------------------------------- /website/scripts/cicero-jsdoc.conf: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [], 3 | "recurseDepth": 10, 4 | "source": { 5 | "includePattern": ".+\\.js(doc|x)?$", 6 | "excludePattern": "(.+\/generator-cicero-template\/.+$)|(.+\/test\/.+$)" 7 | }, 8 | "sourceType": "module", 9 | "tags": { 10 | "allowUnknownTags": true, 11 | "dictionaries": ["jsdoc","closure"] 12 | }, 13 | "templates": { 14 | "cleverLinks": false, 15 | "monospaceLinks": false 16 | } 17 | } -------------------------------------------------------------------------------- /website/scripts/concerto-api.hbs: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-concerto-api 3 | title: Concerto API 4 | --- 5 | 6 | {{>main}} 7 | -------------------------------------------------------------------------------- /website/scripts/concerto-jsdoc.conf: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [], 3 | "recurseDepth": 10, 4 | "source": { 5 | "includePattern": ".+\\.js(doc|x)?$", 6 | "excludePattern": "(.+\/concerto-cli\/.+$)|(.+\/test\/.+$)" 7 | }, 8 | "sourceType": "module", 9 | "tags": { 10 | "allowUnknownTags": true, 11 | "dictionaries": ["jsdoc","closure"] 12 | }, 13 | "templates": { 14 | "cleverLinks": false, 15 | "monospaceLinks": false 16 | }, 17 | "module-index-format" : "table", 18 | "global-index-format" : "table", 19 | "param-list-format" : "table", 20 | "property-list-format" : "table", 21 | "member-index-format" : "grouped" 22 | } -------------------------------------------------------------------------------- /website/scripts/ergo-api.hbs: -------------------------------------------------------------------------------- 1 | --- 2 | id: ref-ergo-api 3 | title: Ergo API 4 | --- 5 | 6 | {{>main}} 7 | -------------------------------------------------------------------------------- /website/scripts/ergo-jsdoc.conf: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [], 3 | "recurseDepth": 10, 4 | "source": { 5 | "includePattern": ".+\\.js(doc|x)?$", 6 | "excludePattern": "(.+\/ergoc-lib.js$)|(.+\/ergo-core.js$)" 7 | }, 8 | "sourceType": "module", 9 | "tags": { 10 | "allowUnknownTags": true, 11 | "dictionaries": ["jsdoc","closure"] 12 | }, 13 | "templates": { 14 | "cleverLinks": false, 15 | "monospaceLinks": false 16 | } 17 | } -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-100.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-100.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-200.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-300.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-400.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-500.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-600.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-700.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-800.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-800.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900-Italic.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900-Italic.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900-Italic.woff2 -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900.otf -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900.woff -------------------------------------------------------------------------------- /website/static/fonts/Graphik-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/fonts/Graphik-900.woff2 -------------------------------------------------------------------------------- /website/static/img/Accord-Project-logo-small.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /website/static/img/LF-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/LF-logo.png -------------------------------------------------------------------------------- /website/static/img/accord_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/accord_icon.png -------------------------------------------------------------------------------- /website/static/img/accord_icon_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/accord_icon_white.png -------------------------------------------------------------------------------- /website/static/img/accord_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/accord_logo.png -------------------------------------------------------------------------------- /website/static/img/accord_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/accord_logo_white.png -------------------------------------------------------------------------------- /website/static/img/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/background.jpg -------------------------------------------------------------------------------- /website/static/img/cicero-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 13 | 16 | 18 | 20 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /website/static/img/clause-logo-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/clause-logo-sm.png -------------------------------------------------------------------------------- /website/static/img/contractpen-logo-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/contractpen-logo-sm.png -------------------------------------------------------------------------------- /website/static/img/ergo-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 11 | 15 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /website/static/img/ergo-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/ergo-vscode.png -------------------------------------------------------------------------------- /website/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/favicon.png -------------------------------------------------------------------------------- /website/static/img/github-brands.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/static/img/grammar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/grammar.png -------------------------------------------------------------------------------- /website/static/img/microsoft-word-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/microsoft-word-logo.png -------------------------------------------------------------------------------- /website/static/img/model-uml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/model-uml.png -------------------------------------------------------------------------------- /website/static/img/model-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/model-vscode.png -------------------------------------------------------------------------------- /website/static/img/modelrepo_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/modelrepo_logo.png -------------------------------------------------------------------------------- /website/static/img/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/noise.png -------------------------------------------------------------------------------- /website/static/img/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/oss_logo.png -------------------------------------------------------------------------------- /website/static/img/playground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/playground.png -------------------------------------------------------------------------------- /website/static/img/studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accordproject/techdocs/b0a7af61af04e026327e3c92b9c4abdc79bf3265/website/static/img/studio.png -------------------------------------------------------------------------------- /website/static/js/code-block-buttons.js: -------------------------------------------------------------------------------- 1 | // Turn off ESLint for this file because it's sent down to users as-is. 2 | /* eslint-disable */ 3 | window.addEventListener('load', function() { 4 | function button(label, ariaLabel, icon, className) { 5 | const btn = document.createElement('button'); 6 | btn.classList.add('btnIcon', className); 7 | btn.setAttribute('type', 'button'); 8 | btn.setAttribute('aria-label', ariaLabel); 9 | btn.innerHTML = 10 | '
' + 11 | icon + 12 | '' + 13 | label + 14 | '' + 15 | '
'; 16 | return btn; 17 | } 18 | 19 | function addButtons(codeBlockSelector, btn) { 20 | document.querySelectorAll(codeBlockSelector).forEach(function(code) { 21 | code.parentNode.appendChild(btn.cloneNode(true)); 22 | }); 23 | } 24 | 25 | const copyIcon = 26 | ''; 27 | 28 | addButtons( 29 | '.hljs', 30 | button('Copy', 'Copy code to clipboard', copyIcon, 'btnClipboard'), 31 | ); 32 | 33 | const clipboard = new ClipboardJS('.btnClipboard', { 34 | target: function(trigger) { 35 | return trigger.parentNode.querySelector('code'); 36 | }, 37 | }); 38 | 39 | clipboard.on('success', function(event) { 40 | event.clearSelection(); 41 | const textEl = event.trigger.querySelector('.btnIcon__label'); 42 | textEl.textContent = 'Copied'; 43 | setTimeout(function() { 44 | textEl.textContent = 'Copy'; 45 | }, 2000); 46 | }); 47 | }); -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-installation 3 | title: Installation 4 | original_id: accordproject-installation 5 | --- 6 | 7 | To start working on your own Accord Project templates, you should install the Cicero command-line tools. This will let you author, parse, and execute Accord Project templates. 8 | 9 | ## Prerequisites 10 | 11 | Before you can install Cicero, you must first obtain and configure the following dependency: 12 | 13 | * [Node.js v8.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a 14 | development web server, run tests, and generate distributable files. Depending on your system, 15 | you can install Node either from source or as a pre-packaged bundle. 16 | 17 | > We recommend using [nvm](https://github.com/creationix/nvm) (or [nvm-windows](https://github.com/coreybutler/nvm-windows)) to manage and install Node.js, which makes it easy to change the version of Node.js per project. 18 | 19 | ## Installing Cicero 20 | 21 | To install the latest version: 22 | 23 | ```bash 24 | npm install -g @accordproject/cicero-cli@0.12 25 | ``` 26 | 27 | To check that Cicero has been properly installed, and display the version number: 28 | ```bash 29 | cicero --version 30 | ``` 31 | 32 | To get command line help: 33 | ```bash 34 | cicero --help 35 | cicero parse --help 36 | cicero execute --help 37 | ``` 38 | 39 | ## Optional Packages 40 | 41 | ### Template Generator 42 | 43 | You may also want to install the template generator tool, which you can use to create an empty template: 44 | 45 | ```bash 46 | npm install -g yo 47 | npm install -g @accordproject/generator-cicero-template@0.12 48 | ``` 49 | 50 | ### Ergo command line 51 | 52 | If you would like to use the Ergo language on its own (i.e., independently of a Cicero template) you can also install the Ergo command-line tools: 53 | 54 | ```bash 55 | npm install @accordproject/ergo-cli@0.12 -g 56 | ``` 57 | 58 | To check that the Ergo compiler has been installed, display the version number: 59 | ```bash 60 | ergoc --version 61 | ``` 62 | 63 | To get command line help: 64 | ```bash 65 | ergoc --help 66 | ergorun --help 67 | ``` 68 | 69 | That's it! 70 | 71 | ## What next? 72 | 73 | The following pages provide links to developers tools and resources. You can also browse using the navigation bar to the left to find additional information: tutorials, API reference, the Ergo language guide, etc. 74 | 75 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-models.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-models 3 | title: Standard Models 4 | original_id: accordproject-models 5 | --- 6 | 7 | Accord Project maintains an Open Source [Models Repository](https://models.accordproject.org) containing standard reusable data models that you can import and use within your Smart Legal Contract Cicero templates and in your Ergo logic. 8 | 9 | ![Model Repository](/docs/assets/bond-model.png) 10 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-resources 3 | title: Learning Resources 4 | original_id: accordproject-resources 5 | --- 6 | 7 | ## Accord Project Resources 8 | 9 | - The Main Web site includes latest news, links to working groups, organizational announcements, etc. : https://www.accordproject.org 10 | - This Technical Documentation: https://docs.accordproject.org 11 | - Recording of Working Group discussions, Tutorial Videos are on available on Vimeo: https://vimeo.com/accordproject 12 | - Accord Project's [Slack](https://accord-project.slack.com/) 13 | 14 | ## Cicero Resources 15 | 16 | - GitHub: https://github.com/accordproject/cicero 17 | - Slack [Channel](https://accord-project.slack.com/messages/CA08NAHQS/details/) 18 | - Technical Questions and Answers on [Stack Overflow](https://stackoverflow.com/questions/tagged/cicero) 19 | 20 | ## Ergo Resources 21 | 22 | - GitHub: https://github.com/accordproject/ergo 23 | - The [Ergo Language Guide](logic-ergo) is a good place to get started with Ergo. 24 | - Slack [Channel](https://accord-project.slack.com/messages/C9HLJHREG/details/) 25 | 26 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-studio.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-studio 3 | title: Template Studio 4 | original_id: accordproject-studio 5 | --- 6 | 7 | [Template Studio](https://studio.accordproject.org) lets you create, edit and test legal clause or contract templates built with the Accord Project. 8 | 9 | ![Model Repository](/img/studio.png) 10 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-templates.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-templates 3 | title: Open Source Templates 4 | original_id: accordproject-templates 5 | --- 6 | 7 | Accord Project maintains an Open Source [Templates Library](https://templates.accordproject.org) of legal clauses and contracts that conform to the Accord Project template specification. 8 | 9 | ![Template Library](/docs/assets/acceptance-of-delivery.png) 10 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/accordproject-tooling.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-accordproject-tooling 3 | title: Developers Tools 4 | original_id: accordproject-tooling 5 | --- 6 | 7 | Several tools are available in order to help you develop your own smart legal templates. 8 | 9 | ## Visual Studio Code Extension 10 | 11 | An extension is available for the popular open-source code editor [Visual Studio Code](https://code.visualstudio.com/). 12 | This provides syntax highlighting, and error reporting when working on source Ergo logic and on Cicero templates. Syntax highlighting for Composer Concerto models is available in a [separate plugin](https://marketplace.visualstudio.com/items?itemName=HyperledgerComposer.composer-support-client). 13 | 14 | Install the Accord Project extension by visiting the [Visual Studio marketplace](https://marketplace.visualstudio.com/items?itemName=accordproject.accordproject-vscode-plugin). 15 | 16 | ![VSCode plugin](/img/ergo-vscode.png) 17 | 18 | ## Syntax highlighting 19 | 20 | Languages modes, which provide syntax highlighting for Ergo, also exist for a couple of other editors. 21 | 22 | ### Emacs 23 | 24 | A simple Emacs mode for Ergo can be found in the [ergo-mode](https://github.com/accordproject/ergo-mode) project on GitHub. 25 | 26 | ### VIM 27 | 28 | A simple VIM mode for Ergo can be found in the [ergo.vim](https://github.com/accordproject/ergo/tree/master/ergo.vim) directory in the Ergo source code on GitHub. 29 | 30 | > Those are not maintained as actively as the rest of the Accord Project. If you know emacs lisp or are a VIM user and would like to contribute, please contact us on the Accord Project Slack or directly through GitHub! 31 | 32 | ## Template Studio 33 | 34 | Finally, [Template Studio](https://studio.accordproject.org) lets you create, edit and test legal clause or contract templates built with the Accord Project directly from your browser, without having to install anything. 35 | 36 | ![Model Repository](/img/studio.png) 37 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/basic-library.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-basic-library 3 | title: Publishing a Template 4 | original_id: basic-library 5 | --- 6 | 7 | This tutorial explains how to contribute a new template to the Accord Project Template Library. 8 | 9 | ## Prerequisites 10 | 11 | Accord Project uses [GitHub](https://github.com/) to maintain its open source template library. For this tutorial, you must first obtain and configure the following dependency: 12 | 13 | * [Git](https://git-scm.com): We use Node to generate the 14 | documentation, run a development web server, run tests, and generate 15 | distributable files. Depending on your system, you can install Node 16 | either from source or as a pre-packaged bundle. 17 | 18 | You will also need a [GitHub](https://github.com/) account. If this is your first time working with GitHub, you can find a number of guides [here](https://guides.github.com). 19 | 20 | ## Clone the template library 21 | 22 | If you have `git` installed you can `git clone` the template library to download all the templates, or you can use the "Download" button inside GitHub: 23 | 24 | ```bash 25 | git clone https://github.com/accordproject/cicero-template-library 26 | ``` 27 | 28 | ## Add a Template to a Library 29 | 30 | The Cicero template library is stored in a GitHub repository: https://github.com/accordproject/cicero-template-library 31 | 32 | To contribute new templates please fork the repository and then create a pull request. Note that templates 33 | should have unit tests. See the ``acceptance-of-delivery`` template for an example with unit tests. 34 | 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/logic-advanced-expr.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-logic-advanced-expr 3 | title: Advanced Expressions 4 | original_id: logic-advanced-expr 5 | --- 6 | 7 | ## Match 8 | 9 | Match expressions allow to check an expression against multiple possible 10 | values: 11 | 12 | ```ergo 13 | match fruitcode 14 | with 1 then "Apple" 15 | with 2 then "Apricot" 16 | else "Strange Fruit" 17 | ``` 18 | 19 | ## Foreach 20 | 21 | Foreach expressions allow to apply an expression of every element in 22 | an input array of values and returns a new array: 23 | 24 | ```ergo 25 | foreach x in [1.0,-2.0,3.0] return x + 1.0 26 | ``` 27 | 28 | Foreach expressions can have an optional condition of the values being 29 | iterated over: 30 | 31 | ```ergo 32 | foreach x in [1.0,-2.0,3.0] where x > 0.0 return x + 1.0 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/logic-ergo.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-logic-ergo 3 | title: Overview 4 | original_id: logic-ergo 5 | --- 6 | 7 | ## Language Goals 8 | 9 | Ergo aims to: 10 | - have contracts and clauses as first-class elements of the language 11 | - help legal-tech developers quickly and safely write computable legal contracts 12 | - be modular, facilitating reuse of existing contract or clause logic 13 | - ensure safe execution: the language should prevent run-time errors and non-terminating logic 14 | - be blockchain neutral: the same contract logic can be executed either on and off chain on a variety of distributed ledger technologies 15 | - be formally specified: the meaning of contracts should be well defined so it can be verified, and preserved during execution 16 | - be consistent with the [Accord Project Template Specification](accordproject-specification) 17 | 18 | ## Design Choices 19 | 20 | To achieve those goals the design of Ergo is based on the following 21 | principles: 22 | 23 | - Ergo contracts have a class-like structure with clauses akin to methods 24 | - Ergo can handle types (concepts, transations, etc) defined with the [Composer Concerto Modeling Language](https://github.com/hyperledger/composer-concerto) (so called CML models), as mandated by the Accord Project Template Specification 25 | - Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects 26 | - The compiler guarantees error-free execution for well-typed Ergo programs 27 | - Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration) 28 | - Most of the compiler is written in Coq as a stepping stone for formal specification and verification 29 | 30 | ## Status 31 | 32 | - The current implementation is considered *in development*, we welcome contributions (be it bug reports, suggestions for new features or improvements, or pull requests) 33 | - The currently compiler targets JavaScript (either standalone or for use in Cicero Templates and Hyperledger Fabric) and Java (experimental) 34 | 35 | ## This Guide 36 | 37 | Ergo provides a simple expression language to describe computation. From those expressions one can write functions, clauses, and then whole contract logic. This guide explains most of the Ergo concepts starting from simple expressions all the way to contracts. 38 | 39 | Ergo is a _strongly typed_ language, which means it checks that the expressions you use are consistent (e.g., you can take the square root of `3.14` but not of `"pi!"`). The type system is here to help you write better and safer contract logic, but it also takes a little getting used to. This page also introduces Ergo types and how to work with them. 40 | 41 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/logic-module.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-logic-module 3 | title: Modularity 4 | original_id: logic-module 5 | --- 6 | 7 | Finally, we can place multiple Ergo declarations (functions, contracts, etc) into a library so it can be shared with other developers. 8 | 9 | ## Namespaces 10 | 11 | Each Ergo file starts with a namespace declaration which provides a way to identify it uniquely: 12 | ```ergo 13 | namespace org.acme.mynamespace 14 | ``` 15 | 16 | ## Libraries 17 | 18 | A library is simply an Ergo file in a namespace which defines useful constants or functions. For instance: 19 | 20 | ```ergo 21 | namespace org.accordproject.ergo.money 22 | 23 | define constant days_in_a_year = 365.0 24 | define function compoundInterests( 25 | annualInterest : Double, 26 | numberOfDays : Double 27 | ) : Double { 28 | return (1.0 + annualInterest) ^ (numberOfDays / days_in_a_year) 29 | } 30 | ``` 31 | 32 | ## Import 33 | 34 | You can then access this library in another Ergo file using import: 35 | ```ergo 36 | namespace org.accordproject.promissorynote 37 | 38 | import org.accordproject.cicero.runtime.* 39 | import org.accordproject.time.* // Imports the DateTime library 40 | import org.accordproject.ergo.money.* // Imports the money.ergo library 41 | 42 | contract PromissoryNote over PromissoryNoteContract { 43 | clause check(request : Payment) : Result { 44 | let interestRate = contract.interestRate ?? 3.4; 45 | let outstanding = contract.amount.doubleValue - request.amountPaid.doubleValue; 46 | 47 | let numberOfDays = 48 | diffDurationAs(dateTime("17 May 2018 13:53:33 EST"),contract.date,"days").amount; 49 | let compounded = 50 | outstanding 51 | * compoundInterests(interestRate, // Calls compoundInterests from the library! 52 | numberOfDays); 53 | 54 | return Result{ 55 | outstandingBalance: compounded 56 | } 57 | } 58 | } 59 | ``` 60 | 61 | > **TechNote:** the namespace and import handling in Ergo allows you to access either existing CTO models or Ergo libraries in the same way. 62 | 63 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/ref-logic-specification.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-ref-logic-specification 3 | title: Ergo Compiler 4 | original_id: ref-logic-specification 5 | --- 6 | 7 | A large part of the Ergo compiler is written as a Coq specification 8 | from which the compiler is extracted. 9 | 10 | Ultimately, one of our goals is to provide a full formal semantics for 11 | Ergo in Coq, and prove correct as much of the compilation pipeline as 12 | possible. 13 | 14 | ## Compiler architecture 15 | 16 | ### Frontend 17 | 18 | ![Frontend](/docs/assets/architecture/frontend.svg) 19 | 20 | ### Code generation 21 | 22 | ![Codegen](/docs/assets/architecture/codegen.svg) 23 | 24 | ## Code Overview 25 | 26 | The Coq source serves a dual purpose: as Ergo's formal semantics and as part of its implementation through extraction. Here are some entry points to the code. 27 | 28 | A browsable version of the Coq code (generated using 29 | [coq2html](https://github.com/xavierleroy/coq2html)) is 30 | available. Below are some of the main intermediate represntations and 31 | compilation phases. 32 | 33 | ### Intermediate representations 34 | 35 | - Ergo: [Ergo/Lang/Ergo](assets/specification/ErgoSpec.Ergo.Lang.Ergo.html) 36 | - Ergo calculus: [ErgoC/Lang/ErgoC](assets/specification/ErgoSpec.ErgoC.Lang.ErgoC.html) 37 | - Ergo NNRC (Named Nested Relational Calculus): [ErgoNNRC/Lang/ErgoNNRC](assets/specification/ErgoSpec.ErgoNNRC.Lang.ErgoNNRC.html) 38 | 39 | ### Macro expansion 40 | 41 | - Ergo to Ergo: [Ergo/Lang/ErgoExpand](assets/specification/ErgoSpec.Ergo.Lang.ErgoExpand.html) 42 | 43 | ### Namespace resolution 44 | 45 | - Ergo to Ergo: [Translation/ErgoNameResolve](assets/specification/ErgoSpec.Translation.ErgoNameResolve.html) 46 | 47 | ### Translations between intermediate representations 48 | 49 | - Ergo to Ergo calculus: [Translation/ErgotoErgoC](assets/specification/ErgoSpec.Translation.ErgotoErgoC.html) 50 | - ErgoC to Ergo NNRC: [Translation/ErgoCtoErgoNNRC](assets/specification/ErgoSpec.Translation.ErgoCtoErgoNNRC.html) 51 | 52 | ### Type checking 53 | 54 | - ErgoC to ErgoC with types: [ErgoCType](assets/specification/ErgoSpec.ErgoC.Lang.ErgoCType.html) 55 | 56 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/spec-example.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-spec-example 3 | title: Example: Late Delivery Clause 4 | original_id: spec-example 5 | --- 6 | 7 | In the rest of this specification, we will use the Late Delivery And Penalty legal clause as an example. It is a common clause in a legal contract related to the delivery of good or services, and in some circumstances may be amenable to automation. 8 | 9 | The Late Delivery And Penalty clause in the typical legal contract looks like this: 10 | 11 | ```text 12 | Late Delivery and Penalty. In case of delayed delivery except for Force 13 | Majeure cases, the Seller shall pay to the Buyer for every 14 | 2 weeks of delay penalty amounting to 10.5% of 15 | the total value of the Equipment whose delivery has been delayed. Any 16 | fractional part of a week is to be considered a full 17 | week. The total amount of penalty shall not however, exceed 18 | 55% of the total value of the Equipment involved in late 19 | delivery. If the delay is more than 10 weeks, the Buyer is entitled to 20 | terminate this Contract. 21 | ``` 22 | 23 | This specification can be used to convert the late delivery and penalty clause into a reusable fragment (a template), that can be executed by a suitable runtime. The complete template can be found in the [Accord Project Template Library](https://templates.accordproject.org/latedeliveryandpenalty@0.13.0.html). 24 | 25 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/spec-instance.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-spec-instance 3 | title: Template Instantiation 4 | original_id: spec-instance 5 | --- 6 | 7 | ## Contract 8 | 9 | A contract is an instance of a Contract Template, where the variables for the template have been set to specific values. A Contract may be instantiated by either parsing natural language text that conforms to the structure of the template grammar, or may be instantiated from a JSON object that is an instance of the Template Model for the template. 10 | 11 | A Contract is composed of a set of Clauses. A Contract may have a state. Many contracts require state, for example, to remember the last time a contracting party made a payment. A contract may optionally be attached to a state object, giving the logic of the contract read and write access to the contract state. 12 | 13 | ## Clause 14 | 15 | Clause is an instance of a Clause Template, where the variables for the template have been set to specific values. 16 | A Clause may be instantiated by either parsing natural language text that conforms to the structure of the 17 | template grammar, or may be instantiated from a JSON object that is an instance of the Template Model for the 18 | template. 19 | 20 | The logic for a Clause is implemented as a function, each of which takes a request and produces a response. The logic for a clause may optionally emit events. A clause has access to the properties and the state of its owning contract. 21 | 22 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.12/spec-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.12-spec-overview 3 | title: Overview 4 | original_id: spec-overview 5 | --- 6 | 7 | This specification defines the structure of Accord Project Templates: legally enforceable natural language text that is bound to executable business logic. 8 | 9 | > Version: 0.8 (Working Draft) 10 | 11 | ## Goals 12 | 13 | Accord Project templates bind legally enforceable natural language text to executable business logic. They provide the foundational technology for legal professionals to formalise a set of legally enforceable executable clauses and contracts. 14 | 15 | The templates are designed to be easy and quick to create from existing legal contracts by legal professionals, and then made executable by legal technologists or programmers using the [Ergo](logic-ergo) domain specific language. 16 | 17 | Templates may support one or more locales, allowing the template to be edited or visualized in different languages, whilst preserving a single locale-neutral executable representation. 18 | 19 | Executable clauses are easy to hash for storage in content-based addressing systems (out of scope for this specification). 20 | 21 | The [reference engine](https://github.com/accordproject/cicero) for the Accord Project Template Specification is designed to be easily embeddable across a wide-variety of form factors: web, middleware, SaaS, on-blockchain execution and off-blockchain execution. 22 | The templates, clauses and the engine are designed to integrate into a traditional DevOps practices and CI/CD, including unit and system testing and code coverage analysis. 23 | 24 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.13/accordproject-installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.13-accordproject-installation 3 | title: Installation 4 | original_id: accordproject-installation 5 | --- 6 | 7 | To start working on your own Accord Project templates, you should install the Cicero command-line tools. This will let you author, parse, and execute Accord Project templates. 8 | 9 | ## Prerequisites 10 | 11 | Before you can install Cicero, you must first obtain and configure the following dependency: 12 | 13 | * [Node.js v8.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a 14 | development web server, run tests, and generate distributable files. Depending on your system, 15 | you can install Node either from source or as a pre-packaged bundle. 16 | 17 | > We recommend using [nvm](https://github.com/creationix/nvm) (or [nvm-windows](https://github.com/coreybutler/nvm-windows)) to manage and install Node.js, which makes it easy to change the version of Node.js per project. 18 | 19 | ## Installing Cicero 20 | 21 | To install the latest version: 22 | 23 | ```bash 24 | npm install -g @accordproject/cicero-cli@0.13 25 | ``` 26 | 27 | To check that Cicero has been properly installed, and display the version number: 28 | ```bash 29 | cicero --version 30 | ``` 31 | 32 | To get command line help: 33 | ```bash 34 | cicero --help 35 | cicero parse --help 36 | cicero execute --help 37 | ``` 38 | 39 | ## Optional Packages 40 | 41 | ### Template Generator 42 | 43 | You may also want to install the template generator tool, which you can use to create an empty template: 44 | 45 | ```bash 46 | npm install -g yo 47 | npm install -g @accordproject/generator-cicero-template@0.13 48 | ``` 49 | 50 | ### Ergo command line 51 | 52 | If you would like to use the Ergo language on its own (i.e., independently of a Cicero template) you can also install the Ergo command-line tools: 53 | 54 | ```bash 55 | npm install @accordproject/ergo-cli@0.13 -g 56 | ``` 57 | 58 | To check that the Ergo compiler has been installed, display the version number: 59 | ```bash 60 | ergoc --version 61 | ``` 62 | 63 | To get command line help: 64 | ```bash 65 | ergoc --help 66 | ergorun --help 67 | ``` 68 | 69 | That's it! 70 | 71 | ## What next? 72 | 73 | The following pages provide links to developers tools and resources. You can also browse using the navigation bar to the left to find additional information: tutorials, API reference, the Ergo language guide, etc. 74 | 75 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.13/ref-errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.13-ref-errors 3 | title: Errors Reference 4 | original_id: ref-errors 5 | --- 6 | 7 | As much as possible, errors returned by Cicero or the Ergo compiler are normalized and categorized in order to facilitate handling of those error by the application code. Those errors are raised in Cicero as JavaScript _exceptions_. 8 | 9 | ## Errors Hierarchy 10 | 11 | The hierarchy of errors (or exceptions) is shown on the following diagram: 12 | 13 | ![Error Hierarchy](assets/exceptions.png) 14 | 15 | ## CTO Model 16 | 17 | For reference, those can also be described using the following CTO model: 18 | 19 | ```ergo 20 | namespace org.accordproject.errors 21 | /** Common */ 22 | concept LocationPoint { 23 | o Integer line 24 | o Integer column 25 | o Integer offset optional 26 | } 27 | concept FileLocation { 28 | o LocationPoint start 29 | o LocationPoint end 30 | } 31 | concept BaseException { 32 | o String component // Node component the error originates from 33 | o String name // name of the class 34 | o String message 35 | } 36 | concept BaseFileException extends BaseException { 37 | o FileLocation fileLocation 38 | o String shortMessage 39 | o String fileName 40 | } 41 | concept ParseException extends BaseFileException { 42 | } 43 | /* Model errors */ 44 | concept ValidationException extends BaseException { 45 | } 46 | concept TypeNotFoundException extends BaseException { 47 | o String typeName 48 | } 49 | concept IllegalModelException extends BaseFileException { 50 | o String modelFile 51 | } 52 | /* Ergo errors */ 53 | concept CompilerException extends BaseFileException { 54 | } 55 | concept TypeException extends BaseFileException { 56 | } 57 | concept SystemException extends BaseFileException { 58 | } 59 | /* Cicero errors */ 60 | concept TemplateException extends ParseException { 61 | } 62 | ``` -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/accordproject-developers.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-accordproject-developers 3 | title: For Developers 4 | original_id: accordproject-developers 5 | --- 6 | 7 | ## Why is the Accord Project relevant for developers? 8 | 9 | The Accord Project provides a universal format for smart legal contracts, and this format is embodied in a variety of open source projects that comprise the Accord Project technology stack. Input from developers are crucial for the Accord Project. 10 | 11 | Developers can contribute by converting legal text into corresponding computer code, creating Accord Project templates to be used by lawyers and businesses. In addition, developers can provide input on the development of its technology stack: language, models, templating, and other tools. 12 | 13 | If this interests you, please visit our [Technology Working Group](https://www.accordproject.org/working-groups/technology) page, and join our [slack channel](https://accord-project-slack-signup.herokuapp.com/)! 14 | 15 | ## How to navigate this documentation? 16 | 17 | If you want to author, validate, and run Accord Project templates locally, please visit our [Install Cicero](https://docs.accordproject.org/docs/next/started-installation.html) page for instructions. 18 | 19 | If you are new to the Accord Project, please read the [Key Concepts](accordproject-concepts) page. This will allow you to understand the three components of a template (text, model, and logic) and how they work together. If you want some guidance on creating your first template, please see [Authoring in Template Studio](tutorial-latedelivery) for a step-by-step guide on how to create your first template. 20 | 21 | If you want to dive into our technology stack, you can find more information about: 22 | - Software implementation: [Cicero](https://github.com/accordproject/cicero) 23 | - Template text: [CiceroMark](markup-cicero) 24 | - Template model: [Concerto Modeling](model-concerto) 25 | - Template logic: [Ergo Logic](logic-ergo) 26 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/logic-advanced-expr.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-logic-advanced-expr 3 | title: Advanced Expressions 4 | original_id: logic-advanced-expr 5 | --- 6 | 7 | ## Match 8 | 9 | ### Match against Values 10 | 11 | Match expressions allow to check an expression against multiple possible 12 | values: 13 | 14 | ```ergo 15 | match fruitcode 16 | with 1 then "Apple" 17 | with 2 then "Apricot" 18 | else "Strange Fruit" 19 | ``` 20 | 21 | Match expressions can also be used to match against enumerated values: 22 | ```ergo 23 | match state 24 | with NY then "Empire State" 25 | with NJ then "Garden State" 26 | else "Far from home state" 27 | ``` 28 | 29 | ### Match against Types 30 | 31 | Match expressions can be used to match a value against a class type:. 32 | 33 | ``` 34 | define constant products = [ 35 | Product{ id : "Blender" }, 36 | Car{ id : "Batmobile", range: "Infinite" }, 37 | Product{ id : "Cup" } 38 | ] 39 | 40 | foreach p in products 41 | return 42 | match p 43 | with let x : Car then "Car (" ++ x.id ++ ") with range " ++ x.range 44 | with let x : Product then "Product (" ++ x.id ++ ")" 45 | else "Not a product" 46 | ``` 47 | Should return the array `["Product (Blender)", "Car (Batmobile) with range Infinite", "Product (Cup)"]` 48 | 49 | ## Foreach 50 | 51 | Foreach expressions allow to apply an expression of every element in 52 | an input array of values and returns a new array: 53 | 54 | ```ergo 55 | foreach x in [1.0,-2.0,3.0] return x + 1.0 56 | ``` 57 | 58 | Foreach expressions can have an optional condition of the values being 59 | iterated over: 60 | 61 | ```ergo 62 | foreach x in [1.0,-2.0,3.0] where x > 0.0 return x + 1.0 63 | ``` 64 | 65 | Foreach expressions can iterate over multiple arrays. For example, the following foreach expression returns all all [Pythagorean triples](https://en.wikipedia.org/wiki/Pythagorean_triple): 66 | ```ergo 67 | let nums = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]; 68 | foreach x in nums 69 | foreach y in nums 70 | foreach z in nums 71 | where (x^2.0 + y^2.0 = z^2.0) 72 | return {a: x, b: y, c: z} 73 | ``` 74 | and should return the array `[{a: 3.0, b: 4.0, c: 5.0}, {a: 4.0, b: 3.0, c: 5.0}, {a: 6.0, b: 8.0, c: 10.0}, {a: 8.0, b: 6.0, c: 10.0}]`. 75 | 76 | ## Template Literals 77 | 78 | Template literals are similar to [String literals](Literal values) but with the ability to embed Ergo expressions. They are written with between `` ` `` and may contains Ergo expressions inside `{{%` and `%}}`. 79 | 80 | The following Ergo expressions illustrates the use of a template literal to construct a String describing the content of a record. 81 | ``` 82 | let law101 = { 83 | name: "Law for developers", 84 | fee: 29.99 85 | }; 86 | `Course "{{% law101.name %}}" (Cost: {{% law101.fee %}})` 87 | ``` 88 | Should return the string literal `"Course \"Law for developers\" (Cost: 29.99)"`. 89 | 90 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/logic-ergo.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-logic-ergo 3 | title: Ergo Overview 4 | original_id: logic-ergo 5 | --- 6 | 7 | ## Language Goals 8 | 9 | Ergo aims to: 10 | - have contracts and clauses as first-class elements of the language 11 | - help legal-tech developers quickly and safely write computable legal contracts 12 | - be modular, facilitating reuse of existing contract or clause logic 13 | - ensure safe execution: the language should prevent run-time errors and non-terminating logic 14 | - be blockchain neutral: the same contract logic can be executed either on and off chain on a variety of distributed ledger technologies 15 | - be formally specified: the meaning of contracts should be well defined so it can be verified, and preserved during execution 16 | - be consistent with the [Accord Project Template Specification](accordproject-specification) 17 | 18 | ## Design Choices 19 | 20 | To achieve those goals the design of Ergo is based on the following 21 | principles: 22 | 23 | - Ergo contracts have a class-like structure with clauses akin to methods 24 | - Ergo can handle types (concepts, transactions, etc) defined with the [Concerto Modeling Language](https://github.com/accordproject/concerto) (so called CML models), as mandated by the Accord Project Template Specification 25 | - Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects 26 | - The compiler guarantees error-free execution for well-typed Ergo programs 27 | - Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration) 28 | - Most of the compiler is written in Coq as a stepping stone for formal specification and verification 29 | 30 | ## Status 31 | 32 | - The current implementation is considered *in development*, we welcome contributions (be it bug reports, suggestions for new features or improvements, or pull requests) 33 | - The current compiler targets JavaScript (either standalone or for use in Cicero Templates and Hyperledger Fabric) and Java (experimental) 34 | 35 | ## This Guide 36 | 37 | Ergo provides a simple expression language to describe computation. From those expressions, one can write functions, clauses, and then whole contract logic. This guide explains most of the Ergo concepts starting from simple expressions all the way to contracts. 38 | 39 | Ergo is a _strongly typed_ language, which means it checks that the expressions you use are consistent (e.g., you can take the square root of `3.14` but not of `"pi!"`). The type system is here to help you write better and safer contract logic, but it also takes a little getting used to. This page also introduces Ergo types and how to work with them. 40 | 41 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/logic-module.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-logic-module 3 | title: Modules 4 | original_id: logic-module 5 | --- 6 | 7 | Finally, we can place multiple Ergo declarations (functions, contracts, etc) into a library so it can be shared with other developers. 8 | 9 | ## Namespaces 10 | 11 | Each Ergo file starts with a namespace declaration which provides a way to identify it uniquely: 12 | ```ergo 13 | namespace org.acme.mynamespace 14 | ``` 15 | 16 | ## Libraries 17 | 18 | A library is an Ergo file in a namespace which defines useful constants or functions. For instance: 19 | 20 | ```ergo 21 | namespace org.accordproject.ergo.money 22 | 23 | define constant days_in_a_year = 365.0 24 | define function compoundInterests( 25 | annualInterest : Double, 26 | numberOfDays : Double 27 | ) : Double { 28 | return (1.0 + annualInterest) ^ (numberOfDays / days_in_a_year) 29 | } 30 | ``` 31 | 32 | ## Import 33 | 34 | You can then access this library in another Ergo file using import: 35 | ```ergo 36 | namespace org.accordproject.promissorynote 37 | 38 | contract PromissoryNote over PromissoryNoteContract { 39 | clause check(request : Payment) : Result { 40 | let interestRate = contract.interestRate ?? 3.4; 41 | enforce interestRate >= 0.0; 42 | enforce contract.amount.doubleValue >= 0.0; 43 | let outstanding = contract.amount.doubleValue - request.amountPaid.doubleValue; 44 | enforce outstanding >= 0.0; 45 | 46 | let numberOfDays = 47 | diffDurationAs( 48 | dateTime("17 May 2018 13:53:33 EST"), 49 | contract.date, 50 | ~org.accordproject.time.TemporalUnit.days).amount; 51 | 52 | enforce numberOfDays >= 0; 53 | 54 | let compounded = outstanding 55 | * compoundInterestMultiple(interestRate, numberOfDays); // Defined in ergo.money module 56 | 57 | return Result{ 58 | outstandingBalance: compounded 59 | } 60 | } 61 | } 62 | ``` 63 | 64 | > **TechNote:** the namespace and import handling in Ergo allows you to access either existing CTO models or Ergo libraries in the same way. 65 | 66 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-api 3 | title: Using the API 4 | original_id: model-api 5 | --- 6 | 7 | ## Install the Core Library 8 | 9 | To install the core model library in your project: 10 | ``` 11 | npm install @accordproject/concerto-core@0.20 --save 12 | ``` 13 | 14 | Below are examples of API use. 15 | 16 | ## Create a Concerto File 17 | 18 | ```js 19 | namespace org.acme.address 20 | 21 | /** 22 | * This is a concept 23 | */ 24 | concept PostalAddress { 25 | o String streetAddress optional 26 | o String postalCode optional 27 | o String postOfficeBoxNumber optional 28 | o String addressRegion optional 29 | o String addressLocality optional 30 | o String addressCountry optional 31 | } 32 | ``` 33 | 34 | ## Create a Model Manager 35 | 36 | ```js 37 | const ModelManager = require('@accordproject/concerto-core').ModelManager; 38 | 39 | const modelManager = new ModelManager(); 40 | modelManager.addModelFile( concertoFileText, 'filename.cto'); 41 | ``` 42 | 43 | ## Create an Instance 44 | 45 | ```js 46 | const Factory = require('@accordproject/concerto-core').Factory; 47 | 48 | const factory = new Factory(modelManager); 49 | const postalAddress = factory.newConcept('org.acme.address', 'PostalAddress'); 50 | postalAddress.streetAddress = '1 Maine Street'; 51 | ``` 52 | 53 | ## Serialize an Instance to JSON 54 | 55 | ```js 56 | const Serializer = require('@accordproject/concerto-core').Serializer; 57 | 58 | const serializer = new Serializer(factory, modelManager); 59 | const plainJsObject = serializer.toJSON(postalAddress); // instance will be validated 60 | console.log(JSON.stringify(plainJsObject, null, 4); 61 | ``` 62 | 63 | ## Deserialize an Instance from JSON 64 | 65 | ```js 66 | const postalAddress = serializer.fromJSON(plainJsObject); // JSON will be validated 67 | console.log(postalAddress.streetAddress); 68 | ``` 69 | 70 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-classes.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-classes 3 | title: Classes 4 | original_id: model-classes 5 | --- 6 | 7 | ## Concepts 8 | 9 | Concepts are similar to class declarations in most object-oriented languages, in that they may have a super-type and a set of typed properties: 10 | 11 | ```js 12 | abstract concept Animal { 13 | o DateTime dob 14 | } 15 | 16 | concept Dog extends Animal { 17 | o String breed 18 | } 19 | ``` 20 | 21 | Concepts can be declared `abstract` if it should not be instantiated (must be subclassed). 22 | 23 | ## Assets 24 | 25 | An asset is a class declaration that has a single `String` property which acts as an identifier. You can use the `modelManager.getAssetDeclarations` API to look up all assets. 26 | 27 | ```js 28 | asset Vehicle identified by vin { 29 | o String vin 30 | } 31 | ``` 32 | 33 | Assets are typically used in your models for the long-lived identifiable Things (or nouns) in the model: cars, orders, shipping containers, products, etc. 34 | 35 | ## Participants 36 | 37 | Participants are class declarations that have a single `String` property acting as an identifier. You can use the `modelManager.getParticipantDeclarations` API to look up all participants. 38 | 39 | ```js 40 | participant Customer identified by email { 41 | o String email 42 | } 43 | ``` 44 | 45 | Participants are typically used for the identifiable people or organizations in the model: person, customer, company, business, auditor, etc. 46 | 47 | ## Transactions 48 | 49 | Transactions are similar to participants in that they are also class declarations that have a single `String` property acting as an identifier. You can use the `modelManager.getTransactionDeclarations` API to look up all transactions. 50 | 51 | ```js 52 | transaction Order identified by orderId { 53 | o String orderId 54 | } 55 | ``` 56 | 57 | Transactions are typically used in models for the identifiable business events or messages that are submitted by Participants to change the state of Assets: cart check out, change of address, identity verification, place order, etc. 58 | 59 | ## Events 60 | 61 | ** TBD ** 62 | 63 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-concerto.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-concerto 3 | title: Concerto Overview 4 | original_id: model-concerto 5 | --- 6 | 7 | ### Principles 8 | 9 | The Concerto Modeling Language (CML) allows you to: 10 | - Define an object-oriented model using a domain-specific language that is much easier to read and write than JSON/XML Schema, XMI or equivalents. 11 | - Optionally edit your models using a powerful [VS Code add-on](https://marketplace.visualstudio.com/items?itemName=accordproject.cicero-vscode-extension) with syntax highlighting and validation 12 | - Create runtime instances of your model 13 | - Serialize your instances to JSON 14 | - Deserialize (and optionally validate) instances from JSON 15 | - Pass JS object instances around your application 16 | - Introspect the model using a powerful set of APIs 17 | - Convert the model to other formats using [concerto-tools](https://github.com/accordproject/concerto/tree/master/packages/concerto-tools) 18 | - Import models from URLs 19 | - Publish your reusable models to any website, including the [Accord Project Open Source model repository](https://models.accordproject.org) 20 | 21 | ### Metamodel Components 22 | 23 | The Concerto metamodel contains the following: 24 | - [Namespaces](model-namespaces) 25 | - [Imports](model-namespaces#imports) 26 | - [Concepts](model-classes#concepts) 27 | - [Assets](model-classes#assets) 28 | - [Participants](model-classes#participants) 29 | - [Transactions](model-classes#transactions) 30 | - [Enumerations & Enumeration Values](model-enum) 31 | - [Properties & Meta Properties](model-properties) 32 | - [Relationships](model-relationships) 33 | - [Decorators](model-decorators) 34 | 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-decorators.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-decorators 3 | title: Decorators 4 | original_id: model-decorators 5 | --- 6 | 7 | Model elements may have arbitrary decorators (aka annotations) placed on them. These are available via API and can be useful for tools to extend the model. 8 | 9 | ```js 10 | @foo("arg1", 2) 11 | asset Order identified by orderId { 12 | o String orderId 13 | } 14 | ``` 15 | 16 | Decorators have an arbitrary number of arguments. They support arguments of type: 17 | - String 18 | - Boolean 19 | - Number 20 | - Type reference 21 | 22 | Resource definitions and properties may be decorated with 0 or more decorations. Note that only a single instance of a decorator is allowed on each element type. I.e. it is invalid to have the @bar decorator listed twice on the same element. 23 | 24 | Decorators are accessible at runtime via the `ModelManager` introspect APIs. This allows tools and utilities to use Concerto to describe a core model, while decorating it with sufficient metadata for their own purposes. 25 | 26 | The example below retrieves the 3rd argument to the foo decorator attached to the myField property of a class declaration: 27 | 28 | ```js 29 | const val = myField.getDecorator('foo').getArguments()[2]; 30 | ``` 31 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-enums.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-enums 3 | title: Enumerations 4 | original_id: model-enums 5 | --- 6 | 7 | Enumerations are used to capture lists of domain values. 8 | 9 | ```js 10 | enum Cardsuit { 11 | o CLUBS 12 | o DIAMONDS 13 | o HEARTS 14 | o SPADES 15 | } 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-namespaces.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-namespaces 3 | title: Namespaces 4 | original_id: model-namespaces 5 | --- 6 | 7 | Each Concerto file starts with the name of a single namespace, which contains the base definitions of asset, event, participant and transaction. All definitions within a single file belong to the same namespace. 8 | 9 | ```js 10 | namespace foo 11 | ``` 12 | 13 | ### Imports 14 | 15 | In order for one namespace to reference types defined in another namespace, the types must be imported. Imports can be either qualified or can use wildcards. 16 | 17 | ```js 18 | import org.accordproject.address.PostalAddress 19 | ``` 20 | 21 | ```js 22 | import org.accordproject.address.* 23 | ``` 24 | 25 | Import also can use the optional `from` declaration to import a model file that has been deployed to a URL. 26 | 27 | ```js 28 | import org.accordproject.address.PostalAddress from https://models.accordproject.org/address.cto 29 | ``` 30 | 31 | Imports using a `from` declaration can be downloaded into the model manager by calling `modelManager.updateExternalModels`. 32 | 33 | The Model Manager will resolve all imports to ensure that the set of declarations that have been loaded are globally consistent. 34 | 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-properties.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-properties 3 | title: Properties 4 | original_id: model-properties 5 | --- 6 | 7 | Class declarations contain properties. Each property has a type which can either be a type defined in the same namespace, an imported type, or a primitive type. 8 | 9 | ### Primitive types 10 | 11 | Concerto supports the following primitive types: 12 | 13 | |Type | Description| 14 | |--- | ---| 15 | |`String` | a UTF8 encoded String. 16 | |`Double` | a double precision 64 bit numeric value. 17 | |`Integer` | a 32 bit signed whole number. 18 | |`Long` | a 64 bit signed whole number. 19 | |`DateTime` | an ISO-8601 compatible time instance, with optional time zone and UTZ offset. 20 | |`Boolean` | a Boolean value, either true or false. 21 | 22 | ### Meta Properties 23 | 24 | |Property|Description| 25 | |---|---| 26 | |`[]` | declares that the property is an array| 27 | |`optional` | declares that the property is not required for the instance to be valid| 28 | | `default` | declares a default value for the property, if not value is specified| 29 | | `range` | declares a valid range for numeric properties| 30 | | `regex` | declares a validation regex for string properties| 31 | 32 | `String` fields may include an optional regular expression, which is used to validate the contents of the field. Careful use of field validators allows Concerto to perform rich data validation, leading to fewer errors and less boilerplate application code. 33 | 34 | `Double`, `Long` or `Integer` fields may include an optional range expression, which is used to validate the contents of the field. 35 | 36 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/model-relationships.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-model-relationships 3 | title: Relationships 4 | original_id: model-relationships 5 | --- 6 | 7 | A relationship in Concerto Modeling Language (CML) is a tuple composed of: 8 | 9 | 1. The namespace of the type being referenced 10 | 2. The type name of the type being referenced 11 | 3. The identifier of the instance being referenced 12 | 13 | Hence a relationship could be: `org.example.Vehicle#123456` 14 | 15 | This would be a relationship to the `Vehicle` _type_ declared in the `org.example` _namespace_ with the _identifier_ `123456`. 16 | 17 | Relationships are unidirectional and deletes do not cascade, ie. removing the relationship has no impact on the thing that is being pointed to. Removing the thing being pointed to does not invalidate the relationship. 18 | 19 | Relationships must be resolved to retrieve an instance of the object being referenced. The act of resolution may result in null, if the object no longer exists or the information in the relationship is invalid. Resolution of relationships is outside of the scope of Concerto. 20 | 21 | A property of a class may be declared as a relationship using the `-->` syntax instead of the `o` syntax. The `o` syntax declares that the class contains (has-a) property of that type, whereas the `-->` syntax declares a typed pointer to an external identifiable instance. 22 | 23 | In this example, the model declares that an `Order` has-an array of reference to `OrderLines`. Deleting the `Order` has no impact on the `OrderLine`. When the `Order` is serialized the JSON only the IDs of the `OrderLines` are stored within the `Order`, not the `OrderLines` themselves. 24 | 25 | ```js 26 | asset OrderLine identified by orderLineId { 27 | o String orderLineId 28 | o String sku 29 | } 30 | 31 | asset Order identified by orderId { 32 | o String orderId 33 | --> OrderLine[] orderlines 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/ref-cicero-ui.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-ref-cicero-ui 3 | title: Cicero UI Reference 4 | original_id: ref-cicero-ui 5 | --- 6 | 7 | Accord Project publishes [React](https://reactjs.org) user interface components for use in web-applications. Please refer to the cicero-ui project [on GitHub](https://github.com/accordproject/cicero-ui) for detailed usage instructions. 8 | 9 | You can preview these components in [Template Studio v2](https://accordproject-studio.netlify.com). 10 | 11 | ![Template-Studio-V2](/docs/assets/reference/tsv2.png) 12 | 13 | ## Contract Editor 14 | 15 | The Contract Editor component provides a rich-text content editor for contract text with embedded clauses. 16 | 17 | > Note that the contract editor does not currently support the full expressiveness of Cicero Templates. Please refer to the Limitations section for details. 18 | 19 | ### Limitations 20 | 21 | The contract editor does not support templates which use the following CiceroMark features: 22 | 23 | * Lists containing [nested lists](markup-commonmark#nested-lists) 24 | * Templates [list blocks](markup-blocks#list-blocks) 25 | 26 | ## Error Logger 27 | 28 | The Error Logger component is used to display structured error messages from the Contract Editor. 29 | 30 | ## Navigation 31 | 32 | The Navigation component displays an outline view for a contract, allowing the user to quickly navigate between sections. 33 | 34 | ## Template Library 35 | 36 | The Template Library component displays a vertical list of template metadata, and allows the user to add a clause (instance of a template) to a contract. 37 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/ref-logic-specification.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-ref-logic-specification 3 | title: Ergo Compiler 4 | original_id: ref-logic-specification 5 | --- 6 | 7 | A large part of the Ergo compiler is written as a Coq specification 8 | from which the compiler is extracted. 9 | 10 | Ultimately, one of our goals is to provide a full formal semantics for 11 | Ergo in Coq, and prove correct as much of the compilation pipeline as 12 | possible. 13 | 14 | ## Compiler architecture 15 | 16 | ### Frontend 17 | 18 | ![Frontend](/docs/assets/architecture/frontend.svg) 19 | 20 | ### Code generation 21 | 22 | ![Codegen](/docs/assets/architecture/codegen.svg) 23 | 24 | ## Code Overview 25 | 26 | The Coq source serves a dual purpose: as Ergo's formal semantics and as part of its implementation through extraction. Here are some entry points to the code. 27 | 28 | A browsable version of the Coq code (generated using 29 | [coq2html](https://github.com/xavierleroy/coq2html)) is 30 | available. Below are some of the main intermediate representations and 31 | compilation phases. 32 | 33 | ### Intermediate representations 34 | 35 | - Ergo: [Ergo/Lang/Ergo](assets/specification/ErgoSpec.Ergo.Lang.Ergo.html) 36 | - Ergo calculus: [ErgoC/Lang/ErgoC](assets/specification/ErgoSpec.ErgoC.Lang.ErgoC.html) 37 | - Ergo NNRC (Named Nested Relational Calculus): [ErgoNNRC/Lang/ErgoNNRC](assets/specification/ErgoSpec.ErgoNNRC.Lang.ErgoNNRC.html) 38 | 39 | ### Macro expansion 40 | 41 | - Ergo to Ergo: [Ergo/Lang/ErgoExpand](assets/specification/ErgoSpec.Ergo.Lang.ErgoExpand.html) 42 | 43 | ### Namespace resolution 44 | 45 | - Ergo to Ergo: [Translation/ErgoNameResolve](assets/specification/ErgoSpec.Translation.ErgoNameResolve.html) 46 | 47 | ### Translations between intermediate representations 48 | 49 | - Ergo to Ergo calculus: [Translation/ErgotoErgoC](assets/specification/ErgoSpec.Translation.ErgotoErgoC.html) 50 | - ErgoC to Ergo NNRC: [Translation/ErgoCtoErgoNNRC](assets/specification/ErgoSpec.Translation.ErgoCtoErgoNNRC.html) 51 | 52 | ### Type checking 53 | 54 | - ErgoC to ErgoC with types: [ErgoCType](assets/specification/ErgoSpec.ErgoC.Lang.ErgoCType.html) 55 | 56 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/started-installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-started-installation 3 | title: Install Cicero 4 | original_id: started-installation 5 | --- 6 | 7 | To experience the full power of Accord Project, you should install the Cicero command-line tools. This will let you author, validate, and run Accord Project templates on your own machine. 8 | 9 | ## Prerequisites 10 | 11 | Before you install Cicero, you must first obtain and configure the following dependency: 12 | 13 | * [Node.js v10.x (LTS)](http://nodejs.org): We use Node.js to run cicero, generate the documentation, run a development web server, testing, and produce distributable files. Depending on your system, you can install Node either from source or as a pre-packaged bundle. 14 | 15 | > We recommend using [nvm](https://github.com/creationix/nvm) (or [nvm-windows](https://github.com/coreybutler/nvm-windows)) to manage and install Node.js, which makes it easy to change the version of Node.js per project. 16 | 17 | ## Installing Cicero 18 | 19 | To install the latest version of the Cicero command-line tools: 20 | 21 | ```bash 22 | npm install -g @accordproject/cicero-cli@0.20 23 | ``` 24 | 25 | :::note 26 | You can install a specific version by appending `@version` at the end of the `npm install` command. For instance to install version `0.20.0` or version `0.13.4`: 27 | ```bash 28 | npm install -g @accordproject/cicero-cli@0.20.3 29 | npm install -g @accordproject/cicero-cli@0.13.4 30 | ``` 31 | ::: 32 | 33 | To check that Cicero has been properly installed, and display the version number: 34 | ```bash 35 | cicero --version 36 | ``` 37 | 38 | To get command line help: 39 | ```bash 40 | cicero --help 41 | cicero parse --help // To parse a sample clause/contract 42 | cicero draft --help // To draft a sample clause/contract 43 | cicero trigger --help // To send a request to a clause/contract 44 | ``` 45 | 46 | ## Optional Packages 47 | 48 | ### Template Generator 49 | 50 | You may also want to install the template generator tool, which you can use to create an empty template: 51 | 52 | ```bash 53 | npm install -g yo 54 | npm install -g @accordproject/generator-cicero-template@0.20 55 | ``` 56 | 57 | ## What next? 58 | 59 | That's it! Go to the next page to see how to use your new installation of Cicero on a real Accord Project template. 60 | 61 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.20/started-studio.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.20-started-studio 3 | title: Online Tour 4 | original_id: started-studio 5 | --- 6 | 7 | To get an better acquainted with Accord Project templates, the easiest way is through the online [Template Studio](https://studio.accordproject.org) editor. 8 | 9 | :::tip 10 | You can open template studio from anywhere in this documentation by clicking the [Try Online!](https://studio.accordproject.org) button located in the top-right of the page. 11 | ::: 12 | 13 | The following video offers a tour of Template Studio and an introduction to the key concepts behind the Accord Project technology. 14 | 15 | 16 | 17 | Here is a timestamp of what is covered in the video: 18 | 19 | - **00:08** : Introduction to template Studio & pointers the other parts of the docs / AP website 20 | - **03:51** : Helloworld template tutorial start 21 | - **04:48** : Template Studio - Metadata 22 | - **06:56** : Template Studio - Contract Text 23 | - **07:52** : The 'live' nature of the text; how to read errors 24 | - **08:39** : Changing the template text itself 25 | - **09:17** : Changing the variables in the template text 26 | - **10:00** : Template Studio - Model update 27 | - **11:28** : Template Studio - Logic update 28 | - **13:17** : Explanation about request types / response types 29 | - **14:44** : Template Studio - Logic - Test Execution (request, response) 30 | - **15:57** : Test Execution - contract state 31 | - **16:49** : Test Execution - obligations 32 | - **18:20** : Wrap-up 33 | 34 | ## What next? 35 | 36 | Learn more about authoring Accord Project templates in template studio with the [Editing a Late Delivery Clause](tutorial-latedelivery) tutorial. 37 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/accordproject-tour.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-accordproject-tour 3 | title: Online Tour 4 | original_id: accordproject-tour 5 | --- 6 | 7 | To get an better acquainted with Accord Project templates, the easiest way is through the online [Template Studio](https://studio.accordproject.org) editor. 8 | 9 | :::tip 10 | You can open template studio from anywhere in this documentation by clicking the [Try Online!](https://studio.accordproject.org) button located in the top-right of the page. 11 | ::: 12 | 13 | The following video offers a tour of Template Studio and an introduction to the key concepts behind the Accord Project technology. 14 | 15 | 16 | 17 | Here is a timestamp of what is covered in the video: 18 | 19 | - **00:08** : Introduction to template Studio & pointers the other parts of the docs / AP website 20 | - **03:51** : Helloworld template tutorial start 21 | - **04:48** : Template Studio - Metadata 22 | - **06:56** : Template Studio - Contract Text 23 | - **07:52** : The 'live' nature of the text; how to read errors 24 | - **08:39** : Changing the template text itself 25 | - **09:17** : Changing the variables in the template text 26 | - **10:00** : Template Studio - Model update 27 | - **11:28** : Template Studio - Logic update 28 | - **13:17** : Explanation about request types / response types 29 | - **14:44** : Template Studio - Logic - Test Execution (request, response) 30 | - **15:57** : Test Execution - contract state 31 | - **16:49** : Test Execution - obligations 32 | - **18:20** : Wrap-up 33 | 34 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/logic-ergo.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-logic-ergo 3 | title: Ergo Overview 4 | original_id: logic-ergo 5 | --- 6 | 7 | ## Language Goals 8 | 9 | Ergo aims to: 10 | - have contracts and clauses as first-class elements of the language 11 | - help legal-tech developers quickly and safely write computable legal contracts 12 | - be modular, facilitating reuse of existing contract or clause logic 13 | - ensure safe execution: the language should prevent run-time errors and non-terminating logic 14 | - be blockchain neutral: the same contract logic can be executed either on and off chain on a variety of distributed ledger technologies 15 | - be formally specified: the meaning of contracts should be well defined so it can be verified, and preserved during execution 16 | - be consistent with the [Accord Project Templates](accordproject-template) 17 | 18 | ## Design Choices 19 | 20 | To achieve those goals the design of Ergo is based on the following 21 | principles: 22 | 23 | - Ergo contracts have a class-like structure with clauses akin to methods 24 | - Ergo can handle types (concepts, transactions, etc) defined with the [Concerto Modeling Language](https://github.com/accordproject/concerto) (so called CML models), as mandated by the Accord Project Template Specification 25 | - Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects 26 | - The compiler guarantees error-free execution for well-typed Ergo programs 27 | - Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration) 28 | - Most of the compiler is written in Coq as a stepping stone for formal specification and verification 29 | 30 | ## Status 31 | 32 | - The current implementation is considered *in development*, we welcome contributions (be it bug reports, suggestions for new features or improvements, or pull requests) 33 | - The current compiler targets JavaScript (either standalone or for use in Cicero Templates and Hyperledger Fabric) and Java (experimental) 34 | 35 | ## This Guide 36 | 37 | Ergo provides a simple expression language to describe computation. From those expressions, one can write functions, clauses, and then whole contract logic. This guide explains most of the Ergo concepts starting from simple expressions all the way to contracts. 38 | 39 | Ergo is a _strongly typed_ language, which means it checks that the expressions you use are consistent (e.g., you can take the square root of `3.14` but not of `"pi!"`). The type system is here to help you write better and safer contract logic, but it also takes a little getting used to. This page also introduces Ergo types and how to work with them. 40 | 41 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/markup-ciceromark.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-markup-ciceromark 3 | title: CiceroMark 4 | original_id: markup-ciceromark 5 | --- 6 | 7 | CiceroMark is an extension to CommonMark used to write the text in Accord Project contracts. The extension is limited in scope, and designed to help with parsing clauses inside contracts and the result of formulas. 8 | 9 | ## Blocks 10 | 11 | ### Clause Blocks 12 | 13 | Clause blocks can be used to identify a specific clause within a contract. Contract blocks are written: 14 | ``` 15 | {{#clause clauseName}} 16 | ...Markdown of the clause... 17 | {{/clause}} 18 | ``` 19 | 20 | ### Example 21 | 22 | For instance, the following is a valid contract text containing a payment clause: 23 | 24 | ```tem 25 | ## Copyright Notices. 26 | 27 | Licensee shall ensure that its use of the Work is marked with the appropriate copyright notices specified by Licensor in a reasonably prominent position in the order and manner provided by Licensor. Licensee shall abide by the copyright laws and what are considered to be sound practices for copyright notice provisions in the Territory. Licensee shall not use any copyright notices that conflict with, confuse, or negate the notices Licensor provides and requires hereunder. 28 | 29 | {{#clause payment}} 30 | Payment 31 | ------- 32 | As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time 33 | fee in the amount of "one hundred US Dollars" (100.0 USD) upon execution of this Agreement, payable as 34 | follows: "bank transfer". 35 | {{/clause}} 36 | 37 | ## General. 38 | 39 | ### Interpretation. 40 | 41 | For purposes of this Agreement, (a) the words "include," "includes," and "including" are deemed to be followed by the words "without limitation"; (b) the word "or" is not exclusive; and (c) the words "herein," "hereof," "hereby," "hereto," and "hereunder" refer to this Agreement as a whole. This Agreement is intended to be construed without regard to any presumption or rule requiring construction or interpretation against the party drafting an instrument or causing any instrument to be drafted. 42 | ``` 43 | 44 | ## Ergo Formulas 45 | 46 | Ergo formulas in template text are essentially similar to Excel formulas. They let you create legal text dynamically based on the other variables in your contract. 47 | 48 | If your contract contains the result of evaluating a formula, the corresponding text should be written `{{% resultOfFormula %}}` where `resultOfFormula` is the expected result of that formula. 49 | 50 | ### Example 51 | 52 | For instance, the following is a valid contract text for the [fixed rate loan](https://templates.accordproject.org/fixed-interests@0.5.2.html) template: 53 | 54 | ```tem 55 | ## Fixed rate loan 56 | 57 | This is a _fixed interest_ loan to the amount of £100,000.00 58 | at the yearly interest rate of 2.5% 59 | with a loan term of 15, 60 | and monthly payments of {{%£667.00%}} 61 | ``` 62 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/model-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-model-api 3 | title: Using the API 4 | original_id: model-api 5 | --- 6 | 7 | ## Install the Core Library 8 | 9 | To install the core model library in your project: 10 | ``` 11 | npm install @accordproject/concerto-core --save 12 | ``` 13 | 14 | Below are examples of API use. 15 | 16 | ## Validating JSON data using a Model 17 | 18 | ```js 19 | const ModelManager = require('@accordproject/concerto-core').ModelManager; 20 | const Concerto = require('@accordproject/concerto-core').Concerto; 21 | const modelManager = new ModelManager(); 22 | modelManager.addModelFile( `namespace org.acme.address 23 | concept PostalAddress { 24 | o String streetAddress optional 25 | o String postalCode optional 26 | o String postOfficeBoxNumber optional 27 | o String addressRegion optional 28 | o String addressLocality optional 29 | o String addressCountry optional 30 | }`, 'model.cto'); 31 | 32 | const postalAddress = { 33 | $class : 'org.acme.address.PostalAddress', 34 | streetAddress : '1 Maine Street' 35 | }; 36 | const concerto = new Concerto(modelManager); 37 | concerto.validate(postalAddress); 38 | ``` 39 | 40 | Now try validating this instance: 41 | 42 | ``` 43 | const postalAddress = { 44 | $class : 'org.acme.address.PostalAddress', 45 | missing : '1 Maine Street' 46 | }; 47 | ``` 48 | 49 | Validation should fail with the message: 50 | 51 | ``` 52 | Instance undefined has a property named missing which is not declared in org.acme.address.PostalAddress 53 | ``` 54 | 55 | ## Runtime introspection of the model 56 | 57 | You can use the Concerto `introspect` APIs to retrieve model information at runtime: 58 | 59 | ``` 60 | const typeDeclaration = concerto.getTypeDeclaration(postalAddress); 61 | const fqn = typeDeclaration.getFullyQualifiedName(); 62 | console.log(fqn); // should equal 'org.acme.address.PostalAddress' 63 | ``` 64 | 65 | These APIs allow you to examine the declared properties, super types and meta-properies for a modelled type. -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/model-concerto.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-model-concerto 3 | title: Concerto Overview 4 | original_id: model-concerto 5 | --- 6 | 7 | ### Principles 8 | 9 | The Concerto Modeling Language (CML) allows you to: 10 | - Define an object-oriented model using a domain-specific language that is much easier to read and write than JSON/XML Schema, XMI or equivalents. 11 | - Optionally edit your models using a powerful [VS Code add-on](https://marketplace.visualstudio.com/items?itemName=accordproject.cicero-vscode-extension) with syntax highlighting and validation 12 | - Create runtime instances of your model 13 | - Serialize your instances to JSON 14 | - Deserialize (and optionally validate) instances from JSON 15 | - Pass JS object instances around your application 16 | - Introspect the model using a powerful set of APIs 17 | - Convert the model to other formats using [concerto-tools](https://github.com/accordproject/concerto/tree/master/packages/concerto-tools) 18 | - Import models from URLs 19 | - Publish your reusable models to any website, including the [Accord Project Open Source model repository](https://models.accordproject.org) 20 | 21 | ### Metamodel Components 22 | 23 | The Concerto metamodel contains the following: 24 | - [Namespaces](model-namespaces) 25 | - [Imports](model-namespaces#imports) 26 | - [Concepts](model-classes#concepts) 27 | - [Assets](model-classes#assets) 28 | - [Participants](model-classes#participants) 29 | - [Transactions](model-classes#transactions) 30 | - [Enumerations](model-enums) 31 | - [Properties & Meta Properties](model-properties) 32 | - [Relationships](model-relationships) 33 | - [Decorators](model-decorators) 34 | 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/model-decorators.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-model-decorators 3 | title: Decorators 4 | original_id: model-decorators 5 | --- 6 | 7 | Model elements may have arbitrary decorators (aka annotations) placed on them. These are available via API and can be useful for tools to extend the model. Accord Project decorators are defined in the [Decorators Reference](ref-concerto-decorators). 8 | 9 | ```js 10 | @foo("arg1", 2) 11 | asset Order identified by orderId { 12 | o String orderId 13 | } 14 | ``` 15 | 16 | Decorators have an arbitrary number of arguments. They support arguments of type: 17 | - String 18 | - Boolean 19 | - Number 20 | - Type reference 21 | 22 | Resource definitions and properties may be decorated with 0 or more decorations. Note that only a single instance of a decorator is allowed on each element type. I.e. it is invalid to have the @bar decorator listed twice on the same element. 23 | 24 | Decorators are accessible at runtime via the `ModelManager` introspect APIs. This allows tools and utilities to use Concerto to describe a core model, while decorating it with sufficient metadata for their own purposes. 25 | 26 | The example below retrieves the 3rd argument to the foo decorator attached to the myField property of a class declaration: 27 | 28 | ```js 29 | const val = myField.getDecorator('foo').getArguments()[2]; 30 | ``` 31 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/model-properties.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-model-properties 3 | title: Properties 4 | original_id: model-properties 5 | --- 6 | 7 | Class declarations contain properties. Each property has a type which can either be a type defined in the same namespace, an imported type, or a primitive type. 8 | 9 | ### Primitive types 10 | 11 | Concerto supports the following primitive types: 12 | 13 | |Type | Description| 14 | |--- | ---| 15 | |`String` | a UTF8 encoded String. 16 | |`Double` | a double precision 64 bit numeric value. 17 | |`Integer` | a 32 bit signed whole number. 18 | |`Long` | a 64 bit signed whole number. 19 | |`DateTime` | an ISO-8601 compatible time instance, with optional time zone and UTZ offset. 20 | |`Boolean` | a Boolean value, either true or false. 21 | 22 | ### Meta Properties 23 | 24 | |Property|Description| 25 | |---|---| 26 | |`[]` | declares that the property is an array| 27 | |`optional` | declares that the property is not required for the instance to be valid| 28 | | `default` | declares a default value for the property, if no value is specified| 29 | | `range` | declares a valid range for numeric properties| 30 | | `regex` | declares a validation regex for string properties| 31 | 32 | `String` fields may include an optional regular expression, which is used to validate the contents of the field. Careful use of field validators allows Concerto to perform rich data validation, leading to fewer errors and less boilerplate application code. 33 | 34 | The example below validates that a `String` variable starts with `abc`: 35 | 36 | ``` 37 | o String myString regex=/abc.*/ 38 | ``` 39 | 40 | `Double`, `Long` or `Integer` fields may include an optional range expression, which is used to validate the contents of the field. Both the lower and upper bound are optional, however at least one must be specified. The upper bound must be greater than or equal to the lower bound. 41 | 42 | ``` 43 | o Integer intLowerUpper range=[-1,1] // greater than or equal to -1 and less than 1 44 | o Integer intLower range=[-1,] // greater than or equal to -1 45 | o Integer intUpper range=[,1] // less than 1 46 | ``` 47 | 48 | #### Example 49 | 50 | ``` 51 | asset Vehicle { 52 | o String model default="F150" 53 | o String make default="FORD" 54 | o Integer year default=2016 range=[1990,] optional // model year must be 1990 or higher 55 | o String V5cID regex=/^[A-z][A-z][0-9]{7}/ 56 | } 57 | ``` 58 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/model-relationships.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-model-relationships 3 | title: Relationships 4 | original_id: model-relationships 5 | --- 6 | 7 | A relationship in Concerto Modeling Language (CML) is a tuple composed of: 8 | 9 | 1. The namespace of the type being referenced 10 | 2. The type name of the type being referenced 11 | 3. The identifier of the instance being referenced 12 | 13 | Hence a relationship could be: `org.example.Vehicle#123456` 14 | 15 | This would be a relationship to the `Vehicle` _type_ declared in the `org.example` _namespace_ with the _identifier_ `123456`. 16 | 17 | > A relationship can be defined to any *identifiable* type, that is a type that has been declared with either the `identified by` or `identified` properties. 18 | 19 | Relationships are unidirectional and deletes do not cascade, ie. removing the relationship has no impact on the thing that is being pointed to. Removing the thing being pointed to does not invalidate the relationship. 20 | 21 | Relationships must be resolved to retrieve an instance of the object being referenced. The act of resolution may result in null, if the object no longer exists or the information in the relationship is invalid. Resolution of relationships is outside of the scope of Concerto. 22 | 23 | A property of a class may be declared as a relationship using the `-->` syntax instead of the `o` syntax. The `o` syntax declares that the class contains (has-a) property of that type, whereas the `-->` syntax declares a typed pointer to an external identifiable instance. 24 | 25 | In this example, the model declares that an `Order` has-an array of reference to `OrderLines`. Deleting the `Order` has no impact on the `OrderLine`. When the `Order` is serialized the JSON only the IDs of the `OrderLines` are stored within the `Order`, not the `OrderLines` themselves. 26 | 27 | ```js 28 | asset OrderLine identified by orderLineId { 29 | o String orderLineId 30 | o String sku 31 | } 32 | 33 | asset Order identified by orderId { 34 | o String orderId 35 | --> OrderLine[] orderlines 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/ref-errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-ref-errors 3 | title: Errors 4 | original_id: ref-errors 5 | --- 6 | 7 | As much as possible, errors returned by all projects (notably Cicero and the Ergo compiler) are normalized and categorized in order to facilitate handling of those error by the application code. Those errors are raised as JavaScript _exceptions_. 8 | 9 | ## Errors Hierarchy 10 | 11 | The hierarchy of errors (or exceptions) is shown on the following diagram: 12 | 13 | ![Error Hierarchy](assets/exceptions.png) 14 | 15 | ## Errors Model 16 | 17 | For reference, those can also be described using the following Concerto model: 18 | 19 | ```ergo 20 | namespace org.accordproject.errors 21 | /** Common */ 22 | concept LocationPoint { 23 | o Integer line 24 | o Integer column 25 | o Integer offset optional 26 | } 27 | concept FileLocation { 28 | o LocationPoint start 29 | o LocationPoint end 30 | } 31 | concept BaseException { 32 | o String component // Node component the error originates from 33 | o String name // name of the class 34 | o String message 35 | } 36 | concept BaseFileException extends BaseException { 37 | o FileLocation fileLocation 38 | o String shortMessage 39 | o String fileName 40 | } 41 | concept ParseException extends BaseFileException { 42 | } 43 | /* Model errors */ 44 | concept ValidationException extends BaseException { 45 | } 46 | concept TypeNotFoundException extends BaseException { 47 | o String typeName 48 | } 49 | concept IllegalModelException extends BaseFileException { 50 | o String modelFile 51 | } 52 | /* Ergo errors */ 53 | concept CompilerException extends BaseFileException { 54 | } 55 | concept TypeException extends BaseFileException { 56 | } 57 | concept SystemException extends BaseFileException { 58 | } 59 | /* Cicero errors */ 60 | concept TemplateException extends ParseException { 61 | } 62 | ``` -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/ref-web-components-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-ref-web-components-overview 3 | title: Overview 4 | original_id: ref-web-components-overview 5 | --- 6 | 7 | Accord Project publishes [React](https://reactjs.org) user interface components for use in web applications. Please refer to the web-components project [on GitHub](https://github.com/accordproject/web-components) for detailed usage instructions. 8 | 9 | You can preview these components in [the project's storybook](https://ap-web-components.netlify.app/). 10 | 11 | ## Contract Editor 12 | 13 | The Contract Editor component provides a rich-text content editor for contract text with embedded clauses. 14 | 15 | > Note that the contract editor does not currently support the full expressiveness of Cicero Templates. Please refer to the Limitations section for details. 16 | 17 | ### Limitations 18 | 19 | The contract editor does not support templates which use the following CiceroMark features: 20 | 21 | * Lists containing [nested lists](markup-commonmark#nested-lists) 22 | * Templates [list blocks](markup-blocks#list-blocks) 23 | 24 | ## Error Logger 25 | 26 | The Error Logger component is used to display structured error messages from the Contract Editor. 27 | 28 | ## Navigation 29 | 30 | The Navigation component displays an outline view for a contract, allowing the user to quickly navigate between sections. 31 | 32 | ## Library 33 | 34 | The Library component displays a vertical list of library item metadata, and allows the user to add an instance of a library item to a contract. 35 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/started-installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-started-installation 3 | title: Install Cicero 4 | original_id: started-installation 5 | --- 6 | 7 | To experiment with Accord Project, you can install the Cicero command-line. This will let you author, validate, and run Accord Project templates on your own machine. 8 | 9 | ## Prerequisites 10 | 11 | You must first obtain and configure the following dependency: 12 | 13 | * [Node.js (LTS)](http://nodejs.org): We use Node.js to run cicero, generate the documentation, run a development web server, testing, and produce distributable files. Depending on your system, you can install Node either from source or as a pre-packaged bundle. 14 | 15 | > We recommend using [nvm](https://github.com/creationix/nvm) (or [nvm-windows](https://github.com/coreybutler/nvm-windows)) to manage and install Node.js, which makes it easy to change the version of Node.js per project. 16 | 17 | ## Installing Cicero 18 | 19 | To install the latest version of the Cicero command-line tools: 20 | 21 | ```bash 22 | npm install -g @accordproject/cicero-cli 23 | ``` 24 | 25 | :::note 26 | You can install a specific version by appending `@version` at the end of the `npm install` command. For instance to install version `0.20.3` or version `0.13.4`: 27 | ```bash 28 | npm install -g @accordproject/cicero-cli@0.20.3 29 | npm install -g @accordproject/cicero-cli@0.13.4 30 | ``` 31 | ::: 32 | 33 | To check that Cicero has been properly installed, and display the version number: 34 | ```bash 35 | cicero --version 36 | ``` 37 | 38 | To get command line help: 39 | ```bash 40 | cicero --help 41 | cicero parse --help // To parse a sample clause/contract 42 | cicero draft --help // To draft a sample clause/contract 43 | cicero trigger --help // To send a request to a clause/contract 44 | ``` 45 | 46 | ## Optional Packages 47 | 48 | ### Template Generator 49 | 50 | You may also want to install the template generator tool, which you can use to create an empty template: 51 | 52 | ```bash 53 | npm install -g yo 54 | npm install -g @accordproject/generator-cicero-template 55 | ``` 56 | 57 | ## What next? 58 | 59 | That's it! Go to the next page to see how to use your new installation of Cicero on a real Accord Project template. 60 | 61 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/tutorial-hyperledger.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-tutorial-hyperledger 3 | title: With Hyperledger Fabric 4 | original_id: tutorial-hyperledger 5 | --- 6 | 7 | ## Hyperledger Fabric 2.2 8 | 9 | Sample chaincode for Hyperledger Fabric that shows how to execute a Cicero template: 10 | https://github.com/accordproject/hlf-cicero-contract 11 | 12 | Please refer to the project README for detailed instructions on installation and submitting transactions. 13 | 14 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.21/tutorial-vscode.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.21-tutorial-vscode 3 | title: With VS Code 4 | original_id: tutorial-vscode 5 | --- 6 | 7 | Cicero comes with a VS Code extension for easier development and testing. It includes support for syntax highlighting, allows you to test your template (contract parsing and logic) and to create template archives directly within VS Code. 8 | 9 | ## Prerequisites 10 | 11 | To follow this tutorial on how to use the Cicero VS Code extension, we recommend you install the following: 12 | 13 | 1. [Node, LTS version](nodejs.org) 14 | 1. [VS Code](https://code.visualstudio.com) 15 | 1. [Yeoman](https://yeoman.io) 16 | 1. [Accord Project Yeoman Generator](https://github.com/accordproject/cicero/tree/master/packages/generator-cicero-template) 17 | 1. [Camel Tooling Yeoman VS Code extension](https://marketplace.visualstudio.com/items?itemName=camel-tooling.yo) 18 | 1. [Accord Project VS Code extension](https://marketplace.visualstudio.com/items?itemName=accordproject.cicero-vscode-extension) 19 | 20 | ## Video Tutorial 21 | 22 | 23 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.22/tutorial-nodejs.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.22-tutorial-nodejs 3 | title: With Node.js 4 | original_id: tutorial-nodejs 5 | --- 6 | 7 | ## Cicero Node.js API 8 | 9 | You can work with Accord Project templates directly in JavaScript using Node.js. 10 | 11 | Documentation for the API can be found in [Cicero API](ref-cicero-api.html). 12 | 13 | ## Working with Templates 14 | 15 | ### Import the Template class 16 | 17 | To import the Cicero classes for templates and clauses, we'll also import the Cicero engine and some helper utilities 18 | 19 | ```js 20 | const fs = require("fs"); 21 | const path = require("path"); 22 | const { Template, Clause } = require("@accordproject/cicero-core"); 23 | const { Engine } = require("@accordproject/cicero-engine"); 24 | ``` 25 | 26 | ### Load a Template 27 | 28 | To create a Template instance in memory call the `fromDirectory`, `fromArchive` or `fromUrl` methods: 29 | 30 | ```js 31 | const template = await Template.fromDirectory( 32 | "./test/data/latedeliveryandpenalty" 33 | ); 34 | ``` 35 | 36 | These methods are asynchronous and return a `Promise`, so you should use `await` to wait for the promise to be resolved. 37 | 38 | > Note that you'll need to wrap this `await` inside an `async` function or use a [top-level await inside a module](https://v8.dev/features/top-level-await) 39 | 40 | ### Instantiate a Template 41 | 42 | Once a Template has been loaded, you can create a Clause based on the Template. You can either instantiate 43 | the Clause using source DSL text (by calling `parse`), or you can set an instance of the template model 44 | as JSON data (by calling `setData`): 45 | 46 | ```js 47 | // load the DSL text for the template 48 | const testLatePenaltyInput = fs.readFileSync( 49 | path.resolve(__dirname, "text/", "sample.md"), 50 | "utf8" 51 | ); 52 | 53 | const clause = new Clause(template); 54 | clause.parse(testLatePenaltyInput); 55 | 56 | // get the JSON object created from the parse 57 | const data = clause.getData(); 58 | ``` 59 | 60 | ## Executing a Template Instance 61 | 62 | Once you have instantiated a clause or contract instance, you can execute it. 63 | 64 | ### Import the Engine class 65 | 66 | To execute a Clause you first need to create an instance of the `Engine` class: 67 | 68 | ```js 69 | const engine = new Engine(); 70 | ``` 71 | 72 | ### Send a request to the contract 73 | 74 | You can then call `execute` on it, passing in the clause or contract instance, and the request: 75 | 76 | ```js 77 | const request = { 78 | $class: 79 | "org.accordproject.latedeliveryandpenalty.LateDeliveryAndPenaltyRequest", 80 | forceMajeure: false, 81 | agreedDelivery: "2017-10-07T16:38:01.412Z", 82 | goodsValue: 200, 83 | }; 84 | const state = { 85 | $class: "org.accordproject.runtime.State", 86 | }; 87 | 88 | const result = await engine.trigger(clause, request, state); 89 | console.log(result); 90 | ``` 91 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.23.0/ref-migrate-concerto-1.0-2.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.23.0-ref-migrate-concerto-1.0-2.0 3 | title: Concerto 1.0 to 2.0 4 | original_id: ref-migrate-concerto-1.0-2.0 5 | --- 6 | 7 | Concerto `2.0` delivers fundamental improvements over previous releases, whilst maintaining a high-degree (though not total!) of backwards compatibility with `1.x`. In particular all of the `1.x` Concerto syntax remains valid in `2.0`. 8 | 9 | > The release includes over 75 commits, and over 400 files changed. Thank you to all the contributors! 10 | 11 | :::note 12 | We are currently in the process of migrating the Accord Project stack to Concero v2.0. While the migration is underway you may see some components that still depend upon Concerto v1.x. 13 | ::: 14 | 15 | ## Summary of Changes 16 | - Update the Concerto metamodel to [version 0.3](https://models.accordproject.org/concerto/metamodel@0.3.0.html) 17 | - Migrate the Concerto parser from pegjs (no longer maintained) to [peggy](https://peggyjs.org) 18 | - Improvements to Typescript type definitions 19 | - Fixes for JSON Schema generation 20 | - Drop support for Node 12, adding support for Node 16 21 | - Re-organize the code to make `concerto-core` independent of the CTO concrete syntax, moving parsing and CTO generation into the new `concerto-cto` package. 22 | - Add `concerto-util` package for common code 23 | - Add `concerto-vocabulary` package, for managing localized terms for models 24 | - Add `DecoratorManager` to allow decorations on model to be externalized and applied to models 25 | 26 | ## Summary of API Changes 27 | - Added method `declarationKind()` to concept/asset etc to determine the type 28 | - Removed the method `hasInstance` to perform instanceof checks 29 | - `ModelFile.getAst` to return the metamodel for a model 30 | - `ModelManager.addCTOModel` to add a model as a CTO string to a model manager 31 | - `BaseModelManager` to manager models, independent of CTO syntax 32 | - `BaseModelManager.getAst` to get metamodel for a set of models 33 | - `BaseModelManager.fromAst` to create a ModelManager from a metamodel 34 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.30.0/model-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.30.0-model-api 3 | title: Using the API 4 | original_id: model-api 5 | --- 6 | 7 | ## Install the Core Library 8 | 9 | To install the core model library in your project: 10 | ``` 11 | npm install @accordproject/concerto-core --save 12 | ``` 13 | 14 | Below are examples of API use. 15 | 16 | ## Validating JSON data using a Model 17 | 18 | ```js 19 | const ModelManager = require('@accordproject/concerto-core').ModelManager; 20 | const Concerto = require('@accordproject/concerto-core').Concerto; 21 | const modelManager = new ModelManager(); 22 | modelManager.addCTOModel( `namespace org.acme.address 23 | concept PostalAddress { 24 | o String streetAddress optional 25 | o String postalCode optional 26 | o String postOfficeBoxNumber optional 27 | o String addressRegion optional 28 | o String addressLocality optional 29 | o String addressCountry optional 30 | }`, 'model.cto'); 31 | 32 | const postalAddress = { 33 | $class : 'org.acme.address.PostalAddress', 34 | streetAddress : '1 Maine Street' 35 | }; 36 | const concerto = new Concerto(modelManager); 37 | concerto.validate(postalAddress); 38 | ``` 39 | 40 | Now try validating this instance: 41 | 42 | ``` 43 | const postalAddress = { 44 | $class : 'org.acme.address.PostalAddress', 45 | missing : '1 Maine Street' 46 | }; 47 | ``` 48 | 49 | Validation should fail with the message: 50 | 51 | ``` 52 | Instance undefined has a property named missing which is not declared in org.acme.address.PostalAddress 53 | ``` 54 | 55 | ## Runtime introspection of the model 56 | 57 | You can use the Concerto `introspect` APIs to retrieve model information at runtime: 58 | 59 | ``` 60 | const typeDeclaration = concerto.getTypeDeclaration(postalAddress); 61 | const fqn = typeDeclaration.getFullyQualifiedName(); 62 | console.log(fqn); // should equal 'org.acme.address.PostalAddress' 63 | ``` 64 | 65 | These APIs allow you to examine the declared properties, super types and meta-properies for a modelled type. -------------------------------------------------------------------------------- /website/versioned_docs/version-0.30.0/model-namespaces.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.30.0-model-namespaces 3 | title: Namespaces 4 | original_id: model-namespaces 5 | --- 6 | 7 | Each Concerto file starts with the name and version of a single namespace. A Concerto namespace declares a set of *declarations*. A declaration is one of: enumeration, concept, asset, participant, transaction, event. All declarations within a single file belong to the same namespace. 8 | 9 | ```js 10 | namespace org.acme@1.0.0 // declares version 1.0.0 of the org.acme namespace 11 | ``` 12 | 13 | ### Imports 14 | 15 | In order for one namespace to reference types defined in another namespace, the types must be imported for a version of a namespace. 16 | 17 | ## Simple 18 | 19 | ```js 20 | import org.accordproject.address@1.0.0.PostalAddress // imports PostalAddress from version 1.0.0 of the org.accordproject.address namespace 21 | ``` 22 | 23 | ## Multiple Imports 24 | 25 | To import multiple types from the same namespace, use the `{}` syntax: 26 | 27 | ```js 28 | import org.accordproject.address@1.0.0.{PostalAddress,Country} // imports PostalAddress and Country from version 1.0.0 of the org.accordproject.address namespace 29 | ``` 30 | 31 | ## Importing from model published to a public URL 32 | 33 | Import also can use the optional `from` declaration to import a model file that has been deployed to a URL. 34 | 35 | ```js 36 | import org.accordproject.address@1.0.0.PostalAddress from https://models.accordproject.org/address.cto 37 | ``` 38 | 39 | Imports using a `from` declaration can be downloaded into the model manager by calling `modelManager.updateExternalModels`. 40 | 41 | The Model Manager will resolve all imports to ensure that the set of declarations that have been loaded are globally consistent. 42 | 43 | ## Strict:false mode 44 | 45 | For backwards compatability, and when running with `strict:false` imports may import types from unversioned namespaces, or may import all types in a namespace. 46 | 47 | > Please migrate models to use versioned namespaces and imports as this capability will be deprecated and removed in a future major release. 48 | 49 | Imports can be either qualified or can use wildcards. 50 | 51 | ```js 52 | import org.accordproject.address.PostalAddress // import a type from an unversioned namespace 53 | import org.accordproject.address.* // import all types from an unversioned namespace 54 | ``` 55 | 56 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.30.0/ref-concerto-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.30.0-ref-concerto-api 3 | title: Concerto API 4 | original_id: ref-concerto-api 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.30.1/logic-ergo.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.30.1-logic-ergo 3 | title: Ergo Overview 4 | original_id: logic-ergo 5 | --- 6 | 7 | ## Language Goals 8 | 9 | Ergo aims to: 10 | - have contracts and clauses as first-class elements of the language 11 | - help legal-tech developers quickly and safely write computable legal contracts 12 | - be modular, facilitating reuse of existing contract or clause logic 13 | - ensure safe execution: the language should prevent run-time errors and non-terminating logic 14 | - be blockchain neutral: the same contract logic can be executed either on and off chain on a variety of distributed ledger technologies 15 | - be formally specified: the meaning of contracts should be well defined so it can be verified, and preserved during execution 16 | - be consistent with the [Accord Project Templates](accordproject-template.md) 17 | 18 | ## Design Choices 19 | 20 | To achieve those goals the design of Ergo is based on the following 21 | principles: 22 | 23 | - Ergo contracts have a class-like structure with clauses akin to methods 24 | - Ergo can handle types (concepts, transactions, etc) defined with the [Concerto Modeling Language](https://github.com/accordproject/concerto) (so called CML models), as mandated by the Accord Project Template Specification 25 | - Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects 26 | - The compiler guarantees error-free execution for well-typed Ergo programs 27 | - Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration) 28 | - Most of the compiler is written in Coq as a stepping stone for formal specification and verification 29 | 30 | ## Status 31 | 32 | - The current implementation is considered *in development*, we welcome contributions (be it bug reports, suggestions for new features or improvements, or pull requests) 33 | - The current compiler targets JavaScript (either standalone or for use in Cicero Templates and Hyperledger Fabric) and Java (experimental) 34 | 35 | ## This Guide 36 | 37 | Ergo provides a simple expression language to describe computation. From those expressions, one can write functions, clauses, and then whole contract logic. This guide explains most of the Ergo concepts starting from simple expressions all the way to contracts. 38 | 39 | Ergo is a _strongly typed_ language, which means it checks that the expressions you use are consistent (e.g., you can take the square root of `3.14` but not of `"pi!"`). The type system is here to help you write better and safer contract logic, but it also takes a little getting used to. This page also introduces Ergo types and how to work with them. 40 | 41 | -------------------------------------------------------------------------------- /website/versioned_docs/version-0.30.1/ref-web-components-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: version-0.30.1-ref-web-components-overview 3 | title: Overview 4 | original_id: ref-web-components-overview 5 | --- 6 | 7 | Accord Project publishes [React](https://reactjs.org) user interface components for use in web applications. Please refer to the web-components project [on GitHub](https://github.com/accordproject/web-components) for detailed usage instructions. 8 | 9 | You can preview these components in [the project's storybook](https://ap-web-components.netlify.app/). 10 | 11 | ## Contract Editor 12 | 13 | The Contract Editor component provides a rich-text content editor for contract text with embedded clauses. 14 | 15 | > Note that the contract editor does not currently support the full expressiveness of Cicero Templates. Please refer to the Limitations section for details. 16 | 17 | ### Limitations 18 | 19 | The contract editor does not support templates which use the following CiceroMark features: 20 | 21 | * Lists containing [nested lists](markup-commonmark.md#nested-lists) 22 | * List blocks [list blocks](markup-commonmark.md#list-blocks) 23 | 24 | ## Error Logger 25 | 26 | The Error Logger component is used to display structured error messages from the Contract Editor. 27 | 28 | ## Navigation 29 | 30 | The Navigation component displays an outline view for a contract, allowing the user to quickly navigate between sections. 31 | 32 | ## Library 33 | 34 | The Library component displays a vertical list of library item metadata, and allows the user to add an instance of a library item to a contract. 35 | -------------------------------------------------------------------------------- /website/versioned_sidebars/version-0.12-sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "version-0.12-docs": { 3 | "Introduction": [ 4 | "version-0.12-accordproject", 5 | "version-0.12-accordproject-installation", 6 | "version-0.12-accordproject-tooling", 7 | "version-0.12-accordproject-models", 8 | "version-0.12-accordproject-templates", 9 | "version-0.12-accordproject-resources" 10 | ], 11 | "Basic Tutorials": [ 12 | "version-0.12-basic-use", 13 | "version-0.12-basic-templates", 14 | "version-0.12-basic-create" 15 | ], 16 | "Advanced Tutorials": [ 17 | "version-0.12-advanced-latedelivery", 18 | { 19 | "type": "subcategory", 20 | "label": "Template Execution", 21 | "ids": [ 22 | "version-0.12-advanced-nodejs", 23 | "version-0.12-advanced-hyperledger" 24 | ] 25 | } 26 | ], 27 | "Ergo Language Guide": [ 28 | "version-0.12-logic-ergo", 29 | "version-0.12-logic-simple-expr", 30 | "version-0.12-logic-simple-type", 31 | "version-0.12-logic-complex-type", 32 | "version-0.12-logic-advanced-expr", 33 | "version-0.12-logic-stmt", 34 | "version-0.12-logic-decl", 35 | "version-0.12-logic-module" 36 | ], 37 | "Template Specification": [ 38 | "version-0.12-spec-overview", 39 | "version-0.12-spec-concepts", 40 | "version-0.12-spec-example", 41 | "version-0.12-spec-template", 42 | "version-0.12-spec-instance", 43 | "version-0.12-spec-execution", 44 | "version-0.12-spec-packaging" 45 | ], 46 | "Reference Manual": [ 47 | "version-0.12-ref-markup", 48 | "version-0.12-ref-testing", 49 | "version-0.12-ref-logic", 50 | "version-0.12-ref-logic-stdlib", 51 | "version-0.12-ref-logic-specification", 52 | { 53 | "type": "subcategory", 54 | "label": "Command Line Interface", 55 | "ids": [ 56 | "version-0.12-cicero-cli", 57 | "version-0.12-ergo-cli" 58 | ] 59 | }, 60 | { 61 | "type": "subcategory", 62 | "label": "JavaScript API", 63 | "ids": [ 64 | "version-0.12-cicero-api", 65 | "version-0.12-ergo-api" 66 | ] 67 | } 68 | ] 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /website/versioned_sidebars/version-0.13-sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "version-0.13-docs": { 3 | "Introduction": [ 4 | "version-0.13-accordproject", 5 | "version-0.13-accordproject-installation", 6 | "version-0.13-accordproject-tooling", 7 | "version-0.13-accordproject-models", 8 | "version-0.13-accordproject-templates", 9 | "version-0.13-accordproject-resources" 10 | ], 11 | "Basic Tutorials": [ 12 | "version-0.13-basic-use", 13 | "version-0.13-basic-templates", 14 | "version-0.13-basic-create" 15 | ], 16 | "Advanced Tutorials": [ 17 | "version-0.13-advanced-latedelivery", 18 | { 19 | "type": "subcategory", 20 | "label": "Template Execution", 21 | "ids": [ 22 | "version-0.13-advanced-nodejs", 23 | "version-0.13-advanced-hyperledger" 24 | ] 25 | } 26 | ], 27 | "Ergo Language Guide": [ 28 | "version-0.13-logic-ergo", 29 | "version-0.13-logic-simple-expr", 30 | "version-0.13-logic-simple-type", 31 | "version-0.13-logic-complex-type", 32 | "version-0.13-logic-advanced-expr", 33 | "version-0.13-logic-stmt", 34 | "version-0.13-logic-decl", 35 | "version-0.13-logic-module" 36 | ], 37 | "Template Specification": [ 38 | "version-0.13-spec-overview", 39 | "version-0.13-spec-concepts", 40 | "version-0.13-spec-example", 41 | "version-0.13-spec-template", 42 | "version-0.13-spec-instance", 43 | "version-0.13-spec-execution", 44 | "version-0.13-spec-packaging" 45 | ], 46 | "Reference Manual": [ 47 | "version-0.13-ref-markup", 48 | "version-0.13-ref-testing", 49 | "version-0.13-ref-errors", 50 | "version-0.13-ref-logic", 51 | "version-0.13-ref-logic-stdlib", 52 | "version-0.13-ref-logic-specification", 53 | { 54 | "type": "subcategory", 55 | "label": "Command Line Interface", 56 | "ids": [ 57 | "version-0.13-cicero-cli", 58 | "version-0.13-ergo-cli" 59 | ] 60 | }, 61 | { 62 | "type": "subcategory", 63 | "label": "JavaScript API", 64 | "ids": [ 65 | "version-0.13-cicero-api", 66 | "version-0.13-ergo-api" 67 | ] 68 | } 69 | ] 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /website/versions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "0.30.1", 3 | "0.30.0", 4 | "0.23.0", 5 | "0.22", 6 | "0.21", 7 | "0.20", 8 | "0.13", 9 | "0.12" 10 | ] 11 | --------------------------------------------------------------------------------