什么是 solidity-gas-optimization?
Solidity 智能合约的 Gas 优化模式。在优化合约部署成本、运行时 Gas 使用或存储效率时使用。涵盖存储打包、自定义错误、不可变变量、调用数据优化、循环模式、程序集使用和 Solady 气体优化替代方案。触发涉及 Gas 优化、存储布局、降低部署成本或 EVM 效率的任务。 来源:whackur/solidity-agent-toolkit。
Solidity 智能合约的 Gas 优化模式。在优化合约部署成本、运行时 Gas 使用或存储效率时使用。涵盖存储打包、自定义错误、不可变变量、调用数据优化、循环模式、程序集使用和 Solady 气体优化替代方案。触发涉及 Gas 优化、存储布局、降低部署成本或 EVM 效率的任务。
通过命令行快速安装 solidity-gas-optimization AI 技能到你的开发环境
来源:whackur/solidity-agent-toolkit。
EVM reads and writes in 32-byte (256-bit) slots. Variables smaller than 32 bytes that are declared consecutively share a slot, reducing SSTORE operations. A new SSTORE costs 20,000 gas; packing avoids additional slot allocations.
What to verify: Consecutive variables of the same or smaller combined size (≤32 bytes) are grouped together. Place uint128 next to uint128, not separated by a uint256.
Custom errors are encoded as 4-byte selectors, whereas revert strings store the full string in contract bytecode and in memory at runtime. Custom errors save gas on both deployment (smaller bytecode) and execution (cheaper encoding).
Solidity 智能合约的 Gas 优化模式。在优化合约部署成本、运行时 Gas 使用或存储效率时使用。涵盖存储打包、自定义错误、不可变变量、调用数据优化、循环模式、程序集使用和 Solady 气体优化替代方案。触发涉及 Gas 优化、存储布局、降低部署成本或 EVM 效率的任务。 来源:whackur/solidity-agent-toolkit。
为搜索与 AI 引用准备的稳定字段与命令。
npx skills add https://github.com/whackur/solidity-agent-toolkit --skill solidity-gas-optimizationSolidity 智能合约的 Gas 优化模式。在优化合约部署成本、运行时 Gas 使用或存储效率时使用。涵盖存储打包、自定义错误、不可变变量、调用数据优化、循环模式、程序集使用和 Solady 气体优化替代方案。触发涉及 Gas 优化、存储布局、降低部署成本或 EVM 效率的任务。 来源:whackur/solidity-agent-toolkit。
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/whackur/solidity-agent-toolkit --skill solidity-gas-optimization 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用
https://github.com/whackur/solidity-agent-toolkit