The get_share_price function calculates the current share price based on the company's net worth (balance minus debt). The function attempts to use max() to handle negative net worth scenarios, but in Vyper, the subtraction operation will revert BEFORE the max() function can evaluate if holding_debt > company_balance.
This causes a permanent DoS for the withdraw_shares function whenever the company accumulates more debt than its available balance.
In Vyper 0.4.1, arithmetic operations use checked math. If holding_debt > company_balance, the subtraction self.company_balance - self.holding_debt will revert with an underflow error before max(..., 0) can be evaluated.
Likelihood:
This occurs whenever holding costs accumulate faster than the company can pay them
The _apply_holding_cost function specifically adds unpaid costs to holding_debt (line 353)
Any period of low sales combined with high inventory will trigger this condition
Impact:
Investors cannot withdraw their shares when the company is in debt
The withdraw_shares function becomes permanently unusable until debt is paid
This locks investor funds even though they may have legitimate shares
Creates a griefing vector where the owner can intentionally let debt accumulate
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.