Skip to content

Commit

Permalink
Split revoking access from Timelock into separate deploy script (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Jun 18, 2024
1 parent 4dfbb17 commit 8c1abac
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
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;
}
}

0 comments on commit 8c1abac

Please sign in to comment.