The `_resetPerAddressTracking()` function in `TokenLaunchHook` is intended to clear the `addressSwappedAmount` and `addressLastSwapBlock` mappings for a given user's address when transitioning between launch phases.
However, the current implementation only deletes entries for address(0), leaving all actual user address data untouched.
The `_resetPerAddressTracking()` function in `TokenLaunchHook` is intended to clear the `addressSwappedAmount` and `addressLastSwapBlock` mappings for a user when transitioning between launch phases.
However, the current implementation does not accept any input paramaters and only deletes the entries for`address(0)`, which does not correspond to any actual user address.
As a result, no user-specific tracking data is reset when the launch phase changes, potentially leading to incorrect enforcement of swap limits and cooldowns across phases.
Likelihood: High
This occurs whenever the launch phase changes and a user with existing entries makes a swap
Impact: Medium
Users may be unfairly penalized due to stale per-address tracking data from previous phases.
Not necessary. Issue is immediately evident from code inspection
Modify _resetPerAddressTracking() to accept a user address parameter and clear the mappings for that specific address.
Note: Using sender as the user address is technically incorrect, as it typically resolves to a router or intermediary contract. This issue is outside the scope of this finding and is addressed in a separate submission.
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.
The contest is complete and the rewards are being distributed.