From 2e61235b684d5f897c977dc05f7ad65b1a839664 Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 22 Oct 2025 11:04:11 -0400 Subject: [PATCH] admin can change protocol fee address --- src/PartyPlanner.sol | 8 ++++---- src/PartyPool.sol | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/PartyPlanner.sol b/src/PartyPlanner.sol index 5f95102..0849606 100644 --- a/src/PartyPlanner.sol +++ b/src/PartyPlanner.sol @@ -32,8 +32,8 @@ contract PartyPlanner is OwnableExternal, IPartyPlanner { function protocolFeePpm() external view returns (uint256) { return PROTOCOL_FEE_PPM; } /// @notice Address to receive protocol fees for pools created by this planner (may be address(0)) - address private immutable PROTOCOL_FEE_ADDRESS; - function protocolFeeAddress() external view returns (address) { return PROTOCOL_FEE_ADDRESS; } + address public protocolFeeAddress; + function setProtocolFeeAddress( address feeAddress ) external onlyOwner { protocolFeeAddress = feeAddress; } NativeWrapper private immutable WRAPPER; function wrapper() external view returns (NativeWrapper) { return WRAPPER; } @@ -78,7 +78,7 @@ contract PartyPlanner is OwnableExternal, IPartyPlanner { require(protocolFeePpm_ < 1_000_000, "Planner: protocol fee >= ppm"); PROTOCOL_FEE_PPM = protocolFeePpm_; - PROTOCOL_FEE_ADDRESS = protocolFeeAddress_; + protocolFeeAddress = protocolFeeAddress_; } /// Main newPool variant: accepts kappa directly (preferred). @@ -120,7 +120,7 @@ contract PartyPlanner is OwnableExternal, IPartyPlanner { swapFeePpm_, flashFeePpm_, PROTOCOL_FEE_PPM, - PROTOCOL_FEE_ADDRESS, + protocolFeeAddress, WRAPPER, SWAP_IMPL, MINT_IMPL diff --git a/src/PartyPool.sol b/src/PartyPool.sol index 75c389c..0fdd2fa 100644 --- a/src/PartyPool.sol +++ b/src/PartyPool.sol @@ -67,8 +67,7 @@ contract PartyPool is PartyPoolBase, OwnableExternal, ERC20External, IPartyPool function protocolFeePpm() external view returns (uint256) { return PROTOCOL_FEE_PPM; } /// @notice Address to which collected protocol _tokens will be sent on collectProtocolFees() - address private immutable PROTOCOL_FEE_ADDRESS; - function protocolFeeAddress() external view returns (address) { return PROTOCOL_FEE_ADDRESS; } + address public protocolFeeAddress; // @inheritdoc IPartyPool function allProtocolFeesOwed() external view returns (uint256[] memory) { return _protocolFeesOwed; } @@ -139,7 +138,7 @@ contract PartyPool is PartyPoolBase, OwnableExternal, ERC20External, IPartyPool // If the protocolFeePpm_ is set, then also require the fee address to be nonzero require(protocolFeePpm_ == 0 || protocolFeeAddress_ != address(0)); PROTOCOL_FEE_PPM = protocolFeePpm_; - PROTOCOL_FEE_ADDRESS = protocolFeeAddress_; + protocolFeeAddress = protocolFeeAddress_; SWAP_IMPL = swapImpl_; MINT_IMPL = mintImpl_; @@ -159,6 +158,14 @@ contract PartyPool is PartyPoolBase, OwnableExternal, ERC20External, IPartyPool _protocolFeesOwed = new uint256[](n); } + // + // Admin operations + // + + function setProtocolFeeAddress( address feeAddress ) external onlyOwner { + protocolFeeAddress = feeAddress; + } + /// @notice If a security problem is found, the vault owner may call this function to permanently disable swap and /// mint functionality, leaving only burns (withdrawals) working. function kill() external onlyOwner { @@ -482,7 +489,7 @@ contract PartyPool is PartyPoolBase, OwnableExternal, ERC20External, IPartyPool function collectProtocolFees() external nonReentrant { bytes memory data = abi.encodeWithSelector( PartyPoolSwapImpl.collectProtocolFees.selector, - PROTOCOL_FEE_ADDRESS + protocolFeeAddress ); Address.functionDelegateCall(address(MINT_IMPL), data); }