Closed sherlock-admin closed 1 year ago
hansfriese
medium
Auction.getEpochsByBuyer()
Auction.getEpochsByBuyer() might omit some valid epochs.
Currently, epochsByBuyer is saved using UintSet here, and the epoch will be saved only once even if the buyer added several orders on the same epoch.
epochsByBuyer
UintSet
So the below scenario would be possible.
addLimitOrder()
Auction.getEpochsByBuyer() might output less epochs than it should.
Manual Review
I think we should use mapping instead of UintSet here to track the total number of active orders for each buyer.
Then Auction.getEpochsByBuyer() can output the epochs that contain at least one active order.
Duplicate of #86
hansfriese
medium
Auction.getEpochsByBuyer()
might omit some valid epochs.Summary
Auction.getEpochsByBuyer()
might omit some valid epochs.Vulnerability Detail
Auction.getEpochsByBuyer()
might omit some valid epochs.Currently,
epochsByBuyer
is saved usingUintSet
here, and the epoch will be saved only once even if the buyer added several orders on the same epoch.So the below scenario would be possible.
addLimitOrder()
.epochsByBuyer
will contain the epoch here.epochsByBuyer
here and getEpochsByBuyer() won't return the epoch even though the buyer has one limit order.Impact
Auction.getEpochsByBuyer()
might output less epochs than it should.Code Snippet
Tool used
Manual Review
Recommendation
I think we should use mapping instead of
UintSet
here to track the total number of active orders for each buyer.Then
Auction.getEpochsByBuyer()
can output the epochs that contain at least one active order.Duplicate of #86