Initial Configuration

  1. Environment File

Create a .env file in the project root with the following variables:

# RPC endpoint for local DexerEVM node
evm_rpc_url=http://localhost:8545

# Deployer private key (for local testing only)
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

# Network chain ID
dexerevm_chain_id=9999
  1. Frontend Configuration

In frontend/src/config.ts, verify the RPC URL and chain ID match your .env:

export const NETWORK_CONFIG = {
  rpcUrl: process.env.NEXT_PUBLIC_EVM_RPC_URL || 'http://localhost:8545',
  chainId: Number(process.env.NEXT_PUBLIC_CHAIN_ID) || 9999,
};
  1. Smart‑Contract Deployment

Deploy contracts to local or testnet:

# Deploy to local
npx hardhat --network local deploy

# Deploy to testnet (e.g., Goerli)
npx hardhat --network goerli deploy
  1. Verify Deployment

  • Confirm contract addresses in deployments/<network>.json.

  • Update frontend/src/constants/contracts.ts with the new addresses.

Last updated