<!-- canonical: https://0xsimao.com/findings/ostium-implement-custom-require-statements -->

# Implement Custom Errors Instead of require Statements

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

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

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

---

### Description

The usage of require statements instead of custom errors is evident in both
OstiumLinkUpKeep and particularly in OstiumVault.

### Recommendation

It is advisable to opt for custom errors as they offer a more gas-efficient method to explain
to users why an operation failed. Additionally, utilizing custom errors is more cost-effective
during deployment.

### Status

Addressed in [#7565043](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/75650439ee1a632ff6eb6c66fc31276381223008).

---

Related findings:

- [Custom errors should be used instead of require() statements to save gas](https://0xsimao.com/findings/metazero-ii-custom-require-statements-gas): MetaZero Staking
- [Throughout code base: use Solidity native errors implementation instead of string errors.](https://0xsimao.com/findings/maple-finance-iii-solidity-native-implementation-string): Maple Finance
