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

Get ready for mainnet flux deployment #384

Merged
merged 13 commits into from
Oct 1, 2023
Merged

Conversation

stevieraykatz
Copy link
Contributor

@stevieraykatz stevieraykatz commented Sep 19, 2023

Explanation of the solution

  • Added a new shell script which allows us to fork an arg-provided chain (rather than hardcoded to mumbai)
  • Made a slight tweak to Ethereum mainnet rpc url in .env to match the other url patterns
  • Made generic deploy script flows for both Vaults and Strategies
  • Removed unused/deprecated tasks from ...tasks/deploy/integrations
  • Added steps to side-chain deployment task for managing registrar

Instructions on making this work

  • run yarn or yarn install to install npm dependencies

@linear
Copy link

linear bot commented Sep 19, 2023

AP-786 Deploy Flux Strategy

This involves a number of steps:

  • Deploy a testnet strategy/vault pair
  • Run deploySideChain on Ethereum mainnet
  • Deploy the Flux strategy contracts
  • Configure the registrars (see AP-638)

@stevieraykatz stevieraykatz self-assigned this Sep 19, 2023
@SovereignAndrey
Copy link
Contributor

SovereignAndrey commented Sep 27, 2023

@stevieraykatz Seeming how vaults are setup now on testnet, do you think this PR is ready for a review?
PS. Looks like there's some merge conflicts to address with master branch.

@stevieraykatz stevieraykatz changed the title [WIP] Get ready for mainnet flux deployment Get ready for mainnet flux deployment Sep 27, 2023
@stevieraykatz stevieraykatz removed the WIP label Sep 27, 2023
Copy link
Contributor

@0xNeshi 0xNeshi left a 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)

tasks/deploy/integrations/helpers/fullStrategy.ts Outdated Show resolved Hide resolved
tasks/deploy/integrations/helpers/fullStrategy.ts Outdated Show resolved Hide resolved
);

// establish registrar config on primary chain and this chain
await hre.run("manage:registrar:setStratParams", {
Copy link
Contributor

@0xNeshi 0xNeshi Sep 29, 2023

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,
  });

Copy link
Contributor Author

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.

@SovereignAndrey SovereignAndrey merged commit 0240014 into master Oct 1, 2023
1 check passed
@SovereignAndrey SovereignAndrey deleted the ap-786-flux-readiness branch October 1, 2023 22:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants