@@ -4,75 +4,78 @@ pragma solidity 0.8.16;
44import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol " ;
55import {TransparentUpgradeableProxy} from
66 "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol " ;
7- import {IL2AddressRegistry} from "./../../address-registries/L2AddressRegistryInterfaces.sol " ;
8- import {L2ArbitrumGovernor} from "./../../../L2ArbitrumGovernor.sol " ;
7+ import {IL2AddressRegistry} from "../../address-registries/L2AddressRegistryInterfaces.sol " ;
8+ import {L2ArbitrumToken} from "../../../L2ArbitrumToken.sol " ;
9+ import {
10+ L2ArbitrumGovernor,
11+ GovernorVotesQuorumFractionUpgradeable
12+ } from "../../../L2ArbitrumGovernor.sol " ;
913
10- interface IArbTokenPostUpgradeInit {
11- function postUpgradeInit1 (uint256 initialTotalDelegation ) external ;
12- }
13-
14- /// @notice This action is performed as a governance proposal to activate the DVP quorum mechanism.
15- /// A second proposal (AdjustDvpEstimateAction) is recommended some time later to adjust the initial
16- /// total delegation estimate set in this proposal.
14+ /// @notice Activates DVP based quorum. The ARB token contract must already be tracking total DVP delta checkpoints.
1715contract ActivateDvpQuorumAction {
1816 address public immutable l2AddressRegistry;
19- address public immutable arbTokenProxy;
20- ProxyAdmin public immutable govProxyAdmin;
21-
17+ address public immutable l2ArbitrumToken;
18+ address public immutable govProxyAdmin;
2219 address public immutable newGovernorImpl;
23- address public immutable newTokenImpl;
24-
25- uint256 public immutable newCoreQuorumNumerator;
26- uint256 public immutable newTreasuryQuorumNumerator;
27- uint256 public immutable initialTotalDelegationEstimatee;
20+ uint256 public immutable coreQuorumNumerator;
21+ uint256 public immutable treasuryQuorumNumerator;
22+ uint256 public immutable totalDelegationAnchor;
2823
2924 constructor (
3025 address _l2AddressRegistry ,
31- address _arbTokenProxy ,
32- ProxyAdmin _govProxyAdmin ,
26+ address _l2ArbitrumToken ,
27+ address _govProxyAdmin ,
3328 address _newGovernorImpl ,
34- address _newTokenImpl ,
35- uint256 _newCoreQuorumNumerator ,
36- uint256 _newTreasuryQuorumNumerator ,
37- uint256 _initialTotalDelegationEstimate
29+ uint256 _coreQuorumNumerator ,
30+ uint256 _treasuryQuorumNumerator ,
31+ uint256 _totalDelegationAnchor
3832 ) {
3933 l2AddressRegistry = _l2AddressRegistry;
40- arbTokenProxy = _arbTokenProxy ;
34+ l2ArbitrumToken = _l2ArbitrumToken ;
4135 govProxyAdmin = _govProxyAdmin;
4236 newGovernorImpl = _newGovernorImpl;
43- newTokenImpl = _newTokenImpl;
44- newCoreQuorumNumerator = _newCoreQuorumNumerator;
45- newTreasuryQuorumNumerator = _newTreasuryQuorumNumerator;
46- initialTotalDelegationEstimatee = _initialTotalDelegationEstimate;
37+ coreQuorumNumerator = _coreQuorumNumerator;
38+ treasuryQuorumNumerator = _treasuryQuorumNumerator;
39+ totalDelegationAnchor = _totalDelegationAnchor;
4740 }
4841
4942 /// @notice Performs the following:
50- /// 1. Upgrades the token contract
51- /// 2. Calls postUpgradeInit1 on the token contract to set the initial total delegation estimate
52- /// 3. Upgrades the core governor contract
53- /// 4. Sets the new quorum numerator for the core governor
54- /// 5. Upgrades the treasury governor contract
55- /// 6. Sets the new quorum numerator for the treasury governor
43+ /// - Sets the total delegation anchor in the ARB token
44+ /// - Upgrades the core and treasury governor
45+ /// - Sets the new quorum numerator in both governors
5646 function perform () external {
57- // 1. Upgrade the token contract
58- govProxyAdmin.upgrade (TransparentUpgradeableProxy (payable (arbTokenProxy)), newTokenImpl);
59-
60- // 2. Call postUpgradeInit1 on the token contract
61- IArbTokenPostUpgradeInit (arbTokenProxy).postUpgradeInit1 (initialTotalDelegationEstimatee);
62-
63- // 3. Upgrade the core governor contract
64- address payable coreGov = payable (address (IL2AddressRegistry (l2AddressRegistry).coreGov ()));
65- govProxyAdmin.upgrade (TransparentUpgradeableProxy (coreGov), newGovernorImpl);
47+ // set the total delegation anchor in the ARB token
48+ L2ArbitrumToken (l2ArbitrumToken).setTotalDelegationAnchor (totalDelegationAnchor);
6649
67- // 4. Set the new quorum numerator for the core governor
68- L2ArbitrumGovernor (coreGov).updateQuorumNumerator (newCoreQuorumNumerator);
50+ // upgrade the core governor
51+ address payable coreGovProxy =
52+ payable (address (IL2AddressRegistry (l2AddressRegistry).coreGov ()));
53+ ProxyAdmin (govProxyAdmin).upgrade (
54+ TransparentUpgradeableProxy (coreGovProxy), newGovernorImpl
55+ );
6956
70- // 5. Upgrade the treasury governor contract
71- address payable treasuryGov =
57+ // upgrade the treasury governor
58+ address payable treasuryGovProxy =
7259 payable (address (IL2AddressRegistry (l2AddressRegistry).treasuryGov ()));
73- govProxyAdmin.upgrade (TransparentUpgradeableProxy (treasuryGov), newGovernorImpl);
60+ ProxyAdmin (govProxyAdmin).upgrade (
61+ TransparentUpgradeableProxy (treasuryGovProxy), newGovernorImpl
62+ );
7463
75- // 6. Set the new quorum numerator for the treasury governor
76- L2ArbitrumGovernor (treasuryGov).updateQuorumNumerator (newTreasuryQuorumNumerator);
64+ // set the new quorum numerator in both governors
65+ L2ArbitrumGovernor (coreGovProxy).relay (
66+ coreGovProxy,
67+ 0 ,
68+ abi.encodeCall (
69+ GovernorVotesQuorumFractionUpgradeable.updateQuorumNumerator, (coreQuorumNumerator)
70+ )
71+ );
72+ L2ArbitrumGovernor (treasuryGovProxy).relay (
73+ treasuryGovProxy,
74+ 0 ,
75+ abi.encodeCall (
76+ GovernorVotesQuorumFractionUpgradeable.updateQuorumNumerator,
77+ (treasuryQuorumNumerator)
78+ )
79+ );
7780 }
7881}
0 commit comments