Skip to content
Request an audit

‹ All findings

OstiumTrading::updateOpenLimitOrder() Makes Unnecessary Field Updates

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

Description

In OstiumTrading::updateOpenLimitOrder(), unnecessary fields of the OpenLimitOrder struct are updated. Specifically, the createdAt field is set, despite its intended immutability after creation, and the lastUpdated field is also updated.

Subsequently, this object is passed to OstiumTradingStorage::updateOpenLimitOrder(), where lastUpdated is reassigned to the current block. However, the createdAt field remains unaltered as intended.

Recommendation

Do the following changes in OstiumTrading::updateOpenLimitOrder():

solidity
- uint32 b = ChainUtils.getBlockNumber().toUint32();
o.targetPrice = price;
o.tp = tp;
o.sl = sl;
- o.createdAt = b;
- o.lastUpdated = b;

Status

Addressed in #d825181.