# evm-chain-differences

> Checklist for porting contracts across Ethereum, L2s and EVM chains: opcodes, block semantics, gas, tokens.

evm-chain-differences is a free AI agent skill on Agensi by BanditXBT. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [BanditXBT](https://www.agensi.io/creators/banditxbt)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/evm-chain-differences
- Tags: web3-crypto, devops-cloud, apis-backend

## About this skill

"EVM-compatible" is a spectrum. Before deploying to a chain, verify each item against that chain's **current docs and a fork/testnet run**; chain behavior changes with upgrades, so do not rely on memory for values.

| Item | Why it breaks | How to check |
|---|---|---|
| **EVM version / opcodes** | Solc defaults to newer EVM versions (e.g., `PUSH0` from Shanghai, `TSTORE/MCOPY` from Cancun); chains lacking them fail deployment or revert at runtime | Set `evm_version` in `foundry.toml` to the lowest common version; deploy a canary on the target; run full test suite with `--fork-url` of the target |
| **Compiler/toolchain** | zkSync-style chains need a specialized compiler and differ on `CREATE/CREATE2` address derivation, `extcodesize`, some assembly | Use the chain's documented toolchain; test deterministic addresses |
| **`block.number`** | On some L2s it reflects L1 block numbers or differs from L2 block cadence (e.g., Arbitrum returns an approximate L1 number; L2 number via `ArbSys`) | Never count blocks for time; use `block.timestamp` for durations; verify per chain |
| **`block.timestamp` & block time** | Sub-second or 2s blocks change meaning of "N blocks" parameters; multiple blocks can share a timestamp | Express intervals in seconds; test same-timestamp sequences |
| **`block.prevrandao`/randomness** | Not secure randomness anywhere; semantics vary on L2s | Use VRF/commit-reveal |
| **Gas model** | L2 fees = L2 execution + L1 data posting; calldata size dominates; opcode gas schedules differ; `gasleft()` patterns and fixed gas stipends may fail | Measure gas on the target; avoid hardcoded gas limits; budget calldata |
| **Precompiles** | Missing or different (`ecrecover`, `modexp`, BLS, P256/secp256r1 `RIP-7212`) | Call each precompile on target in tests |
| **Contract size / init limits** | 24 KB limit commonly; variations exist | `forge build --sizes` against target |
| **Native gas token** | `ETH` assumptions break where native token is MATIC/BNB/AVAX/etc.; `WETH` address and name differ | Abstract "wrapped native" in config; don't assume 18-decimals semantics blindly |
| **Reorg depth & finality** | Ethereum has epoch finality; L2s have soft/L1-confirmed/challenge-period finality; some L1s have probabilistic finality | See `cross-chain-messaging-review`; set confirmation counts per chain |
| **Sequencer / centralized components** | Downtime or forced-inclusion delays freeze liquidations and oracles | Integrate sequencer uptime feed + grace period where available |
| **Mempool / MEV** | Many L2s use private sequencer ordering (FCFS or priority fee), no public mempool; MEV and front-running profiles differ | Re-evaluate sandwich/liquidation-race assumptions per chain |
| **Tokens** | Same ticker, different decimals (e.g., USDT/USDC are 6 decimals on Ethereum but 18 on some chains); bridged vs. native variants; non-standard `transfer` returns; blacklistable stablecoins; fee-on-transfer | Read `decimals()`, test with the real token on fork; use SafeERC20 |
| **Oracles** | Different feed addresses, heartbeats, decimals per chain | See `oracle-risk-review` |
| **Account abstraction/EIP-7702** | `tx.origin == msg.sender` EOA checks and `extcodesize == 0` assumptions are unreliable | Avoid "is EOA" gating |
| **EIP-712 / signatures** | Domain separator must bind `chainId`; replay across chains or forks | Compute domain separator dynamically or on `chainid` change |

1. List target chains and their VM type. **Non-EVM targets (Solana/Move/CosmWasm)** are a separate codebase: share only specs, test vectors, and economic parameters; port invariants as tests.
2. Maintain a single config module (per-chain addresses: wrapped native, tokens, oracles, routers, sequencer feed, finality/confirmations, block-time-derived constants). Never inline addresses.
3. Compile with the lowest common `evm_version`; add a CI matrix: build + unit + fork tests per chain.
4. Deploy deterministically (CREATE2 via a known factory) where supported; verify source on each explorer; record constructor args and chain config in `deployments/<chain>.json`.
5. Post-deploy checklist: ownership transferred to multisig/timelock, roles set, pause tested, oracle reads succeed, one smoke trade/liquidation on testnet or fork, monitoring attached.

Filled compatibility matrix per chain, required code changes (parameterization, `evm_version`), CI matrix config, and open risks needing live verification.

## Requires

- Optional: Foundry

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the evm-chain-differences skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does evm-chain-differences do?

Checklist for porting contracts across Ethereum, L2s and EVM chains: opcodes, block semantics, gas, tokens.

### Which AI agents support evm-chain-differences?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use evm-chain-differences?

Connect your AI agent to Agensi through MCP, then ask it to use evm-chain-differences on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
