Tadle

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

Offer's tradeTax not update

Summary

Offer's tradeTax not update

Vulnerability Details

When create offer, there is tradeTax in it.

offerInfoMap[offerAddr] = OfferInfo({
id: offerId,
authority: _msgSender(),
maker: makerAddr,
offerStatus: OfferStatus.Virgin,
offerType: params.offerType,
points: params.points,
amount: params.amount,
collateralRate: params.collateralRate,
abortOfferStatus: AbortOfferStatus.Initialized,
usedPoints: 0,
tradeTax: 0, //@audit not update
settledPoints: 0,
settledPointTokenAmount: 0,
settledCollateralAmount: 0
});

But this field is not updated during the entire lifecycle.

I think it should be updated same as platformFee, which is updated each time when fee collected in createTaker.

makerInfo.platformFee = makerInfo.platformFee + remainingPlatformFee;

Impact

Offer's tradeTax not update

Tools Used

vscode

Recommendations

Update offerInfo.tradeTax in createTaker

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-PreMarkets-createTaker-offerInfo-tradetax-settledCollateralAmount-not-updated

Borderline low/informational, tradeTax is posted by the original maker when creating an offer within the `makerInfo` mapping as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L112C13-L112C25). and is simply a placeholder for the offerInfo mapping. Given it can impact details of offer regarding the tradeTax, low severity seems appropriate. Similar reasonings apply for settledCollateralAmount.

Support

FAQs

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