The platform code does not provide secure ways to derive platform revenue with updating platformFee field values inside PreMarkets contract.
When users interact with the platform, platformFee is accumulated in MakerInfo inside PreMarkets contracts, which displays the platform's earnings for a particular maker.
The vulnerability is that the system code does not add functions by which, for example, a contract owner would be able to derive platform revenues with further updates to the values of the platformFee parameter.
Of course, the TokenManager contract has a rescue function that can withdraw tokens from the contract, but this method for withdrawing rewards is a bad option as it will never update the values of the platformFee parameters inside the PreMarkets contract. This in turn leads to a complicated calculation of how many tokens to withdraw between income withdrawals.
Complicated platform rewards calculation and withdrawal process, which is not very trustworthy from the users' point of view, and also does not update the values of platformFee parameters inside the PreMarkets contract.
Manual auditing of the protocol code was used to discover the vulnerability. No third-party programs were used.
Add a function to withdraw platform rewards.
You could also change the logic of accumulating platform rewards a bit. Instead of writing values inside each MakerInfo, you could have one variable at the contract level. Then it would be easy to get the total value of the protocol rewards and would be cheaper since only one value would need to be updated.
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.