Skip to content

Commit

Permalink
Update proposal script
Browse files Browse the repository at this point in the history
  • Loading branch information
jferas committed Nov 27, 2023
1 parent 3b3a686 commit ce8bc2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
21 changes: 10 additions & 11 deletions script/Propose.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ import {ICompoundTimelock} from

import {RadworksGovernor} from "src/RadworksGovernor.sol";
import {IGovernorAlpha} from "src/interfaces/IGovernorAlpha.sol";
import {Constants} from "test/Constants.sol";

contract Propose is Script {
IGovernorAlpha constant GOVERNOR_ALPHA =
IGovernorAlpha(0x690e775361AD66D1c4A25d89da9fCd639F5198eD);

// TODO: resolve the list of large delegates with tally
address PROPOSER = 0x464D78a5C97A2E2E9839C353ee9B6d4204c90B0b; // cloudhead.eth
/// @notice Script to submit the proposal to upgrade Radworks governor.
contract Propose is Script, Constants {
IGovernorAlpha constant radworksGovernorAlpha = IGovernorAlpha(GOVERNOR_ALPHA);
address PROPOSER_ADDRESS = 0x464D78a5C97A2E2E9839C353ee9B6d4204c90B0b; // cloudhead.eth

function propose(RadworksGovernor _newGovernor) internal returns (uint256 _proposalId) {
address[] memory _targets = new address[](2);
uint256[] memory _values = new uint256[](2);
string[] memory _signatures = new string [](2);
string[] memory _signatures = new string[](2);
bytes[] memory _calldatas = new bytes[](2);

_targets[0] = GOVERNOR_ALPHA.timelock();
_targets[0] = radworksGovernorAlpha.timelock();
_values[0] = 0;
_signatures[0] = "setPendingAdmin(address)";
_calldatas[0] = abi.encode(address(_newGovernor));
Expand All @@ -31,12 +30,12 @@ contract Propose is Script {
_signatures[1] = "__acceptAdmin()";
_calldatas[1] = "";

return GOVERNOR_ALPHA.propose(
return radworksGovernorAlpha.propose(
_targets, _values, _signatures, _calldatas, "Upgrade to Governor Bravo"
);
}

/// @dev After the new Governor is deployed on mainnet, this can move from a parameter to a const
/// @dev After the new Governor is deployed on mainnet, `_newGovernor` can become a const
function run(RadworksGovernor _newGovernor) public returns (uint256 _proposalId) {
// The expectation is the key loaded here corresponds to the address of the `proposer` above.
// When running as a script, broadcast will fail if the key is not correct.
Expand All @@ -46,7 +45,7 @@ contract Propose is Script {
);
vm.rememberKey(_proposerKey);

vm.startBroadcast(PROPOSER);
vm.startBroadcast(PROPOSER_ADDRESS);
_proposalId = propose(_newGovernor);
vm.stopBroadcast();
return _proposalId;
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/ProposalTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract contract ProposalTest is RadworksGovernorTest {

TestableProposeScript _proposeScript = new TestableProposeScript();
// We override the deployer to use an alternate delegate, because in this context,
// lonser.eth already has a live proposal
// the PROPOSER_ADDRESS used already has a live proposal
_proposeScript.overrideProposerForTests(0x69dceee155C31eA0c8354F90BDD65C12FaF5A00a);

upgradeProposalId = _proposeScript.run(governorBravo);
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/TestableProposeScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ contract TestableProposeScript is Propose {
/// proposer. This is needed when testing with live proposal data, because the Governor only
/// allows each proposer to have one live proposal at a time.
function overrideProposerForTests(address _testProposer) external {
PROPOSER = _testProposer;
PROPOSER_ADDRESS = _testProposer;
}
}

0 comments on commit ce8bc2a

Please sign in to comment.