<!-- canonical: https://0xsimao.com/findings/fuji-finance-temp-need-state-variable -->

# _tempTokenToCheck in BaseRouter does not need to be a state variable

Low/Info · Three Sigma · Lending aggregator · 6th May, 2023

Finding 3S-FUJI-N15 of the Fuji Finance security review.

- Report: /reports/fuji-finance
- Source: https://cdn.sanity.io/files/qoqld077/staging/32181a28eac3175d15fb8924d249bb0d91ca350c.pdf

---

### Description

_tempTokenToCheck checks that the balance of the ConnextRouter does not change after
having received tokens in xReceive(...) . This variable is unnecessary as the
tokensToCheck variable of _bundleInternal(...) could be created before the
_bundleInternal(...) call and passed as argument.

### Recommendation

In the ConnextRouter, create the tokensToCheck variable in the xReceive(...) function
and pass it as argument to xBundleConnext(...), which should pass it as argument to
_bundleInternal(...). In the BaseRouter, create the tokensToCheck variable in
xBundle(...) and pass it as argument to _bundleInternal(...).

### Status

Addressed here: [Fujicracy/fuji-v2#622](https://github.com/Fujicracy/fuji-v2/pull/622)

---

Related findings:

- [OstiumOpenPnl::average() can be simplified by adding a state variable that tracks the cumulative sum of nextEpochValues](https://0xsimao.com/findings/ostium-average-tracks-sum-epoch): Ostium
- [Unnecessary check in StandardGovernor.state](https://0xsimao.com/findings/m-0-unnecessary-standard-governor-state): M^0 Minter Gateway
- [The domain with 0 index in Cap::_checkRemoteStateAndAdvance() is not checked for equality](https://0xsimao.com/findings/mitosis-index-remote-advance-equality): Mitosis
- [Cap::_checkRemoteStateAndAdvance() may be optimized by returning early as soon as a different epoch is found in a remote domain](https://0xsimao.com/findings/mitosis-remote-returning-soon-epoch): Mitosis
