fix: No events on fee destination state changes (#958)

Add FeeDestinationSet and FeeDestinationLocked events to LiquidityManager,
emitted on every setFeeDestination() call and lock engagement respectively.
Update tests to assert both events are emitted in all code paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 21:25:12 +00:00
parent 240d3ae1ac
commit e3c699b7eb
2 changed files with 33 additions and 3 deletions

View file

@ -65,6 +65,12 @@ contract LiquidityManager is ThreePositionStrategy, PriceOracle {
/// @notice Emitted on each successful recenter for monitoring and indexing
event Recentered(int24 indexed currentTick, bool indexed isUp);
/// @notice Emitted whenever feeDestination is updated
event FeeDestinationSet(address indexed newDest);
/// @notice Emitted when the fee destination lock is permanently engaged
event FeeDestinationLocked(address indexed dest);
/// @notice Custom errors
error ZeroAddressInSetter();
@ -139,12 +145,15 @@ contract LiquidityManager is ThreePositionStrategy, PriceOracle {
// to storage. A subsequent SELFDESTRUCT clears the bytecode but cannot undo this write.
if (!feeDestinationLocked && feeDestination != address(0) && feeDestination.code.length > 0) {
feeDestinationLocked = true;
emit FeeDestinationLocked(feeDestination);
return;
}
require(!feeDestinationLocked, "fee destination locked");
feeDestination = feeDestination_;
emit FeeDestinationSet(feeDestination_);
if (feeDestination_.code.length > 0) {
feeDestinationLocked = true;
emit FeeDestinationLocked(feeDestination_);
}
}