sechub
HomeServicesAssetsJobsFindingsTicketsGovCheck
Guest Mode. Click here to sign in and access all features

    Redundant check implemented

    Holoride: DeFi Token

    Severity
    Informational
    Status
    Fixed
    Location(s)

    https://github.com/sub7security/holoride-defi/blob/main/contracts/Farming.sol#L171-L173

    Description

    In function pending, variable lastBlock is calculated as the minimum of current block(i.e. block.number) and endBlock (i.e. lastBlock = min(block.number, endBlock)). The if condition check is as follows:
    if (lastBlock > pool.lastRewardBlock && block.number > pool.lastRewardBlock && lpSupply != 0)

    the check of block.number > pool.lastRewardBlock is not necessary since lastBlock > pool.lastRewardBlock already checks this.

    Recommendation

    Remove the redundant check of block.number > pool.lastRewardBlock

    Comments
    No comments yet

    Redundant check implemented

    Holoride: DeFi Token

    Severity
    Informational
    Status
    Fixed