optimism

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

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

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, such as ignoring the L1 data fee in gas estimates, assuming instant L2-to-L1 withdrawals, or hallucinating predeploy contract addresses. This Skill provides accurate, current knowledge of OP Mainnet and the OP Stack so contracts, bridges, and cross-chain messages are built correctly the first time. ## Core Features & Use Cases - Deployment & Verification: Deploy and verify Solidity contracts on OP Mainnet and OP Sepolia using Foundry or Hardhat with correct Etherscan and Blockscout configurations. - Cross-Chain Messaging & Bridging: Implement CrossDomainMessenger contracts, bridge ETH and ERC20 tokens via the Standard Bridge, and handle the three-step withdrawal lifecycle (initiate, prove, finalize after 7 days). - Gas Model & Predeploys: Estimate total transaction cost by combining L2 execution gas with the L1 data fee from the GasPriceOracle, and reference all predeploy contract addresses. - Use Case: A developer building a token bridge asks how to estimate fees and handle withdrawals; the Skill supplies the post-Ecotone gas formula, the GasPriceOracle interface, and the full prove-and-finalize withdrawal flow with working Viem and Solidity code. ## Quick Start Ask the agent to help you deploy a contract to OP Mainnet or estimate the full 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 gas costs on Optimism?

Optimism transactions pay two fees: L2 execution gas from eth_estimateGas and an L1 data fee from the GasPriceOracle predeploy at 0x420000000000000000000000000000000000000F. Add getL1Fee(serializedTx) to the L2 execution cost for the true total.

How do I bridge ETH from Ethereum to Optimism?

Call depositETH on the L1StandardBridge contract at 0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1 with the ETH as msg.value. The funds arrive on OP Mainnet in about 1-3 minutes with no prove or finalize step required.

Why does my Optimism withdrawal take 7 days?

L2-to-L1 withdrawals require a 7-day fault proof challenge period. You must initiate on L2, prove the withdrawal on OptimismPortal after the output root is proposed (~1 hour), then finalize on L1 after the challenge period ends.

Do I need to modify my Solidity contracts for Optimism?

No. OP Mainnet is EVM-equivalent, so standard Solidity contracts deploy without modification using forge create or Hardhat. The main differences are the two-component gas model, L2 block numbers in block.number, and non-random PREVRANDAO.

Why did my L1 to L2 message fail to execute?

Common causes are an insufficient minGasLimit for L2 execution or a reverting target function. Failed messages can be replayed by calling relayMessage on the L2CrossDomainMessenger at 0x4200000000000000000000000000000000000007 with a higher gas limit.

What is SuperchainERC20 and when should I use it?

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