fix contract

This commit is contained in:
2026-01-12 14:33:16 +08:00
parent a18b9a42e4
commit d56f83726b
70 changed files with 1988 additions and 142 deletions

View File

@@ -79,6 +79,13 @@ async function main() {
console.log("✅ LendingPriceFeed Implementation:", lendingPriceFeedImplAddress);
deployments.lendingPriceFeedImpl = lendingPriceFeedImplAddress;
// 根据网络设置价格过期阈值(必须在验证价格之前设置)
const isTestnet = network.chainId === 97n || network.chainId === 11155111n; // BSC测试网或Sepolia
const priceStalenesThreshold = isTestnet ? 86400 : 3600; // 测试网24小时主网1小时
const setThresholdTx = await lendingPriceFeed.setPriceStalenessThreshold(priceStalenesThreshold);
await setThresholdTx.wait(); // 等待交易确认
console.log("✅ 价格过期阈值已设置:", priceStalenesThreshold, "秒", `(${priceStalenesThreshold / 3600}小时)`);
// 验证价格获取
const usdcPrice = await lendingPriceFeed.getPrice(USDC_ADDRESS);
console.log("✅ USDC 价格 (1e30 精度):", usdcPrice.toString());