Tools for GX EVM Builders
Overview
GX EVM supports the full Ethereum developer toolkit. Any tool that works with EVM-compatible chains works with GX Chain. This page covers RPC endpoints, development frameworks, client libraries, and integration patterns.
RPC Endpoints
| Network | RPC URL | Chain ID | Explorer |
|---|---|---|---|
| Mainnet | https://rpc.gx.exchange | TBD | https://explorer.gx.exchange |
| Testnet | https://testnet-rpc.gx.exchange | TBD | https://testnet-explorer.gx.exchange |
Development Frameworks
Hardhat
// hardhat.config.js
module.exports = {
solidity: "0.8.27",
networks: {
gx: {
url: "https://rpc.gx.exchange",
accounts: [process.env.PRIVATE_KEY],
},
gxTestnet: {
url: "https://testnet-rpc.gx.exchange",
accounts: [process.env.PRIVATE_KEY],
},
},
};Foundry
# Deploy with Foundry
forge create --rpc-url https://rpc.gx.exchange \
--private-key $PRIVATE_KEY \
src/MyContract.sol:MyContract
# Verify contract
forge verify-contract <address> src/MyContract.sol:MyContract \
--verifier-url https://explorer.gx.exchange/apiClient Libraries
| Library | Language | Installation |
|---|---|---|
| ethers.js v6 | JavaScript/TypeScript | npm install ethers |
| viem | TypeScript | npm install viem |
| wagmi | React | npm install wagmi |
| web3.py | Python | pip install web3 |
| ethers-rs | Rust | cargo add ethers |
ethers.js Example
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider("https://rpc.gx.exchange");
const wallet = new ethers.Wallet(privateKey, provider);
// Read GX balance
const balance = await provider.getBalance(wallet.address);
console.log("GX Balance:", ethers.formatEther(balance));
// Deploy a contract
const factory = new ethers.ContractFactory(abi, bytecode, wallet);
const contract = await factory.deploy();
await contract.waitForDeployment();viem Example
import { createPublicClient, createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const gxChain = {
name: "GX Chain",
nativeCurrency: { name: "GX", symbol: "GX", decimals: 18 },
rpcUrls: {
default: { http: ["https://rpc.gx.exchange"] },
},
};
const publicClient = createPublicClient({
chain: gxChain,
transport: http(),
});Wallet Configuration (MetaMask)
| Field | Value |
|---|---|
| Network Name | GX Chain |
| RPC URL | https://rpc.gx.exchange |
| Chain ID | TBD |
| Currency Symbol | GX |
| Block Explorer | https://explorer.gx.exchange |
Supported Contract Standards
| Standard | Description |
|---|---|
| ERC-20 | Fungible tokens |
| ERC-721 | Non-fungible tokens |
| ERC-1155 | Multi-token standard |
| ERC-4626 | Tokenized vaults |
| EIP-2612 | Permit (gasless approvals) |
| EIP-712 | Typed structured data signing |
GX Core Trading API
Beyond standard EVM RPC, GX Core exposes trading-specific APIs.
REST API (Port 4001)
# Get orderbook
curl https://api.gx.exchange/v4/orderbook?market=BTC-USD
# Get account positions
curl https://api.gx.exchange/v4/account?address=0x...WebSocket API (Port 4000)
const ws = new WebSocket("wss://ws.gx.exchange");
ws.send(JSON.stringify({
method: "subscribe",
subscription: { type: "l2Book", coin: "BTC" }
}));Deployment Workflow
- Write contracts using Hardhat or Foundry (Solidity 0.8.27+)
- Test locally using Hardhat node or Foundry Anvil
- Deploy to GX testnet at
https://testnet-rpc.gx.exchange - Verify on the GX Explorer
- Deploy to mainnet at
https://rpc.gx.exchange
Security Best Practices
- Use OpenZeppelin v5 audited contract libraries
- GX Core enforces
overflow-checks = trueat the protocol level - EIP-712 signature verification includes low-s normalization
- All integer arithmetic uses checked/saturating operations — no floating point in matching or settlement
- Validator keys are stored via environment variables, never exposed in CLI arguments or logs