<!-- canonical: https://0xsimao.com/findings/maple-finance-syrup-router-hardcoded-1e18-rate-provider -->

# Hardcoded 1e18 in SyrupRateProvider

Low/Info · Three Sigma · Permissionless lending · 21st May 2024

Finding 3S-Sy-N02 of the Maple Syrup Router security review.

- Protocol: https://maple.finance/
- Report: /reports/maple-syrup-router
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-05-21-maple-finance-syrup-router.pdf

---

### Description

SyrupRateProvider hardcodes the shares when [calling](https://github.com/maple-labs/syrup-router/blob/main/contracts/utils/SyrupRateProvider.sol#L17)
IPoolLike(pool).convertToExitAssets(1e18);.

### Recommendation

Consider using a constant state value instead along with a comment for better readability.

### Status

Addressed in [32b7bc3](https://github.com/maple-labs/syrup-utils/commit/32b7bc30f077b140143c88ee4e7655cfd5240bcd)

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [Hardcoded 1e18 ratio calculation regardless of decimals](https://0xsimao.com/findings/ojo-network-hardcoded-calculation-regardless-decimals): Ojo Mellow Price Feed
