Skip to content

Commit c89c349

Browse files
Add supporting files
Co-authored-by: Gary Ghayrat <garyghayrat@users.noreply.github.com>
1 parent f180c40 commit c89c349

16 files changed

+2308
-1
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ARBITRUM_ONE_RPC_URL=

foundry.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# when changing optimizer settings, make sure to also change settings in hardhat.config.ts
22
[profile.default]
33
src = 'src'
4+
script = 'script'
45
out = 'out'
56
libs = ['lib']
67
optimizer = true

script/BaseDeployer.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {Script} from "forge-std/Script.sol";
7+
8+
// Basic shared infrastructure for all deploy scripts
9+
contract BaseDeployer is Script {
10+
uint256 deployerPrivateKey;
11+
12+
function setUp() public virtual {
13+
deployerPrivateKey =
14+
vm.envOr("DEPLOYER_PRIVATE_KEY", uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80));
15+
}
16+
}

script/BaseGovernorDeployer.sol

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {BaseDeployer} from "script/BaseDeployer.sol";
7+
import {SharedGovernorConstants} from "script/SharedGovernorConstants.sol";
8+
import {L2ArbitrumGovernorV2} from "src/L2ArbitrumGovernorV2.sol";
9+
import {TransparentUpgradeableProxy} from
10+
"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
11+
import {TimelockControllerUpgradeable} from
12+
"openzeppelin-upgradeable-v5/governance/TimelockControllerUpgradeable.sol";
13+
import {IVotes} from "openzeppelin-v5/governance/utils/IVotes.sol";
14+
15+
// This base deployer contract is meant to be inherited by each concrete script written to deploy a specific governor,
16+
// namely the Treasury Governor and Core Governor. It includes the base deployment logic, shared constants, and
17+
// defines the virtual methods for values which must be provided by each concrete implementation.
18+
abstract contract BaseGovernorDeployer is BaseDeployer, SharedGovernorConstants {
19+
// Virtual methods returning initialization parameters that must be implemented by
20+
// each concrete deploy script.
21+
function NAME() public virtual returns (string memory);
22+
function TIMELOCK_ADDRESS() public virtual returns (address payable);
23+
function QUORUM_NUMERATOR() public virtual returns (uint256);
24+
25+
function run(address _implementation) public virtual returns (L2ArbitrumGovernorV2 _governor) {
26+
vm.startBroadcast(deployerPrivateKey);
27+
bytes memory _initData = abi.encodeCall(
28+
L2ArbitrumGovernorV2.initialize,
29+
(
30+
NAME(),
31+
INITIAL_VOTING_DELAY,
32+
INITIAL_VOTING_PERIOD,
33+
INITIAL_PROPOSAL_THRESHOLD,
34+
IVotes(L2_ARB_TOKEN_ADDRESS),
35+
TimelockControllerUpgradeable(TIMELOCK_ADDRESS()),
36+
QUORUM_NUMERATOR(),
37+
INITIAL_VOTE_EXTENSION,
38+
L2_UPGRADE_EXECUTOR
39+
)
40+
);
41+
TransparentUpgradeableProxy _proxy =
42+
new TransparentUpgradeableProxy(_implementation, L2_PROXY_ADMIN, _initData);
43+
_governor = L2ArbitrumGovernorV2(payable(address(_proxy)));
44+
vm.stopBroadcast();
45+
}
46+
}

script/DeployCoreGovernor.s.sol

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {BaseGovernorDeployer, L2ArbitrumGovernorV2} from "script/BaseGovernorDeployer.sol";
7+
8+
// Concrete deployment script for the Arbitrum L2 Core Governor.
9+
contract DeployCoreGovernor is BaseGovernorDeployer {
10+
function NAME() public pure override returns (string memory) {
11+
return "Core L2ArbitrumGovernor";
12+
}
13+
14+
function TIMELOCK_ADDRESS() public pure override returns (address payable) {
15+
return payable(L2_CORE_GOVERNOR_TIMELOCK);
16+
}
17+
18+
function QUORUM_NUMERATOR() public pure override returns (uint256) {
19+
return 500;
20+
}
21+
22+
function run(address _implementation) public override returns (L2ArbitrumGovernorV2 _governor) {
23+
return super.run(_implementation);
24+
}
25+
}

script/DeployImplementation.s.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {BaseDeployer} from "script/BaseDeployer.sol";
7+
import {L2ArbitrumGovernorV2} from "src/L2ArbitrumGovernorV2.sol";
8+
9+
// Deploy script for the underlying implementation that will be used by both Governor proxies
10+
contract DeployImplementation is BaseDeployer {
11+
function run() public returns (L2ArbitrumGovernorV2 _implementation) {
12+
vm.startBroadcast(deployerPrivateKey);
13+
_implementation = new L2ArbitrumGovernorV2();
14+
vm.stopBroadcast();
15+
}
16+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {BaseDeployer} from "script/BaseDeployer.sol";
7+
import {TimelockRolesUpgrader} from
8+
"src/gov-action-contracts/gov-upgrade-contracts/update-timelock-roles/TimelockRolesUpgrader.sol";
9+
import {SharedGovernorConstants} from "script/SharedGovernorConstants.sol";
10+
11+
contract DeployTimelockRolesUpgrader is BaseDeployer, SharedGovernorConstants {
12+
function run(address _newCoreGovernor, address _newTreasuryGovernor)
13+
public
14+
returns (TimelockRolesUpgrader timelockRolesUpgrader)
15+
{
16+
vm.startBroadcast();
17+
timelockRolesUpgrader = new TimelockRolesUpgrader(
18+
L2_CORE_GOVERNOR_TIMELOCK,
19+
L2_CORE_GOVERNOR,
20+
_newCoreGovernor,
21+
L2_TREASURY_GOVERNOR_TIMELOCK,
22+
L2_TREASURY_GOVERNOR,
23+
_newTreasuryGovernor
24+
);
25+
vm.stopBroadcast();
26+
}
27+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
import {BaseGovernorDeployer, L2ArbitrumGovernorV2} from "script/BaseGovernorDeployer.sol";
7+
8+
// Concrete deployment script for the Arbitrum L2 Core Governor.
9+
contract DeployTreasuryGovernor is BaseGovernorDeployer {
10+
function NAME() public pure override returns (string memory) {
11+
return "Treasury L2ArbitrumGovernor";
12+
}
13+
14+
function TIMELOCK_ADDRESS() public pure override returns (address payable) {
15+
return payable(L2_TREASURY_GOVERNOR_TIMELOCK);
16+
}
17+
18+
function QUORUM_NUMERATOR() public pure override returns (uint256) {
19+
return 300;
20+
}
21+
22+
function run(address _implementation) public override returns (L2ArbitrumGovernorV2 _governor) {
23+
return super.run(_implementation);
24+
}
25+
}

script/SharedGovernorConstants.sol

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// slither-disable-start reentrancy-benign
3+
4+
pragma solidity 0.8.26;
5+
6+
// Inheritable extension holding governor deployment constants that are shared between the Core Governor and the
7+
// Treasury Governor. These should be carefully checked and reviewed before final deployment.
8+
contract SharedGovernorConstants {
9+
uint256 constant FORK_BLOCK = 245_608_716; // Arbitrary recent block
10+
address public constant L2_ARB_TOKEN_ADDRESS = 0x912CE59144191C1204E64559FE8253a0e49E6548;
11+
12+
address public constant L2_CORE_GOVERNOR = 0xf07DeD9dC292157749B6Fd268E37DF6EA38395B9;
13+
address public constant L2_CORE_GOVERNOR_TIMELOCK = 0x34d45e99f7D8c45ed05B5cA72D54bbD1fb3F98f0;
14+
address public constant L2_TREASURY_GOVERNOR = 0x789fC99093B09aD01C34DC7251D0C89ce743e5a4;
15+
address public constant L2_TREASURY_GOVERNOR_TIMELOCK =
16+
0xbFc1FECa8B09A5c5D3EFfE7429eBE24b9c09EF58;
17+
address public constant L2_PROXY_ADMIN = 0xdb216562328215E010F819B5aBe947bad4ca961e;
18+
19+
address public constant L2_ARB_SYS = 0x0000000000000000000000000000000000000064;
20+
address public constant L2_ARB_TREASURY_FIXED_DELEGATE =
21+
0xF3FC178157fb3c87548bAA86F9d24BA38E649B58;
22+
address public constant L2_ARB_RETRYABLE_TX = 0x000000000000000000000000000000000000006E;
23+
address public constant L2_SECURITY_COUNCIL_9 = 0x423552c0F05baCCac5Bfa91C6dCF1dc53a0A1641;
24+
25+
address public constant L1_TIMELOCK = 0xE6841D92B0C345144506576eC13ECf5103aC7f49;
26+
uint256 public constant L1_TIMELOCK_MIN_DELAY = 259_200; // TODO: Make sure this is up to date.
27+
address public constant L1_ARB_ONE_DELAYED_INBOX = 0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f;
28+
29+
address public constant L2_CORE_GOVERNOR_ONCHAIN = 0x7796F378B3c56ceD57350B938561D8c52256456b;
30+
address public constant L2_TREASURY_GOVERNOR_ONCHAIN =
31+
0x4fd1216c8b5E72b22785169Ae5C1e8f3b30C19E4;
32+
bool public constant UPGRADE_PROPOSAL_PASSED_ONCHAIN = false; // TODO: Update after the upgrade proposal is passed.
33+
34+
address public constant L2_UPGRADE_EXECUTOR = 0xCF57572261c7c2BCF21ffD220ea7d1a27D40A827;
35+
36+
address public constant RETRYABLE_TICKET_MAGIC = 0xa723C008e76E379c55599D2E4d93879BeaFDa79C;
37+
38+
address public constant EXCLUDE_ADDRESS = address(0xA4b86);
39+
uint256 public constant QUORUM_DENOMINATOR = 10_000;
40+
41+
bytes32 public constant TIMELOCK_PROPOSER_ROLE =
42+
0xb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1;
43+
44+
uint8 public constant VOTE_TYPE_FRACTIONAL = 255;
45+
46+
// These values match the current production values for both governors. Note that they are expressed in L1 blocks,
47+
// with an assumed 12 second block time, because on Arbitrum, block.number returns the number of the L1.
48+
uint48 public constant INITIAL_VOTING_DELAY = 21_600; // 3 days
49+
uint32 public constant INITIAL_VOTING_PERIOD = 100_800; // 14 days
50+
uint48 public constant INITIAL_VOTE_EXTENSION = 14_400; // 2 days
51+
52+
// This value matches the current production value for both governors. 1M Arb in raw decimals.
53+
uint256 public constant INITIAL_PROPOSAL_THRESHOLD = 1_000_000_000_000_000_000_000_000;
54+
55+
address[] public _majorDelegates;
56+
57+
enum ProposalState {
58+
Pending,
59+
Active,
60+
Canceled,
61+
Defeated,
62+
Succeeded,
63+
Queued,
64+
Expired,
65+
Executed
66+
}
67+
68+
enum VoteType {
69+
Against,
70+
For,
71+
Abstain
72+
}
73+
74+
constructor() {
75+
_majorDelegates = new address[](18);
76+
_majorDelegates[0] = 0x1B686eE8E31c5959D9F5BBd8122a58682788eeaD; // L2BEAT
77+
_majorDelegates[1] = 0xF4B0556B9B6F53E00A1FDD2b0478Ce841991D8fA; // olimpio
78+
_majorDelegates[2] = 0x11cd09a0c5B1dc674615783b0772a9bFD53e3A8F; // Gauntlet
79+
_majorDelegates[3] = 0xB933AEe47C438f22DE0747D57fc239FE37878Dd1; // Wintermute
80+
_majorDelegates[4] = 0x0eB5B03c0303f2F47cD81d7BE4275AF8Ed347576; // Treasure
81+
_majorDelegates[5] = 0xF92F185AbD9E00F56cb11B0b709029633d1E37B4; //
82+
_majorDelegates[6] = 0x186e505097BFA1f3cF45c2C9D7a79dE6632C3cdc;
83+
_majorDelegates[7] = 0x5663D01D8109DDFC8aACf09fBE51F2d341bb3643;
84+
_majorDelegates[8] = 0x2ef27b114917dD53f8633440A7C0328fef132e2F; // MUX Protocol
85+
_majorDelegates[9] = 0xE48C655276C23F1534AE2a87A2bf8A8A6585Df70; // ercwl
86+
_majorDelegates[10] = 0x8A3e9846df0CDc723C06e4f0C642ffFF82b54610;
87+
_majorDelegates[11] = 0xAD16ebE6FfC7d96624A380F394cD64395B0C6144; // DK (Premia)
88+
_majorDelegates[12] = 0xA5dF0cf3F95C6cd97d998b9D990a86864095d9b0; // Blockworks Research
89+
_majorDelegates[13] = 0x839395e20bbB182fa440d08F850E6c7A8f6F0780; // Griff Green
90+
_majorDelegates[14] = 0x2e3BEf6830Ae84bb4225D318F9f61B6b88C147bF; // Camelot
91+
_majorDelegates[15] = 0x8F73bE66CA8c79382f72139be03746343Bf5Faa0; // mihal.eth
92+
_majorDelegates[16] = 0xb5B069370Ef24BC67F114e185D185063CE3479f8; // Frisson
93+
_majorDelegates[17] = 0xdb5781a835b60110298fF7205D8ef9678Ff1f800; // yoav.eth
94+
}
95+
}

0 commit comments

Comments
 (0)