Platform fee cannot be withdrawn from the protocol as there is not any mechanism implemented for it.
When a taker places an order, he should deposit the platformFee
as well.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L217-L234
Then, based on the referrerReferralBonus
and authorityReferralBonus
, some part of the platform fee will be dedicated to referrer
and msg.sender
, respectively.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L858-L891
The remaining of the platform fee will be stored in:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L263
The issue is that, there is no mechanism in the protocol to withdraw the accumulated platform fee. Please note that the assumption that the protocol is not still complete can not be reasonable.
Please note that using the function rescue
in the contract Rescuable
by the owner is not for withdrawing platform fee. If it was for withdrawing platform fee, then makerInfo.platformFee
should have been updated accordingly in this function.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/utils/Rescuable.sol#L64
Stuck of platform fee in the protocol.
It is recommended to implement platform fee withdrawal mechanism.
Low severity, this can be done using the `Rescuable.sol` contract. Arguably there is no errors here given the `platformFee` variable can represent the historical fees that the protocol has accumulated and need not be updated when fees are withdrawn. However, I believe a more explicit function can be valuable to be more transparent regarding withdrawals. However, I will leave this issue open for escalation for debates because I can see it as arguably invalid as well, but I see no arguments for it being medium severity since there is an alternative to retrieve platform fees, assuming admins are trusted.
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.