Building Your First Base dApp: Complete 2025 Guide
This walkthrough takes you from zero to a live, production-ready smart contract on Base mainnet. You will:
- Configure your wallet for Base
- Bridge ETH from Ethereum to Base
- Deploy a simple NFT smart contract with Hardhat
- Hook up a basic dApp frontend using a Thirdweb template
Expect about 60-90 minutes if you already have Node.js installed. If we can get this running step by step, so can you.
1. What You’ll Achieve
By the end, you will have a minimal but real dApp on Base mainnet:
- A deployed ERC-721 NFT contract that mints “Builder” NFTs on Base
- A simple web UI (Next.js + Thirdweb) that connects with MetaMask/Coinbase Wallet
- Verified contract and transaction history visible on BaseScan
This is the same end-to-end path teams are using to ship production dApps into an ecosystem that now handles ~25M transactions and ~$1.2B of volume per day, with average gas around $0.001 per interaction.
2. Why Building on Base Matters in 2025
Base is an Ethereum Layer 2 (L2) built on the OP Stack and incubated by Coinbase. As of late 2025, it sits around $2.9B TVL with roughly 450K daily active users and ~25M daily transactions. Those numbers matter for you because they signal:
- Deep liquidity for DeFi and token-based apps
- Low, predictable gas (a fraction of a cent in normal conditions)
- Real users arriving via Coinbase on-ramps and existing L2 traffic
Unlike many L2s, Base has no native token-gas is paid in ETH. That simplifies your first dApp: you don’t need to invent or manage a chain token; you just deploy contracts and pay fees in ETH.
There are trade-offs: Coinbase currently operates the sequencer (centralization risk), and Base inherits Ethereum’s congestion if L1 is busy. You will mitigate those with careful contract design, audits, and sane admin controls.
3. Prerequisites
You don’t need to be a Solidity expert, but you should be comfortable with JavaScript/TypeScript and basic CLI usage.
3.1 Tools & Environment
- Node.js v18+ and npm or pnpm
- Git (optional but recommended)
- Code editor (VS Code, WebStorm, etc.)
- Terminal (macOS Terminal, PowerShell, or Linux shell)
3.2 Wallet & Base Network Details
Install MetaMask or Coinbase Wallet as a browser extension. Then add Base mainnet:
- Network name: Base
- RPC URL:
https://mainnet.base.org - Chain ID:
8453 - Currency symbol: ETH
- Block explorer: https://basescan.org
We’ll also use Base Sepolia testnet:
- Network name: Base Sepolia
- RPC URL:
https://sepolia.base.org - Chain ID:
84532 - Currency symbol: ETH
- Block explorer: https://sepolia.basescan.org
3.3 Funds & Gas
- On Ethereum mainnet: ~0.02-0.05 ETH to pay L1 gas and bridge to Base
- On Base mainnet: 0.005-0.01 ETH (after bridging) is usually enough for several deployments and test interactions
- On Base Sepolia: Test ETH from a faucet (no real funds required)
3.4 Services & Accounts
- Thirdweb account – for frontend templates and wallet UI components: https://thirdweb.com
- RPC provider (optional but recommended): e.g. Alchemy or QuickNode with a Base endpoint
Using a dedicated RPC (instead of only the public https://mainnet.base.org) avoids rate limits when you scale.

4. Step-by-Step: From ETH to a Live Base dApp
Step 1 – Configure Your Wallet for Base
This is foundational. If the network is misconfigured, you’ll send funds to the wrong chain or fail to sign transactions.
- Open MetaMask → click the network dropdown →
Add network. - Choose
Add a network manuallyand enter the Base mainnet details from section 3.2. - Repeat for Base Sepolia so you can test safely before using real ETH.
Once you see “Base” as a selectable network, you’re ready to receive bridged funds.
Step 2 – Bridge ETH to Base (Official Bridge)
This next step is where many first-time users fail-usually by selecting the wrong network or bridging token. Slow down here; it’s worth it.
- In MetaMask, switch to Ethereum mainnet.
- Go to the official bridge: https://bridge.base.org.
- Connect your wallet and ensure:
- From: Ethereum
- To: Base
- Asset: ETH
- Enter an amount (e.g.
0.02 ETH) and confirm.
Timing & cost:
- Deposit to Base usually finalizes in 1–5 minutes.
- Gas on Ethereum for the bridge transaction can be a few dollars depending on L1 congestion.
- After that, on Base, your typical interaction will be around $0.001 (a tenth of a cent) in normal conditions.
After the bridge confirms, switch MetaMask to Base and verify that your ETH balance increased.
Step 3 – Scaffold a Hardhat Project
Now you’ll create the backend of your dApp: the smart contract and deploy scripts. Hardhat gives you a clean development and testing environment.
- Create a new folder and initialize:
mkdir base-first-dapp && cd base-first-dappnpm init -ynpm install --save-dev hardhatnpx hardhat→ choose Create a JavaScript project and accept the defaults.
- Install dependencies:
npm install @openzeppelin/contracts dotenv ethers
Hardhat creates a contracts folder, a sample script in scripts, and a hardhat.config.js file that we’ll modify shortly.
Step 4 – Write a Simple NFT Contract
We’ll build an extremely simple ERC-721 (NFT) contract using audited OpenZeppelin libraries. This keeps your first deployment safe and gas-efficient.

- Create
contracts/MyBaseNFT.solwith content equivalent to:- Import OpenZeppelin’s
ERC721andOwnable. - Define a constructor that sets the name and symbol (e.g.
"Base Builders","BASENFT"). - Add a simple
mintfunction callable only by the owner that mints to a given address.
- Import OpenZeppelin’s
- Compile:
npx hardhat compile
If compilation succeeds, you’re ready to deploy. If it fails, read the error carefully-Solidity version mismatches and missing imports are the most common issues.
Step 5 – Configure Hardhat for Base & Base Sepolia
This part is a little tricky, but stick with me—getting network config and private keys right is critical for security.
- Create a
.envfile and add:PRIVATE_KEY=your_wallet_private_key_hereBASE_RPC_URL=https://mainnet.base.org(or your Alchemy/QuickNode URL)BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
Never commit
.envto Git. - In
hardhat.config.js, importdotenvand configure networks:- baseSepolia with:
url: process.env.BASE_SEPOLIA_RPC_URLchainId: 84532accounts: [process.env.PRIVATE_KEY]
- baseMainnet with:
url: process.env.BASE_RPC_URLchainId: 8453accounts: [process.env.PRIVATE_KEY]
- baseSepolia with:
Using a single deployer key that you control via a hardware wallet or multisig for production is strongly recommended. For this tutorial you can use a regular EOA, but do not reuse it for serious funds.
Step 6 – Deploy to Base Sepolia (Testnet)
This is your dress rehearsal. Once you get past this step, the rest is straightforward.
- Write a deploy script in
scripts/deploy.jsthat:- Gets a contract factory for
MyBaseNFT. - Deploys with constructor arguments (name & symbol).
- Waits for deployment and logs
contract.address.
- Gets a contract factory for
- Run:
npx hardhat run scripts/deploy.js --network baseSepolia
Hardhat will show the deployment transaction hash. Copy the contract address from the logs and open it on sepolia.basescan.org.
Use the “Write Contract” tab on BaseScan to test the mint function. This confirms that your ABI, contract, and network settings all line up before you risk real ETH.
Step 7 – Deploy to Base Mainnet
Once testnet behaves as expected, deploy the same contract to Base mainnet.
- Double-check your
BASE_RPC_URLpoints to mainnet, not Sepolia. - Ensure your wallet has enough ETH on Base (0.005–0.01 ETH is usually plenty for this contract).
- Run:
npx hardhat run scripts/deploy.js --network baseMainnet
Deployment should cost only a few cents in gas at 2025 prices. Once mined, open your contract address on BaseScan and verify it via the “Verify and Publish” flow so anyone can read your source code.

Step 8 – Add a Thirdweb Frontend Template
With the contract live, you’ll give users a clean, wallet-connected UI using Thirdweb’s Next.js template. This is where your dApp feels real.
- In a new folder (e.g.
base-first-dapp-ui), run:npx thirdweb create
and follow the prompts to choose a Next.js + TypeScript template.
- When configuring the app, select Base as the default chain, or set it in the Thirdweb config file as chain ID 8453.
- Update the app’s config to include your deployed
MyBaseNFTcontract address and ABI. - Use Thirdweb’s prebuilt components (e.g. “Connect Wallet” and “NFT Mint” button) to:
- Let users connect with MetaMask / Coinbase Wallet.
- Call your contract’s
mintfunction when they click “Mint”.
- Run the dev server:
npm run dev
and open the app in your browser.
Your first Base dApp is now live: a real on-chain contract, a wallet-connected UI, and transactions visible on BaseScan.
5. Common Issues and How to Fix Them
Transaction Stuck or Pending Forever?
- Check BaseScan with your transaction hash.
- If it shows as “Pending” for more than a few minutes, network may be spiking; wait or try a higher gas price.
- If it doesn’t appear at all, your wallet may have failed to broadcast—re-sign with a slightly higher gas fee.
- In MetaMask, you can use
Speed Upto resend with higher priority.
Bridge Taking Forever?
- Deposits (Ethereum → Base) normally settle within 1–5 minutes. If it’s much longer:
- Confirm the bridge transaction on Etherscan.
- Confirm destination chain is Base, not another L2.
- Verify you’re checking the same wallet address on Base that initiated the bridge.
- Withdrawals (Base → Ethereum) on optimistic rollups can take several days; plan UX and treasury flows around that.
“Insufficient Liquidity” on DEXs or Swaps?
Your first dApp here doesn’t require a DEX, but once you integrate DeFi, you may hit “insufficient liquidity” errors if you choose thin pools or obscure tokens.
- Stick to blue-chip tokens on Base like:
- WETH:
0x4200000000000000000000000000000000000006 - USDC (native on Base):
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
- WETH:
- Query liquidity before routing trades, or use established routers that already do this.
Hardhat “Invalid Network” or “Chain ID Mismatch” Errors
- Ensure
chainIdinhardhat.config.jsmatches:- 8453 for Base mainnet
- 84532 for Base Sepolia
- Verify your RPC URLs:
https://mainnet.base.orgfor mainnethttps://sepolia.base.orgfor testnet
- Clear Hardhat cache if network settings changed:
npx hardhat clean
6. Pro Tips for Production-Ready Base dApps
- Audit before you scale: Even though Base gas is cheap, exploits are not. Have a security firm review non-trivial contracts and enable a bug bounty.
- Use multisig admins: Put upgradeability, minting, and treasury controls behind a multisig (e.g. Safe) instead of a single EOA.
- Optimize for gas: Batch writes where possible, prefer
uint256over mixed types, and avoid unnecessary storage writes—cheaper gas is not a license to be sloppy. - Time your heavy transactions: In rare peaks, Base gas can spike to ~$0.01. Schedule large migrations or mass mints during off-peak hours.
- Plan for sequencer risk: Because Coinbase operates the sequencer today, include pause switches and emergency withdrawal flows that can handle temporary downtime or censorship.
- Use real monitoring: Hook up a provider like Alchemy or QuickNode plus logging to track failures, reorgs, and unusual usage in real time.
7. What’s Next
You’ve done the heavy lifting: funded Base from Ethereum, deployed a smart contract with Hardhat, and wired up a Thirdweb-powered frontend. From here, you can iterate quickly because each additional contract or UI update is just another cheap Base transaction.
- Add features: Royalties, metadata, or allowlists to your NFT contract.
- Branch into DeFi: Build staking or liquidity mining contracts that plug into existing Base DEXs.
- Production hardening: Move admin keys to a multisig, document an upgrade plan, and set up monitoring and alerting.
- Explore Base ecosystem: Study popular apps on BaseScan to see what patterns are working in the wild.
Base’s combination of low fees, EVM equivalence, and growing liquidity makes it a strong 2025 home for your first serious dApp. Now that you’ve shipped your v1 contract and UI, your next step isn’t “how do I deploy?”—it’s “what valuable on-chain experience do I build next?”
