BID offers are paid with collateral instead of token points, so the maker will not receive any points; they pay to get nothing in return.
I suggest to read my previous issue before reading this one, as it gives more context to understand it:
Bid offer points are taken from the maker instead of the taker
They have different root causes and fixes, so they are 2 separate issues.
Alice creates a BID offer for 1000 points and 2000 collateral
Bob creates an ASK order to sell 400 points, he sends 800 collateral
The issue is that Bob paid with collateral instead of token points and he has zero liability to send any point tokens
Alice settles 400 points on Bob's order. The problem is, she must send her own 400 points to close the order (The current logic "works" because she buys her own points, but this is described in the previous issue)
Alice will never receive her points as no one sent them
Bob gets his collateral back minus the small trading fee
Fix the previous issue before this one to fully understand the impact of this issue.
Poc, run forge test --via-ir --match-test test_h5_bid_offer_steals_points -vv
.
Impact: High (Loss of user funds, BID makers can't withdraw any points)
Likelihood: High (It will happen without pre-conditions)
Risk: Critical
Manual review
It's difficult to recommend a solution because it's a big change, and it impacts the business logic on multiple levels.
The main issue is that the taker has no liability to send points (they recoup the entire collateral when the BID offer is closed minus the trading fee).
A solution could be to send point tokens instead of the collateral in PreMarktes.createTaker
. Taxes can be applied to the deposited points.
In PreMarktes
, change _depositTokenWhenCreateTaker
so that for BID offers, token points are transferred instead of the collateral.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L212-L216
Valid high severity, this allows resellers listing offers via `listOffer/relistOffer` to game the system. Based on the inherent design of Turbo mode not requiring takers making ask offers for the original maker offer to deposit collateral, the wrong refund of collateral to takers even when they did not deposit collateral due to turbo mode during settleAskMaker allows possible draining of pools.
Valid high severity, In `settleAskTaker/closeBidTaker`, by assigning collateral token to user balance instead of point token, if collateral token is worth more than point, this can cause stealing of other users collateral tokens within the CapitalPool contract, If the opposite occurs, user loses funds based on the points they are supposed to receive
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.