▐ homomorph ▌

rules / HM004

HM004 transient-allow-on-storage MEDIUM

Handle persisted to storage but only granted FHE.allowTransient

Why it matters

`FHE.allowTransient` grants access for the current transaction only. It is the right tool for handles passed to another contract within a call, but a handle that is written to storage outlives the transaction. Once the transaction ends the permission evaporates and the stored value becomes unusable by the contract on the next call.

Fix

Use `FHE.allowThis(handle)` (persistent) for anything written to storage. Keep `FHE.allowTransient` for values handed to external contracts inside the same transaction.

Check locally

homomorph scan . --rules HM004