Skip to content

Use != 0 instead of > 0 #21

Open
Open
@code423n4

Description

@code423n4

Handle

mics

Vulnerability details

Using != 0 is slightly cheaper than > 0.
see code-423n4/2021-12-maple-findings#75 for similar issue.

    OpenLevV1.sol, 454: change 'buyAmount > 0' to 'buyAmount != 0'
    OpenLevV1Lib.sol, 112: change 'marginLimit > 0' to 'marginLimit != 0'
    OpenLevV1.sol, 424: change 'balance > 0' to 'balance != 0'
    UniV2Dex.sol, 207: change 'reserveIn > 0' to 'reserveIn != 0'
    ControllerV1.sol, 342: change 'supplyAmount > 0' to 'supplyAmount != 0'
    UniV3Dex.sol, 165: change 'amount0Delta > 0' to 'amount0Delta != 0'
    OpenLevV1Lib.sol, 276: change 'totalShare > 0' to 'totalShare != 0'
    XOLE.sol, 266: change '_value > 0' to '_value != 0'
    ControllerV1.sol, 363: change 'borrowAmount > 0' to 'borrowAmount != 0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    G (Gas Optimization)bugSomething isn't workingsponsor acknowledgedTechnically the issue is correct, but we're not going to resolve it for XYZ reasons

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions