Dria

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

Incorrect status check in `swan::relist()`

Summary

The [asset status check](https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/Swan.sol#L206) in `swan::relist()` is incorrect because it confirms whether an asset is listed meanwhile it has to check whether an asset is unlisted rather because a listed asset cannot be listed again, it is only a listed asset that has been unlisted that can be relisted.

Vulnerability Details

in `Swan::relist()` we can find this check making sure the asset being called with relist is listed

if (asset.status != AssetStatus.Listed) {
revert InvalidStatus(asset.status, AssetStatus.Listed);
}

however reading the natspec below indicates that the asset has to be unlisted because it's round of listing will end making it unlisted but the check above checks wrongly that the asset has to be listed instead of unlisted.

Impact

incorrect check in relist that breaks the invariant of the function

Tools Used

manual review

Recommendations

Check that the asset is unlisted and that its round has ended.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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