Omniscia Sova Network Audit
ManagedWithdrawRWAStrategy Code Style Findings
ManagedWithdrawRWAStrategy Code Style Findings
MWW-01C: Potential Optimization of Nonce Consumption
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | ManagedWithdrawRWAStrategy.sol: • I-1: L137, L143 • I-2: L168, L170 |
Description:
The ManagedWithdrawReportedStrategy::_validateRedeem function will validate that the signature nonce has not been consumed and any code block that invokes it will immediately consume the nonce afterward.
Example:
src/strategy/ManagedWithdrawRWAStrategy.sol
168_validateRedeem(requests[i]);169_verifySignature(requests[i], signatures[i]);170usedNonces[requests[i].owner][requests[i].nonce] = true;Recommendation:
We advise the nonce validation and consumption code to be relocated to the same function block, permitting the interim usedNonces[owner] lookup to be cached to a local mapping(uint256 => bool) variable and thus the nonce's read and write operations to be made optimally.
Alleviation (e4d6885477438291b0d3ca477fab7e088522967b):
The code was updated to consume the nonce right after validating in the ManagedWithdrawReportedStrategy::_validateRedeem function, addressing this exhibit.
