This repository contains the solidity code for Renegade's settlement contracts. The contracts encapsulate the Merklized exchange state, PlonK verifier, and settlement logic which together compose the Renegade darkpool.
Please refer to our whitepaper and docs for an introduction the Renegade protocol as a whole.
curl -L https://foundry.paradigm.xyz | bash
curl -L get.huff.sh | bash
The integration tests are written in rust, and the unit test use rust reference implementations:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone --recurse-submodules https://github.com/renegade-fi/renegade-solidity-contracts
forge test --ffi -vv
Assuming you have installed foundry and cargo, you can run the integration tests directly with:
./scripts/run-integration-tests.sh --release
This will:
- Start an
anvil
node - Deploy the Renegade contracts to the node
- Run the integration tests against the node. These tests simulate a rust-based client interacting with the darkpool.
The repository includes several helpful tools for development and deployment.
To deploy Renegade contracts to an EVM chain:
./script/bin/deploy.sh --rpc-url <RPC_URL> --pkey <PRIVATE_KEY>
This will prompt for any missing configuration values like fee rates and contract addresses.
For testing purposes, you can deploy dummy ERC20 tokens or a WETH mock:
# Deploy a regular ERC20 token (will prompt for name, symbol, and decimals)
./script/bin/deploy-token.sh --rpc-url <RPC_URL> --pkey <PRIVATE_KEY>
# Deploy a WETH mock
./script/bin/deploy-token.sh --rpc-url <RPC_URL> --pkey <PRIVATE_KEY> --weth
You can also specify token details directly:
# Deploy with all parameters specified
./script/bin/deploy-token.sh --rpc-url <RPC_URL> --pkey <PRIVATE_KEY> --name "My Token" --symbol "TKN" --decimals 18