The function TokenLaunchHook::_resetPerAddressTracking is used in TokenLaunchHook::_beforeSwap to reset addressSwappedAmount and addressLastSwappedBlock when switching to the next phase of the token launch ( specifically between phase1 and 2).
The function is incorrect since it resets the amounts of address(0) instead of dynamically resetting the address for the caller of the swap ( the swap router in this case).
High: addressSwappedAmount and addressLastSwapBlock will always persist from phase 1 to phase 2.
Note: this will not happen when moving to phase 3 since the function then stops tracking the addressSwappedAmount and addressLastSwapBlock variables.
High: Swaps in phase 2 will accumulate addressSwappedAmount from phase 1 and might run into penalties earlier than expected
High: users that want to perform swaps in phase 2 might be forced to wait for the PHASE2_COOLDOWN to be over to avoid penalties since addressLastSwapBlock isn't reset correctly.
Add the following test to the test suite, which demonstrates the persistence of addressSwappedAmount and addressLastSwapBlock when transitioning from phase 1 to phase 2.
_resetPerAddressTracking should take as argument the msg.sender ( the swap router ) and reset accordingly
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.