optimism

Guides Optimism and OP Stack development including deployment, bridging, cross-chain messaging, and gas estimation.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill optimism-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimism
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/optimism
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill optimism-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem, @eth-optimism/sdk, ethers, hardhat, @nomicfoundation/hardhat-toolbox.

What problem does it solve? AI agents frequently produce outdated or incorrect guidance for Optimism development — wrong gas models (pre-Ecotone formulas), hallucinated contract addresses, and incorrect assumptions about withdrawal timing or EVM equivalence. This Skill provides verified, current knowledge of OP Mainnet and the OP Stack so agents generate correct deployment commands, bridge interactions, and cross-chain messaging code. ## Core Features & Use Cases - Deployment & Verification: Foundry and Hardhat configurations for OP Mainnet and OP Sepolia, including Etherscan and Blockscout verification workflows. - Cross-Chain Messaging & Bridging: Complete CrossDomainMessenger patterns (L1→L2 deposits, L2→L1 withdrawals with prove/finalize lifecycle), Standard Bridge ETH/ERC20 transfers, and SuperchainERC20 implementation. - Gas Model & Predeploys: Post-Ecotone L1 data fee calculation via the GasPriceOracle predeploy, full predeploy address tables, and troubleshooting guides for common errors. - Use Case: A developer asks an agent to estimate transaction costs on OP Mainnet. The agent correctly combines L2 execution gas with the L1 data fee from the GasPriceOracle at 0x420000000000000000000000000000000000000F instead of relying on eth_estimateGas alone. ## Quick Start Ask the agent to deploy a contract to OP Mainnet with Foundry and estimate the total transaction cost including the L1 data fee.

Frequently Asked Questions about optimism

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate transaction gas costs on Optimism?

Optimism transactions pay two fees: L2 execution gas and an L1 data fee. Use eth_estimateGas for the L2 portion, then call getL1Fee on the GasPriceOracle predeploy at 0x420000000000000000000000000000000000000F and add both values for the true total cost.

How do I bridge ETH from Ethereum to Optimism?

Call depositETH on the L1StandardBridge contract at 0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1 with the ETH amount as msg.value. The ETH arrives on OP Mainnet in about 1-3 minutes with no additional steps required.

Why do Optimism withdrawals take 7 days?

L2 to L1 withdrawals require a 7-day challenge period for fault proofs. The flow involves three steps: initiate on L2, prove on L1 after the output root is proposed (~1 hour), then finalize on L1 after the challenge period expires.

Do I need to modify Solidity contracts for Optimism deployment?

No. OP Mainnet is EVM-equivalent, so standard Solidity contracts deploy without modification using forge create or Hardhat. No custom compiler, legacy flags, or opcode changes are needed.

What is SuperchainERC20 and how does it differ from ERC20?

SuperchainERC20 is a cross-chain token standard for OP Stack chains enabling native transfers between Superchain members. Tokens must implement ICrosschainERC20 with crosschainMint and crosschainBurn functions callable only by the SuperchainTokenBridge predeploy.

Why does my Optimism contract verification fail on Etherscan?

Optimistic Etherscan requires a separate API key from Ethereum Etherscan, registered at optimistic.etherscan.io. Also ensure the exact compiler version, optimization runs, via-ir setting, and constructor argument encoding match the original deployment.