The createPool
function in the mock DistributionV2
contract lacks essential validation checks, posing potential risks related to the pool's payout start, decrease interval, and the prevention of duplicate pools. The absence of these checks could lead to unexpected behavior, disruptions, and complexities in managing the system. The recommended checks aim to enhance the robustness and security of the contract.
Payout Start Validation Missing:
The createPool
function does not check whether pool_.payoutStart
is set to a future timestamp. This absence allows the possibility of setting payout start to 0 or a past date.
Decrease Interval Validation Missing:
The function does not verify if pool_.decreaseInterval
is greater than zero. This lack of validation can lead to unexpected behavior, especially if the contract performs calculations involving decreaseInterval
.
Duplicate Pool Check Missing:
The function does not check for duplicate pools before adding them to the pools
array. This absence may result in confusion and complexity in managing and maintaining the system, as duplicate pools may be inadvertently added.
Even there is no access control, so anyone can call this function.
Payout Start Validation Missing:
The absence of a payout start validation check could allow users to set payout start to 0 or a past date. This may impact functions relying on payout start, potentially leading to unexpected behavior.
Decrease Interval Validation Missing:
Lack of validation for decreaseInterval
may introduce vulnerabilities, impacting calculations and potentially causing transaction reverts or unexpected results.
Duplicate Pool Check Missing:
The absence of a duplicate pool check may lead to confusion and complexities in managing pools, as unintended duplicate entries could be added to the pools
array.
Anyone can call this
Manual review and analysis
Payout Start Validation:
Add the following check to ensure that payoutStart
is set to a future timestamp:
Decrease Interval Validation:
Add the following check to ensure that decreaseInterval
is greater than zero:
Duplicate Pool Check:
Implement a check to ensure that duplicate pools are not added to the pools
array. This can be achieved by verifying the uniqueness of pool attributes before appending a new pool.
Add access control.
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.