Omniscia WagmiDAO Audit
WagmiWithdrawer Code Style Findings
WagmiWithdrawer Code Style Findings
WWR-01C: Redundant Memory Declaration
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | WagmiWithdrawer.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:
WagmiWithdrawer.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.