Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split revoking access from Timelock into separate deploy script #439

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions script/deploy/mainnet/014_xOGNGovernanceScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity 0.8.10;

import "./BaseMainnetScript.sol";
import {Vm} from "forge-std/Vm.sol";

import {Addresses} from "contracts/utils/Addresses.sol";

Expand Down Expand Up @@ -57,23 +56,6 @@ contract XOGNGovernanceScript is BaseMainnetScript {
govProposal.action(
Addresses.TIMELOCK, "grantRole(bytes32,address)", abi.encode(timelock.EXECUTOR_ROLE(), xognGov)
);

// Revoke access from Multisig
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.PROPOSER_ROLE(), Addresses.GOV_MULTISIG)
);
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.CANCELLER_ROLE(), Addresses.GOV_MULTISIG)
);
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.EXECUTOR_ROLE(), Addresses.GOV_MULTISIG)
);
}

function _fork() internal override {
Expand Down
62 changes: 62 additions & 0 deletions script/deploy/mainnet/015_RevokeMultisigGovernance.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;

import "./BaseMainnetScript.sol";

import {Addresses} from "contracts/utils/Addresses.sol";

import {Timelock} from "contracts/Timelock.sol";
import {Governance} from "contracts/Governance.sol";

import {GovFive} from "contracts/utils/GovFive.sol";

contract XOGNGovernanceScript is BaseMainnetScript {
using GovFive for GovFive.GovFiveProposal;

GovFive.GovFiveProposal public govProposal;

string public constant override DEPLOY_NAME = "015_RevokeMultisigGovernance";
bool public constant override proposalExecuted = false;

constructor() {}

function _execute() internal override {}

function _buildGovernanceProposal() internal override {
Timelock timelock = Timelock(payable(Addresses.TIMELOCK));

address xognGov = deployedContracts["XOGN_GOV"];

govProposal.setName("Revoke access from Multisig");

govProposal.setDescription("Revoke access from Multisig");

// Revoke access from Multisig
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.PROPOSER_ROLE(), Addresses.GOV_MULTISIG)
);
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.CANCELLER_ROLE(), Addresses.GOV_MULTISIG)
);
govProposal.action(
Addresses.TIMELOCK,
"revokeRole(bytes32,address)",
abi.encode(timelock.EXECUTOR_ROLE(), Addresses.GOV_MULTISIG)
);
}

function _fork() internal override {
// Simulate execute on fork by impersonating Timelock
govProposal.execute();
}

function skip() external view override returns (bool) {
// Don't deploy it for now
return true;
}
}
Loading