square-codeBuild APP

Build an App on SATUCHAIN

This section explains the standard setup to build an EVM dApp on SATUCHAIN Testnet: connect a wallet, read chain data, and send transactions using common tooling.

Prerequisites

  • Frontend: React + Vite (or Next.js)

  • Wallet: MetaMask (EIP-1193 provider)

  • SDK: ethers.js

  • Contract tooling: Hardhat / Foundry


1) Create a Frontend (Vite + React)


2) Connect Wallet (MetaMask)

Create src/satuchain.js:

Then update src/App.jsx:

This gives you:

  • Wallet connect

  • Network switch/add flow

  • Balance read (tSTU)


3) Send a Transaction (Native Transfer)

Add this function to src/satuchain.js:

Usage example:

Verify on explorer:


4) Read & Write a Smart Contract

Once you deploy a contract (Hardhat/Foundry/Remix), you can interact from the frontend.

Example for the Storage contract:


Production Notes

  • Use a dedicated RPC (or your own node) for production apps.

  • Add basic retry and timeout handling around RPC calls.

  • Handle chain changes (ethereum.on("chainChanged", ...)) and account changes.

  • Never expose private keys in frontend code; use wallets or backend signers.

Last updated