Timestamp verification flaw in _isPoolTimestampValid function
The _isPoolTimestampValid function has an oversight in its timestamp verification logic, resulting in potential unintended behavior when determining the validity of pool timestamps.
Vulnerability Detail
The function _isPoolTimestampValid checks the validity of the provided timestamps to ensure they follow a logical sequence. While the function verifies most timestamp conditions, it overlooks a critical condition: ensuring that the _allocationStartTime is not less than the _registrationEndTime. This means a situation can arise where allocation can start even before registration has ended, causing potential inconsistencies and disruptions in the expected workflow.
Impact
Failure to enforce the correct sequence of timestamps can lead to operational issues, user confusion, and potential misuse of the system. Specifically, users might be allocated resources before the registration period ends, which could unfairly impact late registrants.
In this scenario, the allocation process begins at timestamp 1500, even though registration doesn't conclude until timestamp 2000. This overlap can lead to disruptions and discrepancies in allocation.
0xaghas
high
Timestamp verification flaw in _isPoolTimestampValid function
The _isPoolTimestampValid function has an oversight in its timestamp verification logic, resulting in potential unintended behavior when determining the validity of pool timestamps.
Vulnerability Detail
The function _isPoolTimestampValid checks the validity of the provided timestamps to ensure they follow a logical sequence. While the function verifies most timestamp conditions, it overlooks a critical condition: ensuring that the _allocationStartTime is not less than the _registrationEndTime. This means a situation can arise where allocation can start even before registration has ended, causing potential inconsistencies and disruptions in the expected workflow.
Impact
Failure to enforce the correct sequence of timestamps can lead to operational issues, user confusion, and potential misuse of the system. Specifically, users might be allocated resources before the registration period ends, which could unfairly impact late registrants.
Example:
Suppose the following timestamps are provided:
block.timestamp: 500
_registrationStartTime: 1000
_registrationEndTime: 2000
_allocationStartTime: 1500
_allocationEndTime: 2500
block.timestamp > _registrationStartTime (500 > 1000): false
_registrationStartTime > _registrationEndTime (1000 > 2000): false
_registrationStartTime > _allocationStartTime (1000 > 1500): false
_allocationStartTime > _allocationEndTime (1500 > 2500): false
_registrationEndTime > _allocationEndTime (2000 > 2500): false
In this scenario, the allocation process begins at timestamp 1500, even though registration doesn't conclude until timestamp 2000. This overlap can lead to disruptions and discrepancies in allocation.
Code Snippet
https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/donation-voting-merkle-base/DonationVotingMerkleDistributionBaseStrategy.sol#L485C4-L509C6
Tool used
Manual Review
Recommendation
Add a condition to check that _allocationStartTime is not less than _registrationEndTime.