Title: Use calldata instead of memory
Severity: GAS
Use calldata instead of memory for function parameters
In some cases, having function arguments in calldata instead of
memory is more optimal.
TurboRouter.constructor (name)
Title: Unused imports
Severity: GAS
In the following files there are contract imports that aren't used
Import of unnecessary files costs deployment gas (and is a bad coding practice that is important to ignore)
TurboMaster.sol, line 12, import {TurboGibber} from "./modules/TurboGibber.sol";
The following functions are not used at all. Therefore you can remove them to save deployment gas and improve code clearness.
TurboSafe.sol, afterDeposit
TurboSafe.sol, beforeWithdraw
Title: Public functions to external
Severity: GAS
The following functions could be set external to save gas and improve code quality.
External call cost is less expensive than of public functions.
The following functions are payable but msg.value isn't used - therefore the function payable state modifier isn't necessary.
Payable functions are more gas expensive than others, and it's danger the users if they send ETH by mistake.
TurboRouter.sol, withdraw is payable but doesn't use msg.value
TurboRouter.sol, redeem is payable but doesn't use msg.value
TurboRouter.sol, mint is payable but doesn't use msg.value
TurboRouter.sol, deposit is payable but doesn't use msg.value
Title: Internal functions to private Severity: GAS
The following functions could be set private to save gas and improve code quality:
Title: Use calldata instead of memory Severity: GAS
Use calldata instead of memory for function parameters In some cases, having function arguments in calldata instead of memory is more optimal.
Title: Unused imports Severity: GAS
In the following files there are contract imports that aren't used Import of unnecessary files costs deployment gas (and is a bad coding practice that is important to ignore)
Title: Unnecessary constructor Severity: GAS
The following constructors are empty. (A similar issue https://github.com/code-423n4/2021-11-fei-findings/issues/12)
Title: Unnecessary functions Severity: GAS
Title: Public functions to external Severity: GAS
The following functions could be set external to save gas and improve code quality. External call cost is less expensive than of public functions.
Title: Unnecessary payable Severity: GAS
The following functions are payable but msg.value isn't used - therefore the function payable state modifier isn't necessary. Payable functions are more gas expensive than others, and it's danger the users if they send ETH by mistake.