> loading_
# Walkthrough: Querying Arbitrum DAO Treasury Balances On-Chain
# Useful for monitoring the proposed 6,000 ETH + USDC transfer if/when it executes.
# Tested against Arbitrum One using ethers.js v6 + a public RPC.
# ----------------------------------------------------------
# Step 1: Set up your provider pointing to Arbitrum One
# ----------------------------------------------------------
# We use the canonical Arbitrum One chain ID (42161).
# Replace the RPC URL with your own Alchemy/Infura/public endpoint.
import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://arb1.arbitrum.io/rpc');
# ----------------------------------------------------------
# Step 2: Define the DAO treasury address and USDC contract
# ----------------------------------------------------------
# The Arbitrum DAO Treasury address (verify on-chain before use).
# USDC on Arbitrum One uses the Bridged USDC (USDC.e) or native USDC contract.
const DAO_TREASURY = '0xF3FC178157fb3c87548bAA86F9d24BA38E649B58'; // Arbitrum DAO Treasury
const USDC_ADDRESS = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831'; // Native USDC on Arb One
# ----------------------------------------------------------
# Step 3: Read ETH balance of the treasury
# ----------------------------------------------------------
# This returns the raw wei balance; we format to ETH for readability.
const ethBalance = await provider.getBalance(DAO_TREASURY);
console.log(`Treasury ETH: ${ethers.formatEther(ethBalance)} ETH`);
# ----------------------------------------------------------
# Step 4: Read USDC balance using the ERC-20 balanceOf call
# ----------------------------------------------------------
# USDC uses 6 decimals on Arbitrum. We use a minimal ABI fragment.
const erc20Abi = ['function balanceOf(address) view returns (uint256)'];
const usdc = new ethers.Contract(USDC_ADDRESS, erc20Abi, provider);
const usdcBalance = await usdc.balanceOf(DAO_TREASURY);
console.log(`Treasury USDC: ${ethers.formatUnits(usdcBalance, 6)} USDC`);
# ----------------------------------------------------------
# Step 5: Compare against proposal thresholds
# ----------------------------------------------------------
# If the proposal passes, you'd expect to see the treasury balance
# decrease by ~6,000 ETH and ~150,000 USDC once the transfer executes.
# You could set up an event listener or poll periodically to detect the move.
const ETH_TRANSFER_AMOUNT = ethers.parseEther('6000');
const USDC_TRANSFER_AMOUNT = ethers.parseUnits('150000', 6);
console.log(`Proposed ETH transfer: ${ethers.formatEther(ETH_TRANSFER_AMOUNT)} ETH`);
console.log(`Proposed USDC transfer: ${ethers.formatUnits(USDC_TRANSFER_AMOUNT, 6)} USDC`);
console.log(`Sufficient ETH? ${ethBalance >= ETH_TRANSFER_AMOUNT}`);
console.log(`Sufficient USDC? ${usdcBalance >= USDC_TRANSFER_AMOUNT}`);