Agent skill

Erc7702 Patterns

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when building with EIP-7702 account abstraction.

MITAuto-check passedBackend & APIs

Install Erc7702 Patterns

skills CLI
$ npx skills add ccashwell/evm-cortex --skill erc7702-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex erc7702-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/erc7702-patterns .claude/skills/erc7702-patterns && rm -rf skills-src

Use ~/.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/

Facts

Skill name
erc7702-patterns
GitHub stars
131
Token cost
~1.7k tokens
SKILL.md length
259 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building with EIP-7702 account abstraction.

  • Building with EIP-7702 account abstraction
  • SKILL.md covers Overview, How It Works, Authorization Tuple and Delegation Contract (Smart…, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Smart contracts

What it does

Erc7702 Patterns is an agent skill from ccashwell/evm-cortex. Use when building with EIP-7702 account abstraction. Covers EOA smart contract delegation, authorization tuples, transaction batching, sponsored transactions, session keys, and dApp integration. Live since Pectra (May 2025).

Its SKILL.md is about 1.7k 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 and Authorization and RBAC. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Building with EIP-7702 account abstraction
  • Tasks that involve Smart contracts
  • Tasks that involve Authorization and RBAC

Example prompts

  • “/erc7702-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity and typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Erc7702 Patterns loads about 1.7k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 259 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 259 words, ~1,683 tokens.

Download SKILL.mdSave it as .claude/skills/erc7702-patterns/SKILL.md (or your agent's skills folder).
name
erc7702-patterns
description
Use when building with EIP-7702 account abstraction. Covers EOA smart contract delegation, authorization tuples, transaction batching, sponsored transactions, session keys, and dApp integration. Live since Pectra (May 2025).

EIP-7702 Account Abstraction Patterns

Overview

EIP-7702 (shipped with Pectra, May 2025) lets EOAs temporarily delegate to smart contract code. The EOA's address gains smart contract capabilities without deploying a new account. Unlike EIP-4337, there's no separate EntryPoint or bundler infrastructure.

How It Works

A new transaction type (0x04) includes authorization tuples that set the EOA's code to point at a delegation contract:

authorization_list: [{ chain_id, address, nonce, y_parity, r, s }]

When the tx executes, the EOA's code is set to 0xef0100 || address (a delegation designator pointing to the implementation contract). All calls to the EOA now execute the implementation's code in the EOA's context.

Authorization Tuple

solidity
struct Authorization {
    uint256 chainId;   // 0 = valid on any chain
    address delegate;  // implementation contract
    uint64 nonce;      // EOA's current nonce
    uint8 yParity;
    bytes32 r;
    bytes32 s;
}

Sign offchain with the EOA's private key:

typescript
import { createWalletClient, http, parseEther } from 'viem';
import { mainnet } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
import { eip7702Actions } from 'viem/experimental';

const account = privateKeyToAccount('0x...');
const client = createWalletClient({
  account,
  chain: mainnet,
  transport: http(),
}).extend(eip7702Actions());

const authorization = await client.signAuthorization({
  contractAddress: '0xDelegateContract...',
});

const hash = await client.sendTransaction({
  authorizationList: [authorization],
  to: account.address,
  data: encodeFunctionData({ ... }),
});

Delegation Contract (Smart Account)

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;

contract SmartAccount {
    struct Call {
        address target;
        uint256 value;
        bytes data;
    }

    /// @notice Execute a batch of calls from the delegating EOA.
    /// Only the EOA itself can invoke (msg.sender == address(this)).
    function execute(Call[] calldata calls) external payable {
        require(msg.sender == address(this), "Only self");
        for (uint256 i = 0; i < calls.length; i++) {
            (bool ok, bytes memory ret) = calls[i].target.call{value: calls[i].value}(calls[i].data);
            require(ok, string(ret));
        }
    }
}

Transaction Batching

Users can batch multiple actions into one transaction:

typescript
const calls = [
  { target: tokenAddress, value: 0n, data: approveCalldata },
  { target: routerAddress, value: 0n, data: swapCalldata },
  { target: stakingAddress, value: 0n, data: stakeCalldata },
];

const hash = await client.sendTransaction({
  authorizationList: [authorization],
  to: account.address,
  data: encodeFunctionData({
    abi: smartAccountAbi,
    functionName: 'execute',
    args: [calls],
  }),
});

Sponsored Transactions

A relayer can submit a 7702 tx on behalf of the user. The user signs the authorization, the relayer pays gas:

solidity
contract SponsoredAccount {
    mapping(address => bool) public sponsors;

    function executeSponsored(
        Call[] calldata calls,
        address sponsor,
        bytes calldata sponsorSig
    ) external {
        require(sponsors[sponsor] || msg.sender == address(this), "Unauthorized");
        for (uint256 i = 0; i < calls.length; i++) {
            (bool ok,) = calls[i].target.call{value: calls[i].value}(calls[i].data);
            require(ok, "Call failed");
        }
    }
}

Session Keys

Delegate limited permissions to a session key for a period:

solidity
contract SessionKeyAccount {
    struct SessionKey {
        address key;
        uint48 validAfter;
        uint48 validUntil;
        address[] allowedTargets;
    }

    mapping(bytes32 => bool) public sessionKeys;

    function addSessionKey(SessionKey calldata sk) external {
        require(msg.sender == address(this), "Only self");
        sessionKeys[keccak256(abi.encode(sk))] = true;
    }

    function executeWithSessionKey(
        Call[] calldata calls,
        SessionKey calldata sk,
        bytes calldata signature
    ) external {
        require(sessionKeys[keccak256(abi.encode(sk))], "Unknown key");
        require(block.timestamp >= sk.validAfter, "Too early");
        require(block.timestamp <= sk.validUntil, "Expired");

        bytes32 digest = keccak256(abi.encode(calls, sk));
        require(ECDSA.recover(digest, signature) == sk.key, "Bad sig");

        for (uint256 i = 0; i < calls.length; i++) {
            _validateTarget(calls[i].target, sk.allowedTargets);
            (bool ok,) = calls[i].target.call{value: calls[i].value}(calls[i].data);
            require(ok, "Call failed");
        }
    }

    function _validateTarget(address target, address[] memory allowed) internal pure {
        for (uint256 i = 0; i < allowed.length; i++) {
            if (target == allowed[i]) return;
        }
        revert("Target not allowed");
    }
}

EIP-7702 vs EIP-4337

FeatureEIP-7702EIP-4337
Account typeEOA with delegationSmart contract account
InfrastructureStandard txBundlers + EntryPoint
Gas overheadMinimalUserOp validation cost
PersistencePer-tx or persistentPermanent
Backwards compatFull (same address)New address
BatchingYesYes

Key Considerations

  • Authorization can set chainId = 0 to be valid on all chains (useful but risky)
  • Delegation is revocable: sign a new authorization pointing to address(0)
  • The EOA's storage persists across delegations — clean up properly
  • EOA nonce increments prevent replay of old authorizations
  • tx.origin == msg.sender checks break for batched calls (avoid this pattern)
  • Delegated code runs in the EOA's context (like delegatecall)

Testing with Foundry

solidity
function test_eip7702_batch() public {
    // Foundry supports EIP-7702 via vm.signAuthorization
    bytes memory auth = vm.signAuthorization(address(smartAccount), eoaPrivateKey);
    vm.attachAuthorization(auth);

    SmartAccount.Call[] memory calls = new SmartAccount.Call[](2);
    calls[0] = SmartAccount.Call(address(token), 0, abi.encodeCall(token.approve, (router, 1e18)));
    calls[1] = SmartAccount.Call(address(router), 0, abi.encodeCall(router.swap, (1e18)));

    vm.prank(eoa);
    SmartAccount(eoa).execute(calls);
}

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/erc7702-patterns of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Erc7702 Patterns 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.

Erc7702 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Erc7702 Patterns this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Entry Point Analyzeralt-research2/SolidityGuard104—~959Automated safety check: PassCustom licence
Eip7702Nethereum/Nethereum2.3k—~1.4kAutomated safety check: PassMIT
Semantic Guard Analysisquillai-network/quillshield_skills129—~2.2kAutomated safety check: WarnMIT
Solidity Vulnerability Scanneralt-research2/SolidityGuard104—~1.6kAutomated safety check: NotesCustom licence
GenLayer ERC-7710 Connectorinternet-court/internet-court-skill6.4k1 repos~2.2kAutomated safety check: PassCustom licence

Similar skills

  • Entry Point Analyzer

    alt-research2/SolidityGuard

    Analyzes Solidity contract entry points to map attack surface.

    104 GitHub stars~959 tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Eip7702

    Nethereum/Nethereum

    Delegate smart contract code to EOAs with EIP-7702 using Nethereum (.NET).

    2.3k GitHub stars~1.4k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Semantic Guard Analysis

    quillai-network/quillshield_skills

    Detects logic vulnerabilities in smart contracts by analyzing guard-state consistency patterns.

    129 GitHub stars~2.2k tokensUpdated 6 mo ago
    Backend & APIsAuto-check: warnings
  • Solidity Vulnerability Scanner

    alt-research2/SolidityGuard

    Comprehensive Solidity contract security scanner detecting 104 vulnerability patterns across reentrancy, access control, arithmetic, DeFi, proxy, and token categories.

    104 GitHub stars~1.6k tokensUpdated 3 mo ago
    Backend & APIsAuto-check: notes
  • GenLayer ERC-7710 Connector

    internet-court/internet-court-skill

    Specifies how a GenLayer Intelligent Contract decision about an agent's performance becomes an ERC-7710 revocation or policy change, through a relayer or bridge and an EVM controller.

    6.4k GitHub starsUsed in 1 repo~2.2k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    elophanto/EloPhanto

    A skill your agent uses when reviewing a Solidity, Vyper, or Rust (Solana/Anchor) smart contract for paid audit work or pre-launch sanity check.

    106 GitHub stars~2.7k tokensUpdated 6 days ago
    SecurityAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    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.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    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.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Categories

Questions about Erc7702 Patterns

What does Erc7702 Patterns do?

A skill your agent uses when building with EIP-7702 account abstraction. Erc7702 Patterns is an agent skill from ccashwell/evm-cortex. Use when building with EIP-7702 account abstraction.

When should I use Erc7702 Patterns?

Erc7702 Patterns fits situations like: building with EIP-7702 account abstraction; tasks that involve Smart contracts; tasks that involve Authorization and RBAC.

How do I install Erc7702 Patterns in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill erc7702-patterns -a claude-code`. Or copy the skill folder (skills/erc7702-patterns in ccashwell/evm-cortex) into .claude/skills/erc7702-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Erc7702 Patterns in Codex?

Run `npx skills add ccashwell/evm-cortex --skill erc7702-patterns -a codex`. Or copy the skill folder (skills/erc7702-patterns in ccashwell/evm-cortex) into .agents/skills/erc7702-patterns in your project. Codex loads it when a task matches its description.

Can I use Erc7702 Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill erc7702-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/erc7702-patterns, .gemini/skills/erc7702-patterns, .github/skills/erc7702-patterns and .opencode/skills/erc7702-patterns in your project.

What does Erc7702 Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Erc7702 Patterns is instructions for the agent only.

Does Erc7702 Patterns access the network?

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.

Is Erc7702 Patterns safe to install?

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.

What licence does Erc7702 Patterns use?

Erc7702 Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Erc7702 Patterns use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Erc7702 Patterns?

Skills that share tags, products or a category with Erc7702 Patterns: Entry Point Analyzer (alt-research2/SolidityGuard, 104 stars), Eip7702 (Nethereum/Nethereum, 2.3k stars), Semantic Guard Analysis (quillai-network/quillshield_skills, 129 stars) and Solidity Vulnerability Scanner (alt-research2/SolidityGuard, 104 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Erc7702 Patterns?

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.