Files
Heyue_test/frontend/scripts/check-balance.ts
Sofio 5cb64f881e feat: 添加多链支持和 Lending 借贷系统
- 新增 ARB Sepolia + BNB Testnet 多链支持
- 添加 LendingPanel 借贷系统组件
- 添加 LendingAdminPanel 管理面板
- 添加 USDCPanel USDC 操作组件
- 添加 HoldersPanel 持有人信息组件
- 添加 AutoTestPanel 自动化测试组件
- 重构 LP 组件为模块化结构 (LP/)
- 添加多个调试和测试脚本
- 修复 USDC 精度动态配置
- 优化合约配置支持多链切换

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:32:29 +08:00

24 lines
822 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { createPublicClient, http, formatEther } from 'viem'
import { arbitrumSepolia } from 'viem/chains'
const client = createPublicClient({
chain: arbitrumSepolia,
transport: http('https://sepolia-rollup.arbitrum.io/rpc'),
})
async function main() {
const balance = await client.getBalance({ address: '0xa013422A5918CD099C63c8CC35283EACa99a705d' })
console.log('主账户 ETH 余额:', formatEther(balance), 'ETH')
// 检查是否足够 (10 个账户 × 0.01 ETH = 0.1 ETH)
const needed = 0.1
if (parseFloat(formatEther(balance)) < needed) {
console.log(`\n⚠ ETH 不足! 需要至少 ${needed} ETH 来分发 gas 费`)
console.log('请先获取测试网 ETH: https://www.alchemy.com/faucets/arbitrum-sepolia')
} else {
console.log('\n✅ ETH 足够运行模拟脚本')
}
}
main()