Skip to content
Request an audit

‹ All findings

Useless else statement

Low/InfoFuji Finance·Three Sigma · Lending aggregator · 6th May, 20233S-FUJI-N17

Description

If a call reverts in the first if statement, the following else is not required.

Recommendation

Replace

solidity
if (balance < amount) {
    revert ConnextRouter__xReceive_notReceivedAssetBalance();
} else {
    _tempTokenToCheck = Snapshot(asset, balance - amount);
}

with

solidity
if (balance < amount) {
    revert ConnextRouter__xReceive_notReceivedAssetBalance();
}
_tempTokenToCheck = Snapshot(asset, balance - amount);

Status

Addressed here: Fujicracy/fuji-v2#625 and Fujicracy/fuji-v2#622