Tadle

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

Improper Handling of `fixedRatio` Logic in `settleAskMaker` and `settleAskTaker` Functions

Summary

The settleAskMaker and settleAskTaker functions incorrectly revert when marketPlaceInfo.fixedratio is true. This flaw prevents the correct calculation and distribution of rewards when fixedratio is set to true, which is supposed to enable airdropping tokens based on points held.

Vulnerability Details

The marketPlaceInfo.fixedratio flag is intended to trigger the distribution of tokens proportional to the points held by users, calculated as marketPlaceInfo.tokenPerPoint * _settledPoints. However, in both the settleAskMaker and settleAskTaker functions, there is a conditional check:

if (marketPlaceInfo.fixedratio) {
revert FixedRatioUnsupported();
}

This logic is incorrect. The functions should only revert if fixedratio is false, as the true condition indicates that the rewards should be distributed according to the points held by users. As it currently stands, when fixedratio is true, the functions revert and prevent the intended token distribution, disrupting the reward mechanism.

image

Impact

This issue directly impacts the ability of the platform to properly execute its reward distribution logic when fixedratio is set to true. Users expecting rewards proportional to their points may not receive them.

Tools Used

Manual Code Review

Recommendations

Correct the Conditional Logic: The logic in the settleAskMaker and settleAskTaker functions should be updated to revert when fixedratio is false, not when it is true. The corrected logic should look like this:

if (!marketPlaceInfo.fixedratio) {
revert FixedRatioUnsupported();
}

This change will ensure that when fixedratio is true, the correct reward distribution calculation is performed, allowing tokens to be airdropped according to the points held by users, as intended by the system design.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

[invalid] finding-SystemConfig-fixed-ratio

Invalid, design decision, this is decided when market place is created. If a fixed ratio market place is allowed, then admin can simply create a new market place to cater to that in which manual arbitrartion is required instead of allowing settlements by makers, as noted in comments [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L88)

Support

FAQs

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