Closed code423n4 closed 1 year ago
wrong, there is an early return if sale has ended due to reaching finalId Mint: if (temp.currentId == temp.finalId) return temp.finalPrice;
If the final mint has not been reached the price moves lower with each second as intended
berndartmueller marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L101
Vulnerability details
Impact
The protocol intends the LPDA to refunds buyers with the difference between the price they paid and the last sale price
But if the buyer waits for the
endTime
, theprice
returned will not be the lowest sale price, but instead the lowest price that would be at the end of the auctionThis means buyers can simply call
refund
after theend
, which will mean they will have only paid the lowest auction amount possible, regardless of the last auction price.Impact
This essentially breaks the
LPDA
, because all buyers will be able to buy at the lowest possible amount. Because it allows users to game the auction, I consider this a High severity issue.Tools Used
Manual Review
Recommended Mitigation Steps
Consider using a storage variable in
buy
to track the timestamp of the latest sale, and use it ingetPrice
to return the correct amount inrefund