Deployment

Framework

To deploy Superfluid to any EVM compatible chain is easy, here is a short guide of how to do it:

$ git clone <https://github.com/superfluid-finance/protocol-monorepo/>
$ yarn install --frozen-lockfile
$ yarn build
$ cd packages/ethereum-contracts
$ cp .env.template .env
$ # edit .env file and configure the correct mnemonic and rpc endpoint
$ # check truffle-config.js for what environment variables are required
$ RELEASE_VERSION=v1 ENABLE_APP_WHITELISTING=1 NEW_TEST_RESOLVER=1 npx truffle --network xdai exec scripts/deploy-framework.js

Note RELEASE_VERSION=v1, is our versioning requirement.

Note ENABLE_APP_WHITELISTING=1, we want to enable app whitelisting on mainnets.

Note NEW_TEST_RESOLVER=1, is to avoid using the official resolver address. Doing so after the command finishes, you should see:

...
======== Super token deployed ========
=============== TEST ENVIRONMENT RESOLVER ======================
export TEST_RESOLVER_ADDRESS=*{ test resolver address }*

By exporting the TEST_RESOLVER_ADDRESS variable, you could then interact with your own deployment of the Superfluid protocol.

Create SuperTokens

SuperToken for Native Tokens

Side chain have their own native tokens. xDai for xDAI chain, and Matic for Polygon (ex. Matic)

For these native tokens, a special type of super token is needed. To deploy it:

  1. First check packages/js-sdk/src/getConfig.js to see for each chain what the symbol (case-sensitive) for the native token is (nativeTokenSymbol configuration key).
  2. To deploy the native token (xDAI as an example):
$ WETH_ADDRESS=*{ wrapped contract address }* npx truffle --network xdai exec scripts/deploy-super-token.js : *xDAI*

Note on WETH_ADDRESS: this refers to the "canonical" wrapped version of the native asset, not WETH itself.

ERC20 Token Wrapper