Skip to content

morph-l2/morph_starter_kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Morph

Create Morph App

A lightweight CLI tool to quickly scaffold Morph blockchain applications with a clean, production-ready structure.

Quick Start

npx @morphl2/create-morph-app@latest

This will guide you through creating a new Morph application with a simple interactive prompt.

Features

  • 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

Project Structure

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

Environment Setup

After creating your project, you'll need to set up your environment:

Frontend (.env.local)

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id

Get your WalletConnect Project ID at https://cloud.walletconnect.com/

Smart Contracts (.env)

PRIVATE_KEY=your_private_key_here
RPC_URL=your_rpc_url_here

Development Workflow

  1. Create your project:

    npx @morphl2/create-morph-app@latest
    cd my-morph-app
  2. Set up the frontend:

    cd frontend
    cp .env.example .env.local
    # Edit .env.local with your WalletConnect Project ID
    yarn install
    yarn dev
  3. Set up Foundry:

    cd ../contracts/foundry
    cp .env.example .env
    # Edit .env with your private key and RPC URL
    forge build
  4. Set up Hardhat:

    cd ../hardhat
    yarn install
    npx hardhat compile
  5. 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

Smart Contract Development

Using Hardhat

cd contracts/hardhat
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.ts --network morphHolesky

Using Foundry

cd contracts/foundry
forge build
forge test
forge script script/Deployer.s.sol --rpc-url $RPC_URL --broadcast --legacy --private-key $PRIVATE_KEY

Frontend Development

cd frontend
yarn dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published