{"id":13617041,"url":"https://github.com/kadena-io/pact","last_synced_at":"2025-06-18T19:07:40.631Z","repository":{"id":38320588,"uuid":"73597023","full_name":"kadena-io/pact","owner":"kadena-io","description":"The Pact Smart Contract Language","archived":false,"fork":false,"pushed_at":"2025-03-13T06:08:25.000Z","size":15362,"stargazers_count":591,"open_issues_count":122,"forks_count":106,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-14T03:39:33.818Z","etag":null,"topics":["blockchain","pact","smart-contracts"],"latest_commit_sha":null,"homepage":"https://docs.kadena.io/build/pact","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kadena-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-11-13T05:16:00.000Z","updated_at":"2025-04-10T09:47:45.000Z","dependencies_parsed_at":"2023-02-19T10:10:40.654Z","dependency_job_id":"c3b0bba9-f87c-4898-9413-e9682206eacd","html_url":"https://github.com/kadena-io/pact","commit_stats":null,"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"purl":"pkg:github/kadena-io/pact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadena-io%2Fpact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadena-io%2Fpact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadena-io%2Fpact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadena-io%2Fpact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kadena-io","download_url":"https://codeload.github.com/kadena-io/pact/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadena-io%2Fpact/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260616578,"owners_count":23036868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","pact","smart-contracts"],"created_at":"2024-08-01T20:01:36.212Z","updated_at":"2025-06-18T19:07:35.618Z","avatar_url":"https://github.com/kadena-io.png","language":"Haskell","funding_links":[],"categories":["Projects","Smart Contract Platforms","Haskell"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/img/kadena-logomark-green.png\" alt=\"Kadena Logo\" title=\"Kadena\"\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n# The Pact Programming Language\n\n[![Build Status](https://travis-ci.org/kadena-io/pact.svg?branch=master)](https://travis-ci.org/kadena-io/pact)\n\n\n[Pact](http://kadena.io/build) is an open-source, Turing-**in**complete smart contract language that has been purpose-built with blockchains first in mind. Pact focuses on facilitating transactional logic with the optimal mix of functionality in authorization, data management, and workflow.\n\nRead the whitepaper:\n\n- [The Pact Smart Contract Language](https://d31d887a-c1e0-47c2-aa51-c69f9f998b07.filesusr.com/ugd/86a16f_442a542b64554cb2a4c1ae7f528ce4c3.pdf)\n\nFor additional information, press, and development inquiries, please refer to the Kadena [website](https://kadena.io)\n\n\n## Table Of Contents\n\n- [Tutorials](#tutorials)\n- [Documentation](#documentation)\n- [Quickstart](#quickstart)\n- [Installing Pact](#installing-pact)\n  - [Binary Downloads](#binary-downloads)\n  - [Instructions for Mac users](#instructions-for-mac-users)\n  - [Instructions for Linux users](#instructions-for-linux-users)\n  - [Building from Source](#building-from-source)\n  - [Verifying Installation](#verifying-installation)\n- [Supported Editors](#supported-editors)\n  - [Chainweaver](#chainweaver)\n  - [In Browser](#in-browser)\n  - [Atom](#atom)\n  - [VS Code](#vs-code)\n  - [Emacs](#emacs)\n  - [Vim](#vim)\n- [The Pact REST Api](#the-pact-rest-api)\n  - [Documentation](#api-documentation)\n  - [Pact REST Api Server](#rest-api-server)\n  - [Related Projects](#related-projects)\n- [License](#license)\n\n## Tutorials\n\nExtensive tutorials on every facet of the Pact language may be found [on docs.kadena.io](https://docs.kadena.io/learn-pact/intro). Additionally, users may find example scripts in Kadena's [pact-examples](https://github.com/kadena-io/pact-examples) repository, in the [examples](https://github.com/kadena-io/pact/tree/master/examples) directory, and in production as part of the [Kadena Public Blockchain](https://github.com/kadena-io/chainweb-node/).\n\n## Documentation\n\nThe Pact language specification, API documentation, features, motivations, and in-depth tutorial content may be found [here](http://pact-language.readthedocs.io).\n\nDocumentation is always in flux, and corrections to out of date documentation are always appreciated. Feel free to do so if you find such an error by opening an [issue](https://github.com/kadena-io/pact/issues).\n\n\n## Quickstart\n\nThe easiest and quickest way to try Pact is [in the browser](http://pact.kadena.io), or via the Chainweaver [wallet](https://github.com/kadena-io/chainweaver). Both environments support error and warning highlighting, as well as an in-app REPL environment for you to test out your code immediately. The Kadena docs also include a [developer quickstart](https://docs.kadena.io/basics/quickstart).\n\n## Installing Pact\n\n\n### Binary Downloads\n\nPact can be installed via ready-to-use binary downloads for Linux or Mac by following the instructions below:\n\n- Install [z3](https://github.com/Z3Prover/z3/wiki) `\u003e= 4.11.2`.\n- Download the [prebuilt binaries](https://github.com/kadena-io/pact/releases) for either Linux or Mac, depending on your OS.\n- Once you've downloaded the binary, make sure that it is marked as executable by running `chmod +x \u003cexecutable-file\u003e`.\n- Put the binary somewhere in your PATH.\n\nOnce you have Pact in your path, proceed to validating your installation by trying out [the repl](#verifying-installation).\n\n\n\n### Instructions for Mac Users\n\n#### Using Brew\n\nOn Mac, the easiest way to install pact is with Homebrew. Make sure that Homebrew has been installed in your machine. Instructions for how to install it can be found [here](https://brew.sh). Once Homebrew is installed, run the following command to install pact:\n\n\n```bash\nbrew update\nbrew install kadena-io/pact/pact\n```\n\nIf you want to install from source, see [building from source](#building-from-source)\n\n### Instructions for Linux Users\n\nLinux is supported both in terms of ready-to-use binary downloads (see [Binary Downloads](#binary-downloads)) and building from source. For installing `pact` on Linux distributions in the Arch family, refer to [this package on the AUR](https://aur.archlinux.org/packages/pact/). Otherwise, please refer to [building from source](#building-from-source).\n\n### Building from Source\n\n#### Dependencies\n- (Mac only) Homebrew: `brew install git`\n- (Linux/Mac) [Installer](https://git-scm.com/downloads)\n\nTo get the code, you can go [here](https://github.com/kadena-io/pact/releases/). Once you have the code, we can pick a build tool.\n\n#### Building with Cabal\n\n[Cabal](https://www.haskell.org/cabal/) is the preferred way to manage packages by the Haskell community. You will need a version of GHC\ninstalled on your machine to use it.\n\n##### Dependencies\n\n- `ghc \u003e= 9.6` (Haskell compiler) and `cabal \u003e= 2.2` (Haskell build-tool)\n  - The easiest way to get this is to install it using (Linux/Mac) [ghcup](https://www.haskell.org/ghcup/) and issue `ghcup install 9.6.2`, followed by `ghcup install-cabal`.\n  - ghc may also be installed via brew, issuing `brew install ghc` and `brew install cabal-install`.\n\n(You may also need to install `zlib`, `z3`, and `sqlite`)\n\nTo build a Pact binary:\n\n```bash\n# Only necessary if you haven't done this recently.\ncabal v2-update\n\n# Build the project.\ncabal v2-build\n```\n\nOn some systems the default build might fail with linker errors complaining about cryptonite and ed25519, try:\n\n```bash\n# configure cabal\ncabal v2-configure -f cryptonite-ed25519\n\n# Build the project.\ncabal v2-build\n```\n\n\nThis will install a runnable version of Pact, which you can run via:\n\n```bash\ncabal v2-exec pact\n```\n\nAlternatively, running `cabal v2-install exe:pact` inside this repository's root will install the binary to `~/.cabal/bin/`, which\nyou may need to add to your path. Then, you can call `pact` as-is.\n\n#### Building with Nix\n\nThe fastest way to build and run Pact is to use the Nix package manager\nwhich has binary caching capabilities that allow you to download pre-built\nbinaries for everything needed by Pact.\nWe use nix flakes (which requires users to set `--experimental-features \"nix-command flakes\"`)\nto build pact and its dependencies. For detailed instructions see [our\n￼wiki](https://github.com/kadena-io/pact/wiki/Building-Kadena-Projects).\n\nTo build the Pact executable:\n```bash\nnix build\n```\nWhen the build is finished, you can run Pact with the following command:\n\n```bash\n./result/bin/pact\n```\n\n### Verifying Installation\n\nTest by issuing `pact` in a terminal or by executing your binary. Try out some commands:\n\n```\n$ pact\npact\u003e (+ 1 2)\n3\npact\u003e (+ \"hello, \" \"world\")\n\"hello, world\"\n```\n\n\n## Supported Editors\n\nPact is supported by a variety of editors ranging from full-fledged IDE environments to syntax highlighting.\nMoreover, we also provide a Pact Language Server, which can be seamlessly integrated with a wide range of editors.\nThe Pact Language Server can be found [here](https://github.com/kadena-io/pact-lsp).\n\n### Chainweaver\n\nThe Chainweaver [wallet](https://github.com/kadena-io/chainweaver) is the Kadena's wallet, offering a seamless IDE experience and wallet in one. It supports a full in-app REPL, code preview, error/warning highlighting, code deployment, key generation, and integration with existing Kadena blockchains.\n\n### In-Browser\n\nAn implementation of Chainweaver exists [in the browser](http://pact.kadena.io), if you do not wish to download the wallet.\n\n### Atom\n\nFor a full-fledged IDE experience, install the [Atom](https://atom.io)  editor along with `language-pact` using the [atom package manager](http://flight-manual.atom.io/using-atom/sections/atom-packages/).\n\n### VS Code\n\nThe Pact language has community support for VS Code via the [pact-vscode](https://github.com/kadena-community/pact-vscode) package. (https://github.com/kadena-community/pact-vscode)\n\n### Emacs\n\nEmacs has [`pact-mode`](https://melpa.org/#/pact-mode) support via MELPA, along with [`flycheck-pact`](https://melpa.org/#/flycheck-pact) for on-the-fly error highlighting. Download `pact-mode` and (optionally) `flycheck-pact` by opening Emacs and issuing `M-x package-list-packages`, syncing MELPA, and installing by name. Then, in your `init.el` or `.emacs`, include\n\n```elisp\n(use-package pact-mode\n  :ensure t\n  :config\n  ;; optionally\n  (require 'flycheck-pact))\n```\n\nIf you've chosen to include `flycheck-pact`, you can start the interactive buffer and trace by calling `flycheck-pact-toggle-trace` and `flycheck-pact-interactive-buffer`.\n### Vim\n\nIf you are a [vim](https://vim.org) user, the [vim-pact](https://github.com/wsdjeg/vim-pact) plugin provides support for the pact syntax.\n\n## The Pact REST Api\n\n### Api Documentation\n\nThe REST API is documented at [http://pact-language.readthedocs.io/en/latest/pact-reference.html#rest-api](http://pact-language.readthedocs.io/en/latest/pact-reference.html#rest-api).\n\n### Pact REST API Server\n\nPact features a full REST API HTTP server and SQLite database implementation, making\nblockchain application development painless and easy. The Pact server simulates a single-node blockchain environment, with the same API supported by the Kadena ScalableBFT blockchain.\n\nTo start the server, issue\n\n```bash\npact --serve CONFIG\n```\n\nor\n\n```\npact -s CONFIG\n```\n\nwhere CONFIG is a valid [config.yaml](config.yaml).\n\n\n#### Hosting static files.\n\nThe HTTP server will host any static files it finds in its working directory.\n\n#### Config file format\n\nThe pact dev server (pact-serve) requires a configuration Yaml file (e.g. server.conf) to operate. The documentation for it is:\n\n```\nconsole\u003e pact --serve --help\nConfig file is YAML format with the following properties:\nport       - HTTP server port\npersistDir - Directory for database files.\n             If omitted, runs in-memory only.\nlogDir     - Directory for HTTP logs\npragmas    - SQLite pragmas to use with persistence DBs\nverbose    - [True|False] Provide extra logging information\n```\n\n#### Replay from disk.\n\nWhen running pact-serve with persistence enabled, the server automatically replays from the database\n`commands.sqlite` in the persist dir. To prevent replay, simply delete this file before starting the server.\n\n### Related Projects\n\n* The [pact-lang-api](https://www.npmjs.com/package/pact-lang-api) `npm` package provides a JavaScript library to aid interaction with the API.\n\n* The [pact-todomvc](https://github.com/kadena-io/pact-todomvc) is a working demonstration.\n\n\n## License\n\nThis code is distributed under the terms of the BSD3 license. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadena-io%2Fpact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadena-io%2Fpact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadena-io%2Fpact/lists"}