Practical overview
When it fits
Consult it while learning Solidity optimization or reviewing a contract, then assess each suggestion in the context of the code and its behavior.
Who it is for
- Solidity developers reviewing smart-contract code for gas efficiency.
- Educators preparing material about Solidity and EVM optimization practices.
Documented uses
- Use categorized tips as a checklist during contract review.
- Study how storage layout, data types, function choices and loops can affect gas use.
- Develop educational material or a review workflow that maps optimization ideas to code patterns.
Requirements & limits
The repository is public on GitHub and identified as open source.
- It is reference material, not an executable analyzer or API.
- Some recommendations are context-dependent; the README notes that memory-versus-storage choices require case-by-case consideration.
- The repository invites contributions including fixes, documentation and tools.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Review Solidity storage and variable choices for gas efficiency
Use the repository’s storage and variable guidance as a checklist while reviewing a Solidity contract.
Before you start
- A Solidity contract to review.
- Familiarity with its intended data types and whether values or collections can be bounded.
Steps
Inspect storage variables and identify values that can be constants or packed together, including compatible struct fields.
Check whether bounded values can use appropriately sized fixed types, such as bytes32 for short text that fits.
Review storage reads and updates; where appropriate, keep intermediate calculations in memory and avoid unnecessary storage-to-memory copies.
For collections, consider mappings or fixed-size arrays when they suit the use case; if a dynamic array is necessary, prefer additive operations over truncation where appropriate.
Expected outcome
A contract review checklist of storage, type, and collection choices to consider for gas efficiency.
Guide limitations
- Packing benefits apply to storage, not memory or calldata; packing function arguments or local variables does not save space.
- Choosing memory versus storage depends on the size and number of copy operations, so each case requires individual consideration.
- Mappings are not suitable for every use case; a small array may be a good choice.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- harendra-shakya/solidity-gas-optimization · Official homepage title · retained in its source language

