Cyfrin_Hub::fund_investor when an investor wants shares at the outset the function reverts because the company is insolventThe expected behavior is that fund_investor allows any investor to buy shares from the first block, using INITIAL_SHARE_PRICE while no shares have been issued and crediting the funds to company_balance.
What actually happens is the function reverts immediately because it checks self.company_balance > self.holding_debt, and the initial state (0 > 0) does not satisfy it; therefore, no public investment can start the round.
Likelihood: High
When the contract is deployed company_balance = 0 and holding_debt = 0. This causes all investments made after deployment to revert because company_balance is not greater than holding_debt.
Impact: High
Completely blocks public capital inflows, leaving the simulation without investment flows and preventing testing of the protocol's main paths.
The first inversor attempts to make a contribution, but the function reverts.
Require the owner to fund the contract during deployment so that fund_investor starts with a visible positive net worth.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.