F-2025-0018·missing-event

Incorrect Event Emitted in setPoolFactory Function

Fixedliquid-stakinglststaking-poolsgithub.com/matchain/contracts
TL;DR

setPoolFactory emits TokenChanged instead of PoolFactoryChanged. Off-chain indexers tracking factory changes will receive the wrong event signature.

Severity
LOW
Impact
LOW
Likelihood
MEDIUM
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

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.

solidity
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 PoolFactoryChanged event to reflect the change in the poolFactory address.
  • Actual Behavior: The TokenChanged event is emitted with the old and new poolFactory values, 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.

03Section · Impact

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.

04Section · Recommendation

Recommendation

Replace the emitted event with the correct one:

solidity
emit PoolFactoryChanged(oldValue, poolFactory);
F-2025-0018

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx