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

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