Works with the AI Agents you already use
Evm Chain Differences
by BanditXBT
Checklist for porting contracts across Ethereum, L2s and EVM chains: opcodes, block semantics, gas, tokens.
Free
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 |
- 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.
- Maintain a single config module (per-chain addresses: wrapped native, tokens, oracles, routers, sequencer feed, finality/confirmations, block-time-derived constants). Never inline addresses.
- Compile with the lowest common
evm_version; add a CI matrix: build + unit + fork tests per chain. - Deploy deterministically (CREATE2 via a known factory) where supported; verify source on each explorer; record constructor args and chain config in
deployments/<chain>.json. - 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.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 13 days ago
- Free with an Agensi account
Nothing to install. It runs in your AI agent.
- Optional
- Foundry
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.