Skip to content

Deploy EtherSwap & ERC20Swap Contracts on Citrea Mainnet #104

@TaprootFreak

Description

@TaprootFreak

Overview

Once Citrea Mainnet launches, we need to deploy the Boltz swap contracts to enable cross-chain bridging functionality. This issue documents the complete deployment process.

Prerequisites

  • Citrea Mainnet is live (currently in final audit phase)
  • Deployer wallet with sufficient cBTC for gas fees
  • Access to Citrea Mainnet RPC endpoint
  • Foundry toolchain installed

Contracts to Deploy

Contract Purpose Source
EtherSwap Atomic swaps for native cBTC EtherSwap.sol
ERC20Swap Atomic swaps for ERC20 tokens (USDT.e, WBTC.e, JUSD) ERC20Swap.sol

Deployment Instructions

1. Install Foundry

curl -L https://foundry.paradigm.xyz | bash
foundryup

2. Clone Repository

git clone https://github.com/LightningDotSpace/boltz-core.git
cd boltz-core

3. Install Dependencies

forge install

4. Configure Environment

Create a .env file:

CITREA_MAINNET_RPC=<RPC_URL>          # Get from Citrea docs when available
DEPLOYER_PRIVATE_KEY=<PRIVATE_KEY>    # Wallet with cBTC for gas
CITREA_CHAIN_ID=<CHAIN_ID>            # Will be published at mainnet launch

5. Deploy Contracts

Option A: Using the Deploy Script

source .env

forge script contracts/script/Deploy.sol \
  --rpc-url $CITREA_MAINNET_RPC \
  --private-key $DEPLOYER_PRIVATE_KEY \
  --broadcast \
  --verify

Option B: Deploy Individually (Recommended for Production)

# Deploy EtherSwap
forge create contracts/EtherSwap.sol:EtherSwap \
  --rpc-url $CITREA_MAINNET_RPC \
  --private-key $DEPLOYER_PRIVATE_KEY \
  --verify

# Deploy ERC20Swap  
forge create contracts/ERC20Swap.sol:ERC20Swap \
  --rpc-url $CITREA_MAINNET_RPC \
  --private-key $DEPLOYER_PRIVATE_KEY \
  --verify

6. Verify Deployment

After deployment, verify the contracts on the Citrea block explorer:

forge verify-contract <DEPLOYED_ADDRESS> contracts/EtherSwap.sol:EtherSwap \
  --chain-id $CITREA_CHAIN_ID \
  --verifier blockscout \
  --verifier-url <CITREA_EXPLORER_API>

Post-Deployment Tasks

  • Document deployed contract addresses
  • Update infrastructure/config/boltz/backend/prd-boltz.conf:
    [[Citrea.contracts]]
    symbol = "cBTC"
    address = "<DEPLOYED_ETHERSWAP_ADDRESS>"
    
    [[Citrea.contracts]]
    symbol = "ERC20"
    address = "<DEPLOYED_ERC20SWAP_ADDRESS>"
  • Update monitoring configuration for new addresses
  • Test swap functionality on mainnet

Reference: Testnet Deployment

For reference, here are the currently deployed testnet contracts:

Contract Testnet Address
EtherSwap 0xd02731fD8c5FDD53B613A699234FAd5EE8851B65
ERC20Swap 0xf2e019a371e5Fd32dB2fC564Ad9eAE9E433133cc

Resources

Blocking

This task is blocked until Citrea Mainnet launches. Monitor Citrea's blog for updates.


Related PR: #86

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions