Omniscia Hot Cross Audit
Misc Code Style Findings
Misc Code Style Findings
MIS-01C: Dead Code
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | Misc.sol:L33-L35 |
Description:
The linked function remains unutilized in the codebase.
Example:
33function today() external view returns (uint256) {34 return block.timestamp / 1 days;35}
Recommendation:
We advise its removal to reduce the total bytecode size of the contracts.
Alleviation:
The function was removed from the codebase properly.
MIS-02C: Misleading Function Name
Type | Severity | Location |
---|---|---|
Code Style | Informational | Misc.sol:L37 |
Description:
The function name zeroOrContract
would indicate to a reader that it evaluates whether its address
argument is equal to the zero address or a contract whereas it evaluates that it is not equal to the zero address and that it is a contract, the former of which is unnecsesary.
Example:
37function zeroOrContract(address account, string memory errorMsg) external view {38 require(39 account != address(0) && isContract(account),40 errorMsg41 );42}
Recommendation:
We advise the simplification of the function to only evaluate whether the address
is a contract and it to be properly renamed. Checking that the address
is not equal to the zero address is redundant as an address being a contract inherently guarantees that it is not equal to the zero address as otherwise, someone would have gained access to the zero-address by deploying a contract on it and thus cause devasatating effects across the whole Ethereum blockchain ecosystem.
Alleviation:
The zeroOrContract
function was removed entirely from the codebase in favor of isContract
wherever it was originally invoked.