From becb8b11339d45c1787d07dfcf74acd3a90a01ec Mon Sep 17 00:00:00 2001 From: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:25:07 -0400 Subject: [PATCH] Add `proposer` &`minDelay` as arguments to SubmitUpgradeProposalScript (#2) * Add `proposer` and `minDelay` as arguments to SubmitUpgradeProposalScript * Use proposer addresse defined in .env --- script/SubmitUpgradeProposalScript.s.sol | 16 +++++++--------- test/L2ArbitrumGovernorV2.t.sol | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/script/SubmitUpgradeProposalScript.s.sol b/script/SubmitUpgradeProposalScript.s.sol index 05015872..d64988f2 100644 --- a/script/SubmitUpgradeProposalScript.s.sol +++ b/script/SubmitUpgradeProposalScript.s.sol @@ -9,12 +9,10 @@ import {GovernorUpgradeable} from "openzeppelin-upgradeable-v5/governance/Govern import {CreateL2ArbSysProposal} from "script/helpers/CreateL2ArbSysProposal.sol"; contract SubmitUpgradeProposalScript is Script, SharedGovernorConstants, CreateL2ArbSysProposal { - // TODO: Update `PROPOSER` to script msg.sender who will submit the proposal. - address PROPOSER = 0x1B686eE8E31c5959D9F5BBd8122a58682788eeaD; // L2Beat - // TODO: Update `minDelay` to latest getMinDelay() from L1Timelock. - uint256 minDelay = 259_200; + address PROPOSER_ADDRESS = + vm.envOr("PROPOSER_ADDRESS", 0x1B686eE8E31c5959D9F5BBd8122a58682788eeaD); //L2Beat - function run(address _timelockRolesUpgrader) + function run(address _timelockRolesUpgrader, uint256 _minDelay) public returns ( address[] memory targets, @@ -24,10 +22,10 @@ contract SubmitUpgradeProposalScript is Script, SharedGovernorConstants, CreateL uint256 _proposalId ) { - return proposeUpgrade(_timelockRolesUpgrader); + return proposeUpgrade(_timelockRolesUpgrader, _minDelay); } - function proposeUpgrade(address _timelockRolesUpgrader) + function proposeUpgrade(address _timelockRolesUpgrader, uint256 _minDelay) internal returns ( address[] memory _targets, @@ -85,8 +83,8 @@ contract SubmitUpgradeProposalScript is Script, SharedGovernorConstants, CreateL By approving this proposal, the Arbitrum DAO will upgrade its governance infrastructure, enabling new features and improvements in the governance process. \ "; (_targets, _values, _calldatas) = - createL2ArbSysProposal(_description, _timelockRolesUpgrader, minDelay); - vm.startBroadcast(PROPOSER); + createL2ArbSysProposal(_description, _timelockRolesUpgrader, _minDelay); + vm.startBroadcast(PROPOSER_ADDRESS); _proposalId = GovernorUpgradeable(payable(L2_CORE_GOVERNOR)).propose( _targets, _values, _calldatas, _description ); diff --git a/test/L2ArbitrumGovernorV2.t.sol b/test/L2ArbitrumGovernorV2.t.sol index 2c31532b..ec816665 100644 --- a/test/L2ArbitrumGovernorV2.t.sol +++ b/test/L2ArbitrumGovernorV2.t.sol @@ -123,7 +123,7 @@ abstract contract L2ArbitrumGovernorV2Test is SetupNewGovernors { bytes[] memory _calldatas, string memory _description, uint256 _proposalId - ) = submitUpgradeProposalScript.run(address(timelockRolesUpgrader)); + ) = submitUpgradeProposalScript.run(address(timelockRolesUpgrader), L1_TIMELOCK_MIN_DELAY); vm.roll(vm.getBlockNumber() + currentCoreGovernor.votingDelay() + 1); assertEq( @@ -1091,7 +1091,7 @@ abstract contract Queue is L2ArbitrumGovernorV2Test { /*string memory _description*/ , uint256 _proposalId - ) = submitUpgradeProposalScript.run(address(timelockRolesUpgrader)); + ) = submitUpgradeProposalScript.run(address(timelockRolesUpgrader), L1_TIMELOCK_MIN_DELAY); vm.roll(vm.getBlockNumber() + currentCoreGovernor.votingDelay() + 1); assertEq(