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

@@ -38,6 +38,17 @@ async function main() {
console.log(" USDC Address:", deployments.usdcAddress);
console.log(" USDC Price Feed:", deployments.usdcPriceFeed, "\n");
// ========== 配置 LendingPriceFeed 价格过期阈值 ==========
console.log("⚙️ 配置 LendingPriceFeed 价格过期阈值");
const lendingPriceFeed = await ethers.getContractAt("LendingPriceFeed", deployments.lendingPriceFeed);
// 根据网络设置价格过期阈值
const isTestnet = network.chainId === 97n || network.chainId === 11155111n; // BSC测试网或Sepolia
const priceStalenesThreshold = isTestnet ? 86400 : 3600; // 测试网24小时主网1小时
await lendingPriceFeed.setPriceStalenessThreshold(priceStalenesThreshold);
console.log(" ✅ 阈值:", priceStalenesThreshold, "秒", `(${priceStalenesThreshold / 3600}小时)\n`);
// ========== 读取 YT Vault 部署信息 ==========
const vaultDeploymentsPath = path.join(__dirname, "../../deployments-vault-system.json");
if (!fs.existsSync(vaultDeploymentsPath)) {