The owner of a bid offer will call closeBidOffer
to close the bid. The bid offer should only be closed when the market is in the BidSettling
state. However, the current code allows the owner to close the bid even when the market is in the AskSettling
state.
The Tadle market maintains different statuses for various purposes. If The market is in the Online
state,The takers and makers can place their offers for bids and asks. After the TGE phase, the market transitions to the AskSettling
state. Following the TGE and the settlement period, the market moves to the BidSettling
state.
The issue here is that the owner should only be allowed to close a bid offer when the market is in the BidSettling
state. However, the code currently checks for both BidSettling
and AskSettling
states, which means that a bid offer can be closed even when the market is in the AskSettling state.
Add following test case to PreMarket.t.sol
:
Run With Command : forge test --mt test_Close_Bid_Offer_In_AskSettling
The offer owner is currently allowed to close a bid offer even when the market is in the AskSettling
status. However, AskSettling
is intended for settling Ask Offers, not Bid Offers. Tadle also maintains specific time frames for each market state.
Manual Review
Remove AskSettling
check for if condition :
Leaving medium severity for now, this is true, given in `getMarketPlaceStatus`, `BidSettling` phase only occurs after settlement period has passed as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/libraries/MarketPlaceLibraries.sol#L34-L38). Although I am unsure if there are any significant fund loss impact, given the funds are still correctly transacted. Will reconsider severity during appeals period.
Leaving medium severity for now, this is true, given in `getMarketPlaceStatus`, `BidSettling` phase only occurs after settlement period has passed as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/libraries/MarketPlaceLibraries.sol#L34-L38). Although I am unsure if there are any significant fund loss impact, given the funds are still correctly transacted. Will reconsider severity during appeals period.
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.