Tadle

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

Offer is incorrectly set in the function

Summary
If the offer isnt Bid the function will revert which isnt a recommended scenrio

Vulnerability Details
In the listOffer func of the PreMarket.sol contract
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L330
If the offer isnt bid the function will revert but acc to comments the offer should be ask
'

* @dev Only ask offer can be listed

'

if (stockInfo.stockType != StockType.Bid) { @audit-info shoulde be ask
revert InvalidStockType(StockType.Bid, stockInfo.stockType);
}

Impact
the function will work on work offer type and will revert on the correct one

Tools Used
Manual

Recommendations
Change the offer from bid to ask in the if statement

Updates

Lead Judging Commences

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

[invalid] finding-PreMarkets-listOffer-validate-offer-Type

Invalid, explicit check not required. listOffer is for subsequent makers that want to sell points again. Based on the original maker creating offer as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L137-L138), if offerType is ASK, the stockType will default to Bid type, so the check [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L330-L332) is sufficient in ensuring only ask offer can be listed

Support

FAQs

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