-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eca70b7
commit 59b2db0
Showing
12 changed files
with
90 additions
and
24 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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.10; | |
import "OpenZeppelin/[email protected]/contracts/governance/TimelockController.sol"; | ||
|
||
contract Timelock is TimelockController { | ||
constructor(address[] memory proposers, address[] memory executors) | ||
TimelockController(86400 * 2, proposers, executors) | ||
constructor(uint256 minDelay, address[] memory proposers, address[] memory executors) | ||
TimelockController(minDelay, proposers, executors) | ||
{} | ||
} |
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 |
---|---|---|
|
@@ -4,14 +4,16 @@ pragma solidity 0.8.10; | |
import "forge-std/Script.sol"; | ||
import "OpenZeppelin/[email protected]/contracts/utils/Strings.sol"; | ||
|
||
import {BaseMainnetScript} from "./mainnet/BaseMainnetScript.sol"; | ||
import {AbstractScript} from "./AbstractScript.sol"; | ||
|
||
import {XOGNSetupScript} from "./mainnet/010_xOGNSetupScript.sol"; | ||
import {OgnOgvMigrationScript} from "./mainnet/011_OgnOgvMigrationScript.sol"; | ||
import {MigrationZapperScript} from "./mainnet/012_MigrationZapperScript.sol"; | ||
import {UpgradeMigratorScript} from "./mainnet/013_UpgradeMigratorScript.sol"; | ||
import {XOGNGovernanceScript} from "./mainnet/014_xOGNGovernanceScript.sol"; | ||
|
||
import {DeployTimelockScript} from "./base/001_Timelock.sol"; | ||
|
||
import {VmSafe} from "forge-std/Vm.sol"; | ||
|
||
contract DeployManager is Script { | ||
|
@@ -69,14 +71,18 @@ contract DeployManager is Script { | |
|
||
function run() external { | ||
// TODO: Use vm.readDir to recursively build this? | ||
_runDeployFile(new XOGNSetupScript()); | ||
_runDeployFile(new OgnOgvMigrationScript()); | ||
_runDeployFile(new MigrationZapperScript()); | ||
_runDeployFile(new UpgradeMigratorScript()); | ||
_runDeployFile(new XOGNGovernanceScript()); | ||
if (block.chainid == 1) { | ||
_runDeployFile(new XOGNSetupScript()); | ||
_runDeployFile(new OgnOgvMigrationScript()); | ||
_runDeployFile(new MigrationZapperScript()); | ||
_runDeployFile(new UpgradeMigratorScript()); | ||
_runDeployFile(new XOGNGovernanceScript()); | ||
} else if (block.chainid == 8453) { | ||
_runDeployFile(new DeployTimelockScript()); | ||
} | ||
} | ||
|
||
function _runDeployFile(BaseMainnetScript deployScript) internal { | ||
function _runDeployFile(AbstractScript deployScript) internal { | ||
if (deployScript.proposalExecuted()) { | ||
// No action to do | ||
return; | ||
|
@@ -137,7 +143,7 @@ contract DeployManager is Script { | |
/** | ||
* Post-deployment | ||
*/ | ||
BaseMainnetScript.DeployRecord[] memory records = deployScript.getAllDeployRecords(); | ||
AbstractScript.DeployRecord[] memory records = deployScript.getAllDeployRecords(); | ||
|
||
for (uint256 i = 0; i < records.length; ++i) { | ||
string memory name = records[i].name; | ||
|
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,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.10; | ||
|
||
import "../AbstractScript.sol"; | ||
import {Vm} from "forge-std/Vm.sol"; | ||
|
||
import {AddressesBase} from "contracts/utils/Addresses.sol"; | ||
|
||
import {Timelock} from "contracts/Timelock.sol"; | ||
|
||
contract DeployTimelockScript is AbstractScript { | ||
string public constant override DEPLOY_NAME = "001_Timelock"; | ||
uint256 public constant override CHAIN_ID = 8453; | ||
bool public constant override proposalExecuted = false; | ||
|
||
constructor() {} | ||
|
||
function _execute() internal override { | ||
console.log("Deploy:"); | ||
console.log("------------"); | ||
|
||
address[] memory proposers = new address[](1); | ||
address[] memory executors = new address[](1); | ||
|
||
proposers[0] = AddressesBase.GOVERNOR; | ||
executors[0] = AddressesBase.GOVERNOR; | ||
|
||
// 1. Deploy Timelock | ||
Timelock timelock = new Timelock( | ||
60, // 60s | ||
proposers, | ||
executors | ||
); | ||
_recordDeploy("TIMELOCK", address(timelock)); | ||
} | ||
|
||
function _fork() internal override {} | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
pragma solidity 0.8.10; | ||
|
||
import "./BaseMainnetScript.sol"; | ||
import "../AbstractScript.sol"; | ||
import {Vm} from "forge-std/Vm.sol"; | ||
|
||
import {Addresses} from "contracts/utils/Addresses.sol"; | ||
|
@@ -17,12 +17,13 @@ import {MigrationZapper} from "contracts/MigrationZapper.sol"; | |
import "OpenZeppelin/[email protected]/contracts/token/ERC20/extensions/ERC20Votes.sol"; | ||
import "OpenZeppelin/[email protected]/contracts/governance/TimelockController.sol"; | ||
|
||
contract MigrationZapperScript is BaseMainnetScript { | ||
contract MigrationZapperScript is AbstractScript { | ||
using GovFive for GovFive.GovFiveProposal; | ||
|
||
GovFive.GovFiveProposal public govProposal; | ||
|
||
string public constant override DEPLOY_NAME = "012_MigrationZapper"; | ||
uint256 public constant override CHAIN_ID = 1; | ||
bool public constant override proposalExecuted = true; | ||
|
||
constructor() {} | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
pragma solidity 0.8.10; | ||
|
||
import "./BaseMainnetScript.sol"; | ||
import "../AbstractScript.sol"; | ||
|
||
import {Addresses} from "contracts/utils/Addresses.sol"; | ||
|
||
|
@@ -14,12 +14,13 @@ import {GovFive} from "contracts/utils/GovFive.sol"; | |
import {ERC20Votes} from "OpenZeppelin/[email protected]/contracts/token/ERC20/extensions/ERC20Votes.sol"; | ||
import {TimelockController} from "OpenZeppelin/[email protected]/contracts/governance/TimelockController.sol"; | ||
|
||
contract XOGNGovernanceScript is BaseMainnetScript { | ||
contract XOGNGovernanceScript is AbstractScript { | ||
using GovFive for GovFive.GovFiveProposal; | ||
|
||
GovFive.GovFiveProposal public govProposal; | ||
|
||
string public constant override DEPLOY_NAME = "014_xOGNGovernance"; | ||
uint256 public constant override CHAIN_ID = 1; | ||
bool public constant override proposalExecuted = false; | ||
|
||
uint256 public constant OGN_EPOCH = 1717041600; // May 30, 2024 GMT | ||
|
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