Deployment Overview
ENS contracts use Hardhat Deploy for managing deployments across networks. Deployment scripts are versioned and only run once per network.Network Configuration
The project supports multiple networks configured inhardhat.config.ts:
- Mainnet - Ethereum mainnet
- Sepolia - Sepolia testnet
- Holesky - Holesky testnet
- Optimism - Optimism L2
- Arbitrum - Arbitrum L2
- Localhost - Local development network
Deployment Commands
Deploy to Network
Deploy L2 Contracts
For Layer 2 deployments:L2ReverseRegistrar and UniversalSigValidator to L2 networks.
Deployment Scripts
Deployment scripts are organized by module in thedeploy/ directory:
Deployment Testing
Using Tenderly Virtual TestNet
For staging environments:- Create a Tenderly Virtual TestNet
- Update network configuration with Tenderly RPC URL
- Deploy using the standard deployment command
Deployment with Impersonation
When you need to deploy without direct access to owner accounts:Environment Setup
Required Environment Variables
Create a.env file with:
Account Configuration
The Hardhat config uses two accounts:- DEPLOYER_KEY - Account for deploying contracts
- OWNER_KEY - Account for ownership operations
Versioning Deployment Scripts
When preparing a new deployment:Bump version number
Update the deploy script version to the appropriate new version. This ensures the script will run for each network.
L2 Deployment Details
Unified Contract Addresses
L2 contracts (L2ReverseRegistrar) maintain the same address across networks using:
- Safe multisig wallets
- CREATE3 helper contract
- Testnet:
0x343431e9CEb7C19cC8d3eA0EE231bfF82B584910 - Mainnet:
0x353530FE74098903728Ddb66Ecdb70f52e568eC1
Deployment Artifacts
After deployment, artifacts are stored in:- Contract deployment JSON files
- Contract addresses
- Constructor arguments
- Transaction hashes
Verifying Contracts
Verify deployed contracts on Etherscan:Post-Deployment Steps
Troubleshooting
Deployment fails with 'already deployed' error
Deployment fails with 'already deployed' error
This means the script has already run for this network. To redeploy, remove the deployment artifacts from
deployments/<network>/.Insufficient funds error
Insufficient funds error
Ensure your deployer account has enough ETH for gas fees:
Contract verification fails
Contract verification fails
Check that:
- Etherscan API key is correct
- Contract was deployed with correct compiler settings
- Constructor arguments match deployment
Related Resources
Release Flow
See the complete release process
Testing Guide
Learn how to test deployments