The current implementation of the contracts, allows users to create a askOffer
, and after a purchase to abort it, and to receive the extra tax the user has paid for the purchase, stealing users funds and farming the taxes.
there's an additional tax a user add when he createOffer
, so the makers can receive an additional tax for each trade. if a user abort the offer, he can claim his collateral back, however, in the current implementation if a user abort his offer after a purchase has been made, his refund amount will be calculated together with the tax the buyer paid.
run the following test (and fix the wrong parts in the codebase so it can be runned, scuh as correct approvals and correct transfer function)
which will log the following result (i have funded each of the users with 2 eth):
This creates an incentive for malicious users to exploit the system and steal funds through taxation.
foundry
Do not add the tax paid by users to the refund amount of sellers.
Valid high severity, given orginal offer makers are not a trusted entity to enforce a settlement. The trade tax set by the maker should be returned back to the takers to avoid abuse of abortion of ask offers to steal trade tax from takers. Note for appeals period: See issue #528 for additional details
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.