Skip to content

Commit ef48ff8

Browse files
authored
Sparrow dom/deploy additions (#1212)
* remove generalized meta strategies that we are not intendint to deploy any time soon * add the ability to execute (generalized strategy) proposals in fork test environment * prettier * exchange alUSD for LUSD in unit tests and fix unit tests * add utlity to handle proposals on forked node more automatically * remove alusd reference * better comments * better comment * simplify * update LUSD address * correct placement
1 parent 5885f8e commit ef48ff8

20 files changed

+193
-281
lines changed

contracts/contracts/mocks/curve/MockCurvealUSDMetapool.sol renamed to contracts/contracts/mocks/curve/MockCurveLUSDMetapool.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ pragma solidity ^0.8.0;
44
import { MockCurveAbstractMetapool } from "./MockCurveAbstractMetapool.sol";
55
import "../MintableERC20.sol";
66

7-
contract MockCurvealUSDMetapool is MockCurveAbstractMetapool {
7+
contract MockCurveLUSDMetapool is MockCurveAbstractMetapool {
88
constructor(address[2] memory _coins)
9-
ERC20("Curve.fi Factory USD Metapool: alUSD", "ALUSD3CRV-f")
9+
ERC20("Curve.fi Factory USD Metapool: LUSD", "LUSD3CRV-f")
1010
{
1111
coins = _coins;
1212
}

contracts/contracts/mocks/curve/MockalUSD.sol renamed to contracts/contracts/mocks/curve/MockLUSD.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ pragma solidity ^0.8.0;
33

44
import "../MintableERC20.sol";
55

6-
contract MockalUSD is MintableERC20 {
7-
constructor() ERC20("alUSD", "alUSD Token") {}
6+
contract MockLUSD is MintableERC20 {
7+
constructor() ERC20("LUSD", "Liquity Token") {}
88
}

contracts/contracts/proxies/Proxies.sol

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,6 @@ contract ConvexOUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
8080

8181
}
8282

83-
/**
84-
* @notice ConvexalUSDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation
85-
*/
86-
contract ConvexalUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
87-
88-
}
89-
90-
/**
91-
* @notice ConvexmUSDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation
92-
*/
93-
contract ConvexmUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
94-
95-
}
96-
97-
/**
98-
* @notice ConvexUSDDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation
99-
*/
100-
contract ConvexUSDDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
101-
102-
}
103-
104-
/**
105-
* @notice ConvexBUSDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation
106-
*/
107-
contract ConvexBUSDMetaStrategyProxy is InitializeGovernedUpgradeabilityProxy {
108-
109-
}
110-
11183
/**
11284
* @notice ConvexLUSDMetaStrategyProxy delegates calls to a ConvexalGeneralizedMetaStrategy implementation
11385
*/

contracts/deploy/000_mock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const deployMocks = async ({ getNamedAccounts, deployments }) => {
227227
args: [[dai.address, usdc.address, usdt.address], threePoolToken.address],
228228
});
229229

230-
await deploy("MockalUSD", {
230+
await deploy("MockLUSD", {
231231
from: deployerAddr,
232232
});
233233

contracts/deploy/001_core.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
} = require("../utils/deploy");
1515
const {
1616
metapoolLPCRVPid,
17-
alusdMetapoolLPCRVPid,
17+
lusdMetapoolLPCRVPid,
1818
} = require("../utils/constants");
1919

2020
/**
@@ -301,45 +301,45 @@ const deployConvexStrategy = async () => {
301301
};
302302

303303
/**
304-
* Deploys a Convex Generalized Meta Strategy with alUSD token configuration
304+
* Deploys a Convex Generalized Meta Strategy with LUSD token configuration
305305
*/
306-
const deployConvexalUSDMetaStrategy = async () => {
306+
const deployConvexLUSDMetaStrategy = async () => {
307307
const assetAddresses = await getAssetAddresses(deployments);
308308
const { deployerAddr, governorAddr } = await getNamedAccounts();
309309
// Signers
310310
const sDeployer = await ethers.provider.getSigner(deployerAddr);
311311
const sGovernor = await ethers.provider.getSigner(governorAddr);
312312

313-
await deployWithConfirmation("ConvexalUSDMetaStrategyProxy");
314-
const cConvexalUSDMetaStrategyProxy = await ethers.getContract(
315-
"ConvexalUSDMetaStrategyProxy"
313+
await deployWithConfirmation("ConvexLUSDMetaStrategyProxy");
314+
const cConvexLUSDMetaStrategyProxy = await ethers.getContract(
315+
"ConvexLUSDMetaStrategyProxy"
316316
);
317317

318-
const dConvexalUSDMetaStrategy = await deployWithConfirmation(
318+
const dConvexLUSDMetaStrategy = await deployWithConfirmation(
319319
"ConvexGeneralizedMetaStrategy"
320320
);
321-
const cConvexalUSDMetaStrategy = await ethers.getContractAt(
321+
const cConvexLUSDMetaStrategy = await ethers.getContractAt(
322322
"ConvexGeneralizedMetaStrategy",
323-
cConvexalUSDMetaStrategyProxy.address
323+
cConvexLUSDMetaStrategyProxy.address
324324
);
325325

326326
await withConfirmation(
327-
cConvexalUSDMetaStrategyProxy["initialize(address,address,bytes)"](
328-
dConvexalUSDMetaStrategy.address,
327+
cConvexLUSDMetaStrategyProxy["initialize(address,address,bytes)"](
328+
dConvexLUSDMetaStrategy.address,
329329
deployerAddr,
330330
[]
331331
)
332332
);
333-
log("Initialized ConvexalUSDMetaStrategyProxy");
333+
log("Initialized ConvexLUSDMetaStrategyProxy");
334334

335335
// Initialize Strategies
336336
const cVaultProxy = await ethers.getContract("VaultProxy");
337337
const mockBooster = await ethers.getContract("MockBooster");
338338
const mockRewardPool = await ethers.getContract("MockRewardPool");
339339

340-
const alUsd = await ethers.getContract("MockalUSD");
340+
const LUSD = await ethers.getContract("MockLUSD");
341341
await withConfirmation(
342-
cConvexalUSDMetaStrategy
342+
cConvexLUSDMetaStrategy
343343
.connect(sDeployer)
344344
[
345345
"initialize(address[],address[],address[],(address,address,address,address,address,address,address,uint256))"
@@ -355,32 +355,32 @@ const deployConvexalUSDMetaStrategy = async () => {
355355
assetAddresses.ThreePool,
356356
cVaultProxy.address,
357357
mockBooster.address, // _cvxDepositorAddress,
358-
assetAddresses.ThreePoolalUSDMetapool, // metapool address,
359-
alUsd.address, // alUsd
358+
assetAddresses.ThreePoolLUSDMetapool, // metapool address,
359+
LUSD.address, // LUSD
360360
mockRewardPool.address, // _cvxRewardStakerAddress,
361-
assetAddresses.alUSDMetapoolToken, // metapoolLpToken
362-
alusdMetapoolLPCRVPid, // _cvxDepositorPTokenId
361+
assetAddresses.LUSDMetapoolToken, // metapoolLpToken
362+
lusdMetapoolLPCRVPid, // _cvxDepositorPTokenId
363363
]
364364
)
365365
);
366-
log("Initialized ConvexalUSDMetaStrategy");
366+
log("Initialized ConvexLUSDMetaStrategy");
367367

368368
await withConfirmation(
369-
cConvexalUSDMetaStrategy.connect(sDeployer).transferGovernance(governorAddr)
369+
cConvexLUSDMetaStrategy.connect(sDeployer).transferGovernance(governorAddr)
370370
);
371-
log(`ConvexalUSDMetaStrategy transferGovernance(${governorAddr}) called`);
371+
log(`ConvexLUSDMetaStrategy transferGovernance(${governorAddr}) called`);
372372
// On Mainnet the governance transfer gets executed separately, via the
373373
// multi-sig wallet. On other networks, this migration script can claim
374374
// governance by the governor.
375375
if (!isMainnet) {
376376
await withConfirmation(
377-
cConvexalUSDMetaStrategy
377+
cConvexLUSDMetaStrategy
378378
.connect(sGovernor) // Claim governance with governor
379379
.claimGovernance()
380380
);
381-
log("Claimed governance for ConvexalUSDMetaStrategy");
381+
log("Claimed governance for ConvexLUSDMetaStrategy");
382382
}
383-
return cConvexalUSDMetaStrategy;
383+
return cConvexLUSDMetaStrategy;
384384
};
385385

386386
/**
@@ -614,17 +614,17 @@ const configureStrategies = async (harvesterProxy) => {
614614
metaStrategy.connect(sGovernor).setHarvesterAddress(harvesterProxy.address)
615615
);
616616

617-
const alUSDMetaStrategyProxy = await ethers.getContract(
618-
"ConvexalUSDMetaStrategyProxy"
617+
const LUSDMetaStrategyProxy = await ethers.getContract(
618+
"ConvexLUSDMetaStrategyProxy"
619619
);
620-
const alUSDMetaStrategy = await ethers.getContractAt(
620+
const LUSDMetaStrategy = await ethers.getContractAt(
621621
"ConvexGeneralizedMetaStrategy",
622-
alUSDMetaStrategyProxy.address
622+
LUSDMetaStrategyProxy.address
623623
);
624624
await withConfirmation(
625-
alUSDMetaStrategy
626-
.connect(sGovernor)
627-
.setHarvesterAddress(harvesterProxy.address)
625+
LUSDMetaStrategy.connect(sGovernor).setHarvesterAddress(
626+
harvesterProxy.address
627+
)
628628
);
629629

630630
const threePoolProxy = await ethers.getContract("ThreePoolStrategyProxy");
@@ -823,20 +823,20 @@ const deployCurveMetapoolMocks = async () => {
823823
};
824824

825825
// deploy curve metapool mocks
826-
const deployCurvealUSDMetapoolMocks = async () => {
826+
const deployCurveLUSDMetapoolMocks = async () => {
827827
const { deployerAddr } = await hre.getNamedAccounts();
828828
const assetAddresses = await getAssetAddresses(deployments);
829829

830-
const alUsd = await ethers.getContract("MockalUSD");
830+
const LUSD = await ethers.getContract("MockLUSD");
831831

832-
await hre.deployments.deploy("MockCurvealUSDMetapool", {
832+
await hre.deployments.deploy("MockCurveLUSDMetapool", {
833833
from: deployerAddr,
834-
args: [[alUsd.address, assetAddresses.ThreePoolToken]],
834+
args: [[LUSD.address, assetAddresses.ThreePoolToken]],
835835
});
836836

837-
const alUSDMetapoolToken = await ethers.getContract("MockCurvealUSDMetapool");
837+
const LUSDMetapoolToken = await ethers.getContract("MockCurveLUSDMetapool");
838838
const mockBooster = await ethers.getContract("MockBooster");
839-
await mockBooster.setPool(alusdMetapoolLPCRVPid, alUSDMetapoolToken.address);
839+
await mockBooster.setPool(lusdMetapoolLPCRVPid, LUSDMetapoolToken.address);
840840
};
841841

842842
// Deploy the Flipper trading contract
@@ -967,13 +967,13 @@ const main = async () => {
967967
await deployOracles();
968968
await deployCore();
969969
await deployCurveMetapoolMocks();
970-
await deployCurvealUSDMetapoolMocks();
970+
await deployCurveLUSDMetapoolMocks();
971971
await deployCompoundStrategy();
972972
await deployAaveStrategy();
973973
await deployThreePoolStrategy();
974974
await deployConvexStrategy();
975975
await deployConvexOUSDMetaStrategy();
976-
await deployConvexalUSDMetaStrategy();
976+
await deployConvexLUSDMetaStrategy();
977977
const harvesterProxy = await deployHarvester();
978978
await configureVault(harvesterProxy);
979979
await configureStrategies(harvesterProxy);

contracts/deploy/045_convex_lusd_meta_strategy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const { lusdMetapoolLPCRVPid } = require("../utils/constants");
33

44
module.exports = generalizedConvexStratDeployment({
55
deployName: "045_convex_lusd_meta_strategy",
6-
forceDeploy: false,
76
mainTokenName: "Liquity USD",
87
mainTokenSymbol: "LUSD",
98
rewardTokenNames: ["CVX", "CRV"],
@@ -19,4 +18,5 @@ module.exports = generalizedConvexStratDeployment({
1918
redeployVault: false,
2019
deployStrategyImplementation: true,
2120
skipMainnetDeploy: false,
21+
proposalId: 41, // just set to false if no proposal id yet
2222
});

contracts/deploy/101_convex_alusd_meta_strategy.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

contracts/deploy/102_convex_musd_meta_strategy.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

contracts/deploy/103_convex_usdd_meta_strategy.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

contracts/deploy/104_convex_busd_meta_strategy.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)