In the current implementation of the relistOffer function, when an offer that was partially filled and then canceled is relisted, the usedPoints are not reset. This means that the relisted offer retains the usedPoints from its previous state.
The relisted offer appears to have less available capacity than it actually does, as the usedPoints from the previous listing are still counted.
Other parts of the contract use usedPoints to calculate available amounts or settle trades, it could lead to incorrect calculations and potentially financial losses for users.
The offer's state becomes inconsistent, as a freshly relisted offer should logically start with zero used points.
Reset the usedPoints to zero when relisting the offer. Here's how we can modify the affected part of the code:
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.