Fund transfer is incorrect due to incorrect implementation of _depositTokenWhenCreateTaker()
The flow of the protocol is as follows: A user creates an offer to sell or buy 500 points for $500, with 1 point being worth$1.
Next, we call createTaker() to accept this proposal.
createTaker() calls _depositTokenWhenCreateTaker() to deposit assets.
As you can see, parameter _isMaker is false.
Therefore when offerInfo.offerType is ask or bid, trasnferAmount is amount or collateralRate * amount.
Now let's look at the following scenario.
1)user calls createOffer to submit 500 points for $500 as bid.
but another create Taker to accept 500 points for$500 * collateralRate as ask.
2)user calls createOffer to submit 500 points for $500 * collateralRate as ask.
but another create Taker to accept 500 points for$500 as bid.
Fund transfer is incorrect due to incorrect implementation of _depositTokenWhenCreateTaker()
Mannual Review
_depositTokenWhenCreateTaker() is modified as follow.
Invalid, the computations are correct, when taker close a bid offer, of type `Bid` represented in their stock, the offerType of maker must be that of `Ask` as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L137-L139) when the offer is created. In which `(_offerType == OfferType.Ask && _isMaker) ` will result in the following computations performed as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/libraries/OfferLibraries.sol#L44-L51), so the collateral will be refunded appropriately,
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.