// the find
kadenzipfel/gas-optimizations
List of smart contract optimizations in solidity
A collection of markdown writeups cataloging gas optimization patterns in Solidity, split into costly patterns to avoid, saving patterns to apply, and micro-optimization gas-golfing tricks. It's a reference doc, not a library or tool — useful for Solidity devs who want to understand why certain code costs more gas, not for automated enforcement.
Each pattern gets its own focused file instead of one giant README, so it's easy to link a specific technique in a PR review. Coverage goes beyond the usual 'use uint256 not uint8' tips into less-obvious stuff like loop fusion, opaque predicates, and storage variable as loop length, which actually require reasoning about control flow. Sources back to a real academic paper (arxiv 1703.03994) and StackExchange discussions rather than just repeating folklore.
No actual before/after gas numbers or benchmarks anywhere — every claim is asserted, not measured, so you can't tell which optimizations matter and which are rounding error. Last pushed April 2023, meaning it predates the Shanghai/Cancun hard forks and transient storage (EIP-1153), so some advice is now outdated or missing entirely. It's just prose files with no code snippets runnable in Foundry/Hardhat, no linter rule, and no Slither/solhint integration, so applying any of it is manual copy-paste work.