You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unused state variables are gas consuming at deployment (since they are located in storage) and are
a bad code practice. Removing those variables will decrease deployment gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
You can change the order of the storage variables to decrease memory uses.
Code instances:
In LiquidityReserveStorage.sol,rearranging the storage fields can optimize to: 6 slots from: 7 slots.
The new order of types (you choose the actual variables):
1. uint256
2. uint256
3. uint256
4. address
5. bool
6. address
7. address
Short the following require messages
The following require messages are of length more than 32 and we think are short enough to short
them into exactly 32 characters such that it will be placed in one slot of memory and the require
function will cost less gas.
The list:
Code instances:
Solidity file: ERC20Upgradeable.sol, In line 281, Require message length to shorten: 38, The message: ERC20: transfer amount exceeds balance
Solidity file: ERC20Upgradeable.sol, In line 362, Require message length to shorten: 36, The message: ERC20: approve from the zero address
Solidity file: ERC20Upgradeable.sol, In line 363, Require message length to shorten: 34, The message: ERC20: approve to the zero address
Solidity file: ERC20Upgradeable.sol, In line 245, Require message length to shorten: 37, The message: ERC20: decreased allowance below zero
Solidity file: ERC20Upgradeable.sol, In line 275, Require message length to shorten: 37, The message: ERC20: transfer from the zero address
Solidity file: ERC20Upgradeable.sol, In line 189, Require message length to shorten: 40, The message: ERC20: transfer amount exceeds allowance
Solidity file: ERC20Upgradeable.sol, In line 333, Require message length to shorten: 34, The message: ERC20: burn amount exceeds balance
Solidity file: ERC20Upgradeable.sol, In line 328, Require message length to shorten: 33, The message: ERC20: burn from the zero address
Solidity file: ERC20Upgradeable.sol, In line 276, Require message length to shorten: 35, The message: ERC20: transfer to the zero address
Unused state variables
Unused state variables are gas consuming at deployment (since they are located in storage) and are
a bad code practice. Removing those variables will decrease deployment gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
Code instances:
Rearrange state variables
You can change the order of the storage variables to decrease memory uses.
Code instances:
In LiquidityReserveStorage.sol,rearranging the storage fields can optimize to: 6 slots from: 7 slots.
The new order of types (you choose the actual variables):
1. uint256
2. uint256
3. uint256
4. address
5. bool
6. address
7. address
Short the following require messages
The following require messages are of length more than 32 and we think are short enough to short
them into exactly 32 characters such that it will be placed in one slot of memory and the require
function will cost less gas.
The list:
Code instances:
Use != 0 instead of > 0
Using != 0 is slightly cheaper than > 0. (see code-423n4/2021-12-maple-findings#75 for similar issue)
Code instances:
Use unchecked to save gas for certain additive calculations that cannot overflow
You can use unchecked in the following calculations since there is no risk to overflow:
Code instance:
Inline one time use functions
The following functions are used exactly once. Therefore you can inline them and save gas and improve code clearness.
Code instances:
The text was updated successfully, but these errors were encountered: