<!-- canonical: https://0xsimao.com/findings/trestle-storage-variables-cached -->

# Storage variables can be cached

Low/Info · Three Sigma · Modular blockchain infrastructure · 27th January 2024

Finding 3S-TR-N01 of the Trestle wTIA Bridge security review.

- Report: /reports/trestle-wtia-bridge
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-01-27-trestle.pdf

---

Occurrences
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/Trestle.sol#L185-L186
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/wTIA.sol#L48-L50
https://github.com/TrestleProtocol/Audit-Contracts/blob/main/src/wTIA.sol#L75

### Status

Acknowledged.

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [Storage variables should be cached whenever possible to save gas](https://0xsimao.com/findings/glacier-storage-cached-whenever-gas): Glacier
- [Storage variables can be cached to save gas](https://0xsimao.com/findings/mitosis-storage-variables-cached-gas): Mitosis
- [Storage variables can be cached to save gas](https://0xsimao.com/findings/orange-storage-variables-cached-gas): Orange Bridge
- [Variables should be cached to memory to save gas](https://0xsimao.com/findings/metazero-ii-variables-cached-memory-gas): MetaZero Staking
