fix: redeployed and verified ConnectorProviderPayment and ConnectGelatoDataPartialRefinanceMaker

This commit is contained in:
gitpusha 2020-11-17 08:29:09 +01:00 committed by Twin Fish
parent 2056c26357
commit c36a988795
19 changed files with 351 additions and 123 deletions

View File

@ -1,8 +1,6 @@
const hre = require("hardhat");
const { ethers } = hre;
const { sleep } = require("@gelatonetwork/core");
const InstaConnector = require("../../pre-compiles/InstaConnectors.json");
module.exports = async (hre) => {
@ -18,25 +16,6 @@ module.exports = async (hre) => {
const { deploy } = deployments;
const { deployer } = await hre.getNamedAccounts();
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
// the following will only deploy "ConnectGelatoDataFullRefinanceMaker"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoDataFullRefinanceMaker", {
from: deployer,
args: [
connectorId,
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
gasPrice: hre.network.config.gasPrice,
log: hre.network.name === "mainnet" ? true : false,
});
if (hre.network.name === "hardhat") {
const deployerWallet = await ethers.provider.getSigner(deployer);
const instaMaster = await ethers.provider.getSigner(
@ -53,6 +32,21 @@ module.exports = async (hre) => {
params: [await instaMaster.getAddress()],
});
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
await deploy("ConnectGelatoDataFullRefinanceMaker", {
from: deployer,
args: [
connectorId,
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
});
await instaConnectors
.connect(instaMaster)
.enable(
@ -64,8 +58,27 @@ module.exports = async (hre) => {
method: "hardhat_stopImpersonatingAccount",
params: [await instaMaster.getAddress()],
});
} else {
// the following will only deploy "ConnectGelatoDataFullRefinanceMaker"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoDataFullRefinanceMaker", {
from: deployer,
args: [
parseInt(process.env.ConnectGelatoDataFullRefinanceMakerId),
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
gasPrice: hre.network.config.gasPrice,
nonce: 172,
log: true,
});
}
};
module.exports.skip = async (hre) => {
if (hre.network.name === "mainnet") return true;
if (hre.network.name !== "hardhat")
return process.env.ConnectGelatoDataFullRefinanceMakerId === undefined;
return false;
};
module.exports.dependencies = ["ConnectGelatoProviderPayment"];
module.exports.tags = ["ConnectGelatoDataFullRefinanceMaker"];

View File

@ -1,8 +1,7 @@
const hre = require("hardhat");
const { ethers } = hre;
const assert = require("assert");
const { sleep } = require("@gelatonetwork/core");
const InstaConnector = require("../../pre-compiles/InstaConnectors.json");
module.exports = async (hre) => {
@ -11,32 +10,13 @@ module.exports = async (hre) => {
"Deploying ConnectGelatoDataPartialRefinanceMaker to mainnet. Hit ctrl + c to abort"
);
console.log("❗ CONNECTOR DEPLOYMENT: VERIFY & HARDCODE CONNECTOR ID");
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
const { deploy } = deployments;
const { deployer } = await hre.getNamedAccounts();
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
// the following will only deploy "ConnectGelatoDataPartialRefinanceMaker"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoDataPartialRefinanceMaker", {
from: deployer,
args: [
connectorId,
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
gasPrice: hre.network.config.gasPrice,
log: hre.network.name === "mainnet" ? true : false,
});
if (hre.network.name === "hardhat") {
const deployerWallet = await ethers.provider.getSigner(deployer);
const instaMaster = await ethers.provider.getSigner(
@ -53,6 +33,21 @@ module.exports = async (hre) => {
params: [await instaMaster.getAddress()],
});
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
await deploy("ConnectGelatoDataPartialRefinanceMaker", {
from: deployer,
args: [
connectorId,
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
});
await instaConnectors
.connect(instaMaster)
.enable(
@ -64,11 +59,28 @@ module.exports = async (hre) => {
method: "hardhat_stopImpersonatingAccount",
params: [await instaMaster.getAddress()],
});
} else {
assert(process.env.ConnectGelatoDataPartialRefinanceMakerId);
// the following will only deploy "ConnectGelatoDataPartialRefinanceMaker"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoDataPartialRefinanceMaker", {
from: deployer,
args: [
parseInt(process.env.ConnectGelatoDataPartialRefinanceMakerId),
(await deployments.get("ConnectGelatoProviderPayment")).address,
],
gasPrice: hre.network.config.gasPrice,
log: true,
});
}
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
if (hre.network.name === "mainnet") return true;
if (hre.network.name !== "hardhat")
return process.env.ConnectGelatoDataPartialRefinanceMakerId === undefined;
return false;
};
module.exports.tags = ["ConnectGelatoDataPartialRefinanceMaker"];
module.exports.dependencies = ["ConnectGelatoProviderPayment"];

View File

@ -1,8 +1,6 @@
const hre = require("hardhat");
const { ethers } = hre;
const { sleep } = require("@gelatonetwork/core");
const InstaConnector = require("../../pre-compiles/InstaConnectors.json");
module.exports = async (hre) => {
@ -11,28 +9,12 @@ module.exports = async (hre) => {
"Deploying ConnectGelatoProviderPayment to mainnet. Hit ctrl + c to abort"
);
console.log("❗ CONNECTOR DEPLOYMENT: VERIFY & HARDCODE CONNECTOR ID");
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
const { deploy } = deployments;
const { deployer, gelatoProvider } = await hre.getNamedAccounts();
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
// the following will only deploy "ConnectGelatoProviderPayment"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoProviderPayment", {
from: deployer,
args: [connectorId, gelatoProvider],
gasPrice: hre.network.config.gasPrice,
log: hre.network.name === "mainnet" ? true : false,
});
if (hre.network.name === "hardhat") {
const deployerWallet = await ethers.provider.getSigner(deployer);
const instaMaster = await ethers.provider.getSigner(
@ -49,6 +31,18 @@ module.exports = async (hre) => {
params: [await instaMaster.getAddress()],
});
const instaConnectors = await hre.ethers.getContractAt(
InstaConnector.abi,
hre.network.config.InstaConnectors
);
const connectorLength = await instaConnectors.connectorLength();
const connectorId = connectorLength.add(1);
await deploy("ConnectGelatoProviderPayment", {
from: deployer,
args: [connectorId, gelatoProvider],
});
await instaConnectors
.connect(instaMaster)
.enable(
@ -59,7 +53,26 @@ module.exports = async (hre) => {
method: "hardhat_stopImpersonatingAccount",
params: [await instaMaster.getAddress()],
});
} else {
// the following will only deploy "ConnectGelatoProviderPayment"
// if the contract was never deployed or if the code changed since last deployment
await deploy("ConnectGelatoProviderPayment", {
from: deployer,
args: [
parseInt(process.env.ConnectGelatoProviderPaymentId),
gelatoProvider,
],
gasPrice: hre.network.config.gasPrice,
nonce: 170,
log: true,
});
}
};
module.exports.skip = async (hre) => {
if (hre.network.name === "mainnet") return true;
if (hre.network.name !== "hardhat")
return process.env.ConnectGelatoProviderPaymentId === undefined;
return false;
};
module.exports.tags = ["ConnectGelatoProviderPayment"];

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying ConditionCompareUintsFromTwoSources to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
@ -21,4 +21,7 @@ module.exports = async (hre) => {
});
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
};
module.exports.tags = ["ConditionCompareUintsFromTwoSources"];

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying ConditionDebtBridgeIsAffordable to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
@ -21,4 +21,7 @@ module.exports = async (hre) => {
});
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
};
module.exports.tags = ["ConditionDebtBridgeIsAffordable"];

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying ConditionMakerVaultUnsafe to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
@ -21,4 +21,7 @@ module.exports = async (hre) => {
});
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
};
module.exports.tags = ["ConditionMakerVaultUnsafe"];

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying FGelatoDebtBridgeMock to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying FGelatoDebtBridgeMock to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;

View File

@ -3,7 +3,7 @@ const { sleep } = require("@gelatonetwork/core");
module.exports = async (hre) => {
if (hre.network.name === "mainnet") {
console.log("Deploying MockCDAI to mainnet. Hit ctrl + c to abort");
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;

View File

@ -3,7 +3,7 @@ const { sleep } = require("@gelatonetwork/core");
module.exports = async (hre) => {
if (hre.network.name === "mainnet") {
console.log("Deploying MockDSR to mainnet. Hit ctrl + c to abort");
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;

View File

@ -8,7 +8,7 @@ module.exports = async (hre) => {
console.log(
"Deploying MockGelatoExecutor to mainnet. Hit ctrl + c to abort"
);
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;

View File

@ -3,7 +3,7 @@ const { sleep } = require("@gelatonetwork/core");
module.exports = async (hre) => {
if (hre.network.name === "mainnet") {
console.log("Deploying MakerResolver to mainnet. Hit ctrl + c to abort");
await sleep(6000);
await sleep(10000);
}
const { deployments } = hre;
@ -19,4 +19,7 @@ module.exports = async (hre) => {
});
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
};
module.exports.tags = ["MakerResolver"];

View File

@ -5,7 +5,7 @@ module.exports = async (hre) => {
console.log(
"Deploying PriceOracleResolver to mainnet. Hit ctrl + c to abort"
);
await sleep(5000);
await sleep(10000);
}
const { deployments } = hre;
@ -21,4 +21,7 @@ module.exports = async (hre) => {
});
};
module.exports.skip = async (hre) => {
return hre.network.name === "mainnet" ? true : false;
};
module.exports.tags = ["PriceOracleResolver"];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ module.exports = {
accounts: DEPLOYER_PK_MAINNET ? [DEPLOYER_PK_MAINNET] : [],
chainId: 1,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_ID}`,
gasPrice: parseInt(utils.parseUnits("90", "gwei")),
gasPrice: parseInt(utils.parseUnits("50", "gwei")),
timeout: 150000,
// Custom
...mainnetDeployments,

View File

@ -47,6 +47,6 @@
},
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,sol,css,md}": "prettier --write"
"*.{js,sol,json,css,md}": "prettier --write"
}
}