Tadle

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

createOffer() doesn't properly account for both the quantity (points) and price (amount) of the offer

Summary

The implementation only considers params.amount (price) and not params.points (quantity) when calculating the collateral.

Vulnerability Details

The current implementation only uses params.amount and params.collateralRate to determine the collateral, ignoring params.points.

https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L39C5-L156C11

The collateral rate should be applied to the total value of the offer (points * amount), not just the amount.

Impact

The bug could lead to under-collateralized positions, especially for offers with high quantities.

Tools Used

Manual review

Recommendations

The collateral should be based on the total value of the offer, which is the product of quantity and price

Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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