Platform: Code4rena
Start Date: 06/12/2022
Pot Size: $36,500 USDC
Total HM: 16
Participants: 119
Period: 3 days
Judge: berndartmueller
Total Solo HM: 2
Id: 189
League: ETH
Rank: 101/119
Findings: 1
Award: $0.84
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: adriro
Also found by: 0x446576, 0xA5DF, 0xDave, 0xDecorativePineapple, 0xRobocop, 0xbepresent, 8olidity, Aymen0909, Ch_301, Chom, Franfran, HollaDieWaldfee, Madalad, Parth, Ruhum, Tricko, bin2chen, carrotsmuggler, chaduke, danyams, evan, gz627, hansfriese, hihen, imare, immeas, jadezti, jayphbee, jonatascm, kaliberpoziomka8552, kiki_dev, kree-dotcom, ladboy233, lukris02, lumoswiz, mahdikarimi, minhquanym, minhtrng, nameruse, neumo, obront, pauliax, poirots, reassor, rvierdiiev, slvDev, sorrynotsorry, yixxas, zapaz
0.8413 USDC - $0.84
https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDAFactory.sol#L29-L42 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L124 https://github.com/code-423n4/2022-12-escher/blob/5d8be6aa0e8634fdb2f328b99076b0d05fefab73/src/minters/LPDA.sol#L63 https://github.com/code-423n4/2022-12-escher/blob/main/src/minters/LPDA.sol#L101
If LPDA
sale contract is deployed with incorrect configuration, the buy(...)
functionality may stop working and in consequence prevent users from buying NFT and saleReceiver
from receiving payment from the sale.
The LPDA
contract is created in function LPDAFactory.createLPDASale(...)
, but there are not enough checks of the input. Precisely the function does not check if sale.startPrice >= (sale.dropPerSecond * (sale.endTime - sale.startTime))
. If the sale contract LPDA
creation is misconfigured (given assertion would not hold), then function LPDA.getPrice(...)
could throw an error after some time, because of the computation of return value: temp.startPrice - (temp.dropPerSecond * timeElapsed)
where temp.startPrice
would be lower than (temp.dropPerSecond * timeElapsed)
. The function LPDA.buy(...)
depends on function LPDA.getPrice(...)
(here) and if LPDA.getPrice(...)
will revert, then buying would be impossible. The sale receiver and fee receiver get funds from the sale when the last token is minted, however, if buying functionality is blocked they wouldn't be paid and the ethers would stay locked in the contract forever. Also the LPDA.refund(...)
function could not work, since is dependent on LPDA.getPrice(...)
(here).
Manual review
Consider checking in LPDAFactory.createLPDASale(...)
if sale.startPrice >= (sale.dropPerSecond * (sale.endTime - sale.startTime))
is true.
#0 - c4-judge
2022-12-11T11:37:06Z
berndartmueller marked the issue as duplicate of #392
#1 - c4-judge
2023-01-02T19:54:11Z
berndartmueller marked the issue as satisfactory