Overview
This guide covers the basic deployment process for the Flash-Loan Router contracts. The contracts are deployed using Foundry’s scripting system and support deterministic deployment via CREATE2, ensuring the same addresses across all networks.For detailed deployment operations, monitoring, and advanced configuration, see the Operations section.
Deployed Addresses
All contracts are deployed deterministically with CREATE2 and share the same addresses across supported networks:| Contract | Address |
|---|---|
| FlashLoanRouter | 0x9da8B48441583a2b93e2eF8213aAD0EC0b392C69 |
| AaveBorrower | 0x7d9C4DeE56933151Bc5C909cfe09DEf0d315CB4A |
| ERC3156Borrower | 0x47d71b4B3336AB2729436186C216955F3C27cD04 |
networks.json for complete deployment details by chain ID.
Prerequisites
Before deploying, ensure you have:Environment setup
Configure your Load the environment variables:
.env file with the required variables:Deployment Options
Deploy All Contracts
To deploy all contracts (FlashLoanRouter, AaveBorrower, and ERC3156Borrower) in a single transaction:Dry-run the deployment
Simulate the deployment without broadcasting:Review the output to verify:
- Gas estimates
- Contract addresses
- Constructor arguments
Deploy a Single Contract
For deploying individual contracts, use the scripts inscript/single-deployment/:
- FlashLoanRouter
- AaveBorrower
- ERC3156Borrower
Contract Verification
If you need to verify already deployed contracts manually:Deployment Flow
TheDeployAllContracts script follows this sequence:
- Deploy FlashLoanRouter - The main router contract that coordinates flash loans and settlements
- Deploy AaveBorrower - Adapter for Aave flash-loan protocol (requires FlashLoanRouter address)
- Deploy ERC3156Borrower - Adapter for ERC-3156 compatible lenders (requires FlashLoanRouter address)
Updating Deployment Records
After deployment, update thenetworks.json file to track your deployment:
Network Support
The Flash-Loan Router supports deployment to all networks where CoW Protocol is deployed and flash-loan lenders (Aave, Maker, etc.) are available. CoW Protocol is deployed on the following networks:| Network | Chain ID | Type |
|---|---|---|
| Ethereum | 1 | Mainnet |
| Gnosis Chain | 100 | Mainnet |
| Arbitrum One | 42161 | Layer 2 |
| Base | 8453 | Layer 2 |
| Optimism | 10 | Layer 2 |
| Polygon | 137 | Sidechain |
| BNB Smart Chain | 56 | Sidechain |
| Avalanche C-Chain | 43114 | Sidechain |
| Linea | 59144 | Layer 2 |
| Sepolia | 11155111 | Testnet |
Deployment Checklist
Before deploying to production:- Verify all environment variables are set correctly
- Run a dry-run deployment on the target network
- Ensure deployer account has sufficient ETH for gas
- Review gas estimates and contract addresses
- Test deployment on a testnet first
- Verify contracts on block explorer
- Update
networks.jsonwith new deployment addresses - Document any network-specific configuration