Tadle

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

`PreMarkets::CreateOffer` stores wrong `StockType`

Summary

The CreateOffer function stores the StockType of the offer, however it is stores the wrong StockType

Vulnerability Details

StockInfo is being stored in the `CreateOffer function:

stockInfoMap[stockAddr] = StockInfo({
id: offerId,
stockStatus: StockStatus.Initialized,
@> stockType: params.offerType == OfferType.Ask ? StockType.Bid : StockType.Ask, //@audit low- incorrect StockType
authority: _msgSender(),
maker: makerAddr,
preOffer: address(0x0),
offer: offerAddr,
points: params.points,
amount: params.amount
});

the StockType that should be stored is the same as the OfferType, however the wrong one is being stored due to the following line:

stockType: params.offerType == OfferType.Ask ? StockType.Bid : StockType.Ask,

Impact

This might lead to inconsistency, wrong representation in the UI and unexpected errors.

Tools Used

manual review

Recommendations

change it to:

stockType: params.offerType == OfferType.Ask ? StockType.Ask : StockType.Bid
Updates

Lead Judging Commences

0xnevi Lead Judge
11 months ago
0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

[invalid] finding-PreMarkets-createTaker-stockType

Support

FAQs

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