Omniscia Mitosis Audit
EETHDepositHelper Code Style Findings
EETHDepositHelper Code Style Findings
EET-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | EETHDepositHelper.sol:L229, L236 |
Description:
The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require
checks or if-else
constructs.
Example:
228if (msg.value < gas) {229 revert Error.InsufficientFee(gas - msg.value);230}231
232// call ccdm.deposit233ICCDMHost(ccdm).deposit{value: gas}(domain, address(_weETH), receiver, amount);234
235// refund remaining gas236uint256 refund = msg.value - gas;
Recommendation:
Given that safe arithmetics are toggled on by default in pragma
versions of 0.8.X
, we advise the linked statement to be wrapped in an unchecked
code block thereby optimizing its execution cost.
Alleviation (58e8cc66dfa900c03c47df78f5170d9960005629):
Both referenced calculations are now safely performed in an unchecked
code block as advised, optimizing their gas cost.
EET-02C: Non-Standard Library Usage
Type | Severity | Location |
---|---|---|
Code Style | EETHDepositHelper.sol:L45, L55, L62, L63, L66, L71, L72 |
Description:
The referenced statements will utilize the SafeERC20
library directly instead of via its using SafeERC20 for IERC20
syntax.
Example:
55SafeERC20.safePermit(IERC20Permit(vault), _msgSender(), address(this), amount, deadline, v, r, s);
Recommendation:
We advise the code to instead employ the syntax aforementioned, optimizing the legibility of the code greatly.
Alleviation (58e8cc66dfa900c03c47df78f5170d9960005629):
The SafeERC20
library is now utilized properly throughout the contract, addressing this exhibit.