Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Valid

PreMarkets - Unable to withdraw platform rewards

Summary

The platform code does not provide secure ways to derive platform revenue with updating platformFee field values inside PreMarkets contract.

Vulnerability Details

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.

Impact

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.

Tools Used

Manual auditing of the protocol code was used to discover the vulnerability. No third-party programs were used.

Recommendations

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.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-PreMarkets-platformFee-no-withdraw-functionality

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.