<!-- canonical: https://0xsimao.com/findings/ostium-trading-checked-trades-callback -->

# OstiumTrading::canExecute() should also be checked in OstiumTradesUpKeep::checkCallback()

Low/Info · Three Sigma · RWA perpetuals DEX · 19th February, 2024

Finding 3S-OS-N13 of the Ostium security review.

- Protocol: https://www.ostium.com/
- Report: /reports/ostium
- Source: https://cdn.sanity.io/files/qoqld077/production/a95b9c69e0f65d1d6b0e649f0d62a362358ca8ce.pdf

---

### Description

Orders in [OstiumTrading::executeAutomationOrder()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/audit-feedback/src/OstiumTrading.sol#L468) will not execute if they are in the
timeout period. This same check should exist in [OstiumTradesUpKeep::checkCallback()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/audit-feedback/src/OstiumTradesUpKeep.sol#L132-L136) to
ensure that non executable orders are added to tradesToTrigger.

### Recommendation

Add the timeout check to OstiumTradesUpKeep::checkCallback().

### Status

Addressed in [#20d8cee](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/20d8cee8543a5e1e4e7702ce79603b2c2c871fee).

---

Related findings:

- [The domain with 0 index in Cap::_checkRemoteStateAndAdvance() is not checked for equality](https://0xsimao.com/findings/mitosis-index-remote-advance-equality): Mitosis
- [Unnecessary conditional check in ThresholdGovernance.execute](https://0xsimao.com/findings/m-0-unnecessary-conditional-threshold-governance): M^0 Minter Gateway
