<!-- canonical: https://0xsimao.com/findings/maple-finance-iii-ensure-fees-delegate-explicitly -->

# Consider adding a check to ensure that fees, delegate cover and so on have been explicitly set.

Low/Info · Three Sigma · Institutional lending · 10th April, 2024

Finding 3S-MAPLE-L07 of the Maple Finance security review.

- Protocol: https://maple.finance/
- Report: /reports/maple-finance-iii-2024
- Source: https://cdn.sanity.io/files/qoqld077/production/36dbe5ca76da3d2392bcee581548067705b8bd36.pdf

---

### Description

Some fees or delegate cover information are set in the globals. When fetched, there is no
check that the values for a specific pool or loan manager have been set, so the default 0
value is assumed. This could lead to unexpected results, even more so if a pool is deployed
through means other than the Maple frontend (or it does not behave as expected).

### Recommendation

Create getters that check if the values were explicitly set, isSet[key].

### Status

Acknowledged by the team.

---

Related findings:

- [Add a 0 address check on the pool when adding liquidity for greater verbosity](https://0xsimao.com/findings/nftperp-ii-add-adding-greater-verbosity): Nftperp Matching Engine
- [Bad check in `Vesting.sol::_resetVestingPlans` will prevent users from adding additional liquidity in `SymmVesting.sol`](https://0xsimao.com/findings/symmio-staking-and-vesting-vesting-plans-additional-symm): Symmio, Staking and Vesting
- [Balance check in Vault::withdraw() does not take fees into account](https://0xsimao.com/findings/orange-balance-withdraw-fees-account): Orange Bridge
- [Equality check should be performed for fees, not >= as it can lead to users sending more fees than supposed](https://0xsimao.com/findings/orange-equality-fees-sending-supposed): Orange Bridge
