Tadle

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

`offerId` is increment in multiple methods

Summary

Inconsistent update of offerId variable potentially leading to skipped offer IDs.

Vulnerability Details

The offerId variable is updated in two different methods:

  1. createOffer: This update is as expected.

  2. createTaker: This additional update may cause inconsistencies in the sequence of offer IDs.

The problem arises because updating offerId in createTaker can lead to gaps in the offer ID sequence, as the next createOffer call will use an ID that skips one or more numbers.

Impact

The overall impact is considered low, as it doesn't compromise the core functionality or security of the contract. However, it may affect the contract's usability and cause inconsistencies in record-keeping.

Tools Used

  • Manual code review

Recommendations

  1. Remove the offerId increment from the createTaker method.

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-PreMarkets-createOffer-offerId-increment-after

I believe this is valid low severity, although there is inconsistency here when using the correct `offerId` for assigning offerIds and generating the unique addresses as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L67-L69), this is purely an accounting error for offerIds. If we generate the offerId using current `offerId - 1`, the appropriate listing/taker orders can still be created against those offers.

Support

FAQs

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