Omniscia Keyko Audit

DonationMinerImplementation Code Style Findings

DonationMinerImplementation Code Style Findings

DMI-01C: Inefficient Event Storage Read

Description:

The linked event emits the values of variables in storage that were written to by the function itself with in-memory values.

Example:

contracts/token/DonationMinerImplementation.sol
350/**
351 * @notice Updates Treasury address
352 *
353 * @param newTreasury_ address of new treasury_ contract
354 */
355function updateTreasury(ITreasury newTreasury_) external override onlyOwner {
356 address oldTreasuryAddress = address(_treasury);
357 _treasury = newTreasury_;
358
359 emit TreasuryUpdated(oldTreasuryAddress, address(_treasury));
360}

Recommendation:

We advise the in-memory values from the function arguments to be utilized directly significantly reducing the gas cost of those functions.

Alleviation:

The event emission statements have been optimised accordingly.

DMI-02C: Redundant User-Defined Getter Functions

Description:

All linked functions can be omitted from the codebase by declaring the corresponding variables returned as public and renaming them.

Example:

contracts/token/DonationMinerImplementation.sol
151/**
152 * @notice Returns the cUSD contract address
153 */
154function cUSD() external view override returns (IERC20) {
155 return _cUSD;
156}
157
158/**
159 * @notice Returns the IPCT contract address
160 */
161function IPCT() external view override returns (IERC20) {
162 return _IPCT;
163}
164
165/**
166 * @notice Returns the Treasury contract address
167 */
168function treasury() external view override returns (ITreasury) {
169 return _treasury;
170}

Recommendation:

We advise this to be done so to significantly reduce the code size of the contract and ensure ease-of-maintenance of the codebase.

Alleviation:

The variables were renamed and adjusted as advised.