A minimal React starter for building dApps on Injective EVM Testnet.
Stack: Vite · React 18 · TypeScript · Tailwind CSS · wagmi v2
Clone and run:
# Clone this template
git clone https://github.com/injective-dev/dapp-react-temp.git my-dapp
cd my-dapp/frontend
# Install dependencies
npm install
# Set up environment (vault address is already deployed!)
cp .env.example .env
# Start the dev server
npm run devOpen http://localhost:5173 — you're ready to go!
A simple custodial vault on Injective EVM Testnet:
- ✅ Deposit USDC — users deposit Circle USDC into the vault
- ✅ Withdraw USDC — users can withdraw their own funds at any time
- ✅ View balance — see total USDC held by the vault
Deployed Contract:
- Address:
0xc79efba3814eedb4b8b85651bc6668198e46ac5a - Network: Injective EVM Testnet (Chain ID: 1439)
- Explorer: View on Blockscout
- Wallet connection — MetaMask, WalletConnect, Coinbase Wallet via wagmi
- Network detection — auto-detects Injective Testnet
- Deposit/Withdraw UI — simple forms for vault interactions
- Real-time balance — shows wallet balance, deposited balance, and total vault balance
- Transaction history — track your deposits and withdrawals
├── frontend/ # React app
│ ├── src/
│ │ ├── components/ # VaultForm, ConnectWallet, etc.
│ │ ├── config/ # wagmi + contract ABIs
│ │ ├── hooks/ # useWallet, useUSDCVault
│ │ └── pages/ # Home, Dashboard
│ └── .env.example # Environment template
│
├── contracts/ # Solidity contracts (reference only)
│ └── contracts/USDCVault.sol
│
└── README.md
Create frontend/.env:
# USDC Vault address (already deployed on testnet)
VITE_VAULT_ADDRESS=0xc79efba3814eedb4b8b85651bc6668198e46ac5a
# Optional: override default USDC address
# VITE_USDC_ADDRESS=0x0C382e685bbeeFE5d3d9C29e29E341fEE8E84C5dThe vault contract is already deployed — you don't need to deploy anything yourself!
Visit the Injective Testnet Faucet:
- Connect your wallet
- Request testnet INJ
- Wait ~30 seconds
Visit faucet.circle.com:
- Select Injective Testnet
- Enter your wallet address
- Receive 10 testnet USDC
- User approves the vault to spend USDC (one-time)
- User enters deposit amount
- Contract transfers USDC from user to vault
- Balance updates instantly
- User enters withdrawal amount (up to their deposited balance)
- Contract transfers USDC back to user
- Balance updates instantly
No admin fees, no lock-up period — users have full control over their funds.
| Testnet | |
|---|---|
| Chain ID | 1439 |
| RPC | https://k8s.testnet.json-rpc.injective.network/ |
| Explorer | testnet.blockscout.injective.network |
| USDC Contract | 0x0C382e685bbeeFE5d3d9C29e29E341fEE8E84C5d |
| Vault Contract | 0xc79efba3814eedb4b8b85651bc6668198e46ac5a |
The vault contract source is in contracts/contracts/USDCVault.sol.
Key functions:
function deposit(uint256 amount) external;
function withdraw(uint256 amount) external;
function withdrawAll() external;
function getVaultBalance() external view returns (uint256);
function getUserDeposit(address user) external view returns (uint256);Security features:
- ✅ ReentrancyGuard on all state-changing functions
- ✅ SafeERC20 for token transfers
- ✅ No admin/owner — fully permissionless
- ✅ Users can only withdraw their own funds
This template includes MCP (Model Context Protocol) integration for AI-powered on-chain operations.
Use Claude, Cursor, or VS Code to interact with Injective using natural language:
"Check my USDC balance"
"Deposit 5 USDC into the vault"
"What's the total vault balance?"
See mcp/README.md for setup instructions.
The vault contract is already deployed for you. If you want to deploy your own version:
cd contracts
npm install
# Deploy (needs a funded wallet — add PRIVATE_KEY to contracts/.env)
npx hardhat run scripts/deploy.ts --network injectiveTestnetMIT