Skip to content
Request an audit

‹ All findings

Storage variables can be cached to save gas

Low/InfoMitosis·Three Sigma · Cross-chain liquidity layer 1 · 25th June, 20243S-Mitosis-N13

Description

Storage variables should be cached to avoid reading from storage more than once and incurring extra gas costs.

Recommendation

In BasicVault::enableEOL(), $.asset.forceApprove(address($v2.eol), type(uint256).max); should use eol instead. In RedeemQueue::push(), queue._count++; could be queue._count = requestId + 1. In RedeemQueue::resolve(), update() writes the whole request to storage, when only the resolved at field is modified.

In StrategyExecutor::disableStrategy, enabled.length should be cached.

Status

Addressed in #43e8fea.