<!-- canonical: https://0xsimao.com/findings/ostium-force-approve-traiding-callbacks -->

# Consider using forceApprove instead of safeApprove in OstiumTraidingCallbacks

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

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

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

---

### Description

safeApprove should only be called when setting an initial allowance, because it reverts
when a non-zero approval is changed to a non-zero approval. Even though it's only called
with either type(uint256).max or 0, using [forceApprove](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/141c947921cc5d23ee1d247c691a8b85cabbbd5d/contracts/token/ERC20/utils/SafeERC20.sol#L76) is safer.

### Status

Addressed in [#55fde4e](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/55fde4edd86dd1fbb03baa29b2059280c475f715).

---

Related findings:

- [safeApprove(...) reverts if approval is different than 0, use safeIncreaseAllowance(...) instead](https://0xsimao.com/findings/fuji-finance-approve-reverts-approval-allowance): Fuji Finance
