Fizz Convert
pashov/skills
Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.
Gas optimization patterns for Solidity smart contracts. An agent skill from ccashwell/evm-cortex.
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ccashwell/evm-cortex gas-optimization --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gas-optimization .claude/skills/gas-optimization && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .claude/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimizationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ccashwell/evm-cortex gas-optimization --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/gas-optimization .agents/skills/gas-optimization && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .agents/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ccashwell/evm-cortex gas-optimization --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/gas-optimization .cursor/skills/gas-optimization && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .cursor/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ccashwell/evm-cortex.git --path skills/gas-optimization--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ccashwell/evm-cortex gas-optimization --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/gas-optimization .gemini/skills/gas-optimization && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .gemini/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ccashwell/evm-cortex gas-optimizationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/gas-optimization .github/skills/gas-optimization && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .github/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill gas-optimization -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ccashwell/evm-cortex gas-optimization --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/gas-optimization .opencode/skills/gas-optimization && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "gas-optimization" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/gas-optimization into .opencode/skills/gas-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gas-optimization", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
gas-optimizationGas optimization patterns for Solidity smart contracts. An agent skill from ccashwell/evm-cortex.
Gas Optimization is an agent skill from ccashwell/evm-cortex. Gas optimization patterns for Solidity smart contracts. Use when optimizing contract deployment cost, runtime gas usage, or reviewing gas-critical paths. Covers calldata vs memory, immutable/constant, unchecked blocks, storage packing, batch operations, and custom errors.
Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Smart contracts. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.
Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity and bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Gas Optimization loads about 1.5k tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 273 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 273 words, ~1,538 tokens.
.claude/skills/gas-optimization/SKILL.md (or your agent's skills folder).Never optimize blindly. Use forge snapshots and gas reports.
# Gas report for all tests
forge test --gas-report
# Snapshot to compare before/after
forge snapshot
# ...make changes...
forge snapshot --diffCustom errors save ~50 gas on deployment and ~200 gas per revert vs require("string").
// BAD: ~24,000 gas on revert (stores string in bytecode + memory)
require(amount > 0, "Amount must be greater than zero");
// GOOD: ~24 gas for error selector encoding
error ZeroAmount();
if (amount == 0) revert ZeroAmount();Use calldata for read-only external function parameters. Avoids copying to memory.
// BAD: copies entire array to memory (~3 gas per byte + allocation)
function processOrders(Order[] memory orders) external { ... }
// GOOD: reads directly from calldata
function processOrders(Order[] calldata orders) external { ... }
// Gas savings scale with input size:
// 100 bytes: ~600 gas saved
// 1KB: ~6,000 gas saved
// 10KB: ~60,000 gas saved// constant: compile-time value, inlined everywhere. 0 gas for SLOAD.
uint256 public constant MAX_SUPPLY = 10_000;
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name)");
// immutable: set once in constructor, stored in bytecode. 0 gas for SLOAD.
address public immutable FACTORY;
uint256 public immutable DEPLOYMENT_TIMESTAMP;
constructor(address factory) {
FACTORY = factory;
DEPLOYMENT_TIMESTAMP = block.timestamp;
}
// Regular storage variable: 2,100 gas (cold) or 100 gas (warm) per SLOAD
address public admin; // avoid if value never changes after deploymentWhen overflow is impossible (e.g., loop counters bounded by array length), use unchecked to skip overflow checks (~40 gas per operation).
// BAD: overflow checks on every increment
for (uint256 i = 0; i < arr.length; i++) { ... }
// GOOD: i cannot overflow (bounded by array length, which fits in uint256)
for (uint256 i; i < arr.length;) {
// process arr[i]
unchecked { ++i; }
}Every SLOAD costs 2,100 gas (cold) or 100 gas (warm). Cache values read more than once.
// BAD: 3 SLOADs for totalSupply
function distribute() external {
if (totalSupply == 0) revert NoSupply(); // SLOAD 1
uint256 perToken = rewards / totalSupply; // SLOAD 2
emit Distributed(perToken, totalSupply); // SLOAD 3
}
// GOOD: 1 SLOAD, cached in memory
function distribute() external {
uint256 supply = totalSupply; // SLOAD 1 (cached)
if (supply == 0) revert NoSupply();
uint256 perToken = rewards / supply;
emit Distributed(perToken, supply);
}Pack related variables into single 32-byte slots. See storage-layout skill for details.
// BAD: 3 slots
uint256 amount; // slot 0
address user; // slot 1
bool active; // slot 2
// GOOD: 2 slots
uint256 amount; // slot 0
address user; // slot 1 (20 bytes)
bool active; // slot 1 (packed, +1 byte)Writing to packed slots together in one transaction saves ~20,000 gas (avoids separate SSTORE).
Put cheap checks first in && / || chains.
// BAD: expensive SLOAD first
if (balances[msg.sender] > minBalance && isWhitelisted) { ... }
// GOOD: cheap check first, SLOAD only if needed
if (isWhitelisted && balances[msg.sender] > minBalance) { ... }Amortize fixed overhead (21,000 base gas, cold SLOADs) across multiple operations.
function batchTransfer(
IERC20 token,
address[] calldata recipients,
uint256[] calldata amounts
) external {
uint256 len = recipients.length;
if (len != amounts.length) revert ArrayLengthMismatch();
for (uint256 i; i < len;) {
token.safeTransfer(recipients[i], amounts[i]);
unchecked { ++i; }
}
}The EVM initializes all values to zero. Explicit zero assignment wastes gas.
// BAD: redundant zero init
uint256 counter = 0;
bool flag = false;
// GOOD: default is already zero/false
uint256 counter;
bool flag;// BAD: dynamic string requires more gas
string public constant NAME = "MyToken";
// GOOD: fixed-size, cheaper to read
bytes32 public constant NAME = "MyToken";// BAD: computed at runtime every call
function hasRole(string memory role) external view {
bytes32 hash = keccak256(abi.encodePacked(role));
...
}
// GOOD: precomputed constant
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");The Solidity dispatcher checks function selectors in order. Frequently called functions with lower selectors dispatch faster. Not worth manual optimization unless the contract has 50+ external functions.
| Optimization | Typical Savings |
|---|---|
| Custom errors vs require strings | ~200 gas/revert |
| calldata vs memory | ~600+ gas/call |
| immutable vs storage | ~2,100 gas/read |
| Unchecked loop increment | ~40 gas/iteration |
| Cache storage reads | ~100-2,100 gas/read |
| Storage packing | ~20,000 gas/write |
| ++i vs i++ | ~5 gas/iteration |
| Zero-init removal | ~3 gas/variable |
© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/gas-optimization of ccashwell/evm-cortex.
Open the folder on GitHubat commit f8f3301
Gas Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Gas Optimization this skillccashwell/evm-cortex | 131 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Fizz Convertpashov/skills | 1.2k | 2 repos | ~3.7k | Automated safety check: Pass | MIT | |
| Feynman Auditor0xiehnnkta/nemesis-auditor | 244 | 1 repos | ~11k | Automated safety check: Pass | MIT | |
| Smart Contract Auditgreatpie/smart-contract-audit-skill | 101 | — | ~1.1k | Automated safety check: Pass | None | |
| RadarAuditware/radar | 154 | — | ~2.1k | Automated safety check: Pass | GPL-3.0 | |
| Solidity AuditorGabson0x/bountyforge | 443 | — | ~3.7k | Automated safety check: Pass | None |
pashov/skills
Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.
0xiehnnkta/nemesis-auditor
Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.
greatpie/smart-contract-audit-skill
Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.
Auditware/radar
Use radar for smart contract security analysis, AST generation, and detection template development.
Gabson0x/bountyforge
Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.
lidofinance/diffyscan
Adds or repairs Diffyscan explorer API routing and response adapters for a new host, chain or payload format.
ccashwell/evm-cortex
A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.
ccashwell/evm-cortex
A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.
ccashwell/evm-cortex
Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.
ccashwell/evm-cortex
A skill your agent uses when running a local Ethereum node with Anvil.
ccashwell/evm-cortex
A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.
ccashwell/evm-cortex
A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.
Works with
Categories
Gas optimization patterns for Solidity smart contracts. An agent skill from ccashwell/evm-cortex. Gas Optimization is an agent skill from ccashwell/evm-cortex. Gas optimization patterns for Solidity smart contracts.
Gas Optimization fits situations like: optimizing contract deployment cost; runtime gas usage; reviewing gas-critical paths.
Run `npx skills add ccashwell/evm-cortex --skill gas-optimization -a claude-code`. Or copy the skill folder (skills/gas-optimization in ccashwell/evm-cortex) into .claude/skills/gas-optimization in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ccashwell/evm-cortex --skill gas-optimization -a codex`. Or copy the skill folder (skills/gas-optimization in ccashwell/evm-cortex) into .agents/skills/gas-optimization in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill gas-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gas-optimization, .gemini/skills/gas-optimization, .github/skills/gas-optimization and .opencode/skills/gas-optimization in your project.
SKILL.md names no scripts, command-line tools or credentials: Gas Optimization is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Gas Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Gas Optimization: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 244 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.
Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.