Skip to content

Redundant Comparator #9

@hawkofsky

Description

@hawkofsky

UHV-03C: Redundant Comparator

Type Severity Location
Gas Optimization Informational strategyUgoHawkVenusFarm.sol:L355, L388

Description:

The comparator used within the while loop can be a strict equality as the greater-than portion will never be satisfied.

Example:

while(position > 0) {
  position = position.sub(_noFlashLoan(position, deficit));
  if (i >= 6) {
    break;
  }
  i++;
}

Recommendation:

We advise it to be done so to reduce the gas cost of the function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions