Omniscia WagmiDAO Audit

WagmiToken Code Style Findings

WagmiToken Code Style Findings

WTN-01C: Inexplicable Value Literal

TypeSeverityLocation
Code StyleInformationalWagmiToken.sol:L597

Description:

The linked value literal represents 20 million units, however, no justification is given for the statement.

Example:

WagmiToken.sol
596constructor() {
597 _mint(msg.sender, 20000000 ether);
598}

Recommendation:

First, we advise the built-in numerical separator (_) to be utilized in the statement to render the value more readable (20000000 -> 20_000_000). Lastly, we advise documentation to be introduced to properly illustrate what this is meant to represent as it significantly concentrates the initial liquidity of the Wagmi token to its deployer.

Alleviation:

The underscore (_) separator is now properly used in the depiction of the number, thereby considering this exhibit alleviated code wise.

WTN-02C: Redundant Memory Declaration

TypeSeverityLocation
Gas OptimizationInformationalWagmiToken.sol:L80, L82, L589, L591

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:

WagmiToken.sol
75/**
76 * @dev Transfers ownership of the contract to a new account (`newOwner`).
77 * Internal function without access restriction.
78 */
79function _transferOwnership(address newOwner) internal virtual {
80 address oldOwner = _owner;
81 _owner = newOwner;
82 emit OwnershipTransferred(oldOwner, newOwner);
83}

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.