The allocateFunds function incorrectly overwrites allocations instead of accumulating them, leading to fund mismanagement and potential financial discrepancies.
The current code would not be problematic if the amount to be allocated was calculated before the allocateFunds function was called. However, there is no such implementation, and the amount passed is never checked to see if it is updated with the user's current allocated funds. This results in overwriting, which would cause a loss of funds for the user.
Affected Function: Treasury:allocateFunds
Issue:
This resets the allocations instead of adding or subtracting them by deleting the previous allocations.
Loss of previous allocations, affecting fund tracking
Incorrect financial records and misallocations
Modify the function to accumulate and also to subtract allocations.
The current implementation of allocateFunds leads to unintended fund overwriting, resulting in financial inconsistencies. By modifying the function to properly adjust allocations instead of replacing them, the contract can ensure accurate fund tracking and prevent user losses. Implementing proper validation and accumulation logic will enhance security.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.