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>
This commit is contained in:
2026-01-26 23:32:29 +08:00
parent c8427caa01
commit 5cb64f881e
80 changed files with 18342 additions and 1117 deletions

View File

@@ -0,0 +1,60 @@
import { createPublicClient, http, getAddress, parseAbiItem } from 'viem'
import { arbitrumSepolia } from 'viem/chains'
const client = createPublicClient({
chain: arbitrumSepolia,
transport: http('https://sepolia-rollup.arbitrum.io/rpc')
})
const LENDING_PROXY = getAddress('0xCb4E7B1069F6C26A1c27523ce4c8dfD884552d1D')
async function main() {
const latestBlock = await client.getBlockNumber()
console.log('Latest Block:', latestBlock)
const fromBlock = latestBlock - 10000n
console.log(`Checking events from block ${fromBlock} to ${latestBlock}..\n`)
// Check SupplyCollateral
const supplyEvent = parseAbiItem('event SupplyCollateral(address indexed from, address indexed dst, address indexed asset, uint256 amount)')
const supplyLogs = await client.getLogs({
address: LENDING_PROXY,
event: supplyEvent,
fromBlock,
toBlock: latestBlock
})
console.log(`SupplyCollateral Events found: ${supplyLogs.length}`)
// Check Deposit
const depositEvent = parseAbiItem('event Deposit(address indexed user, address indexed collateralAsset, uint256 amount)')
const depositLogs = await client.getLogs({
address: LENDING_PROXY,
event: depositEvent,
fromBlock,
toBlock: latestBlock
})
console.log(`Deposit Events found: ${depositLogs.length}`)
// Check WithdrawCollateral
const withdrawColEvent = parseAbiItem('event WithdrawCollateral(address indexed src, address indexed to, address indexed asset, uint256 amount)')
const withdrawColLogs = await client.getLogs({
address: LENDING_PROXY,
event: withdrawColEvent,
fromBlock,
toBlock: latestBlock
})
console.log(`WithdrawCollateral Events found: ${withdrawColLogs.length}`)
// Check Withdraw
const withdrawEvent = parseAbiItem('event Withdraw(address indexed user, address indexed collateralAsset, uint256 amount)')
const withdrawLogs = await client.getLogs({
address: LENDING_PROXY,
event: withdrawEvent,
fromBlock,
toBlock: latestBlock
})
console.log(`Withdraw Events (custom) found: ${withdrawLogs.length}`)
}
main().catch(console.error)