Skip to content

Commit

Permalink
Make changes based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Feb 14, 2024
1 parent c16b9c0 commit cd01887
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
1 change: 1 addition & 0 deletions script/ProposeFactorySetOwner.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contract ProposeFactorySetOwner is Script, DeployInput {
address _proposer =
vm.envOr("PROPOSER_ADDRESS", address(0x0459f41c5f09BF678D9C07331894dE31d8C22255));

/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
function proposeFactoryOwnerChangeOnGovernor(address _newV3FactoryOwner)
internal
returns (uint256 _proposalId)
Expand Down
19 changes: 19 additions & 0 deletions script/ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.23;

import {Script} from "forge-std/Script.sol";

import {DeployInput} from "script/DeployInput.sol";
import {GovernorBravoDelegate} from "script/interfaces/GovernorBravoInterfaces.sol";
import {ProposeSetProtocolFeeOnPools} from "script/ProposeSetProtocolFeeOnPools.s.sol";

contract ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools is ProposeSetProtocolFeeOnPools {
PoolFeeSettings[] public poolFeeSettings;

function getPoolFeeSettings() internal override returns (PoolFeeSettings[] memory) {
poolFeeSettings.push(PoolFeeSettings(WBTC_WETH_3000_POOL, 10, 10));
poolFeeSettings.push(PoolFeeSettings(DAI_WETH_3000_POOL, 10, 10));
poolFeeSettings.push(PoolFeeSettings(DAI_USDC_100_POOL, 10, 10));
return poolFeeSettings;
}
}
19 changes: 0 additions & 19 deletions script/ProposeSetProtocolFeeOnFirstPools.sol

This file was deleted.

13 changes: 8 additions & 5 deletions script/ProposeSetProtocolFeeOnPools.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract contract ProposeSetProtocolFeeOnPools is Script, DeployInput {
string[] public signatures;
bytes[] public calldatas;

struct PoolFees {
struct PoolFeeSettings {
address pool;
uint8 feeProtocol0;
uint8 feeProtocol1;
Expand All @@ -35,7 +35,7 @@ abstract contract ProposeSetProtocolFeeOnPools is Script, DeployInput {
calldatas.push(abi.encode(_pool, _feeProtocol0, _feeProtocol1));
}

function newPoolFeeSettings() internal virtual returns (PoolFees[] memory);
function getPoolFeeSettings() internal virtual returns (PoolFeeSettings[] memory);

function propose() internal returns (uint256 _proposalId) {
return GOVERNOR.propose(
Expand All @@ -58,10 +58,13 @@ abstract contract ProposeSetProtocolFeeOnPools is Script, DeployInput {
vm.rememberKey(_proposerKey);

vm.startBroadcast(_proposer);
PoolFees[] memory poolFees = newPoolFeeSettings();
for (uint256 i = 0; i < poolFees.length; i++) {
PoolFeeSettings[] memory poolFeeSettings = getPoolFeeSettings();
for (uint256 i = 0; i < poolFeeSettings.length; i++) {
pushFeeSettingToProposalCalldata(
_newV3FactoryOwner, poolFees[i].pool, poolFees[i].feeProtocol0, poolFees[i].feeProtocol1
_newV3FactoryOwner,
poolFeeSettings[i].pool,
poolFeeSettings[i].feeProtocol0,
poolFeeSettings[i].feeProtocol1
);
}

Expand Down
4 changes: 2 additions & 2 deletions test/helpers/ProposalTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Test} from "forge-std/Test.sol";
import {Deploy} from "script/Deploy.s.sol";
import {DeployInput} from "script/DeployInput.sol";
import {ProposeFactorySetOwner} from "script/ProposeFactorySetOwner.s.sol";
import {ProposeSetProtocolFeeOnFirstPools} from "script/ProposeSetProtocolFeeOnFirstPools.sol";
import {ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools} from "script/ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools.sol";
import {Constants} from "test/helpers/Constants.sol";
import {GovernorBravoDelegate} from "script/interfaces/GovernorBravoInterfaces.sol";
import {V3FactoryOwner} from "src/V3FactoryOwner.sol";
Expand Down Expand Up @@ -62,7 +62,7 @@ abstract contract ProposalTest is Test, DeployInput, Constants {
}

function _proposePoolFee() internal {
ProposeSetProtocolFeeOnFirstPools _proposeFeeScript = new ProposeSetProtocolFeeOnFirstPools();
ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools _proposeFeeScript = new ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools();
setFeeProposalId = _proposeFeeScript.run(address(v3FactoryOwner));
}

Expand Down

0 comments on commit cd01887

Please sign in to comment.