Failure to update global state when relisting floor items
Summary
The Listings::relist() allows users to relist items that are unlisted but deposited in the Locker at the floor price, effectively treating them as new listings. However, this process does not correctly update global state variables, such as listingCount, nor does it create necessary checkpoints via createCheckpoints().
Vulnerability Detail
The Listings::relist() function fails to update critical global state variables, such as listingCount, and does not create checkpoints using createCheckpoints() when relisting floor items deposited into the Locker but not currently listed in the Listing contract.
Inaccurate listing counts arise because the listingCount remains outdated, affecting how listings are managed and reported.
Additionally, the lack of checkpoints created when the listing amounts are changed results in missing checkpoints, especially when the utilization rate has changed.
Vast Umber Walrus
Medium
Failure to update global state when relisting floor items
Summary
The
Listings::relist()
allows users to relist items that are unlisted but deposited in theLocker
at the floor price, effectively treating them as new listings. However, this process does not correctly update global state variables, such aslistingCount
, nor does it create necessary checkpoints viacreateCheckpoints()
.Vulnerability Detail
The
Listings::relist()
function fails to update critical global state variables, such aslistingCount
, and does not create checkpoints usingcreateCheckpoints()
when relisting floor items deposited into theLocker
but not currently listed in theListing
contract.This issue arises under the assumption that it is intentional design to support such cases, as demonstrated in the test cases:
test_CanRelistFloorItemAsLiquidListing()
andtest_CanRelistFloorItemAsDutchListing()
.Impact
Inaccurate listing counts arise because the
listingCount
remains outdated, affecting how listings are managed and reported.Additionally, the lack of checkpoints created when the listing amounts are changed results in missing checkpoints, especially when the utilization rate has changed.
Code Snippet
Listings::relist()
Tool used
Manual Review
Recommendation
Updates global state variables such as
listingCount
and creates necessary checkpoints viacreateCheckpoints()
when relisting floor items.