tokamak-network / crossTrade

Cross Trade is a new core service for optimistic rollups that complements standard withdrawals and fast withdrawals. It is trustless and do not require extensive backend.
4 stars 1 forks source link

Provider condition is checked twice in `claimCT` and `cancelCT` #45

Closed parth-15 closed 3 months ago

parth-15 commented 3 months ago

Describe the bug The function claimCT and cancelCT uses modifier providerCheck to ensure that the order is not yet fulfilled. However, in the implementation, same condition is checked again which can result in loss of gas for users.

providerCheck modifier https://github.com/tokamak-network/crossTrade/blob/fc11f6e37f93530a65924f8a89f3487fb2e68ea7/contracts/L2/L2CrossTrade.sol#L61-L64

claimCT function https://github.com/tokamak-network/crossTrade/blob/fc11f6e37f93530a65924f8a89f3487fb2e68ea7/contracts/L2/L2CrossTrade.sol#L189-L204

cancelCT function https://github.com/tokamak-network/crossTrade/blob/fc11f6e37f93530a65924f8a89f3487fb2e68ea7/contracts/L2/L2CrossTrade.sol#L235-L247

zzooppii commented 3 months ago

oh thank you but Someone else left an issue first. https://github.com/tokamak-network/crossTrade/issues/42

parth-15 commented 3 months ago

oops. sorry for that. should I close this issue?

zzooppii commented 3 months ago

I'll close it.