If very few NFTs have been sold saleReceiver will have to buy all remaining NFTs if he want to get the funds that he obtained during the mint period.
Fortunately, It is still possible to mint NFT after temp.endTime because the following check is not done in LPDA.buy:
require(block.timestamp < temp.endTime, "TOO LATE");
But, still, it could be very expensive to buy all the remaining Ids.
Lines of code
https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L81-L89
Vulnerability details
Impact
If very few NFTs have been sold
saleReceiver
will have to buy all remaining NFTs if he want to get the funds that he obtained during the mint period.Fortunately, It is still possible to mint NFT after
temp.endTime
because the following check is not done inLPDA.buy
:require(block.timestamp < temp.endTime, "TOO LATE");
But, still, it could be very expensive to buy all the remaining Ids.
Proof of Concept
LPDA.sol#L81-L89
Tools Used
Manual Review.
Recommended Mitigation Steps
I recommend using the same mecanism as in
OpenEdition
contract withfinalize
.