<!-- canonical: https://0xsimao.com/findings/vertex-initializes-product-frontrunned-someone -->

# ClearingHouse::addEngine() initializes productEngine, so it may be frontrunned and someone initializes productEngine instead

Low/Info · Three Sigma · Hybrid orderbook DEX · 3rd April 2024

Finding 3S-Vertex-L08 of the Vertex security review.

- Report: /reports/vertex
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-04-03-vertex.pdf

---

### Description

ClearingHouse::addEngine() initializes productEngine, which means it is uninitialized
prior to the call. Thus, someone may spot the uninitialized productEngine proxy and
initialize it themselves, making the addEngine() call revert.

### Recommendation

Send the productEngine creation and ClearingHouse::addEngine() atomically, via a
multicall or custom contract deployer.

### Status

Acknowledged

Disclosed by 0xSimao (https://0xsimao.com/).
