Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: medium
Invalid

Inability to List Remaining Points or Recreate Offer Due to Restrictive Check in `listOffer`

Summary

In the listOffer function, a restrictive check prevents users from listing remaining points after an initial offer. If a user lists a portion of their stock and later tries to list the remaining points or recreate the offer after closing it, they will be unable to do so.

Vulnerability Details

When a user with 100 points in stock decides to list 50 points, they call the listOffer function with the specified amount, collateral rate, and _stock. After successfully listing the 50 points, the user might want to list the remaining 50 points later.

However, the following check in the listOffer function prevents this:

if (stockInfo.offer != address(0x0)) {
revert OfferAlreadyExist();
}

This condition checks if an offer already exists for the stock and reverts if it does. Consequently, after the initial offer is made, the user is blocked from listing the remaining points. Additionally, even if the user closes the initial offer, they are still unable to create a new offer for the same stock, as the offer already exists.

Impact

Inability to Sell Remaining Points.

Tools Used

Manual Review

Recommendations

Modify the Check: Adjust the listOffer function to allow users to list remaining points even if a previous offer exists. This could be done by tracking the amount of points already listed and permitting additional offers up to the total points in stock.

Updates

Lead Judging Commences

0xnevi Lead Judge
10 months ago
0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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