Incorrect Event Emitted in setPoolFactory Function
setPoolFactory emits TokenChanged instead of PoolFactoryChanged. Off-chain indexers tracking factory changes will receive the wrong event signature.
Description
The setPoolFactory function in the MatchConfig contract incorrectly emits the TokenChanged event instead of the intended PoolFactoryChanged event.
This is a logical bug that could lead to inaccurate off-chain tracking of critical state changes.
function setPoolFactory(address _poolFactory) public onlyOwner {if (_poolFactory == poolFactory)return;address oldValue = poolFactory;poolFactory = _poolFactory;emit TokenChanged(oldValue, poolFactory); // <-- Incorrect event}
- Expected Behavior: The function should emit the
PoolFactoryChangedevent to reflect the change in thepoolFactoryaddress. - Actual Behavior: The
TokenChangedevent is emitted with the old and newpoolFactoryvalues, which is misleading and incorrect.
While this does not affect on-chain logic, it breaks event-based tracking for external systems such as frontends, subgraphs, indexers, or monitoring tools. It may also cause confusion during audits or debugging.
Impact
Indexers, subgraphs, and monitoring tools will not detect changes to poolFactory through the proper event channel. State change is silent from an integration perspective.
Recommendation
Replace the emitted event with the correct one:
emit PoolFactoryChanged(oldValue, poolFactory);

