Skip to content

Commit

Permalink
Prettify code
Browse files Browse the repository at this point in the history
  • Loading branch information
ylv-io committed Jun 1, 2021
1 parent 8a29f73 commit 510d07d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions deployments/deploy-mainnet-31042021.log
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
contracts/BabController.sol -> Upgrade -> Done
contracts/PriceOracle.sol -> Deploy -> Done
contracts/PriceOracle.sol -> Deploy -> Done -> Set
contracts/gardens/Garden.sol -> Deploy -> Done
contracts/gardens/GardenFactory.sol -> Deploy -> Done
contracts/integrations/passive/HarvestVaultIntegration.sol -> Deploy -> Done
contracts/gardens/GardenFactory.sol -> Deploy -> Done -> Set
contracts/integrations/passive/HarvestVaultIntegration.sol -> Deploy -> Done -> Set
contracts/integrations/trade/OneInchTradeIntegration.sol -> Deploy -> Done
contracts/strategies/Strategy.sol -> Deploy -> Done
contracts/strategies/StrategyFactory.sol -> Deploy -> Done
Expand Down
1 change: 0 additions & 1 deletion deployments/migrations/005-garden-valuer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = async ({
gasPrice,
});


if (deployment.newlyDeployed) {
console.log(`Setting garden valuer on controller ${deployment.address}`);
await (await controllerContract.editGardenValuer(deployment.address, { gasPrice })).wait();
Expand Down
7 changes: 3 additions & 4 deletions deployments/migrations/007-garden-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ module.exports = async ({
getRapid,
}) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const singer = await getSigner(deployer);
const { deployer, owner } = await getNamedAccounts();
const signer = await getSigner(signer);
const gasPrice = await getRapid();

const gardenFactoryContract = 'GardenFactory';
const gardenContract = 'Garden';
const beaconContract = 'GardenBeacon';

const controller = await deployments.get('BabControllerProxy');
const controllerContract = await ethers.getContractAt('BabController', controller.address, singer);
const controllerContract = await ethers.getContractAt('BabController', controller.address, signer);

const garden = await deploy(gardenContract, {
from: deployer,
Expand Down Expand Up @@ -60,4 +60,3 @@ module.exports = async ({
};

module.exports.tags = ['GardenFactory'];
module.exports.dependencies = ['Controller'];
1 change: 0 additions & 1 deletion deployments/migrations/008-strategy-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module.exports = async ({
gasPrice,
});


if (strategyFactory.newlyDeployed) {
console.log(`Setting strategy factory on controller ${strategyFactory.address}`);
await (await controllerContract.editStrategyFactory(strategyFactory.address, { gasPrice })).wait();
Expand Down
8 changes: 4 additions & 4 deletions deployments/migrations/012-inch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module.exports = async ({
getRapid,
}) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const singer = await getSigner(deployer);
const { deployer, owner } = await getNamedAccounts();
const signer = await getSigner(owner);
const gasPrice = await getRapid();
const contract = 'OneInchTradeIntegration';

const controller = await deployments.get('BabControllerProxy');
const controllerContract = await ethers.getContractAt('BabController', controller.address, singer);
const controllerContract = await ethers.getContractAt('BabController', controller.address, signer);

const deployment = await deploy(contract, {
from: deployer,
Expand All @@ -25,7 +25,7 @@ module.exports = async ({
gasPrice,
});

if (deployment.newlyDeployed) {
if (!deployment.newlyDeployed) {
console.log(`Adding integration ${contract}(${deployment.address}) to BabController`);
await (
await controllerContract.addIntegration(
Expand Down
2 changes: 1 addition & 1 deletion deployments/migrations/018-harvest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = async ({
getRapid,
}) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const { deployer, owner } = await getNamedAccounts();
const singer = await getSigner(deployer);
const gasPrice = await getRapid();
const contract = 'HarvestVaultIntegration';
Expand Down
1 change: 0 additions & 1 deletion deployments/migrations/025-gardennft.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = async ({
gasPrice,
});


if (deployment.newlyDeployed) {
console.log(`Setting garden NFT on controller ${deployment.address}`);
await (await controllerContract.editGardenNFT(deployment.address, { gasPrice })).wait();
Expand Down
6 changes: 5 additions & 1 deletion lib/plugins/upgrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ extendEnvironment((hre) => {
const { deployments } = hre;

async function getContract(contractName, deploymentName, signer) {
return await ethers.getContractAt(contractName, (await deployments.get(deploymentName || contractName)).address, signer);
return await ethers.getContractAt(
contractName,
(await deployments.get(deploymentName || contractName)).address,
signer,
);
}

hre.upgradesDeployer = {
Expand Down

0 comments on commit 510d07d

Please sign in to comment.