Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Added stratParams update to the fullStrategy deployment flow
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieraykatz committed Sep 28, 2023
1 parent aaaf304 commit 0bed982
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 13 additions & 5 deletions tasks/deploy/integrations/deployFlux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ import {deployStrategySet} from "./helpers";

const NAME = "flux";

task("Deploy:strategy:flux", `Will deploy ${NAME} and a pair of generic vaults`).setAction(
async (_, hre) => {
type TaskArgs = {
apTeamSignerPkey?: string;
};

task("Deploy:strategy:flux", `Will deploy ${NAME} and a pair of generic vaults`)
.addOptionalParam(
"apTeamSignerPkey",
"If running on prod, provide a pkey for a valid APTeam Multisig Owner."
)
.setAction(async (taskArgs: TaskArgs, hre) => {
try {
logger.out(`Deploying strategy: ${NAME}`);
const {deployer} = await getSigners(hre);
const StrategyFactory = new FluxStrategy__factory(deployer);
await deployStrategySet(NAME, StrategyFactory, hre);
const signerPkey = taskArgs.apTeamSignerPkey ? taskArgs.apTeamSignerPkey : "";
await deployStrategySet(NAME, StrategyFactory, signerPkey, hre);
} catch (error) {
logger.out(error, logger.Level.Error);
}
}
);
});
18 changes: 17 additions & 1 deletion tasks/deploy/integrations/helpers/fullStrategy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ContractFactory} from "ethers";
import {Deployment} from "types";
import {Deployment, StrategyApprovalState} from "types";
import {
deploy,
getAddresses,
Expand All @@ -16,6 +16,7 @@ import {HardhatRuntimeEnvironment} from "hardhat/types";
export async function deployStrategySet(
strategyName: string,
factory: ContractFactory,
signerPkey: string,
hre: HardhatRuntimeEnvironment
) {
const config: StratConfig = allStrategyConfigs[strategyName];
Expand Down Expand Up @@ -54,6 +55,21 @@ export async function deployStrategySet(
hre
);

// establish registrar config on primary chain and this chain
await hre.run("manage:registrar:setStratParams", {
stratConfig: {
...config,
params: {
approvalState: config.params.approvalState,
network: config.params.network,
lockedVaultAddr: Locked.contract.address,
liquidVaultAddr: Liquid.contract.address,
},
},
modifyExisting: true,
apTeamSignerPkey: signerPkey,
});

// Store addresses
writeStrategyAddresses(strategyName, {
locked: Locked.contract.address,
Expand Down

0 comments on commit 0bed982

Please sign in to comment.