Omniscia Faith Tribe Audit
ContextMixin Code Style Findings
ContextMixin Code Style Findings
CMN-01C: Redundant return Statement
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | ContextMixin.sol:L23 |
Description:
The linked statement is redundant given that the function contains a named return variable.
Example:
contracts/external/common/ContextMixin.sol
5function msgSender()6 internal7 view8 returns (address sender)9{10 if (msg.sender == address(this)) {11 bytes memory array = msg.data;12 uint256 index = msg.data.length;13 assembly {14 // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.15 sender := and(16 mload(add(array, index)),17 0xffffffffffffffffffffffffffffffffffffffff18 )19 }20 } else {21 sender = msg.sender;22 }23 return sender;24}Recommendation:
We advise the return statement to be safely omitted from the code.
Alleviation:
The explicit return statement has been safely omitted.