What should an Optimism smart contract audit cover?
An Optimism smart contract audit should check how your Solidity on OP Mainnet authenticates deposits sent from Ethereum contracts, what it promises users when exits to Ethereum can be paused, and how it treats prices while the sequencer is down. QuillShield audits the Solidity code of a Foundry project that targets OP Mainnet, deposit receivers and exit flows included, and compares every later pull request with that audit.
What is different about auditing on OP Mainnet?
OP Mainnet runs Solidity much as Ethereum does. The review differences come from three places: messages that arrive from Ethereum, exits that go back to it, and the sequencer in between.
- Contract senders are aliased on deposits. A discussion in the OP Stack specs repository explains that OP uses the same address aliasing scheme as Arbitrum, an offset of
0x1111000000000000000000000000000000001111, and that it applies only to contracts sending messages to L2. A message from an EOA keeps its address, so a receiver that accepts both has two cases to get right. - Exits to Ethereum can be paused. Runtime Verification's report on Optimism pausability (16 May 2024) describes a mechanism in the L1 contracts that lets governance stop L2-to-L1 transactions from being finalized. A product that promises users an exit by a fixed date is promising something the protocol can delay.
- Sequencer downtime has a feed. Chainlink lists an OP Mainnet L2 sequencer uptime feed at
0x371EAD81c9102C9BF4874A9075FFFf170F2Ee389, answering 0 while the sequencer is up and 1 while it is down, withstartedAtmarking the last change. - Base no longer ships the same upgrades. Azul was, in the words of the Base docs, Base's first independent network upgrade, and since Denim Base produces five blocks per second. Code deployed to both chains needs tests on each chain's own behavior, not one run that stands in for both.
What should a reviewer check before deploying to OP Mainnet?
- Every function that accepts a deposit from an L1 contract compares the aliased address, not the raw L1 address.
- Receivers that accept deposits from both EOAs and contracts handle each case, since only contract senders are aliased.
- Exit flows say what happens to a user's position if L2-to-L1 finalization is paused, and nothing on L1 assumes a withdrawal always lands on time.
- Liquidations and price reads check the OP Mainnet uptime feed and wait for a grace period after
startedAtchanges. - Deployment scripts confirm that each address you send funds to on OP Mainnet holds the contract you expect on OP Mainnet as well as on Ethereum.
- Constants copied from a Base deployment (block counts, withdrawal delays) are recomputed for OP Mainnet.
What happened in the Sonne Finance exploit on OP Mainnet?
| Protocol | Sonne Finance |
|---|---|
| Date | 14 May 2024 |
| Chain | Optimism (OP Mainnet) |
| Loss | about $20M |
| What happened | Sonne, a Compound v2 fork, queued the transactions that would add a VELO market behind a 2-day timelock. On OP Mainnet anyone could execute them once the timelock ended, while on Base they could not. The attacker executed the market creation and collateral factor transactions, deposited into the still-empty market and donated VELO straight to the soVELO contract to inflate its exchange rate, then used rounding in redeemUnderlying to redeem underlying tokens for fewer soTokens. The team says adding about $100 of VELO to the markets saved the remaining $6.5M. |
| Sources | Sonne Finance, CertiK |
The donation attack on empty Compound v2 markets was already known, and the Sonne post-mortem says the team had a routine against it: add a market at a 0% collateral factor, seed it with collateral and burn the seed. That routine depended on the order of transactions, and on OP Mainnet the attacker controlled the order. A review of an OP Mainnet deployment covers who can execute queued governance transactions as well as the contracts, and the rounding and precision page explains the redeem math.
Which OP Mainnet protocols need these checks most?
Lending markets such as Moonwell run on OP Mainnet as well as Base, and Moonwell's February 2026 oracle loss came from a governance change that touched both chains (see the Base page). Apps that bridge from Ethereum and relay L1 governance add the alias and exit checks above.
| Protocol type | What to check first on OP Mainnet |
|---|---|
| Lending market | The sequencer uptime check and grace period before liquidations, feed units and price bounds |
| Deposit receiver or token bridge | The aliased L1 sender, separate handling for EOA deposits, replay protection |
| L1 governance relay | That only the aliased timelock or executor address can trigger L2 actions |
| Vault with exits to Ethereum | What users are told, and what the code does, while L2-to-L1 finalization is paused |
Which vulnerabilities matter most on OP Mainnet?
- Cross-chain message validation: deposits from L1 contracts arrive from an aliased address, and a check against the raw address never matches.
- Access control: an L2 function that trusts an L1 governance contract must check its alias, because a check on the raw L1 address never passes and a missing check lets anyone in.
- Stale oracle prices: a price read during or just after sequencer downtime can be as old as the outage.
- Rounding and precision errors: Sonne lost about $20M on OP Mainnet to a donation into an empty market and rounding in
redeemUnderlying. - Governance attacks: on OP Mainnet anyone could execute the queued Sonne timelock transactions, so the attacker chose their order.
How do you run QuillShield on OP Mainnet code?
- Have the OP Mainnet contracts in a Foundry project. QuillShield supports Solidity in Foundry projects today.
- Bring the code in from GitHub or GitLab.com, a git URL, a Foundry .zip of up to 50 MiB, a folder or a single .sol file.
- In the audit context, list the L1 contracts whose deposits you accept with their aliased addresses, the exits you promise users, and every feed you read.
- Approve the quote once you've seen the exact price. New accounts get $50 in credit, good for up to half of an order.
- When the audit is complete, check each finding's lines, impact, recommended fix and proof of concept result. A separate reviewer agent has already tried to disprove it.
- With a GitHub or GitLab.com repo, connect pull request checks so each later change is reviewed against the security graph from the audit.
A full audit costs from $49, priced from the lines of Solidity in scope on the pricing page. The credit expires after six months.
For a manual review alongside QuillShield, request a manual audit from QuillAudits. The Solidity page shows what QuillShield checks in the language itself.
Start free: sign up and see the exact price for your OP Mainnet contracts.
FAQ
What is address aliasing on OP Mainnet?
When an Ethereum contract sends a message to OP Mainnet, the L2 sees its address plus 0x1111000000000000000000000000000000001111. Messages from EOAs are not aliased (OP Stack specs discussion).
Can withdrawals from OP Mainnet to Ethereum be paused?
Yes. The L1 contracts have a mechanism that lets governance stop L2-to-L1 transactions from being finalized, as Runtime Verification describes.
Is an audit for OP Mainnet valid for the same code on Base?
Only in part. Base now runs its own upgrades, including 200ms blocks, so check timing and withdrawal constants on each chain. The Base page lists the Base-specific checks.
Sources
- What should the value of tx.origin and msg.sender be for L1 to L2 transactions? (discussion 246), ethereum-optimism/specs on GitHub checked 3 December 2026
- Optimism pausability, Runtime Verification checked 3 December 2026
- L2 Sequencer Uptime Feeds, Chainlink docs checked 3 December 2026
- Azul, Base docs checked 3 December 2026
- 200ms blocks, Base docs checked 3 December 2026
- Post Mortem: Sonne Finance Exploit, Sonne Finance checked 3 December 2026
- Sonne Finance Incident Analysis, CertiK checked 3 December 2026