Skip to content
Draft
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@arbitrum/nitro-contracts": "1.1.1",
"@arbitrum/token-bridge-contracts": "1.0.0-beta.0",
"@gnosis.pm/safe-contracts": "1.3.0",
"@offchainlabs/upgrade-executor": "1.1.1",
Comment thread
gzeoneth marked this conversation as resolved.
"@openzeppelin/contracts": "4.7.3",
"@openzeppelin/contracts-upgradeable": "4.7.3",
"@types/yargs": "^17.0.17",
Expand Down
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
forge-std/=lib/forge-std/src/
solady/=lib/solady/src/
@offchainlabs/upgrade-executor/=node_modules/@offchainlabs/upgrade-executor/
@arbitrum/token-bridge-contracts/=node_modules/@arbitrum/token-bridge-contracts/
@arbitrum/nitro-contracts/=node_modules/@arbitrum/nitro-contracts/
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/
Expand Down
2 changes: 1 addition & 1 deletion src/L1GovernanceFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.16;

import "./L1ArbitrumTimelock.sol";
import "./UpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol";

import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/L2GovernanceFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.16;
import "./L2ArbitrumToken.sol";
import "./L2ArbitrumGovernor.sol";
import "./ArbitrumTimelock.sol";
import "./UpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol";
import "./FixedDelegateErc20Wallet.sol";
import "./ArbitrumDAOConstitution.sol";
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/UpgradeExecRouteBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.16;

import "@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol";
import "./UpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol";
import "./L1ArbitrumTimelock.sol";
import "./security-council-mgmt/Common.sol";

Expand Down
60 changes: 0 additions & 60 deletions src/UpgradeExecutor.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import "../../../security-council-mgmt/interfaces/IGnosisSafe.sol";
import "../../address-registries/L2AddressRegistryInterfaces.sol";
import "./SecurityCouncilMgmtUpgradeLib.sol";
import "../../../interfaces/IArbitrumDAOConstitution.sol";
import "../../../interfaces/IUpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol";
import "../../../interfaces/ICoreTimelock.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/IAccessControl.sol";

contract GovernanceChainSCMgmtActivationAction {
IGnosisSafe public immutable newEmergencySecurityCouncil;
Expand Down Expand Up @@ -116,11 +117,11 @@ contract GovernanceChainSCMgmtActivationAction {
// confirm updates
bytes32 EXECUTOR_ROLE = upgradeExecutor.EXECUTOR_ROLE();
require(
upgradeExecutor.hasRole(EXECUTOR_ROLE, address(newEmergencySecurityCouncil)),
IAccessControl(address(upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(newEmergencySecurityCouncil)),
"NonGovernanceChainSCMgmtActivationAction: new emergency security council not set"
);
require(
!upgradeExecutor.hasRole(EXECUTOR_ROLE, address(prevEmergencySecurityCouncil)),
!IAccessControl(address(upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(prevEmergencySecurityCouncil)),
"NonGovernanceChainSCMgmtActivationAction: prev emergency security council still set"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.16;

import "../../../security-council-mgmt/interfaces/IGnosisSafe.sol";
import "../../../interfaces/IUpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol";
import "../../../interfaces/ICoreTimelock.sol";
import "./SecurityCouncilMgmtUpgradeLib.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ contract NonGovernanceChainSCMgmtActivationAction {
// confirm updates
bytes32 EXECUTOR_ROLE = upgradeExecutor.EXECUTOR_ROLE();
require(
upgradeExecutor.hasRole(EXECUTOR_ROLE, address(newEmergencySecurityCouncil)),
IAccessControl(address(upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(newEmergencySecurityCouncil)),
"NonGovernanceChainSCMgmtActivationAction: new emergency security council not set"
);
require(
!upgradeExecutor.hasRole(EXECUTOR_ROLE, address(prevEmergencySecurityCouncil)),
!IAccessControl(address(upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(prevEmergencySecurityCouncil)),
"NonGovernanceChainSCMgmtActivationAction: prev emergency security council still set"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
pragma solidity 0.8.16;

import "../../../security-council-mgmt/interfaces/IGnosisSafe.sol";
import "../../../interfaces/IUpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol";
import "@openzeppelin/contracts/access/IAccessControl.sol";

library SecurityCouncilMgmtUpgradeLib {
function replaceEmergencySecurityCouncil(
Expand All @@ -14,16 +15,16 @@ library SecurityCouncilMgmtUpgradeLib {
requireSafesEquivalent(_prevSecurityCouncil, _newSecurityCouncil, _threshold);
bytes32 EXECUTOR_ROLE = _upgradeExecutor.EXECUTOR_ROLE();
require(
_upgradeExecutor.hasRole(EXECUTOR_ROLE, address(_prevSecurityCouncil)),
IAccessControl(address(_upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(_prevSecurityCouncil)),
"SecurityCouncilMgmtUpgradeLib: prev council not executor"
);
require(
!_upgradeExecutor.hasRole(EXECUTOR_ROLE, address(_newSecurityCouncil)),
!IAccessControl(address(_upgradeExecutor)).hasRole(EXECUTOR_ROLE, address(_newSecurityCouncil)),
"SecurityCouncilMgmtUpgradeLib: new council already executor"
);

_upgradeExecutor.revokeRole(EXECUTOR_ROLE, address(_prevSecurityCouncil));
_upgradeExecutor.grantRole(EXECUTOR_ROLE, address(_newSecurityCouncil));
IAccessControl(address(_upgradeExecutor)).revokeRole(EXECUTOR_ROLE, address(_prevSecurityCouncil));
IAccessControl(address(_upgradeExecutor)).grantRole(EXECUTOR_ROLE, address(_newSecurityCouncil));
}

function requireSafesEquivalent(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.16;

import {UpgradeExecutor} from "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol"; // todo: deploy UpgradeExecutor separately
import {
ProxyAdmin,
TransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";

contract UpgradeExecutorUpgradeAction {
ProxyAdmin public immutable proxyAdmin;
address public immutable newUpgradeExecutorImplementation;

constructor(address _proxyAdmin, address _newUpgradeExecutorImplementation) {
proxyAdmin = ProxyAdmin(_proxyAdmin);
newUpgradeExecutorImplementation = _newUpgradeExecutorImplementation;
}

function perform() external {
TransparentUpgradeableProxy proxy = TransparentUpgradeableProxy(payable(address(this)));

proxyAdmin.upgrade(proxy, newUpgradeExecutorImplementation);

require(
proxyAdmin.getProxyImplementation(proxy) == newUpgradeExecutorImplementation,
"UpgradeExecutorUpgradeAction: upgrade failed"
);
}
}

// Proxy Admins:
// Arb1: 0xdb216562328215E010F819B5aBe947bad4ca961e
// Nova: 0xf58eA15B20983116c21b05c876cc8e6CDAe5C2b9
// L1: 0x5613AF0474EB9c528A34701A5b1662E3C8FA0678

// Upgrade Executor Impls:
// Arb1: 0x12B1389Fbf261E781bdc3094d28636Abfb03C5b3
// Nova: 0xebb11Bbd7d72165FaC86bb5AB1B07A602540b286
// L1: 0xDE505e42D50abd07c8D39Dcf692920d56cBA35Da

contract ArbOneUpgradeExecutorUpgradeAction is UpgradeExecutorUpgradeAction {
constructor()
UpgradeExecutorUpgradeAction(
0xdb216562328215E010F819B5aBe947bad4ca961e,
0x12B1389Fbf261E781bdc3094d28636Abfb03C5b3
)
{}
}

contract NovaUpgradeExecutorUpgradeAction is UpgradeExecutorUpgradeAction {
constructor()
UpgradeExecutorUpgradeAction(
0xf58eA15B20983116c21b05c876cc8e6CDAe5C2b9,
0xebb11Bbd7d72165FaC86bb5AB1B07A602540b286
)
{}
}

contract L1UpgradeExecutorUpgradeAction is UpgradeExecutorUpgradeAction {
constructor()
UpgradeExecutorUpgradeAction(
0x5613AF0474EB9c528A34701A5b1662E3C8FA0678,
0xDE505e42D50abd07c8D39Dcf692920d56cBA35Da
)
{}
}
10 changes: 0 additions & 10 deletions src/interfaces/IUpgradeExecutor.sol

This file was deleted.

2 changes: 1 addition & 1 deletion src/security-council-mgmt/SecurityCouncilManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.16;

import "../ArbitrumTimelock.sol";
import "../UpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol";
import "../L1ArbitrumTimelock.sol";
import "./SecurityCouncilMgmtUtils.sol";
import "./interfaces/ISecurityCouncilManager.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.16;
import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVotesUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./modules/SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol";
import "../interfaces/ISecurityCouncilMemberElectionGovernor.sol";
import "../interfaces/ISecurityCouncilNomineeElectionGovernor.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import
"@openzeppelin/contracts-upgradeable/governance/extensions/GovernorCountingSimpleUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./../interfaces/ISecurityCouncilManager.sol";
import "../Common.sol";
import "./modules/ArbitrumGovernorVotesQuorumFractionUpgradeable.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.8.16;

import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "../interfaces/ISecurityCouncilMemberElectionGovernor.sol";
import "../interfaces/ISecurityCouncilNomineeElectionGovernor.sol";
import "./modules/SecurityCouncilNomineeElectionGovernorCountingUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/L2GovernanceFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import "../src/L2GovernanceFactory.sol";
import "../src/L2ArbitrumGovernor.sol";
import "../src/UpgradeExecutor.sol";
import "@offchainlabs/upgrade-executor/src/UpgradeExecutor.sol";
import "../src/ArbitrumTimelock.sol";
import "../src/ArbitrumDAOConstitution.sol";

Expand Down
Loading