Skip to content
Request an audit

‹ All findings

OstiumTrading::closeTradeMarket() Makes Redundant Call to OstiumTradingStorage::getOpenTradeInfo()

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

Description

At L284 in OstiumTrading::closeTradeMarket(), the trade info can be reused from the previous call to OstiumTradingStorage::getOpenTradeInfo() at L265 to conserve gas by avoiding redundant function calls.

The same issue is seen in OstiumTrading::closeTradeMarketTimeout() on L561 and L568

Recommendation

solidity
emit MarketCloseOrderInitiated( - orderId, storageT.getOpenTradeInfo(sender, pairIndex, index).tradeId,

sender, pairIndex + orderId, i.tradeId, sender, pairIndex );

Status

Addressed in #155ab21.