Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions contracts/deploy/000_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ const {
bytecode: MANAGER_BYTECODE,
} = require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json");

const {
abi: TOKEN_DESCRIPTOR_ABI,
bytecode: TOKEN_DESCRIPTOR_BYTECODE,
} = require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json");

const {
abi: QUOTER_ABI,
bytecode: QUOTER_BYTECODE,
Expand Down
163 changes: 71 additions & 92 deletions contracts/deploy/001_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const deployAaveStrategy = async () => {
await withConfirmation(
cAaveStrategy
.connect(sDeployer)
// eslint-disable-next-line no-unexpected-multiline
[initFunctionName](
assetAddresses.AAVE_ADDRESS_PROVIDER,
cVaultProxy.address,
Expand Down Expand Up @@ -189,23 +190,10 @@ const deployThreePoolStrategy = async () => {
// Initialize Strategies
const cVaultProxy = await ethers.getContract("VaultProxy");
await withConfirmation(
cThreePoolStrategy
.connect(sDeployer)
[
"initialize(address,address,address[],address[],address[],address,address)"
](
assetAddresses.ThreePool,
cVaultProxy.address,
[assetAddresses.CRV],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
assetAddresses.ThreePoolGauge,
assetAddresses.CRVMinter
)
cThreePoolStrategy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address,address,address[],address[],address[],address,address)"
](assetAddresses.ThreePool, cVaultProxy.address, [assetAddresses.CRV], [assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT], [assetAddresses.ThreePoolToken, assetAddresses.ThreePoolToken, assetAddresses.ThreePoolToken], assetAddresses.ThreePoolGauge, assetAddresses.CRVMinter)
);
log("Initialized ThreePoolStrategy");

Expand Down Expand Up @@ -261,24 +249,23 @@ const deployConvexStrategy = async () => {
const mockBooster = await ethers.getContract("MockBooster");
const mockRewardPool = await ethers.getContract("MockRewardPool");
await withConfirmation(
cConvexStrategy
.connect(sDeployer)
cConvexStrategy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address,address,address[],address[],address[],address,address,uint256)"
](
assetAddresses.ThreePool,
cVaultProxy.address,
[assetAddresses.CRV, assetAddresses.CVX],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
"initialize(address,address,address[],address[],address[],address,address,uint256)"
](
assetAddresses.ThreePool,
cVaultProxy.address,
[assetAddresses.CRV, assetAddresses.CVX],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
mockBooster.address, // _cvxDepositorAddress,
mockRewardPool.address, // _cvxRewardStakerAddress,
9 // _cvxDepositorPTokenId
)
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
mockBooster.address, // _cvxDepositorAddress,
mockRewardPool.address, // _cvxRewardStakerAddress,
9 // _cvxDepositorPTokenId
)
);
log("Initialized ConvexStrategy");

Expand Down Expand Up @@ -339,29 +326,28 @@ const deployConvexLUSDMetaStrategy = async () => {

const LUSD = await ethers.getContract("MockLUSD");
await withConfirmation(
cConvexLUSDMetaStrategy
.connect(sDeployer)
cConvexLUSDMetaStrategy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address[],address[],address[],(address,address,address,address,address,address,address,uint256))"
](
[assetAddresses.CVX, assetAddresses.CRV],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
"initialize(address[],address[],address[],(address,address,address,address,address,address,address,uint256))"
](
[assetAddresses.CVX, assetAddresses.CRV],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
[
assetAddresses.ThreePool,
cVaultProxy.address,
mockBooster.address, // _cvxDepositorAddress,
assetAddresses.ThreePoolLUSDMetapool, // metapool address,
LUSD.address, // LUSD
mockRewardPool.address, // _cvxRewardStakerAddress,
assetAddresses.LUSDMetapoolToken, // metapoolLpToken
lusdMetapoolLPCRVPid, // _cvxDepositorPTokenId
]
)
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
[
assetAddresses.ThreePool,
cVaultProxy.address,
mockBooster.address, // _cvxDepositorAddress,
assetAddresses.ThreePoolLUSDMetapool, // metapool address,
LUSD.address, // LUSD
mockRewardPool.address, // _cvxRewardStakerAddress,
assetAddresses.LUSDMetapoolToken, // metapoolLpToken
lusdMetapoolLPCRVPid, // _cvxDepositorPTokenId
]
)
);
log("Initialized ConvexLUSDMetaStrategy");

Expand Down Expand Up @@ -422,29 +408,28 @@ const deployConvexOUSDMetaStrategy = async () => {
const ousd = await ethers.getContract("OUSDProxy");

await withConfirmation(
cConvexOUSDMetaStrategy
.connect(sDeployer)
cConvexOUSDMetaStrategy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address[],address[],address[],(address,address,address,address,address,address,address,uint256))"
](
[assetAddresses.CVX, assetAddresses.CRV],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
"initialize(address[],address[],address[],(address,address,address,address,address,address,address,uint256))"
](
[assetAddresses.CVX, assetAddresses.CRV],
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
[
assetAddresses.ThreePool,
cVaultProxy.address,
mockBooster.address, // _cvxDepositorAddress,
assetAddresses.ThreePoolOUSDMetapool, // metapool address,
ousd.address, // _ousdAddress,
mockRewardPool.address, // _cvxRewardStakerAddress,
assetAddresses.ThreePoolOUSDMetapool, // metapoolLpToken (metapool address),
metapoolLPCRVPid, // _cvxDepositorPTokenId
]
)
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
[
assetAddresses.ThreePool,
cVaultProxy.address,
mockBooster.address, // _cvxDepositorAddress,
assetAddresses.ThreePoolOUSDMetapool, // metapool address,
ousd.address, // _ousdAddress,
mockRewardPool.address, // _cvxRewardStakerAddress,
assetAddresses.ThreePoolOUSDMetapool, // metapoolLpToken (metapool address),
metapoolLPCRVPid, // _cvxDepositorPTokenId
]
)
);
log("Initialized ConvexOUSDMetaStrategy");

Expand Down Expand Up @@ -1103,13 +1088,10 @@ const deployBuyback = async () => {

// Init proxy to implementation
await withConfirmation(
cBuybackProxy
.connect(sDeployer)
["initialize(address,address,bytes)"](
dBuybackImpl.address,
deployerAddr,
[]
)
cBuybackProxy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address,address,bytes)"
](dBuybackImpl.address, deployerAddr, [])
);

const cBuyback = await ethers.getContractAt("Buyback", cBuybackProxy.address);
Expand Down Expand Up @@ -1178,13 +1160,10 @@ const deployWOusd = async () => {
const wousdProxy = await ethers.getContract("WrappedOUSDProxy");
const wousd = await ethers.getContractAt("WrappedOusd", wousdProxy.address);

await wousdProxy
.connect(sDeployer)
["initialize(address,address,bytes)"](
dWrappedOusdImpl.address,
deployerAddr,
[]
);
await wousdProxy.connect(sDeployer)[
// eslint-disable-next-line no-unexpected-multiline
"initialize(address,address,bytes)"
](dWrappedOusdImpl.address, deployerAddr, []);
await wousd.connect(sDeployer)["initialize()"]();
await wousd.connect(sDeployer).transferGovernance(governorAddr);
await wousd.connect(sGovernor).claimGovernance();
Expand Down
4 changes: 1 addition & 3 deletions contracts/deploy/008_ousd_reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,9 @@ const deployVault = async () => {
};

const upgradeAndResetOUSD = async () => {
const { depoyerAddr, governorAddr, v1GovernorAddr } =
await hre.getNamedAccounts();
const { governorAddr, v1GovernorAddr } = await hre.getNamedAccounts();

// Signers
const sDeployer = await ethers.provider.getSigner(depoyerAddr);
const sGovernor = await ethers.provider.getSigner(governorAddr);

// Temporary OUSD for running a reset
Expand Down
10 changes: 4 additions & 6 deletions contracts/deploy/009_ousd_fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,24 @@ const fixOUSD = async () => {
await withConfirmation(
cOUSDProxy
.connect(sGovernor)
.upgradeTo(dOUSDReset.address, await getTxOpts(gasLimit))
.upgradeTo(dOUSDReset.address, await getTxOpts())
);
log("Upgraded OUSD to reset implementation");

await withConfirmation(
cOUSDReset
.connect(sGovernor)
.setVaultAddress(cVaultProxy.address, await getTxOpts(gasLimit))
.setVaultAddress(cVaultProxy.address, await getTxOpts())
);
log("Vault address set");

await withConfirmation(
cOUSDReset.connect(sGovernor).reset(await getTxOpts(gasLimit))
cOUSDReset.connect(sGovernor).reset(await getTxOpts())
);
log("Called reset on OUSD");

await withConfirmation(
cOUSDProxy
.connect(sGovernor)
.upgradeTo(dOUSD.address, await getTxOpts(gasLimit))
cOUSDProxy.connect(sGovernor).upgradeTo(dOUSD.address, await getTxOpts())
);
log("Upgraded OUSD to standard implementation");
}
Expand Down
4 changes: 1 addition & 3 deletions contracts/deploy/011_ousd_fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ const fixOUSD = async (hre) => {
log("Proposal executed.");
} else {
await withConfirmation(
cOUSDProxy
.connect(sGovernor)
.upgradeTo(dOUSD.address, await getTxOpts(gasLimit))
cOUSDProxy.connect(sGovernor).upgradeTo(dOUSD.address, await getTxOpts())
);
log("Upgraded OUSD to new implementation");
}
Expand Down
8 changes: 3 additions & 5 deletions contracts/deploy/012_upgrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,21 @@ const upgrades = async (hre) => {
log("Proposal executed.");
} else {
await withConfirmation(
cOUSDProxy
.connect(sGovernor)
.upgradeTo(dOUSD.address, await getTxOpts(gasLimit))
cOUSDProxy.connect(sGovernor).upgradeTo(dOUSD.address, await getTxOpts())
);
log("Upgraded OUSD to new implementation");

await withConfirmation(
cVaultCoreProxy
.connect(sGovernor)
.setAdminImpl(dVaultAdmin.address, await getTxOpts(gasLimit))
.setAdminImpl(dVaultAdmin.address, await getTxOpts())
);
log("Upgraded VaultAdmin to new implementation");

await withConfirmation(
cCompoundStrategyProxy
.connect(sGovernor)
.upgradeTo(dCompoundStrategy.address, await getTxOpts(gasLimit))
.upgradeTo(dCompoundStrategy.address, await getTxOpts())
);
log("Upgraded CompoundStrategy to new implementation");
}
Expand Down
6 changes: 3 additions & 3 deletions contracts/deploy/013_trustee.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ const trustee = async (hre) => {
await withConfirmation(
cVaultProxy
.connect(sGovernor)
.upgradeTo(dVaultCore.address, await getTxOpts(gasLimit))
.upgradeTo(dVaultCore.address, await getTxOpts())
);
log("Upgraded VaultCore to new implementation");

await withConfirmation(
cvaultAdmin
.connect(sGovernor)
.setTrusteeAddress(trusteeAddress, await getTxOpts(gasLimit))
.setTrusteeAddress(trusteeAddress, await getTxOpts())
);
log("Trustee address set");

await withConfirmation(
cvaultAdmin
.connect(sGovernor)
.setTrusteeFeeBps(trusteeFeeBps, await getTxOpts(gasLimit))
.setTrusteeFeeBps(trusteeFeeBps, await getTxOpts())
);
log("Trustee fee bps set");
}
Expand Down
30 changes: 6 additions & 24 deletions contracts/deploy/014_3pool_strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,10 @@ const runDeployment = async (hre) => {

// Initialize 3Pool implementation.
await withConfirmation(
cThreePoolStrategy
.connect(sDeployer)
[
"initialize(address,address,address,address[],address[],address,address)"
](
assetAddresses.ThreePool,
cVaultProxy.address,
assetAddresses.CRV,
[assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT],
[
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
assetAddresses.ThreePoolToken,
],
assetAddresses.ThreePoolGauge,
assetAddresses.CRVMinter
)
cThreePoolStrategy.connect(sDeployer)[
// eslint-disable-next-line
"initialize(address,address,address,address[],address[],address,address)"
](assetAddresses.ThreePool, cVaultProxy.address, assetAddresses.CRV, [assetAddresses.DAI, assetAddresses.USDC, assetAddresses.USDT], [assetAddresses.ThreePoolToken, assetAddresses.ThreePoolToken, assetAddresses.ThreePoolToken], assetAddresses.ThreePoolGauge, assetAddresses.CRVMinter)
);
log("Initialized ThreePoolStrategy");

Expand Down Expand Up @@ -140,18 +127,13 @@ const runDeployment = async (hre) => {
log("Proposal executed.");
} else {
await withConfirmation(
cThreePoolStrategy
.connect(sGovernor)
.claimGovernance(await getTxOpts(gasLimit))
cThreePoolStrategy.connect(sGovernor).claimGovernance(await getTxOpts())
);
log("Claimed governance of ThreePoolStrategy");
await withConfirmation(
cVault
.connect(sGovernor)
.approveStrategy(
cThreePoolStrategyProxy.address,
await getTxOpts(gasLimit)
)
.approveStrategy(cThreePoolStrategyProxy.address, await getTxOpts())
);
log("Approved ThreePoolStrategy on Vault");
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/016_chainlink_and_buyback.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const runDeployment = async (hre) => {
);
log("Upgrade VaultCore implementation");
await withConfirmation(
cBuyback.connect(sGovernor).claimGovernance(await getTxOpts(gasLimit))
cBuyback.connect(sGovernor).claimGovernance(await getTxOpts())
);
log("Claimed governance of Buyback contract");
await withConfirmation(
Expand Down
Loading