<!-- canonical: https://0xsimao.com/findings/fuji-finance-whole-storage-try-succeeds -->

# In ConnextHandler, executeFailedWithUpdatedArgs(...), the whole tx is updated on storage if the try call succeeds

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

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

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

---

### Description

In the ConnextHandle, executeFailedWithUpdatedArgs(...), the failed tx executed
field is set to true. Currently it is loaded in memory and then written to storage completely,
which is unnecessary and adds significant gas overhead.

### Recommendation

Change the code below try connextRouter.xBundle(actions, args) to
_failedTxns[transferId][nonce].executed = true; to save on storage writes.

### Status

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

---

Related findings:

- [Malicious user can call `borrowing::calculateCumulativeRate()` any number of times to inflate debt rate as `lastEventTime` is not updated](https://0xsimao.com/findings/autonomint-calculate-times-inflate-debt): Autonomint
- [OstiumTrading::closeTradeMarket() Makes Redundant Call to OstiumTradingStorage::getOpenTradeInfo()](https://0xsimao.com/findings/ostium-close-redundant-storage-info): Ostium
