Agent skill

Cross Chain Security

by ccashwell in ccashwell/evm-cortex

Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions.

MITAuto-check passedBackend & APIs

Install Cross Chain Security

skills CLI
$ npx skills add ccashwell/evm-cortex --skill cross-chain-security -a claude-code

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

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

At a glance

Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions.

  • Deploying contracts across multiple chains
  • SKILL.md covers Message Replay Across Chains, Bridge Verification, Finality Assumptions and Chain-Specific Behavior…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Integrating with bridges

What it does

Cross Chain Security is an agent skill from ccashwell/evm-cortex. Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions. Use when deploying contracts across multiple chains, integrating with bridges, or handling chain-specific behavior differences. Covers message replay, finality, and chain-specific gotchas.

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 Deployment. It works with Solidity and Ethereum. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Deploying contracts across multiple chains
  • Integrating with bridges
  • Handling chain-specific behavior differences

Example prompts

  • “/cross-chain-security”

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

    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

Cross Chain Security loads about 1.7k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 240 words of instructions outside code blocks.

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

Download SKILL.mdSave it as .claude/skills/cross-chain-security/SKILL.md (or your agent's skills folder).
name
cross-chain-security
description
Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions. Use when deploying contracts across multiple chains, integrating with bridges, or handling chain-specific behavior differences. Covers message replay, finality, and chain-specific gotchas.

Cross-Chain Security

Message Replay Across Chains

Signatures and messages valid on one chain can be replayed on another if the chain ID isn't included.

solidity
// VULNERABLE: no chain ID in domain separator
bytes32 DOMAIN_SEPARATOR = keccak256(abi.encode(
    keccak256("EIP712Domain(string name,address verifyingContract)"),
    keccak256("MyProtocol"),
    address(this)
));

// FIXED: include chain ID
bytes32 DOMAIN_SEPARATOR = keccak256(abi.encode(
    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
    keccak256("MyProtocol"),
    keccak256("1"),
    block.chainid,
    address(this)
));
Recomputing Domain Separator on Fork

If a chain forks, block.chainid changes but a cached domain separator doesn't.

solidity
uint256 private immutable _CACHED_CHAIN_ID;
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;

constructor() {
    _CACHED_CHAIN_ID = block.chainid;
    _CACHED_DOMAIN_SEPARATOR = _computeDomainSeparator();
}

function DOMAIN_SEPARATOR() public view returns (bytes32) {
    if (block.chainid == _CACHED_CHAIN_ID) {
        return _CACHED_DOMAIN_SEPARATOR;
    }
    return _computeDomainSeparator();
}

Bridge Verification

Never trust bridge messages blindly. Verify the source chain, sender, and message format.

solidity
interface ICrossDomainMessenger {
    function xDomainMessageSender() external view returns (address);
}

contract L2Vault {
    address public immutable L1_BRIDGE;
    address public immutable MESSENGER;

    error NotFromBridge();
    error InvalidL1Sender();

    modifier onlyBridge() {
        if (msg.sender != MESSENGER) revert NotFromBridge();
        if (ICrossDomainMessenger(MESSENGER).xDomainMessageSender() != L1_BRIDGE) {
            revert InvalidL1Sender();
        }
        _;
    }

    function handleMessage(bytes calldata data) external onlyBridge {
        // safe to process — verified from L1_BRIDGE via canonical messenger
    }
}

Finality Assumptions

Different chains have different finality guarantees.

ChainFinalityNotes
Ethereum L1~13 min (2 epochs)Reorgs very rare post-merge
Optimism7-day challenge periodOptimistic rollup — wait for finality
Arbitrum7-day challenge periodOptimistic rollup
zkSyncMinutes (proof time)ZK rollup — faster finality
Polygon PoS~2 minCheckpoints to Ethereum
Base7-day challenge periodOP Stack
solidity
// Don't act on cross-chain messages until finality is reached
// For optimistic rollups, this means waiting for the challenge period
// For ZK rollups, wait for proof verification on L1

Chain-Specific Behavior Differences

PUSH0 Opcode (EIP-3855)

Available on Ethereum (Shanghai), not on all L2s or older EVMs.

solidity
// Solidity 0.8.20+ uses PUSH0 by default
// If deploying to chains without PUSH0, compile with:
// solc --evm-version paris  (pre-Shanghai)

// foundry.toml
// evm_version = "paris"
block.number
solidity
// Ethereum L1: increments every ~12 seconds
// Arbitrum: block.number returns L1 block number (NOT Arbitrum block)
//           Use ArbSys.arbBlockNumber() for Arbitrum blocks
// Optimism: block.number returns L2 block number
// zkSync: block.number returns L2 batch number

// VULNERABLE: assuming block.number behavior
uint256 public lastActionBlock = block.number;

// SAFER: use block.timestamp for time-based logic (consistent across chains)
uint256 public lastActionTimestamp = block.timestamp;
block.basefee and PREVRANDAO
solidity
// block.basefee: may be 0 on some L2s
// block.prevrandao (was block.difficulty): not available or 0 on most L2s
// Never use these for randomness on L2
msg.sender on L2
solidity
// On Optimism/Base, for L1→L2 messages:
// msg.sender = L2CrossDomainMessenger
// Use xDomainMessageSender() to get the actual L1 sender

// On Arbitrum:
// msg.sender = aliased address for L1→L2 calls
// alias = L1Address + 0x1111000000000000000000000000000000001111

CREATE2 Address Differences

Same CREATE2 salt + bytecode = same address on all chains, but only if:

  • Same deployer address
  • Same constructor arguments
  • Same compiler settings (optimizer, version)
solidity
// Risk: deploying "same" contract on two chains at same address
// but with different constructor args → different behavior, same address
// Users might trust the address based on one chain's deployment

// Defense: verify deployments independently per chain

Cross-Chain Token Bridging Gotchas

solidity
// Different token representations across chains:
// - USDC on Ethereum: native Circle deployment
// - USDC on Arbitrum: bridged via Arbitrum bridge (USDC.e) vs native (USDC)
// - USDC on Optimism: bridged via OP bridge vs native

// Always verify the correct token address per chain
// Don't assume same address = same token across chains

mapping(uint256 => address) public chainToUSDC;

constructor() {
    chainToUSDC[1] = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;     // Ethereum
    chainToUSDC[42161] = 0xaf88d065e77c8cC2239327C5EDb3A432268e5831; // Arbitrum native
    chainToUSDC[10] = 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85;    // Optimism native
}

Cross-Chain Governance

solidity
// Governance on L1, execution on L2 requires:
// 1. Proposal passes on L1
// 2. Message sent via canonical bridge
// 3. L2 timelock receives and queues
// 4. Execution after L2 timelock delay

// Total delay = L1 voting + bridge finality + L2 timelock
// For optimistic rollups: voting period + 7 days + L2 delay

Cross-Chain Security Checklist

  • EIP-712 domain separator includes chainId
  • Domain separator recomputed if block.chainid changes (fork handling)
  • Bridge messages verified: source chain, sender, messenger
  • Finality assumptions documented per chain
  • block.number not relied upon for cross-chain consistency
  • block.timestamp used for time-based logic (more portable)
  • Compiler EVM version matches target chain capabilities
  • CREATE2 deployments verified independently per chain
  • Token addresses verified per chain (no cross-chain address assumptions)
  • Cross-chain governance accounts for bridge finality delays

© 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/cross-chain-security of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Cross Chain Security 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.

Cross Chain Security compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cross Chain Security this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Developing Smart ContractsLFDT-Lineth/lineth-monorepo126—~1.4kAutomated safety check: PassAGPL-3.0
Foundry Deploy Fixturesaviggiano/security144—~634Automated safety check: PassMIT
New Configlidofinance/diffyscan142—~1kAutomated safety check: PassMIT
Validate Configlidofinance/diffyscan142—~1.1kAutomated safety check: PassMIT
Ethskillsaustintgriffith/ethskills294—~1.4kAutomated safety check: PassNone

Similar skills

  • Developing Smart Contracts

    LFDT-Lineth/lineth-monorepo

    Solidity smart contract development guidelines for Lineth blockchain.

    126 GitHub stars~1.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • Foundry Deploy Fixtures

    aviggiano/security

    Create or refactor Foundry deployment fixtures for Solidity tests.

    144 GitHub stars~634 tokensUpdated 23 days ago
    Backend & APIsAuto-check passed
  • New Config

    lidofinance/diffyscan

    Creates or extends a Diffyscan verification config for a deployed contract or deployment.

    142 GitHub stars~1k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Validate Config

    lidofinance/diffyscan

    Reviews an existing Diffyscan YAML or JSON config for load errors, runtime prerequisites, pinned sources, address mappings and broad exceptions.

    142 GitHub stars~1.1k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Ethskills

    austintgriffith/ethskills

    Ethereum development knowledge for AI agents — from idea to deployed dApp.

    294 GitHub stars~1.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Smart Contract Development

    vechain/x-app-template

    Solidity smart contract development on VeChainThor — Hardhat setup, ERC-20/721 patterns, upgradeable contracts, gas optimization, testing with Thor Solo, security auditing, and ABI codegen.

    450 GitHub stars~1.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-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 9 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 9 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 9 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 9 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 9 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 9 days ago
    Auto-check passed

Categories

Questions about Cross Chain Security

What does Cross Chain Security do?

Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions. Cross Chain Security is an agent skill from ccashwell/evm-cortex. Cross-chain security patterns for multi-chain Solidity deployments and bridge interactions.

When should I use Cross Chain Security?

Cross Chain Security fits situations like: deploying contracts across multiple chains; integrating with bridges; handling chain-specific behavior differences.

How do I install Cross Chain Security in Claude Code?

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

How do I install Cross Chain Security in Codex?

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

Can I use Cross Chain Security 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 cross-chain-security -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cross-chain-security, .gemini/skills/cross-chain-security, .github/skills/cross-chain-security and .opencode/skills/cross-chain-security in your project.

What does Cross Chain Security need to run?

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

Does Cross Chain Security 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 Cross Chain Security 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 Cross Chain Security use?

Cross Chain Security 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 Cross Chain Security 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 Cross Chain Security?

Skills that share tags, products or a category with Cross Chain Security: Developing Smart Contracts (LFDT-Lineth/lineth-monorepo, 126 stars), Foundry Deploy Fixtures (aviggiano/security, 144 stars), New Config (lidofinance/diffyscan, 142 stars) and Validate Config (lidofinance/diffyscan, 142 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cross Chain Security?

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.