From 1bb2b2879ee26a0845b65668b5ec1447208c4b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Fri, 8 Nov 2024 15:30:41 +0000 Subject: [PATCH] fix: Add Governance owner as constructor param --- script/DeploySepolia.s.sol | 1 + src/Governance.sol | 3 ++- test/BribeInitiative.t.sol | 1 + test/CurveV2GaugeRewards.t.sol | 1 + test/E2E.t.sol | 1 + test/Governance.t.sol | 18 +++++++++++++++++- test/GovernanceAttacks.t.sol | 1 + test/UniV4Donations.t.sol | 1 + test/VotingPower.t.sol | 1 + test/recon/Setup.sol | 1 + 10 files changed, 27 insertions(+), 2 deletions(-) diff --git a/script/DeploySepolia.s.sol b/script/DeploySepolia.s.sol index 84dd8502..1a6f003a 100644 --- a/script/DeploySepolia.s.sol +++ b/script/DeploySepolia.s.sol @@ -97,6 +97,7 @@ contract DeploySepoliaScript is Script, Deployers { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + deployer, initialInitiatives ); assert(governance == uniV4Donations.governance()); diff --git a/src/Governance.sol b/src/Governance.sol index 49e4ccfa..02ff7e25 100644 --- a/src/Governance.sol +++ b/src/Governance.sol @@ -83,8 +83,9 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, Ownable, IG address _stakingV1, address _bold, Configuration memory _config, + address _owner, address[] memory _initiatives - ) UserProxyFactory(_lqty, _lusd, _stakingV1) Ownable(msg.sender) { + ) UserProxyFactory(_lqty, _lusd, _stakingV1) Ownable(_owner) { stakingV1 = ILQTYStaking(_stakingV1); lqty = IERC20(_lqty); bold = IERC20(_bold); diff --git a/test/BribeInitiative.t.sol b/test/BribeInitiative.t.sol index a922c0e5..e6b3aaab 100644 --- a/test/BribeInitiative.t.sol +++ b/test/BribeInitiative.t.sol @@ -77,6 +77,7 @@ contract BribeInitiativeTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); diff --git a/test/CurveV2GaugeRewards.t.sol b/test/CurveV2GaugeRewards.t.sol index cb3b9db7..bb0edec8 100644 --- a/test/CurveV2GaugeRewards.t.sol +++ b/test/CurveV2GaugeRewards.t.sol @@ -98,6 +98,7 @@ contract CurveV2GaugeRewardsTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); diff --git a/test/E2E.t.sol b/test/E2E.t.sol index 6eb98bda..d3e69e64 100644 --- a/test/E2E.t.sol +++ b/test/E2E.t.sol @@ -93,6 +93,7 @@ contract E2ETests is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); } diff --git a/test/Governance.t.sol b/test/Governance.t.sol index 458b31d1..91ea5620 100644 --- a/test/Governance.t.sol +++ b/test/Governance.t.sol @@ -26,7 +26,7 @@ contract GovernanceInternal is Governance { address _bold, Configuration memory _config, address[] memory _initiatives - ) Governance(_lqty, _lusd, _stakingV1, _bold, _config, _initiatives) {} + ) Governance(_lqty, _lusd, _stakingV1, _bold, _config, msg.sender, _initiatives) {} function averageAge(uint32 _currentTimestamp, uint32 _averageTimestamp) external pure returns (uint32) { return _averageAge(_currentTimestamp, _averageTimestamp); @@ -119,6 +119,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -407,6 +408,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -449,6 +451,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -497,6 +500,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1639,6 +1643,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1758,6 +1763,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1841,6 +1847,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1899,6 +1906,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1948,6 +1956,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -1998,6 +2007,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2048,6 +2058,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2104,6 +2115,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2177,6 +2189,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2249,6 +2262,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2311,6 +2325,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); @@ -2358,6 +2373,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); diff --git a/test/GovernanceAttacks.t.sol b/test/GovernanceAttacks.t.sol index eb572667..e18e1b6c 100644 --- a/test/GovernanceAttacks.t.sol +++ b/test/GovernanceAttacks.t.sol @@ -65,6 +65,7 @@ contract GovernanceTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); } diff --git a/test/UniV4Donations.t.sol b/test/UniV4Donations.t.sol index 3614bdc5..574ed2d7 100644 --- a/test/UniV4Donations.t.sol +++ b/test/UniV4Donations.t.sol @@ -123,6 +123,7 @@ contract UniV4DonationsTest is Test, Deployers { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); } diff --git a/test/VotingPower.t.sol b/test/VotingPower.t.sol index 861ce24a..1c27c552 100644 --- a/test/VotingPower.t.sol +++ b/test/VotingPower.t.sol @@ -92,6 +92,7 @@ contract VotingPowerTest is Test { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), initialInitiatives ); } diff --git a/test/recon/Setup.sol b/test/recon/Setup.sol index 5924352f..ebf93617 100644 --- a/test/recon/Setup.sol +++ b/test/recon/Setup.sol @@ -75,6 +75,7 @@ abstract contract Setup is BaseSetup { epochDuration: EPOCH_DURATION, epochVotingCutoff: EPOCH_VOTING_CUTOFF }), + address(this), deployedInitiatives // no initial initiatives passed in because don't have cheatcodes for calculating address where gov will be deployed );