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

    The actor funding the farming contract may lose funds

    Holoride: DeFi Token

    Severity
    High
    Status
    Fixed
    Location(s)

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

    Description

    The function fund doesn’t check if the amount to fund is multiple of rewardPerBlock. Thus, if the amount to fund isn’t the multiple of rewardPerBlock, then the remainder of amount/rewardPerBlock gets lost in the farming contract and can’t be used as a reward. The ideal behavior is to refund the excess fund to the funder since those funds won’t be able to be used by anyone and will get lost.

    Recommendation

    It would be better to disallow funding of amount that is not perfectly divisible by rewardPerBlock .

    Comments
    No comments yet

    The actor funding the farming contract may lose funds

    Holoride: DeFi Token

    Severity
    High
    Status
    Fixed