The seller of LPDA get more ETH and buyers lose these ETH.
Proof of Concept
LPDA is used for a Last Price Dutch Auction Sale.
When the finalId is bought, the final price is set and totalSale = price * amountSold will be tranferred to feeReceiver and saleReceiver.
After that, there are still ETHs left in the contract because most users bid higher than the final price and they need to manually call refund to get the extra ETHs back.
If someone try to buy 0 NFT now (calls buy(0)), the function will assume that the sale is now complete and transfer ETHs to the feeReceiver and saleReceiver again.
The buy(0) can be
This operation be repeated until there is not 0 ETH in the contract.
Lines of code
https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/LPDA.sol#L58-L89
Vulnerability details
Impact
The seller of LPDA get more ETH and buyers lose these ETH.
Proof of Concept
LPDA is used for a Last Price Dutch Auction Sale.
When the finalId is bought, the final price is set and
totalSale = price * amountSold
will be tranferred tofeeReceiver
andsaleReceiver
.After that, there are still ETHs left in the contract because most users bid higher than the final price and they need to manually call refund to get the extra ETHs back.
If someone try to buy 0 NFT now (calls
buy(0)
), the function will assume that the sale is now complete and transfer ETHs to the feeReceiver and saleReceiver again. Thebuy(0)
can be This operation be repeated until there is not 0 ETH in the contract.Sample of a sale (total 40 NFTs) and attack:
Tools Used
Manual
Recommended Mitigation Steps
Check the
_amount
inbuy(uint256 _amount)
.