Omniscia WagmiDAO Audit

WagmiEarn Code Style Findings

WagmiEarn Code Style Findings

WEN-01C: Redundant Memory Declaration

TypeSeverityLocation
Gas OptimizationInformationalWagmiEarn.sol:L76, L78

Description:

The linked statements perform a memory declaration of a storage value, write over it with an in-memory value and emit an event right after with the value read from storage before the write and the input argument of the function.

Example:

WagmiEarn.sol
75function _setOwner(address newOwner) private {
76 address oldOwner = _owner;
77 _owner = newOwner;
78 emit OwnershipTransferred(oldOwner, newOwner);
79}

Recommendation:

We advise the event emission to be relocated before the storage write to directly utilize the storage member and render the in-memory variable declaration redundant within the code.

Alleviation:

The statements were adjusted as per our recommendation.

WEN-02C: Redundant Visibility Specifier

TypeSeverityLocation
Gas OptimizationInformationalWagmiEarn.sol:L541

Description:

The linked variable has a public visibility specifier yet is meant to represent an internally accessible constant.

Example:

WagmiEarn.sol
541uint256 public constant MAX_EMISSION_RATE = 100 ether;

Recommendation:

We advise it to be set as private or internal greatly optimizing the deployment size and gas cost of the contract.

Alleviation:

The variable is now set as internal alleviating this exhibit.