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

@@ -108,6 +108,15 @@ async function main() {
console.log(" ✅ Vault地址:", vaultAddress);
console.log(" ✅ Vault索引:", index.toString());
// 配置价格过期阈值
const vault = await ethers.getContractAt("YTAssetVault", vaultAddress);
const network = await ethers.provider.getNetwork();
const isTestnet = network.chainId === 97n || network.chainId === 11155111n; // BSC测试网或Sepolia
const priceStalenesThreshold = isTestnet ? 86400 : 3600; // 测试网24小时主网1小时
await factory.setPriceStalenessThreshold(vaultAddress, priceStalenesThreshold);
console.log(" ✅ 价格过期阈值:", priceStalenesThreshold, "秒", `(${priceStalenesThreshold / 3600}小时)`);
createdVaults.push({
name: params.name,