CustomerEngine::trigger_demand will call sell_to_customer on the company contract, requesting between 1 and 6 of the product. It is on a 60 second cooldown for each caller, and forces the company contract to have a reputation above or equal to 60. The company function, sell_to_customer, can only be called by the CustomerEngine, and trigger_demand is the only function that can call sell_to_customer. Furthermore, reputation can only increase with a successful sale in sell_to_customer. Therefore, if a company's reputation falls below 60, trigger_demand will always revert and the company's reputation will never be able to recover.
Likelihood:
This will occur whenever the company falls below a 60 reputation score. This is fairly common because the only way for the company to produce any inventory is for the owner to call produce. Since the REPUTATION_PENALTY is 5, if only 9 demand requests come in while the company has no inventory, they will fall to a reputation of 55.
Impact:
If this occurs, any attempts to trigger demand will be denied. The company will be unable to function and sell any more product.
Add this test in tests/unit/test_Engine.py.
This test will show that 9 demand requests while no inventory has been produced will prevent any more demand requests.
Consider implementing other ways for the reputation to increase. One good option would be when the company produces more inventory. Another would be when the company receives funding and is brought out of debt.
Also consider allowing the company to produce more inventory within sell_to_customer, removing the sole reliance on the owner to continuously produce inventory. This would allow for requests to be satisfied when the company has enough funds to produce more inventory.
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.