Due to the lack of a refund mechanism for native tokens, users may lose assets when the platformFee decreases.
In createTaker, in addition to the order amount, the user will also transfer in platformFee.
platformFee is retrieved in real time and can be set by the owner.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L829-L836
In tillIn, it only ensures that msg.value >= amount, but if msg.value > amount, there is no refund.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/TokenManager.sol#L79-L90
This will result in the following scenario:
Alice expects to deposit 1 ETH through tillIn, msg.value is set to 1 ETH, which includes the platformFee.
In the block where Alice's transaction is located, before Alice's transaction, the owner lowers the platformFee, resulting in only needing to deposit 0.8 ETH.
Due to the lack of a refund mechanism, Alice ends up overpaying by 0.2 ETH.
In this process, neither Alice nor the owner acted maliciously, but it still resulted in Alice's asset loss.
Users may lose assets when the platformFee decreases.
vscode
Add refund in tillIn
The following issues and its duplicates are invalid as admin errors/input validation/malicious intents are1 generally considered invalid based on [codehawks guidelines](https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity#findings-that-may-be-invalid). If they deploy/set inputs of the contracts appropriately, there will be no issue. Additionally admins are trusted as noted in READ.ME they can break certain assumption of the code based on their actions, and
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.