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 | bashRemember to run foundryup in a new terminal after running this command.
curl -L get.huff.sh | bashRemember to run huffupp in a new terminal after running this command.
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 | shgit clone --recurse-submodules https://github.com/renegade-fi/renegade-contractsforge test --ffi -vvAssuming you have installed foundry and cargo, you can run the integration tests directly with:
./script/bin/run-integration-tests.sh --releaseThis will:
- Start an
anvilnode - 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> --wethYou 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