The Swan protocol's asset tracking system fails to maintain consistent state across rounds and buyers during asset relisting operations, potentially compromising market integrity and bypassing protocol constraints.
The issue is in the asset tracking logic, specifically in the list()
and relist()
functions where assets are tracked per buyer and round in the assetsPerBuyerRound
mapping:
Swan.sol#L93 https://github.com/Cyfrin/2024-10-swan-dria/blob/c3f6f027ed51dd31f60b224506de2bc847243eb7/contracts/swan/Swan.sol#L92-L93
The contract fails to maintain proper asset count invariants across rounds and buyers. When assets are relisted, the old state isn't cleaned up, leading to potential asset tracking inconsistencies.
The bug manifests in the following scenario.
An asset is listed for a buyer in round N
The asset is relisted for a different buyer in round N+1
The original buyer's asset count isn't properly decremented
Consider this
The issue connects directly to the round-based market system and buyer agent functionality, potentially disrupting the entire trading mechanism.
Asset counts can become invalid
Assets can appear in multiple rounds simultaneously
Market constraints (maxAssetCount) can be bypassed
Buyer agent operations could be disrupted
Vs
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.