Open code423n4 opened 2 years ago
https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#:~:text=weth%20%3D%20WETH%3B-,for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20numSells%3B%20)%20%7B,)%3B,-unchecked%20%7B
When checking the executionValid fails in the middle of the iteration it could interrupt the whole matchOrders
executionValid
matchOrders
[InfinityExchange.sol L#272-288]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#:~:text=for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20numSells,weth
Manuel Review
Intentional
matchOrders could revert, but then the matching engine could remove the bad order and try again. Lowering risk and converting into a QA report for the warden.
Lines of code
https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#:~:text=weth%20%3D%20WETH%3B-,for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20numSells%3B%20)%20%7B,)%3B,-unchecked%20%7B
Vulnerability details
Impact
When checking the
executionValid
fails in the middle of the iteration it could interrupt the wholematchOrders
Proof of Concept
[InfinityExchange.sol L#272-288]https://github.com/code-423n4/2022-06-infinity/blob/main/contracts/core/InfinityExchange.sol#:~:text=for%20(uint256%20i%20%3D%200%3B%20i%20%3C%20numSells,weth
Tools Used
Manuel Review
Recommended Mitigation Steps