Wrong Id matching leading to accounting errors
Context
PreMarkets.sol#L117
In the PreMarkets.sol:createOffer()
function, the Id used in generating the address for the makerAddr, offerAddr and stockAddr are different from the Id stored in their struct due to already updating the tokenId above but still referring to the new Id in the struct creation causing a mismatch in the entire storage mapping and some orders having the same Id as another e.t.c leading to accounting errors and unexpected behaviours.
Wrong Id matching leading to accounting errors
Manaul Review
Update the Id used in their struct creation with the one that was used to generate their addresses as done in other places
I believe this is valid low severity, although there is inconsistency here when using the correct `offerId` for assigning offerIds and generating the unique addresses as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L67-L69), this is purely an accounting error for offerIds. If we generate the offerId using current `offerId - 1`, the appropriate listing/taker orders can still be created against those offers.
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.