The README.md of the project states: The protocol implements a phased fee structure to prevent manipulation during the initial launch period, with configurable limits, cooldowns, and penalties for excessive selling.
In the TokenLaunchHook::_beforeSwap limits and penalties are applied to both buy and sell operations. Specifically the addressSwappedAmount mapping is updated on both types of swap and then used to decide to apply penalties. The same happens with updates of addressLastSwapBlock.
In this code snippet swapAmount is updated without checking if the user is buying or selling the tokens:
and later used to decide to apply penalties:
The mapping addressLastSwapBlock is used in a similar fashion in _beforeSwap to both buy and sell operations
High: Everytime a swap occurs addressSwappedAmount and addressLastSwapBlock are updated
High: The behavior of the contract contrasts with what is specified in the README.md.
This will invalidate the whole purpose of the hook.
The following test demonstrates that both buy and sell operations are tracked for limiting purposes, an operation is a buy operation ( in the context of the test contract) when params.zeroToOne = true.
In TokenLaunchHook::_beforeSwap there should be a check to identify the swap as a "Buy" or "Sell" operation and act accordingly.
Add the following code:
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.