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,55 @@
import { createPublicClient, http } from 'viem'
import { arbitrumSepolia } from 'viem/chains'
const client = createPublicClient({
chain: arbitrumSepolia,
transport: http('https://api.zan.top/node/v1/arb/sepolia/baf84c429d284bb5b676cb8c9ca21c07')
})
const PRICE_FEED = '0xE82c7cB9CfA42D6eb7e443956b78f8290249c316'
const YT_A = '0x97204190B35D9895a7a47aa7BaC61ac08De3cF05'
const PRICE_FEED_ABI = [
{
inputs: [
{ internalType: 'address', name: 'asset', type: 'address' }
],
name: 'getPrice',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function'
}
]
async function main() {
console.log('\n检查价格源...\n')
try {
const price = await client.readContract({
address: PRICE_FEED,
abi: PRICE_FEED_ABI,
functionName: 'getPrice',
args: [YT_A]
})
console.log('YT-A 地址:', YT_A)
console.log('价格 (原始值):', price.toString())
console.log('价格 (格式化):', Number(price) / 1e8, 'USD')
if (price === 0n) {
console.log('\n✗ 错误: 价格为 0')
console.log(' 这会导致存入失败,因为合约无法计算抵押品价值')
} else {
console.log('\n✓ 价格正常')
}
} catch (error) {
console.error('\n✗ 读取价格失败:', error.message)
console.log('\n可能的原因:')
console.log(' 1. 价格源合约没有设置 YT-A 的价格')
console.log(' 2. getPrice 函数不存在或签名不匹配')
console.log(' 3. YT-A 地址在价格源中未注册')
}
}
main()