A lightweight CLI tool to quickly scaffold Morph blockchain applications with a clean, production-ready structure.
npx @morphl2/create-morph-app@latest
This will guide you through creating a new Morph application with a simple interactive prompt.
- Streamlined Setup: Create a complete Morph application with a single command
- Modern Stack: Next.js frontend with Web3 integration
- Dual Smart Contract Development: Includes both Hardhat and Foundry environments
- Production Ready: Follows best practices for Morph development
- Lightweight: Fast project creation with minimal dependencies
your-app/
├── contracts/
│ ├── hardhat/
│ │ ├── contracts/ # Solidity smart contracts
│ │ ├── scripts/ # Deployment scripts
│ │ └── test/ # Contract tests
│ └── foundry/
│ ├── src/ # Solidity smart contracts
│ ├── test/ # Contract tests
│ └── script/ # Deployment scripts
└── frontend/
├── app/ # Next.js application
├── components/ # React components
└── public/ # Static assets
After creating your project, you'll need to set up your environment:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id
Get your WalletConnect Project ID at https://cloud.walletconnect.com/
PRIVATE_KEY=your_private_key_here
RPC_URL=your_rpc_url_here
-
Create your project:
npx @morphl2/create-morph-app@latest cd my-morph-app
-
Set up the frontend:
cd frontend cp .env.example .env.local # Edit .env.local with your WalletConnect Project ID yarn install yarn dev
-
Set up Foundry:
cd ../contracts/foundry cp .env.example .env # Edit .env with your private key and RPC URL forge build
-
Set up Hardhat:
cd ../hardhat yarn install npx hardhat compile
-
Add Foundry submodules (optional but recommended):
# From project root git submodule add https://github.com/OpenZeppelin/openzeppelin-contracts.git contracts/foundry/lib/openzeppelin-contracts git submodule add https://github.com/foundry-rs/forge-std contracts/foundry/lib/forge-std
cd contracts/hardhat
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.ts --network morphHolesky
cd contracts/foundry
forge build
forge test
forge script script/Deployer.s.sol --rpc-url $RPC_URL --broadcast --legacy --private-key $PRIVATE_KEY
cd frontend
yarn dev