Master Ethereum development including EVM, gas optimization, and client interactions
Provides Ethereum development expertise covering EVM internals, gas optimization, transaction mechanics, and client interactions. Use when users need to optimize Solidity contracts, estimate transaction fees, read on-chain storage, or troubleshoot blockchain transactions.
/plugin marketplace add pluginagentmarketplace/custom-plugin-blockchain/plugin install custom-plugin-blockchain@pluginagentmarketplace-blockchainThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyMaster Ethereum development including EVM internals, gas optimization, transaction mechanics, and client interactions.
# Invoke this skill for Ethereum development
Skill("ethereum-development", topic="gas", network="mainnet")
Understand the execution environment:
Reduce transaction costs:
Master transaction lifecycle:
Work with Ethereum nodes:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Optimized {
// Pack into single slot (32 bytes)
struct User {
uint128 balance; // 16 bytes
uint64 lastUpdate; // 8 bytes
uint32 nonce; // 4 bytes
bool active; // 1 byte
// 3 bytes padding
}
mapping(address => User) public users;
}
import { createPublicClient, http, keccak256, encodePacked, pad } from 'viem';
import { mainnet } from 'viem/chains';
const client = createPublicClient({ chain: mainnet, transport: http() });
// Read mapping value: balances[address]
async function getBalance(contract: `0x${string}`, user: `0x${string}`) {
const slot = keccak256(encodePacked(['address', 'uint256'], [user, 0n]));
return await client.getStorageAt({ address: contract, slot });
}
import { createWalletClient, http, parseEther } from 'viem';
const client = createWalletClient({ transport: http() });
const hash = await client.sendTransaction({
to: '0x...',
value: parseEther('0.1'),
type: 'eip1559',
maxFeePerGas: parseGwei('30'),
maxPriorityFeePerGas: parseGwei('2'),
});
| Technique | Savings | Example |
|---|---|---|
| Storage packing | ~20k/slot | uint128 + uint128 in one slot |
| Calldata vs memory | ~3/byte | Use calldata for read-only |
| Unchecked math | ~80/op | unchecked { i++; } |
| Custom errors | ~200+ | error Unauthorized() |
| Short-circuit | Variable | Cheap checks first |
| Pitfall | Issue | Solution |
|---|---|---|
| Storage in loops | Expensive reads | Cache in memory first |
| String storage | Uses multiple slots | Use bytes32 when possible |
| Zero value storage | Full refund gone | Don't rely on SSTORE refunds |
# Check current gas prices
cast gas-price --rpc-url $RPC
cast basefee --rpc-url $RPC
Set maxFeePerGas to at least 2x current base fee.
# Trace transaction to find issue
cast run --trace $TX_HASH --rpc-url $RPC
# Get current nonce
cast nonce $ADDRESS --rpc-url $RPC
# Foundry essentials
forge build --sizes # Contract sizes
forge test --gas-report # Gas consumption
forge snapshot # Gas snapshots
cast storage $ADDR $SLOT # Read storage
cast call $ADDR "fn()" # Simulate call
contract GasTest is Test {
function test_GasOptimization() public {
uint256 gasBefore = gasleft();
target.optimizedFunction();
uint256 gasUsed = gasBefore - gasleft();
assertLt(gasUsed, 50000, "Too much gas used");
}
}
02-ethereum-developmentsolidity-development, web3-frontend| Version | Date | Changes |
|---|---|---|
| 2.0.0 | 2025-01 | Production-grade with viem, gas optimization |
| 1.0.0 | 2024-12 | Initial release |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.