Agent skill

Create2 Patterns

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when deploying contracts to deterministic addresses with CREATE2.

MITAuto-check passedDevOps & Cloud

Install Create2 Patterns

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

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

GitHub CLI
$ gh skill install ccashwell/evm-cortex create2-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/create2-patterns .claude/skills/create2-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
create2-patterns
GitHub stars
131
Token cost
~1.7k tokens
SKILL.md length
189 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when deploying contracts to deterministic addresses with CREATE2.

  • Works in 3 steps: Use the same factory contract address on… → Use the same salt → Use the same creation code (including…
  • Deploying contracts to deterministic addresses with CREATE2
  • SKILL.md covers Address Calculation, Basic CREATE2 Factory, Salt Selection Strategies and Cross-Chain Same-Address…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Create2 Patterns is an agent skill from ccashwell/evm-cortex. Use when deploying contracts to deterministic addresses with CREATE2. Covers address prediction, salt selection, factory patterns, cross-chain same-address deployment, CREATE3, vanity addresses, and replay protection.

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 DevOps & Cloud, covering Deployment. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Deploying contracts to deterministic addresses with CREATE2
  • Tasks that involve Deployment

Example prompts

  • “/create2-patterns”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Use the same factory contract address on all chains (deploy factory with CREATE2 from an EOA at same nonce, or use a known factory like…
  2. Use the same salt
  3. Use the same creation code (including constructor arguments)

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 bash).

    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

Create2 Patterns loads about 1.7k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 189 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
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). 189 words, ~1,657 tokens.

Download SKILL.mdSave it as .claude/skills/create2-patterns/SKILL.md (or your agent's skills folder).
name
create2-patterns
description
Use when deploying contracts to deterministic addresses with CREATE2. Covers address prediction, salt selection, factory patterns, cross-chain same-address deployment, CREATE3, vanity addresses, and replay protection.

CREATE2 Deterministic Deployment Patterns

Address Calculation

CREATE2 address is determined by four inputs:

address = keccak256(0xff ++ deployer ++ salt ++ keccak256(initCode))[12:]
solidity
function computeAddress(bytes32 salt, bytes32 initCodeHash, address deployer)
    internal pure returns (address)
{
    return address(uint160(uint256(keccak256(abi.encodePacked(
        bytes1(0xff), deployer, salt, initCodeHash
    )))));
}

Basic CREATE2 Factory

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

contract Create2Factory {
    event Deployed(address indexed addr, bytes32 indexed salt);

    function deploy(bytes32 salt, bytes memory creationCode)
        external payable returns (address deployed)
    {
        assembly {
            deployed := create2(callvalue(), add(creationCode, 0x20), mload(creationCode), salt)
        }
        require(deployed != address(0), "CREATE2: deployment failed");
        emit Deployed(deployed, salt);
    }

    function computeAddress(bytes32 salt, bytes memory creationCode)
        external view returns (address)
    {
        bytes32 hash = keccak256(abi.encodePacked(
            bytes1(0xff), address(this), salt, keccak256(creationCode)
        ));
        return address(uint160(uint256(hash)));
    }
}

Salt Selection Strategies

solidity
// Simple: use deployer address + nonce
bytes32 salt = keccak256(abi.encode(msg.sender, nonce));

// Access-controlled: only specific deployer can use this salt
bytes32 salt = keccak256(abi.encode(msg.sender, "MyContract-v1"));

// Include constructor args in salt for uniqueness
bytes32 salt = keccak256(abi.encode(msg.sender, name, symbol, initialSupply));

Cross-Chain Same-Address Deployment

To deploy at the same address on multiple chains:

  1. Use the same factory contract address on all chains (deploy factory with CREATE2 from an EOA at same nonce, or use a known factory like Arachnid's)
  2. Use the same salt
  3. Use the same creation code (including constructor arguments)
solidity
// Arachnid's deterministic deployment proxy (deployed on most chains):
// 0x4e59b44847b379578588920cA78FbF26c0B4956C

// Deploy to same address on any chain:
bytes memory initCode = abi.encodePacked(type(MyContract).creationCode, abi.encode(arg1, arg2));
bytes32 salt = keccak256("my-protocol-v1");

// Submit identical tx to factory on each chain

CREATE3 Pattern (Address Independent of Init Code)

CREATE3 makes the deployed address independent of constructor arguments. Useful when constructor args differ per chain but you want the same address:

solidity
library CREATE3 {
    bytes internal constant PROXY_BYTECODE = hex"67363d3d37363d34f03d5260086018f3";
    bytes32 internal constant PROXY_BYTECODE_HASH = keccak256(PROXY_BYTECODE);

    function deploy(bytes32 salt, bytes memory creationCode, uint256 value)
        internal returns (address deployed)
    {
        // Step 1: deploy a minimal proxy via CREATE2 (deterministic)
        address proxy;
        assembly {
            proxy := create2(0, add(PROXY_BYTECODE, 0x20), mload(PROXY_BYTECODE), salt)
        }
        require(proxy != address(0), "CREATE3: proxy deploy failed");

        // Step 2: proxy deploys the real contract via CREATE (nonce-based)
        // The real contract address = f(proxy address, nonce=1)
        (bool ok,) = proxy.call{value: value}(creationCode);
        require(ok, "CREATE3: deploy failed");

        deployed = addressOf(salt);
    }

    function addressOf(bytes32 salt) internal view returns (address) {
        address proxy = address(uint160(uint256(keccak256(abi.encodePacked(
            bytes1(0xff), address(this), salt, PROXY_BYTECODE_HASH
        )))));
        return address(uint160(uint256(keccak256(abi.encodePacked(
            bytes2(0xd694), proxy, bytes1(0x01)
        )))));
    }
}

Replay Protection

Prevent the same contract from being deployed twice to the same address:

solidity
contract SafeCreate2Factory {
    mapping(address => bool) public isDeployed;

    function deploy(bytes32 salt, bytes memory creationCode)
        external payable returns (address deployed)
    {
        deployed = _computeAddress(salt, creationCode);
        require(!isDeployed[deployed], "Already deployed");

        assembly {
            deployed := create2(callvalue(), add(creationCode, 0x20), mload(creationCode), salt)
        }
        require(deployed != address(0), "Deploy failed");
        isDeployed[deployed] = true;
    }
}

Vanity Addresses

Mine salts for addresses with desirable prefixes:

solidity
// Off-chain salt mining (pseudocode)
// for salt in 0..2^256:
//     addr = computeCreate2Address(factory, salt, initCodeHash)
//     if addr starts with 0x0000:
//         return salt

// Use create2crunch or similar GPU miner for efficient vanity search
bash
# create2crunch: GPU-accelerated vanity address mining
create2crunch --factory 0xFactory... --caller 0xCaller... \
  --init-code-hash 0xHash... --leading 4 --total 6

Foundry Testing

solidity
function test_create2_deterministic() public {
    bytes32 salt = keccak256("test-salt");
    bytes memory initCode = abi.encodePacked(
        type(MyContract).creationCode,
        abi.encode("arg1", 42)
    );

    address predicted = factory.computeAddress(salt, initCode);
    address deployed = factory.deploy(salt, initCode);

    assertEq(deployed, predicted, "Address mismatch");
    assertGt(deployed.code.length, 0, "No code at address");
}

function test_create2_sameAddressDifferentChains() public {
    bytes32 salt = keccak256("cross-chain");
    bytes memory initCode = type(MyContract).creationCode;

    // Same factory + salt + initCode = same address regardless of chain
    address addr = factory.computeAddress(salt, initCode);
    assertTrue(addr != address(0));
}

Key Considerations

  • CREATE2 address depends on init code, so different constructor args = different address
  • CREATE3 removes init code dependency (address depends only on factory + salt)
  • If a contract is selfdestructed, a new contract CAN be deployed at the same CREATE2 address
  • selfdestruct is deprecated post-Dencun (EIP-6780) — only works in same tx as creation
  • Always verify the deployed bytecode matches expectations after cross-chain deployment

© 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/create2-patterns of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Create2 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.

Create2 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Create2 Patterns this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Kubeshark Installerkubeshark/kubeshark12k—~3.6kAutomated safety check: NotesApache-2.0
GreptimeDB Dev Docker ImageGreptimeTeam/greptimedb6.7k—~4kAutomated safety check: NotesApache-2.0
KubeSphere ServiceMesh Managerkubesphere/kubesphere17k—~2.4kAutomated safety check: PassCustom licence
Vercelremotion-dev/remotion62k—~1.2kAutomated safety check: PassCustom licence
AWS Cdk Developmentzxkane/aws-skills3672 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • Kubeshark Installer

    kubeshark/kubeshark

    Installs and configures Kubeshark on a Kubernetes cluster, choosing between the quick CLI path and a Helm install with custom values.

    12k GitHub stars~3.6k tokensUpdated 7 days ago
    DevOps & CloudAuto-check: notes
  • GreptimeDB Dev Docker Image

    GreptimeTeam/greptimedb

    Packages a locally built GreptimeDB debug binary into a development-only Docker image for local-cluster testing, with an optional push to a dev registry.

    6.7k GitHub stars~4k tokensUpdated 3 days ago
    DevOps & CloudAuto-check: notes
  • KubeSphere ServiceMesh Manager

    kubesphere/kubesphere

    Installs, checks and troubleshoots the KubeSphere ServiceMesh extension (Istio, Kiali, Jaeger), including grayscale release, sidecar injection, topology and tracing issues.

    17k GitHub stars~2.4k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Vercel

    remotion-dev/remotion

    Official

    Set up a Codex monitor for Vercel deployments and preview URLs.

    62k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • AWS Cdk Development

    zxkane/aws-skills

    AWS Cloud Development Kit (CDK) expert for building cloud infrastructure with TypeScript/Python.

    367 GitHub starsUsed in 2 repos~2.5k tokens
    DevOps & CloudAuto-check passed
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    259 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes

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 Create2 Patterns

What does Create2 Patterns do?

A skill your agent uses when deploying contracts to deterministic addresses with CREATE2. Create2 Patterns is an agent skill from ccashwell/evm-cortex. Use when deploying contracts to deterministic addresses with CREATE2.

When should I use Create2 Patterns?

Create2 Patterns fits situations like: deploying contracts to deterministic addresses with CREATE2; tasks that involve Deployment.

How do I install Create2 Patterns in Claude Code?

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

How do I install Create2 Patterns in Codex?

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

Can I use Create2 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 create2-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/create2-patterns, .gemini/skills/create2-patterns, .github/skills/create2-patterns and .opencode/skills/create2-patterns in your project.

What does Create2 Patterns need to run?

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

Does Create2 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 Create2 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 Create2 Patterns use?

Create2 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 Create2 Patterns use?

About 1.7k tokens (SKILL.md is roughly 6.6k 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 Create2 Patterns?

Skills that share tags, products or a category with Create2 Patterns: Kubeshark Installer (kubeshark/kubeshark, 12k stars), GreptimeDB Dev Docker Image (GreptimeTeam/greptimedb, 6.7k stars), KubeSphere ServiceMesh Manager (kubesphere/kubesphere, 17k stars) and Vercel (remotion-dev/remotion, 62k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Create2 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.