Omniscia Kinza Finance Audit

ProtectedERC20Gateway Code Style Findings

ProtectedERC20Gateway Code Style Findings

PEC-01C: Generic Typographic Mistakes

TypeSeverityLocation
Code StyleProtectedERC20Gateway.sol:L53-L57, L80-L83

Description:

The referenced lines contain typographical mistakes (i.e. private variable without an underscore prefix) or generic documentational errors (i.e. copy-paste) that should be corrected.

Example:

src/periphery/pToken/ProtectedERC20Gateway.sol
53/**
54 * @dev withdraws the WETH _reserves of msg.sender.
55 * @param amount amount of aWETH to withdraw and receive native ETH
56 * @param to address of the user who will receive native ETH
57 */

Recommendation:

We advise them to be corrected enhancing the legibility of the codebase.

Alleviation:

The referenced documentation blocks have been corrected.

PEC-02C: Redundant Code Imports

TypeSeverityLocation
Gas OptimizationProtectedERC20Gateway.sol:L9, L10, L11, L12, L20, L21

Description:

All referenced code imports and use statements are redundant given that they are not actively utilized by any statement in the ProtectedERC20Gateway contract's code.

Example:

src/periphery/pToken/ProtectedERC20Gateway.sol
4import {Ownable} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol';
5import {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';
6import {GPv2SafeERC20} from '@aave/core-v3/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol';
7import {IPool} from '@aave/core-v3/contracts/interfaces/IPool.sol';
8import {IAToken} from '@aave/core-v3/contracts/interfaces/IAToken.sol';
9import {ReserveConfiguration} from '@aave/core-v3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol';
10import {UserConfiguration} from '@aave/core-v3/contracts/protocol/libraries/configuration/UserConfiguration.sol';
11import {DataTypes} from '@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol';
12import {DataTypesHelper} from '../libraries/DataTypesHelper.sol';
13import {IPERC20} from './interfaces/IPERC20.sol';
14
15/**
16 * @dev This contract helps to deposit to /wthidraw from the lending pool using protected token
17 * user can also first wrap token into the protected token himself/herself without going through this gateway
18 */
19contract ProtectedERC20Gateway is Ownable {
20 using ReserveConfiguration for DataTypes.ReserveConfigurationMap;
21 using UserConfiguration for DataTypes.UserConfigurationMap;
22 using GPv2SafeERC20 for IERC20;

Recommendation:

We advise them to be safely omitted, greatly reducing the bytecode size of the contract.

Alleviation:

All redundant imports and usage statements have been properly omitted, reducing the contract's bytecode size significantly.