-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devHolesky deployment for protocol v1.2.0 (#282)
* chore: devHolesky deployment for protocol v1.2.0 * chore: v1.2.0 deployment with updated license
- Loading branch information
Showing
15 changed files
with
10,580 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { DeployFunction } from "hardhat-deploy/dist/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { isDeployed, logStep, logStepEnd } from "../../ts-utils/helpers/index"; | ||
import { verify } from "../../scripts/helpers"; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts }: HardhatRuntimeEnvironment) { | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
const allowlistDeployment = await deployments.deploy("AllowlistV1_Implementation_1_2_0", { | ||
contract: "AllowlistV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("AllowlistV1", allowlistDeployment.address, []); | ||
|
||
const coverageFundDeployment = await deployments.deploy("CoverageFundV1_Implementation_1_2_0", { | ||
contract: "CoverageFundV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("CoverageFundV1", coverageFundDeployment.address, []); | ||
|
||
const elFeeRecipientDeployment = await deployments.deploy("ELFeeRecipientV1_Implementation_1_2_0", { | ||
contract: "ELFeeRecipientV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("ELFeeRecipientV1", elFeeRecipientDeployment.address, []); | ||
|
||
const operatorsRegistryDeployment = await deployments.deploy("OperatorsRegistryV1_Implementation_1_2_0", { | ||
contract: "OperatorsRegistryV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("OperatorsRegistryV1", operatorsRegistryDeployment.address, []); | ||
|
||
const oracleDeployment = await deployments.deploy("OracleV1_Implementation_1_2_0", { | ||
contract: "OracleV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("OracleV1", oracleDeployment.address, []); | ||
|
||
const redeemManagerDeployment = await deployments.deploy("RedeemManagerV1_Implementation_1_2_0", { | ||
contract: "RedeemManagerV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("RedeemManagerV1", redeemManagerDeployment.address, []); | ||
|
||
const riverDeployment = await deployments.deploy("RiverV1_Implementation_1_2_0", { | ||
contract: "RiverV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("RiverV1", riverDeployment.address, []); | ||
|
||
const withdrawDeployment = await deployments.deploy("WithdrawV1_Implementation_1_2_0", { | ||
contract: "WithdrawV1", | ||
from: deployer, | ||
log: true, | ||
}); | ||
await verify("WithdrawV1", withdrawDeployment.address, []); | ||
|
||
logStepEnd(__filename); | ||
}; | ||
|
||
func.skip = async function ({ deployments }: HardhatRuntimeEnvironment): Promise<boolean> { | ||
logStep(__filename); | ||
const shouldSkip = | ||
(await isDeployed("AllowlistV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("CoverageFundV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("ELFeeRecipientV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("OperatorsRegistryV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("OracleV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("RedeemManagerV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("RiverV1_Implementation_1_2_0", deployments, __filename)) && | ||
(await isDeployed("WithdrawV1_Implementation_1_2_0", deployments, __filename)); | ||
if (shouldSkip) { | ||
console.log("Skipped"); | ||
logStepEnd(__filename); | ||
} | ||
return shouldSkip; | ||
}; | ||
|
||
export default func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import { DeployFunction } from "hardhat-deploy/dist/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts, ethers }: HardhatRuntimeEnvironment) { | ||
const { proxyAdministrator, governor } = await getNamedAccounts(); | ||
|
||
const allowlistNewImplementationDeployment = await deployments.get("AllowlistV1_Implementation_1_2_0"); | ||
const coverageFundNewImplementationDeployment = await deployments.get("CoverageFundV1_Implementation_1_2_0"); | ||
const elFeeRecipientNewImplementationDeployment = await deployments.get("ELFeeRecipientV1_Implementation_1_2_0"); | ||
const operatorsRegistryNewImplementationDeployment = await deployments.get( | ||
"OperatorsRegistryV1_Implementation_1_2_0" | ||
); | ||
const oracleNewImplementationDeployment = await deployments.get("OracleV1_Implementation_1_2_0"); | ||
const redeemManagerNewImplementationDeployment = await deployments.get("RedeemManagerV1_Implementation_1_2_0"); | ||
const riverNewImplementationDeployment = await deployments.get("RiverV1_Implementation_1_2_0"); | ||
const withdrawNewImplementationDeployment = await deployments.get("WithdrawV1_Implementation_1_2_0"); | ||
|
||
const riverProxyFirewallDeployment = await deployments.get("RiverProxyFirewall"); | ||
const operatorsRegistryFirewallDeployment = await deployments.get("OperatorsRegistryProxyFirewall"); | ||
const oracleProxyFirewallDeployment = await deployments.get("OracleProxyFirewall"); | ||
const redeemManagerProxyFirewallDeployment = await deployments.get("RedeemManagerProxyFirewall"); | ||
const allowlistProxyFirewallDeployment = await deployments.get("AllowlistProxyFirewall"); | ||
const withdrawProxyDeployment = await deployments.get("Withdraw"); | ||
const coverageFundProxyDeployment = await deployments.get("CoverageFund"); | ||
const eLFeeRecipientProxyDeployment = await deployments.get("ELFeeRecipient"); | ||
const proxyAdministratorSigner = await ethers.getSigner(proxyAdministrator); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
allowlistNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
allowlistProxyFirewallDeployment.address, | ||
"Allowlist" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
coverageFundNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
coverageFundProxyDeployment.address, | ||
"CoverageFund" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
elFeeRecipientNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
eLFeeRecipientProxyDeployment.address, | ||
"ELFeeRecipient" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
oracleNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
oracleProxyFirewallDeployment.address, | ||
"Oracle" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
operatorsRegistryNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
operatorsRegistryFirewallDeployment.address, | ||
"OperatorsRegistry" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
redeemManagerNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
redeemManagerProxyFirewallDeployment.address, | ||
"RedeemManager" | ||
); | ||
|
||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
riverNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
riverProxyFirewallDeployment.address, | ||
"River" | ||
); | ||
await upgradeTo( | ||
deployments, | ||
ethers, | ||
withdrawNewImplementationDeployment, | ||
proxyAdministratorSigner, | ||
withdrawProxyDeployment.address, | ||
"Withdraw" | ||
); | ||
|
||
// TODO: Have to add a keeper transaction setKeeper | ||
}; | ||
|
||
async function upgradeTo(deployments, ethers, newImplementation, signer, sendTo, upgrading) { | ||
const proxyTransparentArtifact = await deployments.getArtifact("ITransparentUpgradeableProxy"); | ||
const proxyTransparentInterface = new ethers.utils.Interface(proxyTransparentArtifact.abi); | ||
let upgradeData = proxyTransparentInterface.encodeFunctionData("upgradeTo", [newImplementation.address]); | ||
let txCount = await signer.getTransactionCount(); | ||
let tx = await signer.sendTransaction({ | ||
to: sendTo, | ||
data: upgradeData, | ||
nonce: txCount, | ||
}); | ||
await tx.wait(); | ||
console.log("tx >> ", tx); | ||
console.log(`${upgrading} Proxy upgraded to ${newImplementation.address}`); | ||
} | ||
|
||
export default func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.