Skip to content

Commit

Permalink
Fix deploy script issues
Browse files Browse the repository at this point in the history
  • Loading branch information
134dd3v committed Aug 15, 2022
1 parent 1c409f1 commit 4d5fc87
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 35 deletions.
10 changes: 5 additions & 5 deletions deploy/curve-yield-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (ProxyDeployment.newlyDeployed) {
await execute(
'CurveYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'grantAllowances',
);

await execute(
'CurveYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'updateBaseParams',
parseUnits(networkInfo.DEPOSIT_CAP_C3CLT.toString(), 18),
networkInfo.KEEPER_ADDRESS,
Expand All @@ -91,7 +91,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

await execute(
'CurveYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'updateCurveParams',
1000, // feeBps
100, // stablecoinSlippage
Expand All @@ -103,7 +103,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const MINTER_ROLE = await read('CollateralToken', 'MINTER_ROLE');
await execute(
'CollateralToken',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'grantRole',
MINTER_ROLE,
ProxyDeployment.address,
Expand All @@ -112,7 +112,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// transfer ownership to team multisig
await execute(
'CurveYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'transferOwnership',
networkInfo.MULTISIG,
);
Expand Down
69 changes: 39 additions & 30 deletions deploy/gmx-vault/gmx-vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,87 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const networkInfo = getNetworkInfo(hre.network.config.chainId ?? 31337);

const gmxBatchingManagerDeployment = await get('GMXBatchingManager');
const gmxYieldStrategyDeployment = await get('GMXYieldStrategy');
const gmxBatchingManagerDeployment = await get('GMXBatchingManager');
const glpStakingManagerDeployment = await get('GlpStakingManager');

//
// provide minter role
//

const MINTER_ROLE = await read('CollateralToken', 'MINTER_ROLE');
await execute(
'CollateralToken',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'grantRole',
MINTER_ROLE,
gmxYieldStrategyDeployment.address,
);

//
// GlpStakingManager
// update params
//

await execute(
'GlpStakingManager',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'updateGMXParams',
1000, // _feeBps,
parseEther('0.01'), // _wethThreshold,
1000, // _slippageThreshold,
gmxBatchingManagerDeployment.address,
);

//
// GMXBatchingManager
//
await execute(
'GMXBatchingManager',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
'addVault',
gmxYieldStrategyDeployment.address,
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'updateBaseParams',
parseUnits(networkInfo.DEPOSIT_CAP_C3CLT.toString(), 18),
networkInfo.KEEPER_ADDRESS,
86400, // rebalanceTimeThreshold
500, // rebalancePriceThresholdBps
);

await execute(
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'updateGMXParams',
glpStakingManagerDeployment.address,
1000, // _usdcReedemSlippage
1e6, // _usdcConversionThreshold
);

await execute(
'GMXBatchingManager',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
'grantAllowances',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'addVault',
gmxYieldStrategyDeployment.address,
);

//
// GMXYieldStrategy
// grant allowances
//

await execute(
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
'GMXBatchingManager',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'grantAllowances',
gmxYieldStrategyDeployment.address,
);

await execute(
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
'updateBaseParams',
parseUnits(networkInfo.DEPOSIT_CAP_C3CLT.toString(), 18),
networkInfo.KEEPER_ADDRESS,
86400, // rebalanceTimeThreshold
500, // rebalancePriceThresholdBps
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'grantAllowances',
);

await execute(
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
'updateGMXParams',
1000, // feeBps
gmxBatchingManagerDeployment.address, // batchingManager
);
//
// finally transfer ownership
//

await execute(
'GMXYieldStrategy',
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations },
{ from: deployer, estimateGasExtra: 1_000_000, waitConfirmations, log: true },
'transferOwnership',
networkInfo.MULTISIG,
);
Expand Down

0 comments on commit 4d5fc87

Please sign in to comment.