원클릭으로
weasel-gas
Gas optimization analysis and implementation for Solidity contracts. Triggers on weasel gas, weasel optimize, or weasel efficiency.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Gas optimization analysis and implementation for Solidity contracts. Triggers on weasel gas, weasel optimize, or weasel efficiency.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Static analysis and security review for Solidity smart contracts. Triggers on weasel analyze, weasel audit, weasel scan, weasel review, or weasel check.
Code explanation and understanding for Solidity smart contracts. Triggers on weasel explain, weasel what does, or weasel walkthrough.
False positive filtering for Weasel static analysis results. Triggers on weasel filter, weasel triage, or weasel clean report.
Project overview and audit preparation for smart contract security. Triggers on weasel overview, weasel scope, or weasel onboard.
Attack hypothesis validation for smart contracts. Triggers on weasel validate, weasel check attack, or weasel verify.
Proof of Concept exploit writing for Solidity vulnerabilities. Triggers on weasel poc, weasel prove, weasel exploit, or weasel demonstrate.
| name | weasel-gas |
| description | Gas optimization analysis and implementation for Solidity contracts. Triggers on weasel gas, weasel optimize, or weasel efficiency. |
Expert in identifying and implementing gas optimizations for Solidity smart contracts.
weasel_analyze with severity: "Gas"Before any gas analysis, determine the target chain.
Config files (most reliable):
hardhat.config.js/ts → networks: { mainnet, arbitrum, optimism, polygon, bsc }
foundry.toml → [rpc_endpoints] or comments
truffle-config.js → networks section
README.md - Look for deployment targets, chain mentions
Dependencies/Files:
foundry.toml, hardhat.config.*, truffle-config.js → EVM (Supported)@arbitrum/* → Arbitrum L2@eth-optimism/* → Optimism L2Anchor.toml, *.rs → Solana (NOT SUPPORTED)Move.toml, *.move → Move (NOT SUPPORTED)tronbox, tronweb → Tron (NOT SUPPORTED).sol files → NOT SUPPORTEDAsk user if unclear: "Which EVM chain is this for? (Ethereum/Arbitrum/Optimism/Polygon/BSC/Other)"
| Category | Chains | Supported |
|---|---|---|
| EVM L1 | Ethereum mainnet | ✓ Full |
| EVM L2 | Arbitrum, Optimism, Base, zkSync, Scroll | ✓ Filtered |
| EVM L1 (cheap) | Polygon, BSC, Avalanche, Fantom | ✓ Filtered |
| Non-EVM | Tron, Solana, Aptos, Sui, CosmWasm, TON, etc. | ❌ NO |
Weasel supports Solidity on EVM chains only.
All standard gas optimizations apply:
Execution is cheap. Calldata dominates costs.
| Optimization | Priority | Why |
|---|---|---|
| Calldata size reduction | HIGH | Calldata posted to L1 |
| Short strings/bytes32 | HIGH | Reduces calldata |
| Event data size | HIGH | Logged to L1 |
| Batch operations | HIGH | Reduces L1 overhead |
| Storage caching | Low | Execution is cheap on L2 |
| Unchecked math | Low | Saves ~20 gas, negligible |
| Struct packing | Maybe | Only if reduces calldata |
Gas is cheap - micro-optimizations often pointless.
| Optimization | Report? | Why |
|---|---|---|
| Storage caching | Maybe | Only for hot paths |
| Unchecked math | Skip | Saves cents, not worth readability |
| Prefix increment | Skip | Negligible savings |
| Array length caching | Skip | Marginal benefit |
Rule: Only report if saves >1000 gas or is on hot path.
Weasel analyzes Solidity on EVM only. Non-EVM chains are not supported.
If detected (Tron, Solana, Move, CosmWasm, TON, etc.):
❌ Cannot run gas analysis.
This project targets a non-EVM chain.
Weasel supports Solidity on EVM chains only.
Gas optimization skill does not apply.
If deploying to multiple EVM chains or unclear:
High Impact - Fix first:
Medium Impact:
Low Impact - Usually skip:
High Impact:
Low Impact (often skip):
Only report if:
Always include chain context:
Gas analysis for: Arbitrum (L2)
Raw findings: 12
After chain filter: 4 relevant
High (2): calldata size (2)
Medium (2): event optimization (2)
Filtered out (8): storage caching, unchecked math - low impact on L2
Fix high impact issues? [yes/specific/skip]
For non-EVM chains:
❌ Cannot run gas analysis.
Detected: Non-EVM project
Weasel supports Solidity on EVM chains only.
Gas optimization skill does not apply.
When user confirms:
Mention when relevant:
| Rationalization | Why It's Wrong |
|---|---|
| "Gas optimizations are universal" | WRONG. L2s have different cost models. Non-EVM is not supported. |
| "I'll assume Ethereum mainnet" | WRONG. ASK or DETECT first. Wrong chain = wrong advice. |
| "Storage caching always helps" | WRONG on L2s. Execution is cheap, saves negligible amounts. |
| "More optimizations = better report" | WRONG. Irrelevant findings waste developer time. |
| "Unchecked math is always good" | WRONG on cheap chains. Saves cents, hurts readability. |
| "Non-EVM is similar enough" | WRONG. Weasel = Solidity + EVM only. Non-EVM = not supported. |
| "I can still give general advice" | WRONG. If not supported, say "not supported" and stop. |