Omniscia Mitosis Audit

EETHDepositHelper Code Style Findings

EETHDepositHelper Code Style Findings

EET-01C: Ineffectual Usage of Safe Arithmetics

Description:

The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.

Example:

src/helpers/EETHDepositHelper.sol
228if (msg.value < gas) {
229 revert Error.InsufficientFee(gas - msg.value);
230}
231
232// call ccdm.deposit
233ICCDMHost(ccdm).deposit{value: gas}(domain, address(_weETH), receiver, amount);
234
235// refund remaining gas
236uint256 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

Description:

The referenced statements will utilize the SafeERC20 library directly instead of via its using SafeERC20 for IERC20 syntax.

Example:

src/helpers/EETHDepositHelper.sol
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.