Even reading the documentation it remains unclear if the intention is to track limits and addressSwappedAmount for each user separately
In the following test found in the project's test suite TokenLaunchHookUnit.t.sol , the function name test_Phase1_MultipleUsersRespectiveLimits seems to imply that tracking each user separately is the intention, however the test checks for addressSwappedAmount(swapRouter) which will accumulate amounts for all of the users:
High: The TokenLaunchHook contract will always track addressSwappedAmount cumulative amounts for swapRouter and not separately for each user, same for the variable addressLastSwapBlock.
High: If the intention is to match each user with its respective addressSwappedAmount or addressLastSwapBlock the hook won't work as intended.
Only the users that sell first won't be penalized, effectively favoring bots.
Add to the following lines to the test mentioned above, it will demonstrate that the addressSwappedAmount for the 2 users respectively remains "0":
If the intention is to track addressSwappedAmount and addressLastSwapBlock separately for each user, in the function _beforeSwap the address of the user that calls the swap should be indentified by decoding the calldata argument.
To prevent a malicious swapRouter to fabricate transactions with misleading addresses to avoid limits, a whitelist of trustes "swap routers" should be maintained:
The tests should be updated 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.