Skip to content

Commit

Permalink
update constitution hash
Browse files Browse the repository at this point in the history
  • Loading branch information
godzillaba committed Dec 20, 2023
1 parent 396eed4 commit 6af9930
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/gov-action-contracts/AIPs/AIPXAction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,31 @@ import {
SecurityCouncilNomineeElectionGovernor,
GovernorSettingsUpgradeable
} from "../../security-council-mgmt/governors/SecurityCouncilNomineeElectionGovernor.sol";
import {IArbitrumDAOConstitution} from "../../interfaces/IArbitrumDAOConstitution.sol";

contract AIPXAction {
address public immutable proxyAdmin;
address public immutable nomineeElectionGovernorProxy;
address public immutable newNomineeElectionGovernorImplementation;
uint256 public immutable votingDelay;

address public immutable constitution;
bytes32 public immutable newConstitutionHash;

constructor(
address _proxyAdmin,
address _nomineeElectionGovernorProxy,
address _newNomineeElectionGovernorImplementation,
uint256 _votingDelay
uint256 _votingDelay,
address _constitution,
bytes32 _newConstitutionHash
) {
proxyAdmin = _proxyAdmin;
nomineeElectionGovernorProxy = _nomineeElectionGovernorProxy;
newNomineeElectionGovernorImplementation = _newNomineeElectionGovernorImplementation;
votingDelay = _votingDelay;
constitution = _constitution;
newConstitutionHash = _newConstitutionHash;
}

function perform() external {
Expand All @@ -41,5 +49,8 @@ contract AIPXAction {
0,
abi.encodeWithSelector(GovernorSettingsUpgradeable.setVotingDelay.selector, votingDelay)
);

// set the new constitution hash
IArbitrumDAOConstitution(constitution).setConstitutionHash(newConstitutionHash);
}
}
12 changes: 11 additions & 1 deletion test/gov-actions/AIPXAction.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ contract AIPXActionTest is Test {
ProxyAdmin proxyAdmin = ProxyAdmin(0xdb216562328215E010F819B5aBe947bad4ca961e);
UpgradeExecutor arbOneUe = UpgradeExecutor(0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827);
address council = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641;
IArbitrumDAOConstitution constitution = IArbitrumDAOConstitution(0x1D62fFeB72e4c360CcBbacf7c965153b00260417);
bytes32 newConstitutionHash = 0x0101010101010101010101010101010101010101010101010101010101010101;

address newImplementation = address(new SecurityCouncilNomineeElectionGovernor());
uint256 votingDelay = 7 days;
AIPXAction action = new AIPXAction(
address(proxyAdmin),
address(gov),
newImplementation,
votingDelay
votingDelay,
address(constitution),
newConstitutionHash
);

function testAction() external {
Expand Down Expand Up @@ -47,6 +51,12 @@ contract AIPXActionTest is Test {
newImplementation,
"implementation not set"
);

assertEq(
constitution.constitutionHash(),
newConstitutionHash,
"constitution hash not set"
);
}

function _getImplementation() internal view returns (address) {
Expand Down

0 comments on commit 6af9930

Please sign in to comment.