<!-- canonical: https://0xsimao.com/findings/beraborrow-i-several-safe-erc20-functions -->

# Missing several `safeERC20` functions

Medium · Sherlock · CDP stablecoin · 25th April, 2025

Finding M-7 of the Beraborrow Managed Dens security review.

- Protocol: https://www.beraborrow.com/
- Report: /reports/beraborrow-i
- Source: https://1570492309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FffzDCMBDa391vIMqruBP%2Fuploads%2FUKDtjc6Dkn6P6i35j5H1%2FManaged%20Leverage%20Vaults%20v0%20private%20audit%20Sherlock.pdf?alt=media&token=c7304efa-8040-4ed0-9a98-dc949af28a85

---

## Summary

Some tokens will not work currently due to not using `safeERC20`.

## Vulnerability Detail

`approve()`, `transferFrom()` don't work for all tokens and `safeERC20` should be used.

## Impact

Protocol can't be used for certain tokens. Leaving as medium because vaults will be migrated and may have these tokens already with TVL.

## Code Snippet

https://github.com/sherlock-audit/2025-04-beraborrow-vault-update/pull/1/files#diff-2d972f52027e0ba1065b2de2b424416244bfef9e2a79d2604e1687867f72c91eR523
https://github.com/sherlock-audit/2025-04-beraborrow-vault-update/pull/1/files#diff-2d972f52027e0ba1065b2de2b424416244bfef9e2a79d2604e1687867f72c91eR493
https://github.com/sherlock-audit/2025-04-beraborrow-vault-update/pull/1/files#diff-2d972f52027e0ba1065b2de2b424416244bfef9e2a79d2604e1687867f72c91eR939

## Tool Used

Manual Review

## Recommendation

Use the `SafeERC20` lib.

---

Related findings:

- [Erc20Utils::safeTransferFrom() assumes the tokens are transferred to this, which may not be the case](https://0xsimao.com/findings/districtone-erc20-utils-transfer-transferred): DistrictOne
- [Throughout code base, implement using SafeERC20 for IERC20 for better readability](https://0xsimao.com/findings/fuji-finance-erc20-ierc20-better-readability): Fuji Finance
- [Codebase is not using SafeERC20](https://0xsimao.com/findings/metazero-ii-codebase-safe-erc20): MetaZero Staking
