Skip to content

Commit

Permalink
Merge pull request #349 from tranchess/dev-terry-deploy
Browse files Browse the repository at this point in the history
Update deploy_maturity_fund
  • Loading branch information
bill-clippy authored May 7, 2024
2 parents 4338f51 + ac444ee commit f232cce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 106 deletions.
1 change: 0 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import "./tasks/deploy_fund";
import "./tasks/deploy_fund_eth";
import "./tasks/deploy_fund_wsteth";
import "./tasks/deploy_governance";
import "./tasks/deploy_liquidity_gauge_curve";
import "./tasks/deploy_maturity_fund";
import "./tasks/deploy_misc";
import "./tasks/deploy_mock";
Expand Down
87 changes: 0 additions & 87 deletions tasks/deploy_liquidity_gauge_curve.ts

This file was deleted.

27 changes: 9 additions & 18 deletions tasks/deploy_maturity_fund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface FundAddresses extends Addresses {
task("deploy_maturity_fund", "Deploy MaturityFund contracts")
.addParam("underlying", "Underlying token address")
.addParam("shareSymbols", "Symbols of share tokens")
.addParam("shareNames", "Names of share tokens")
.addParam("maturityDays", "Maturity days")
.addParam("redemptionFeeRate", "Primary market redemption fee rate")
.addParam("mergeFeeRate", "Primary market merge fee rate")
Expand Down Expand Up @@ -52,6 +53,11 @@ task("deploy_maturity_fund", "Deploy MaturityFund contracts")
assert.match(symbol, /^[a-zA-Z]+$/, "Invalid symbol");
}
assert.ok(shareSymbols.length == 3, "Share symbol count is not 3");
const shareNames: string[] = args.shareNames.split(",").filter(Boolean);
for (const name of shareNames) {
assert.match(name, /^[a-zA-Z ]+$/, "Invalid name");
}
assert.ok(shareNames.length == 3, "Share name count is not 3");

const maturityDays = parseInt(args.maturityDays);
assert.ok(maturityDays > 0 && maturityDays <= 365 * 10, "Invalid maturity days");
Expand Down Expand Up @@ -102,30 +108,15 @@ task("deploy_maturity_fund", "Deploy MaturityFund contracts")
});

const Share = await ethers.getContractFactory("ShareV2");
const shareQ = await Share.deploy(
`Tranchess ${underlyingSymbol} QUEEN`,
`${shareSymbols[0]}`,
fundAddress,
0
);
const shareQ = await Share.deploy(shareNames[0], shareSymbols[0], fundAddress, 0);
console.log(`ShareQ: ${shareQ.address}`);
await waitForContract(hre, shareQ.address);

const shareB = await Share.deploy(
`Tranchess ${underlyingSymbol} stable YSTONE`,
`${shareSymbols[1]}`,
fundAddress,
1
);
const shareB = await Share.deploy(shareNames[1], shareSymbols[1], fundAddress, 1);
console.log(`ShareB: ${shareB.address}`);
await waitForContract(hre, shareB.address);

const shareR = await Share.deploy(
`Tranchess ${underlyingSymbol} turbo YSTONE`,
`${shareSymbols[2]}`,
fundAddress,
2
);
const shareR = await Share.deploy(shareNames[2], shareSymbols[2], fundAddress, 2);
console.log(`ShareR: ${shareR.address}`);
await waitForContract(hre, shareR.address);

Expand Down
1 change: 1 addition & 0 deletions tasks/test_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ task("test_deploy", "Run all deployment scripts on a temp Hardhat node", async (

await hre.run("deploy_maturity_fund", {
underlying: mockAddresses.mockBusd,
shareNames: "Maturity QUEEN,Maturity BISHOP,Maturity ROOK",
shareSymbols: "maturityQ,maturityB,maturityR",
maturityDays: "180",
redemptionFeeRate: "0.0035",
Expand Down

0 comments on commit f232cce

Please sign in to comment.