The normal behavior in sell_to_customer updates company_balance with a calculated revenue (requested * SALE_PRICE) after a successful sale, assuming the caller (engine) sends the exact amount.
The specific issue is that it uses the calculated value instead of msg.value, allowing desynchronization if the trusted engine sends a mismatched amount (e.g., due to compromise or error), leading to internal balance not matching actual ETH held.
Likelihood: Low
Compromise of the trusted CustomerEngine address after being set once by the owner.
Rare misconfiguration or external call with incorrect value, but restricted to engine.
Impact: Medium
Desynchronized accounting could falsely indicate insolvency, preventing functions like production or payouts.
Indirect fund risk through decisions based on incorrect balance, such as over-payouts or unnecessary debt accumulation.
The test funds and produces inventory, pranks as the engine to call sell_to_customer with mismatched ETH value (e.g., 0.03 instead of 0.02), then asserts that internal company_balance updates with calculated revenue while actual contract ETH differs, showing desync.
Add an assert to verify msg.value == requested * SALE_PRICE, and update company_balance += msg.valueinstead of calculated revenue, ensuring tracking matches actual inflows.
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.