<!-- canonical: https://0xsimao.com/findings/maple-finance-iii-repeated-variable-fetching-storage -->

# In PoolManager, requestFunds(...) repeated variable fetching from storage.

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

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

On line 221 the factory_ address is assigned from IMapleProxied(msg.sender).factory(). However, on line 225,
IMapleProxied(msg.sender).factory() is called again instead of using the already
fetched factory_.

### Recommendation

Use the already fetched factory_ variable.

### Status

Addressed in the following PR:
https://github.com/maple-labs/pool-v2-private/pull/269

---

Related findings:

- [In glAVAX, naming convention for storage variable should be consistent](https://0xsimao.com/findings/glacier-naming-convention-storage-consistent): Glacier
- [DarkpoolAssetManager::Split() into 2 equal amounts leads to lost funds](https://0xsimao.com/findings/singularity-darkpool-split-equal-amounts): Singularity
- [CurveAssetManagerHelper::_validateAssets() should check that the number of assets provided is smaller than the maximum of the pool](https://0xsimao.com/findings/singularity-curve-helper-validate-provided): Singularity
- [DarkPoolAssetManager can be drained by looping over join(), joinSplit() or swap() with only some initial amount](https://0xsimao.com/findings/singularity-dark-looping-join-split): Singularity
