-
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.
TLC migration to the new schedule (#296)
* chore: migration contract & deployment scripts * Added more tests * fix: fixed the issue with TLC_migration script * chore: fixed order of testing * fix: added check for global unlock ignored flag * chore: uncommented deploy rate provider * chore: TLC migration deployment --------- Co-authored-by: Mischa <[email protected]>
- Loading branch information
Showing
9 changed files
with
766 additions
and
112 deletions.
There are no files selected for viewing
415 changes: 373 additions & 42 deletions
415
contracts/src/migration/TLC_globalUnlockScheduleMigration.sol
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,42 @@ | ||
import { DeployFunction } from "hardhat-deploy/dist/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { isDeployed, logStep, logStepEnd } from "../../ts-utils/helpers/index"; | ||
import { upgradeTo, upgradeToAndCall, verify } from "../../scripts/helpers"; | ||
import { ethers } from "hardhat"; | ||
|
||
const func: DeployFunction = async function ({ deployments, network, getNamedAccounts }: HardhatRuntimeEnvironment) { | ||
if (!["mainnet", "hardhat", "tenderly"].includes(network.name)) { | ||
throw new Error("Invalid network for mainnet deployment"); | ||
} | ||
|
||
const { deployer, proxyAdministrator } = await getNamedAccounts(); | ||
const tlc = await deployments.get("TLC"); | ||
const tlcImplementation = await deployments.get("TLCV1_Implementation_1_1_0"); | ||
const tlcProxyFirewall = await deployments.get("TLCProxyFirewall"); | ||
|
||
const tlcMigrationDeployment = await deployments.deploy("TLC_GlobalUnlockSchedule_Migration_2", { | ||
contract: "TlcMigration", | ||
from: deployer, | ||
log: true, | ||
}); | ||
|
||
await verify("TlcMigration", tlcMigrationDeployment.address, []); | ||
// migration and upgrade steps | ||
// 1. upgradeToAndCall TlcMigration + TlcMigration.migrate() | ||
// 2. upgradeTo TLCV1_Implementation_1_1_0 | ||
logStepEnd(__filename); | ||
}; | ||
|
||
func.skip = async function ({ deployments, ethers }: HardhatRuntimeEnvironment): Promise<boolean> { | ||
logStep(__filename); | ||
const shouldSkip = | ||
(await isDeployed("TLCV1_Implementation_1_1_0", deployments, __filename)) && | ||
(await isDeployed("TLC_GlobalUnlockSchedule_Migration_2", deployments, __filename)); | ||
if (shouldSkip) { | ||
console.log("Skipped"); | ||
logStepEnd(__filename); | ||
} | ||
return shouldSkip; | ||
}; | ||
|
||
export default func; |
108 changes: 108 additions & 0 deletions
108
deployments/mainnet/TLC_GlobalUnlockSchedule_Migration_2.json
Large diffs are not rendered by default.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
deployments/mainnet/solcInputs/37f3fc6b84869918de46b14efdfb3bb5.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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