Omniscia AllianceBlock Audit

MultiWithDefaultProviderSelector Static Analysis Findings

MultiWithDefaultProviderSelector Static Analysis Findings

MWD-01S: Inexistent Event Emissions

Description:

The linked functions adjust sensitive contract variables yet do not emit an event for it.

Example:

contracts/MultiWithDefaultProviderSelector.sol
109function _addProvider(address provider) internal {
110 if (provider == address(0)) revert ZeroAddressProvider();
111 validProviders[provider] = true;
112}
113
114function _removeProvider(address provider) internal {
115 if (provider == address(0)) revert ZeroAddressProvider();
116 if (!this.isValidProvider(provider)) revert ProviderNotFound();
117
118 validProviders[provider] = false;
119
120 if (provider == _currentProvider) {
121 _currentProvider == address(0);
122 }
123}

Recommendation:

We advise an event to be declared and correspondingly emitted for each function to ensure off-chain processes can properly react to this system adjustment.

Alleviation (e6f704512a03e960f6cd0802fb70aa284591fe37):

The ProviderAdded, and ProviderRemoved events were introduced to the codebase and are correspondingly emitted in the MultiWithDefaultProviderSelector::_addProvider, and MultiWithDefaultProviderSelector::_removeProvider functions respectively, addressing this exhibit in full.