Skip to content
Home for all packages related to the Counterfactual project
TypeScript Solidity JavaScript CSS Python Shell Other
Branch: master
Clone or download
rhlsthrm and snario [all] Update node engines (#2494)
* Update node engines

* Bump version

* Update yarn dep
Latest commit 0657a00 Oct 4, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Rename verify-solc job in CircleCI (#2378) Sep 10, 2019
.github Split contracts package into 2: Adjudicator & Funding Protocol (#2084) Aug 1, 2019
bin Remove yarn.lock replacement in heroku buildpack (#1726) Jun 20, 2019
packages [all] Update node engines (#2494) Oct 4, 2019
patches Make patch-package warning go away (#2319) Sep 3, 2019
.editorconfig fix #393 use solc binary for fast contract compilation (#1204) Apr 9, 2019
.gitattributes Init commit. Feb 28, 2018
.gitignore [greenboard] Adds Login scenario (#2134) Aug 7, 2019
.nvmrc Add .nvmrc and regenerate yarn.lock (#1544) May 27, 2019
.soliumrc.json [all] Introduction of AppRegistry and significant code improvements t… Dec 27, 2018
.yarnrc Typescript+lerna+yarn-monorepo (#80) Jun 27, 2018 Create (#173) Nov 6, 2018
LICENSE Single license for all packages (#131) Oct 20, 2018 Bulk dependencies update (#2231) Aug 20, 2019 [greenboard] Fallbacks to $(which python2.7) if no PYTHON env var exi… Aug 15, 2019 [greenboard] small fixes (#2292) Aug 28, 2019
jest.config.js Roll up jest.config.js files into default monorepo one (#2012) Jul 26, 2019
lerna.json Publish to npm if versions are bumped in source code (#895) Mar 1, 2019
logo.svg 🛠 Ensure `yarn build` and `yarn test` work as expected (#143) Oct 23, 2018
package.json Node version (#2492) Oct 1, 2019
renovate.json [monorepo] Remove Dapps + Bots + Playground from Monorepo (#2141) Aug 9, 2019
tsconfig.json [node] Add appSeqNo to engine input parameters (#2320) Sep 3, 2019
tslint.json [node] Remove need for mnemonic, use extended private key (#2075) Aug 1, 2019
waffle.js [monorepo] commit contract build artifacts (#2293) Aug 29, 2019
yarn.lock Update deps (#2491) Sep 30, 2019


Simple off-chain applications framework for Ethereum.

circleci license

Counterfactual is a simple off-chain framework for building state channel applications on top of the Ethereum blockchain. It aims to make it simpler to build permissionless applications that have instant finality with zero-fee transactions.

You can learn more about what state channels are by reading our whitepaper or a less technical written description. Further, if you want to dive into the specifications of the Counterfactual protocol you can read them here.

🚨 WARNING: the code found here has been created for demonstration and example purposes, with developers looking to build state channel applications as the intended audience and user-base. This code is not yet intended for production use with real funds, assets or users. In particular, specific safety measures have been intentionally omitted from this early version for the sake of simplicity, and various pieces of its architecture (e.g., the messaging layer) use trust assumptions that, while appropriate to a "playtesting" development environment, would have serious consequences if used to protect actual assets in the real world. This framework, once further developed, finalized, and hardened, is intended to eventually become a tool that will be used in production deployments. If you have those use cases in mind we welcome your participation and feedback now, to ensure that early production versions will meet your needs. But please don't deploy this framework in its current form. That is not its intended use.


Solidity Packages

Package Version Description
@counterfactual/cf-funding-protocol-contracts npm Contracts implementation of the Counterfactual funding protocol
@counterfactual/cf-adjudicator-contracts npm Contracts implementation of an AppInstance Adjudicator

Typescript/Javascript Packages

Counterfactual-specific packages

Package Version Description
@counterfactual/node npm The core state channels client that a user runs
@counterfactual/cf.js npm A JS API for interacting with off-chain apps
@counterfactual/node-provider npm Wrapper around API calls to a Node


Package Version Description
@counterfactual/types npm Shared type declarations
@counterfactual/typescript-typings npm Shims for external library typings


Ethereum Networks

The Playground currently only supports the Kovan network.

Installing dependencies

Make sure you have Yarn v1.17.3 installed. For easy management of specific Yarn versions, we recommend using Yarn Version Manager (YVM).

To install the dependencies:


Building packages

It is recommended (optional) that you installed solc compiler binary on your machine (installation guide) and specify the following in your .env under cf-funding-protocol-contracts and apps


To build all packages:

yarn build


To clean all packages:

yarn clean


To lint all packages:

yarn lint

To also apply automatic fixes:

yarn lint:fix


To run all tests:

yarn test

To run E2E tests:

  • If you're using E2E tests for the first time or have done recent changes to the code, run:
yarn test:e2e:setup
  • If you're re-running tests or writing new scenarios, run:
NODE_EXTENDED_PRIVATE_KEY="..." yarn test:e2e

See the "Funding the Hub Account for Playground Testing" section on the Simple Hub Server package for more information about NODE_EXTENDED_PRIVATE_KEY.


We generate patches using the patch-package tool with a workaround described in this issue for yarn workspaces.

You can’t perform that action at this time.