A purchased listing does not get deleted from the listings mapping.
When a listing is created in Swan::list it gets registered in the Listings mapping. However, when the listing is purchased, in Swan::purchase the entry does not get deleted.
The listing remains in the listings mapping even though the asset has been sold.
Although the status is updated to AssetStatus.Sold If listings are not deleted after purchase, they will accumulate in the listings mapping indefinitely, increasing storage costs for the contract. This can be problematic, especially if the contract is frequently used and storage space grows, leading to increased gas costs over time.
Manual Review
In the purchase function, a purchased listing should be deleted from the listings mapping. The function can be implemented as below:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.