The sell_to_customer function is designed to process sales when customers purchase items through the CustomerEngine. When customers trigger demand, they send ETH payment which is forwarded to sell_to_customer via raw_call with the payment value.
However, the sell_to_customer function never credits the received ETH (msg.value) to the company_balance. Instead, it only updates company_balance based on a hardcoded SALE_PRICE calculation, causing all customer payments to be permanently trapped in the contract.
The issue flow:
Customer sends ETH to CustomerEngine.trigger_demand()
CustomerEngine forwards this ETH to sell_to_customer() via raw_call(..., value=total_cost)
sell_to_customer() receives the ETH but only adds requested * SALE_PRICE to company_balance
The actual ETH payment sits in self.balance but is never accessible
Likelihood:
This occurs on EVERY customer purchase through the CustomerEngine
The flow is part of the core game mechanics and will happen repeatedly during normal operation
Impact:
All customer payments are permanently locked in the contract
The contract's self.balance grows but company_balance only tracks calculated revenue
Investors cannot access customer payments when withdrawing shares
The company appears to have less capital than it actually received
Over time, significant ETH accumulates in the contract with no recovery mechanism
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.