Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Feb 14, 2024
1 parent 94be298 commit bf75440
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
20 changes: 14 additions & 6 deletions script/ProposeProtocolFeesBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {Script} from "forge-std/Script.sol";
import {DeployInput} from "script/DeployInput.sol";
import {GovernorBravoDelegate} from "script/interfaces/GovernorBravoInterfaces.sol";

/// @dev A new proposal script that updates a pool's fee settings should inherit this abstract script and implement `getPoolFeeSettings`.
/// @dev A new proposal script that updates a pool's fee settings should inherit this abstract
/// script and implement `getPoolFeeSettings`.
abstract contract ProposeProtocolFeesBase is Script, DeployInput {
GovernorBravoDelegate constant GOVERNOR = GovernorBravoDelegate(UNISWAP_GOVERNOR);
// The default proposer is uf.eek.eth.
Expand All @@ -17,19 +18,23 @@ abstract contract ProposeProtocolFeesBase is Script, DeployInput {
address[] public targets;
/// @dev The values to pass into the proposal which should all be 0.
uint256[] public values;
/// @dev The function signatures that will be called when a proposal is executed. All of the signatures should be `setFeeProtocol(address,uint8,uint8)`.
/// @dev The function signatures that will be called when a proposal is executed. All of the
/// signatures should be `setFeeProtocol(address,uint8,uint8)`.
string[] public signatures;
/// @dev The calldata for all of function calls in the proposal. These should match the `PoolFeeSettings` defined in `getPoolFeeSettings`.
/// @dev The calldata for all of function calls in the proposal. These should match the
/// `PoolFeeSettings` defined in `getPoolFeeSettings`.
bytes[] public calldatas;

/// @dev A struct to represent all of the information needed to update a pool's fees. Such as the target pool and the new fees for each token in the pool.
/// @dev A struct to represent all of the information needed to update a pool's fees. Such as the
/// target pool and the new fees for each token in the pool.
struct PoolFeeSettings {
address pool;
uint8 feeProtocol0;
uint8 feeProtocol1;
}

/// @dev A utility function that updates the targets, values, signatures, and calldatas for a proposal that will only update protocol fees for a list of pools.
/// @dev A utility function that updates the targets, values, signatures, and calldatas for a
/// proposal that will only update protocol fees for a list of pools.
function pushFeeSettingToProposalCalldata(
address _v3FactoryOwner,
address _pool,
Expand All @@ -43,7 +48,10 @@ abstract contract ProposeProtocolFeesBase is Script, DeployInput {
}

/// @return A list of pool settings used to update protocol fees for each pool.
/// @dev A new `ProposeProtocolFees` script should extend this base script and only implement this function to return a list of pools to be updated with their new settings. This function will return the appropriate pool settings in the `run` method and add them to the proposal that will be proposed.
/// @dev A new `ProposeProtocolFees` script should extend this base script and only implement this
/// function to return a list of pools to be updated with their new settings. This function will
/// return the appropriate pool settings in the `run` method and add them to the proposal that
/// will be proposed.
function getPoolFeeSettings() internal pure virtual returns (PoolFeeSettings[] memory);

function propose() internal returns (uint256 _proposalId) {
Expand Down
2 changes: 0 additions & 2 deletions test/helpers/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ contract Constants {
address constant WBTC_WETH_3000_POOL = 0xCBCdF9626bC03E24f779434178A73a0B4bad62eD;
address constant DAI_WETH_3000_POOL = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8;
address constant DAI_USDC_100_POOL = 0x5777d92f208679DB4b9778590Fa3CAB3aC9e2168;


}
6 changes: 2 additions & 4 deletions test/helpers/ProposalTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +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 {ProposeProtocolFeesBatch1} from
"script/ProposeProtocolFeesBatch1.sol";
import {ProposeProtocolFeesBatch1} from "script/ProposeProtocolFeesBatch1.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 @@ -63,8 +62,7 @@ abstract contract ProposalTest is Test, DeployInput, Constants {
}

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

Expand Down

0 comments on commit bf75440

Please sign in to comment.