Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Use of " <= " Instead of " == " in Round Check in Swan:: relist() Function

Vulnerability Details

  • In the Swan contract, within the relist() function, there is a check to ensure that an asset can only be relisted after the round in which it was originally listed has ended. The current implementation uses a less-than-or-equal-to (<=) condition to compare the current round with the round when the asset was originally listed.

  • However, using '<=' is unnecessary and potentially misleading. The condition should only check for equality (==) to determine whether the current round is the same as the round in which the asset was listed.

  • Additionally, the variable name oldRound is misleading because it represents the current round of the buyer agent, not an "old" round. A more appropriate name would be currentBuyerRound or buyerRound.

Impact

  • Unnecessary Condition: Using <= instead of == adds unnecessary complexity to the logic.

  • Misleading Variable Name: The variable name oldRound suggests that it refers to a past round, but it actually represents the current round of the buyer agent.

Tools Used

  • Manual review

Recommendations

  • Change Condition from <= to ==

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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