Omniscia Impact Market Audit

DonationMinerImplementation Code Style Findings

DonationMinerImplementation Code Style Findings

DMI-01C: Event Emission Optimizations

Description:

The linked event emissions can be optimized rendering the local variables redundant.

Example:

contracts/donationMiner/DonationMinerImplementation.sol
305/**
306 * @notice Updates claimDelay value
307 *
308 * @param _newClaimDelay Number of reward periods a donor has to wait after
309 * a donation until he will be able to claim his reward
310 */
311function updateClaimDelay(uint256 _newClaimDelay) external override onlyOwner {
312 uint256 _oldClaimDelay = claimDelay;
313 claimDelay = _newClaimDelay;
314
315 emit ClaimDelayUpdated(_oldClaimDelay, _newClaimDelay);
316}

Recommendation:

We advise the event emissions to be performed prior to the variables being adjusted thus permitting the events to be emitted with the current state variables and input arguments no longer requiring local variables.

Alleviation:

The linked code has been updated to emit the events prior to the variables being adjusted thus eliminating the need for temporary local variables and optimizing the codebase.