Skip to content
Request an audit

‹ All findings

Redundant Calculations in OstiumTrading::openTrade()

Low/InfoOstium·Three Sigma · RWA perpetuals DEX · 19th February, 20243S-OS-N08

Description

When opening a LIMIT or STOP order, the first empty index is calculated using OstiumTradingStorage::firstEmptyOpenLimitIndex() on L209.

However, the same function is executed again in OstiumTradingStorage::storeOpenLimitOrder() on L233, which results in the index property being overridden with the same value.

Similarly, the current block number is retrieved on L211 in OstiumTrading, and then on L231 in OstiumTradingStorage.

Recommendation

Remove the redundant overriding of these variables from OstiumTradingStorage::storeOpenLimitOrder().

Status

Addressed in #3d116cd.