admin can change protocol fee address

This commit is contained in:
tim
2025-10-22 11:04:11 -04:00
parent 903f65327a
commit 2e61235b68
2 changed files with 15 additions and 8 deletions

View File

@@ -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

View File

@@ -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);
}