Omniscia Mean Finance Audit
ProtocolTokenWrapperTransformer Code Style Findings
ProtocolTokenWrapperTransformer Code Style Findings
PTW-01C: Misleading Naming Conventions
Type | Severity | Location |
---|---|---|
Code Style | ProtocolTokenWrapperTransformer.sol:L114-L117, L119-L122 |
Description:
The functions _toUnderlying
& _toUnderlyingAmount
simply assign an input address
/ uint256
to a single-entry address
/ uint256
array and yield it.
Example:
solidity/contracts/transformers/ProtocolTokenWrapperTransformer.sol
114function _toUnderlying(address _underlying) internal pure returns (address[] memory _underlyingArray) {115 _underlyingArray = new address[](1);116 _underlyingArray[0] = _underlying;117}
Recommendation:
We advise them to be renamed to _toSingletonArray
instead as the _toUnderlying
/ _toUnderylingAmount
function names signify additional logic that would somehow convert the _underlying
/ _amount
data points which doesn't exist.
Alleviation (6ed56b5449ca241fc6be369d44f392f1f5313f93):
The _toUnderlying
and _toUnderlyingAmount
functions were both updated to _toSingletonArray
increasing the legibility of the codebase significantly.