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

    Initialisation of variables to 0 is not neccessary

    Holoride: DeFi Token

    Severity
    Informational
    Status
    Fixed
    Location(s)

    https://github.com/sub7security/holoride-defi/blob/0557444ec0b3a4df44e0cf6c9bcd8e06eaea63c4/contracts/Farming.sol#L51

    https://github.com/sub7security/holoride-defi/blob/0557444ec0b3a4df44e0cf6c9bcd8e06eaea63c4/contracts/Farming.sol#L42

    Description

    In solidity, all variables defaults to the 0 value. There is no need to explicitly set them to 0 since they have an addtional gas cost.

    Recommendation

    Consider making the below changes in farming contract.

    Consider making the below changes in farming contract.
    
    - uint256 public paidOut = 0;
    + uint256 public paidOut;
    
    - uint256 public totalAllocPoint = 0;
    + uint256 public totalAllocPoint;
    
    
    
    Comments
    No comments yet

    Initialisation of variables to 0 is not neccessary

    Holoride: DeFi Token

    Severity
    Informational
    Status
    Fixed