Introduction to Developing on Morph
Building on Morph L2 chains mirrors Ethereum's development experience. With seamless compatibility across popular frameworks like Hardhat, Foundry, and ethers.js, deploying contracts requires minimal adjustments. This guide provides step-by-step network configurations for both Morph Mainnet and Holesky Testnet, along with optimized code snippets for each development tool.
👉 Discover Morph's RPC endpoints
Mainnet Development Setup
Network Configuration
Essential parameters for connecting to Morph Mainnet:
| Parameter | Morph Mainnet | Ethereum Mainnet |
|---|---|---|
| RPC URL | https://rpc-quicknode.morphl2.io | https://ethereum-rpc.publicnode.com/ |
| Chain ID | 2818 | 1 |
| Currency Symbol | ETH | ETH |
| Block Explorer | Morph Explorer | Etherscan |
WebSocket Connection: wss://rpc-quicknode.morphl2.io
Framework-Specific Setup
Hardhat Configuration
Update hardhat.config.ts to target Morph Mainnet:
const config: HardhatUserConfig = {
networks: {
morphl2: {
url: 'https://rpc-quicknode.morphl2.io',
accounts: [process.env.PRIVATE_KEY || ''],
gasPrice: 1000000000
}
}
};Foundry Deployment
Deploy contracts using:
forge create --rpc-url=https://rpc-quicknode.morphl2.io --legacyethers.js Provider
Instantiate a Morph provider:
import { ethers } from 'ethers';
const provider = new ethers.providers.JsonRpcProvider(
'https://rpc-quicknode.morphl2.io'
);Holesky Testnet Setup
Network Configuration
Testnet parameters for development and debugging:
| Parameter | Morph Holesky | Holesky Testnet |
|---|---|---|
| RPC URL | https://rpc-quicknode-holesky.morphl2.io | https://ethereum-holesky-rpc.publicnode.com/ |
| Chain ID | 2810 | 17000 |
| Currency Symbol | ETH | ETH |
| Block Explorer | Morph Holesky Explorer | Holesky Etherscan |
WebSocket Connection: wss://rpc-quicknode-holesky.morphl2.io
Framework-Specific Testnet Setup
Hardhat Configuration
const config: HardhatUserConfig = {
networks: {
morphl2: {
url: 'https://rpc-quicknode-holesky.morphl2.io',
accounts: [process.env.PRIVATE_KEY || ''],
gasPrice: 2000000000
}
}
};Foundry Deployment
forge create --rpc-url=https://rpc-quicknode-holesky.morphl2.io --legacyethers.js Provider
const provider = new ethers.providers.JsonRpcProvider(
'https://rpc-quicknode-holesky.morphl2.io'
);Acquiring Testnet ETH
To fuel your Holesky Testnet transactions:
Use Faucets:
Morph-Specific Options:
- Morph Faucet (ETH & USDT)
- Discord Faucet
👉 Bridge Holesky ETH to Morph
FAQ
Q: Why does Morph use zkEVM?
A: zkEVM enables Ethereum-level security with L2 scalability, allowing developers to use existing Ethereum tooling.
Q: Can I reuse my Ethereum private keys on Morph?
A: Yes! Morph is EVM-compatible—your existing keys work without modification.
Q: How do I check my Holesky transaction status?
A: Use the Holesky Etherscan block explorer.
Q: Is there a gas fee difference between Mainnet and Testnet?
A: Testnet fees are simulated (often lower) for development purposes.
Key Takeaways
- Ethereum Parity: Morph’s EVM equivalence means zero learning curve for Ethereum devs.
- Cross-Chain Flexibility: Deploy once on Holesky, then migrate seamlessly to Mainnet.
- Cost Efficiency: Testnet faucets eliminate financial barriers to experimentation.
For advanced documentation, refer to Morph’s official docs.