<!-- canonical: https://0xsimao.com/findings/maple-finance-iii-functionality-instance-thus-removed -->

# In MapleLoanFactory, isLoan has the same functionality of isInstance and thus can be removed.

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

Finding 3S-MAPLE-N05 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

The mapping isLoan is only modified in the respective MapleLoanFactory.sol contract
which extends MapleProxyFactory.sol.
isLoan is only modified in line 24 of MapleLoanFactory where, in the same call, isInstance
is also set to true in line 95 of MapleProxyFactory.
So every valid loan according to isLoan is a valid instance according to isInstance and
every address that is not registered in isLoan will also not be registered in isInstance.

### Recommendation

The mapping isLoan can be removed and isInstance can be used in its place whenever
needed.

### Status

Acknowledged, this was done to maintain compatibility with the fixed term loan factory
(which is out of scope for our audit).

---

Related findings:

- [SpiritVestingFactory::createSpiritVestingContract overwrites the spiritVestings mapping for the same recipient](https://0xsimao.com/findings/spirit-protocol-vesting-overwrites-vestings-recipient): Spirit Protocol
- [Factory update for maple loans can be performed with the old factory](https://0xsimao.com/findings/maple-finance-ii-factory-loans-performed-old): Maple Withdrawal Manager
