Skip to content

Commit

Permalink
Add proposer &minDelay as arguments to SubmitUpgradeProposalScript (
Browse files Browse the repository at this point in the history
#2)

* Add `proposer` and `minDelay` as arguments to SubmitUpgradeProposalScript

* Use proposer addresse defined in .env
  • Loading branch information
garyghayrat committed Aug 28, 2024
1 parent ce941dd commit becb8b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions script/SubmitUpgradeProposalScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 2 additions & 2 deletions test/L2ArbitrumGovernorV2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit becb8b1

Please sign in to comment.