Open code423n4 opened 2 years ago
Finding is technically valid, impact is gas cost as a order that was created has an NFT that will cause a new fillOrder
to revert in spite of the cancelledOrder
status
No exploit is given here other than gas cost and duplicate events being emitted - should this be med or low?
Report: Order can be cancelled even if order was already filled
Since it's a minor issue regarding state handling and there isn't a loss of funds, I'll downgrade this to QA.
This shall be the warden's QA primary report as he submitted no other issues
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L526
Vulnerability details
Impact
An order could be canceled even after the order was filled. Even if this does not affect any other part of the process, the mapping
cancelledOrders
still gets updated and aCancelledOrder
event is emitted, this could cause issues on a front-end or monitoring tools working with the protocol.Proof of Concept
Recommended Mitigation Steps
Check if the order was already filled before. This could be done by checking if an
nft
with the order id was created before.