-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
AP-786 Deploy Flux Strategy
This involves a number of steps:
|
…implify strategy-specific tasks
@stevieraykatz Seeming how vaults are setup now on testnet, do you think this PR is ready for a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only important comment is the "set strategy params in (Local)Registrar
" one, see #384 (comment)
Co-authored-by: Nenad Misic <nenad@angelprotocol.io>
); | ||
|
||
// establish registrar config on primary chain and this chain | ||
await hre.run("manage:registrar:setStratParams", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, there's a gotcha here - stratConfig
parameter actually expects the name of the strategy config to use, defined as key of allStrategyConfigs (available values in this PR: dummy, flux
).
See setStratParams task source for more details.
The task uses an internal converter (see cliTypes.stratConfig) to convert the stratConfig name into the StratConfig
type and fills its data from allStrategyConfigs
.
This may be counter-intuitive because the task's arguments are defined as:
type TaskArgs = {
stratConfig: StratConfig; // CLI expects "string", but before running the task it converts it into `StratConfig`
modifyExisting: boolean;
apTeamSignerPkey?: string;
};
Is this too counter-intuitive? We could simplify this, the change(s) wouldn't be big.
Anyway, what needs to be done no matter how this task is called is that writeStrategyAddresses
is called before it (the task), so that correct values are read within it.
// Store addresses
writeStrategyAddresses(strategyName, {
locked: Locked.contract.address,
liquid: Liquid.contract.address,
strategy: Strategy.contract.address,
});
// establish registrar config on primary chain and this chain
await hre.run("manage:registrar:setStratParams", {
stratConfig: strategyName,
modifyExisting: true,
apTeamSignerPkey: signerPkey,
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a poorly named argument. I'll switch the order and rename that arg then.
Explanation of the solution
.env
to match the other url patternsdeploy
script flows for both Vaults and StrategiesInstructions on making this work
yarn
oryarn install
to install npm dependencies