<!-- canonical: https://0xsimao.com/findings/ostium-transfer-instead-call-revert -->

# Using transfer() instead of call() may revert

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

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

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

---

### Description

When withdrawing ETH in OstiumPriceUpKeep::withdrawEth() using the deprecated
transfer() function will make the transaction revert when:
1. The claimer smart contract does not implement a payable function.
2. The claimer smart contract does implement a payable fallback which uses more than
2300 gas units.
3. The claimer smart contract implements a payable fallback function that needs less than
2300 gas units but is called through proxy, raising the call's gas usage above 2300.
Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.

### Recommendation

```solidity
Use sendValue() or: payable(msg.sender).call{value: amount}("");
```

### Status

Addressed in [#173093](https://github.com/0xOstium/smart-contracts-threeSigma/commit/173093a04e7cef130bae843e0b7c31a3da862ef8).

---

Related findings:

- [Use of `address.transfer` instead of the recommended `address.call{value: amount}("")`](https://0xsimao.com/findings/blast-ido-pools-transfer-recommended-call-value): Blast IDO Pools
- [In glAVAX, should use .call instead of .transfer](https://0xsimao.com/findings/glacier-avax-call-instead-transfer): Glacier
- [Initializable constracts should call _disableInitializers() in the constructor instead of using the initializer modifier](https://0xsimao.com/findings/mitosis-initializable-constracts-initializers-initializer): Mitosis
- [`GovernorTimelock::_call()` assembly revert block doesn't have the memory safe attribute](https://0xsimao.com/findings/maple-finance-ii-timelock-assembly-revert-attribute): Maple Governor Timelock
