change WUSD payment to USDC
This commit is contained in:
@@ -19,10 +19,12 @@ async function main() {
|
||||
|
||||
const vaultDeployment = JSON.parse(fs.readFileSync("./deployments-vault-system.json", "utf8"));
|
||||
const factoryAddress = vaultDeployment.contracts.YTAssetFactory.proxy;
|
||||
const wusdAddress = vaultDeployment.wusdAddress;
|
||||
const usdcAddress = vaultDeployment.usdcAddress;
|
||||
const usdcPriceFeedAddress = vaultDeployment.usdcPriceFeedAddress;
|
||||
|
||||
console.log("YTAssetFactory:", factoryAddress);
|
||||
console.log("WUSD地址:", wusdAddress);
|
||||
console.log("YTAssetFactory: ", factoryAddress);
|
||||
console.log("USDC地址: ", usdcAddress);
|
||||
console.log("Chainlink价格预言机: ", usdcPriceFeedAddress);
|
||||
|
||||
const factory = await ethers.getContractAt("YTAssetFactory", factoryAddress);
|
||||
|
||||
@@ -37,7 +39,6 @@ async function main() {
|
||||
manager: deployer.address,
|
||||
hardCap: ethers.parseEther("10000000"), // 1000万
|
||||
redemptionTime: Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60, // 1年后
|
||||
initialWusdPrice: PRICE_PRECISION, // $1.00 (精度1e30)
|
||||
initialYtPrice: PRICE_PRECISION // $1.00 (精度1e30)
|
||||
},
|
||||
{
|
||||
@@ -46,7 +47,6 @@ async function main() {
|
||||
manager: deployer.address,
|
||||
hardCap: ethers.parseEther("10000000"),
|
||||
redemptionTime: Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60,
|
||||
initialWusdPrice: PRICE_PRECISION, // $1.00 (精度1e30)
|
||||
initialYtPrice: PRICE_PRECISION // $1.00 (精度1e30)
|
||||
},
|
||||
{
|
||||
@@ -55,7 +55,6 @@ async function main() {
|
||||
manager: deployer.address,
|
||||
hardCap: ethers.parseEther("10000000"),
|
||||
redemptionTime: Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60,
|
||||
initialWusdPrice: PRICE_PRECISION, // $1.00 (精度1e30)
|
||||
initialYtPrice: PRICE_PRECISION // $1.00 (精度1e30)
|
||||
}
|
||||
];
|
||||
@@ -69,18 +68,19 @@ async function main() {
|
||||
console.log(`\n创建 ${params.name} (${params.symbol})...`);
|
||||
|
||||
// 价格已经是1e30精度,直接使用
|
||||
const wusdPrice = params.initialWusdPrice;
|
||||
const ytPrice = params.initialYtPrice;
|
||||
|
||||
// 新的createVault签名:
|
||||
// createVault(name, symbol, manager, hardCap, usdc, redemptionTime, ytPrice, usdcPriceFeed)
|
||||
const tx = await factory.createVault(
|
||||
params.name,
|
||||
params.symbol,
|
||||
params.manager,
|
||||
params.hardCap,
|
||||
wusdAddress,
|
||||
usdcAddress, // USDC地址
|
||||
params.redemptionTime,
|
||||
wusdPrice,
|
||||
ytPrice
|
||||
ytPrice, // 只需要ytPrice
|
||||
usdcPriceFeedAddress // Chainlink价格预言机地址
|
||||
);
|
||||
|
||||
const receipt = await tx.wait();
|
||||
@@ -117,7 +117,6 @@ async function main() {
|
||||
manager: params.manager,
|
||||
hardCap: params.hardCap.toString(),
|
||||
redemptionTime: params.redemptionTime,
|
||||
wusdPrice: wusdPrice.toString(),
|
||||
ytPrice: ytPrice.toString()
|
||||
});
|
||||
}
|
||||
@@ -146,9 +145,9 @@ async function main() {
|
||||
|
||||
console.log("\n💡 下一步:");
|
||||
console.log("1. 在YTLp系统中将这些vault添加到白名单");
|
||||
console.log("2. 为YTPriceFeed设置价格来源(使用第一个vault)");
|
||||
console.log("3. 为每个vault设置初始价格");
|
||||
console.log("4. 开始使用!");
|
||||
console.log("2. 为每个vault设置初始价格");
|
||||
console.log("3. 开始使用!");
|
||||
console.log("\n注意: USDC价格自动从Chainlink获取,无需手动设置");
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user