Raiden Network Smart Contracts
Clone or download
loredanacirstea Merge pull request #370 from pirapira/release
Add a draft of a release process document
Latest commit 9fd2124 Dec 12, 2018


Raiden Network Smart Contracts

Chat on Gitter

Raiden Network Smart Contract specs




pip install raiden-contracts


We do not recommend the smart contracts to be used in production as of this moment. All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use at your own risk.

If you want to use the officially deployed contracts, please use the raiden_contracts/data/contracts.json file to get the ABI and bytecode for initializing the contract instances.

You can find the addresses of the deployed contracts in raiden_contracts/, along with other useful constants that you can import.

If you are using the raiden-contracts package in your project, you can use:

from raiden_contracts.contract_manager import (
from raiden_contracts.constants import (

manager = ContractManager(contracts_precompiled_path())
compiled_contract_data = manager.get_contract(CONTRACT_TOKEN_NETWORK_REGISTRY)

deployment_data = get_contracts_deployed(int(

# And then use:
# compiled_contract_data['abi']
# compiled_contract_data['bin']
# to initialize the contract instance

All contracts under raiden_contracts/contracts/test/ are only for testing purposes and they should not be used in production.


If you want to test and further develop outside the officially provided source code, compiled files and deployed addresses, you can do it at your own risk.

If you want to install the package from source:

make install

To verify that the precompiled raiden_contracts/data/contracts.json file corresponds to the source code of the contracts:

make verify_contracts

For development and testing, you have to install additional dependencies:

pip install -r requirements-dev.txt

Compile the contracts

Make sure you have solc installed:

make compile_contracts


# tests
pytest raiden_contracts/tests/

# Recommended for speed:
pip install pytest-xdist==1.17.1
pytest -n NUM_OF_CPUs

If you are using the raiden-contracts package in your project, you can also test the source code directly (not only the precompiled contract data):

from raiden_contracts.contract_manager import (

manager = ContractManager(contracts_source_path())

Deployment on a testnet

Check deployment options:

python -m raiden_contracts.deploy --help

Deploying the main Raiden Network contracts with the raiden command:

python -m raiden_contracts.deploy raiden --rpc-provider --private-key /path/to/your/private_key/file --gas-price 10 --gas-limit 6000000

Deploying a token for testing purposes (please DO NOT use this for production purposes) with the token command:

python -m raiden_contracts.deploy token --rpc-provider --private-key /path/to/your/private_key/file --gas-price 10 --token-supply 10000000 --token-name TestToken --token-decimals 18 --token-symbol TTT

Registering a token with the TokenNetworkRegistry contract, so it can be used by the Raiden Network, with the register command:

python -m raiden_contracts.deploy register --rpc-provider --private-key /path/to/your/private_key/file --gas-price 10 --token-address TOKEN_TO_BE_REGISTERED_ADDRESS --registry-address TOKEN_NETWORK_REGISTRY_ADDRESS

Deployment information is stored in a deployment_[CHAIN_NAME].json file corresponding to the chain on which it was deployed. To verify that the deployed contracts match the compiled data in contracts.json and also match the deployment information in the file, we can run:

python -m raiden_contracts.deploy verify --rpc-provider

# Based on the network id, the script verifies the corresponding deployment_[CHAIN_NAME].json file
# using the chain name-id mapping from

Verification with Etherscan

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name EndpointRegistry --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name SecretRegistry --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name TokenNetworkRegistry --chain-id 3

Making a Release

See Release Process Document.