The closeOffer function updates offerInfo.offerStatus to Canceled, but doesn't update the corresponding stockInfo. This leaves the stockInfo.offer still pointing to a canceled offer, potentially leading to inconsistent state. When an offer is closed, related state in stockInfo (like stockInfo.offer) should be reset or updated to reflect that the offer no longer exists.
The offerInfo.offerStatus is updated to Canceled. However, the corresponding stockInfo is not updated to reflect this change. In a system where Stocks and Offers are related entities, it's crucial to keep their states consistent with each other. The function cancels an offer but doesn't update the stock to indicate that it no longer has an active offer.
This leads to a situation where the offer is marked as canceled, but the stock still references it as an active offer.
Manual Review
When an offer is canceled, the function should:
Update the offerInfo to mark it as canceled.
Update the stockInfo to remove the reference to the canceled offer or mark it as inactive.
Potentially update any other related state (e.g., in makerInfo) to reflect the offer cancellation.
Valid low severity due to accounting error, although `stock` status is not update appropriately to `Finished`, there will be no exploit possible given relevant checks on the `offer` side.
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.