Skip to main content

Build a dapp

This tutorial walks through a small React app that connects to TeQoin, reads a contract value, and sends a transaction.

What you will build

You will build a React app that:
  • Connects to a wallet
  • Checks that the user is on TeQoin
  • Reads number() from a deployed Counter
  • Sends increment()

Step 1: Create the app

Step 2: Add contract details

Create src/config.js:

Step 3: Build the app

Replace src/App.jsx:

Step 4: Start the app

Open the local URL from Vite, connect your wallet, and test the read and write buttons.

Common fixes

Wallet switch fails

If wallet_switchEthereumChain fails because TeQoin is not added yet, first follow /tutorials/integrate-wallet.

Contract calls revert

Check:
  • The contract address is correct
  • The ABI matches the deployed contract
  • Your wallet is on chain 420377

Next steps

  • Add loading and error states
  • Store the contract address in an environment variable
  • Add event listening with provider.on()
  • Move to Wagmi or Viem if you want a larger React app