Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ScopeLift/radworks-governor-upgrade
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aa49609917a6196b4a6998a2aaa09eb537389961
Choose a base ref
..
head repository: ScopeLift/radworks-governor-upgrade
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 95a8d9364d12d552cf66ad2ed25e65287759b811
Choose a head ref
Showing with 18 additions and 18 deletions.
  1. +10 −11 script/Propose.s.sol
  2. +4 −3 test/helpers/ProposalTest.sol
  3. +3 −3 test/helpers/RadworksGovernorTest.sol
  4. +1 −1 test/helpers/TestableProposeScript.sol
21 changes: 10 additions & 11 deletions script/Propose.s.sol
Original file line number Diff line number Diff line change
@@ -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 RADWORK_GOVERNOR_ALPHA = 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] = RADWORK_GOVERNOR_ALPHA.timelock();
_values[0] = 0;
_signatures[0] = "setPendingAdmin(address)";
_calldatas[0] = abi.encode(address(_newGovernor));
@@ -31,12 +30,12 @@ contract Propose is Script {
_signatures[1] = "__acceptAdmin()";
_calldatas[1] = "";

return GOVERNOR_ALPHA.propose(
return RADWORK_GOVERNOR_ALPHA.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.
@@ -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;
7 changes: 4 additions & 3 deletions test/helpers/ProposalTest.sol
Original file line number Diff line number Diff line change
@@ -35,16 +35,17 @@ abstract contract ProposalTest is RadworksGovernorTest {
RadworksGovernorTest.setUp();

if (_useDeployedGovernorBravo()) {
// Use the actual live proposal data when it gets put on chain
upgradeProposalId = 17; // assume this is the next proposal
// Use the actual live proposal data expected to be on chain
// if Radworks Governor Bravo has already deployed
upgradeProposalId = 17; // assume this is the next proposal (as most recent is 16)
// Since the proposal was already submitted, the count before its submissions is one less
initialProposalCount = governorAlpha.proposalCount() - 1;
} else {
initialProposalCount = governorAlpha.proposalCount();

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);
6 changes: 3 additions & 3 deletions test/helpers/RadworksGovernorTest.sol
Original file line number Diff line number Diff line change
@@ -52,10 +52,10 @@ abstract contract RadworksGovernorTest is Test, DeployInput, Constants {
delegates.push(_delegate);
}

// After the Radworks Governor Bravo is deployed, the actual deployed contract can be tested.
// Before then, we'll use the Deploy script to deploy a new instance of the contract in the test
// fork.
if (_useDeployedGovernorBravo()) {
// The Radworks contract bravo governor hasn't deployed to mainnet yet, so we're let's not
// test this yet
// using Deploy in this repo.
governorBravo = RadworksGovernor(payable(DEPLOYED_BRAVO_GOVERNOR));
} else {
// We still want to exercise the script in these tests to give us
2 changes: 1 addition & 1 deletion test/helpers/TestableProposeScript.sol
Original file line number Diff line number Diff line change
@@ -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;
}
}