# What should a Unichain smart contract audit check?

URL: https://shield.quillaudits.com/chains/unichain/

A Unichain smart contract audit starts from what any OP Stack chain needs and adds what Unichain changes: blocks built with attested ordering by priority fee, and the Uniswap v4 hooks behind pools like the Bunni pool exploited there in 2025. QuillShield audits the Solidity code of a Foundry project that targets Unichain, hooks included.

Last updated 3 December 2026. 5 minute read. By the QuillAudits Team.

## What is different about auditing on Unichain?

Unichain is one of the OP Stack chains of the Superchain, which [Hacken](https://hacken.io/services/superchain-audit-grants/) lists with OP Mainnet and Base, and [CertiK Skynet](https://skynet.certik.com/projects/unichain) describes it as a DeFi-native Ethereum L2 purpose-built for onchain markets. These are the parts that change a review.

- **Priority ordering you can verify.** Unichain integrates TEE attestations into block production, and Flashtestations, which [OpenZeppelin audited](https://www.openzeppelin.com/news/uniswap-flashtestations-audit-1) in August 2025, let anyone check on-chain that a block was built under transparent ordering rules that enforce priority ordering. A transaction that pays a higher priority fee still lands first, so ordering by fee does not stop front-running, and slippage limits and deadlines stay in every swap path.
- **Flashtestations carry trust assumptions.** If a protocol uses builder attestations to decide anything on-chain, OpenZeppelin noted that the `version` and `blockContentHash` inputs are not checked on-chain, and that removing a bad attestation depends on someone calling `invalidateAttestation`.
- **Flashblocks every 200 ms.** In the [same audit](https://www.openzeppelin.com/news/uniswap-flashtestations-audit-1), the team notes that it intends to send one verification call every 200 ms, for each flashblock. Keepers and front ends that act on state at that pace should not treat it as final.
- **DeFi built on Uniswap v4 hooks.** Bunni V2, an AMM built on Uniswap v4 hooks, had a weETH/ETH pool on Unichain when it was exploited in September 2025. [Trail of Bits](https://blog.trailofbits.com/2026/07/30/building-secure-uniswap-v4-hooks/) found that neither the Bunni nor the Cork incident came from a flaw in Uniswap v4 core or the PoolManager, and that both came from authorization and accounting logic the teams built around their hooks.

## What happened in the Bunni exploit on Unichain?

On 2 September 2025 one attack took funds from Bunni V2 pools on Ethereum and on Unichain.

| Protocol | Bunni V2 |
| --- | --- |
| Date | 2 September 2025 |
| Chain | Ethereum and Unichain |
| Loss | about $8.4M across two pools |
| What happened | An attacker took about $8.4M from two Bunni V2 pools, USDC/USDT on Ethereum and weETH/ETH on Unichain. The withdraw function of Bunni rounded its idle balance update down, and the Bunni post-mortem, as The Block reported it, says each rounding direction was safe on its own and the exploit came from combining operations. BlockSec counts 44 tiny withdrawals that shrank a pool balance while burning almost no shares, followed by a sandwich around the distorted pool. |
| Sources | [The Block](https://www.theblock.co/post/369564/bunni-smart-contract-rounding-error), [BlockSec](https://blocksec.com/blog/bunni-incident-repeated-small-withdrawals-compound-a-rounding-error-into-an-8.4m-drain) |

Bunni shut down in October 2025, saying it could not afford a secure relaunch ([The Block](https://www.theblock.co/post/375813/bunni-dex-shuts-down)). The [Uniswap v4 hook audit guide](https://shield.quillaudits.com/use-cases/uniswap-v4-hooks/) walks through the rounding bug step by step.

## Which protocol types need the most care on Unichain?

- Uniswap v4 hooks and the AMMs, vaults and routers built around them, where Trail of Bits places the risk in authorization and accounting logic.
- Swap routers, aggregators and liquidation bots, where ordering by priority fee decides who goes first.
- Protocols that use Flashtestations attestations on-chain, where the inputs that go unchecked are a trust assumption.

## Which vulnerabilities matter most on Unichain?

- **Uniswap v4 hook vulnerabilities.** Callback access, permission flags and delta accounting decide what a hook can do to every swap in its pools ([Uniswap v4 hook vulnerabilities](https://shield.quillaudits.com/learn/vulnerabilities/uniswap-v4-hook-vulnerabilities/)).
- **Rounding and precision errors.** One rounding direction in withdrawals was the root of the Bunni loss ([rounding and precision](https://shield.quillaudits.com/learn/vulnerabilities/rounding-precision-errors/)).
- **Front running.** Priority ordering means the higher fee goes first, so a visible transaction can still be front-run.
- **Sandwich attack.** The Bunni attacker finished with a sandwich around the distorted pool, and a swap without limits is open to the same move.
- **Missing slippage protection.** Under priority ordering, a minimum output and a deadline are what stop a swap from filling at a bad price.

## What should a reviewer check on Unichain?

- Every hook callback: who can call it, which permission flags the hook address encodes, and how deltas are settled.
- The rounding direction in every deposit, withdrawal and balance update, and what many tiny operations in a row do to it.
- A minimum output and a deadline on every swap and liquidity change.
- Any logic that depends on transaction order, tested against an attacker who pays a higher priority fee.
- Any on-chain use of Flashtestations, and what happens when an attestation is stale or invalid.

## How do you run QuillShield on a Unichain project?

QuillShield audits Solidity in Foundry projects, and for a Unichain protocol the scope should be the hook plus everything around it.

1. Before an audit, the [hook scan guide](https://shield.quillaudits.com/guides/scan-a-uniswap-v4-hook-before-an-audit/) gives an agent prompt for a first QuillShield review of a v4 hook.
2. Run the full audit on the hook together with its routers, vaults and accounting code, since that is where Trail of Bits traced the Bunni and Cork losses.
3. In the audit context, say which pools and tokens the hook serves on Unichain and whether any path depends on transaction order. A separate reviewer agent tries to disprove each finding, and full audits add a proof of concept result.
4. Keep [pull request checks](https://www.quillaudits.com/quillshield/guides/guides/ci-cd-checks) on, because a change to one rounding direction can be a one-line diff.

A hook and router codebase of 1,000 lines costs $379 as of November 2026 ([pricing](https://shield.quillaudits.com/pricing/)), shown to you before anything is charged. New accounts get $50 in credit, good for up to half of an order.

QuillShield does not replace a manual audit. [Request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit) for a hook going to mainnet, [talk to an auditor](https://calendly.com/akshadh-a-quillaudits/30min), or [start free](https://shield.quillaudits.com/register).

## FAQ

### Does priority ordering on Unichain prevent front-running?

It doesn't, because transactions are ordered by priority fee and a front-runner who pays more still goes first. Keep slippage limits and deadlines in every swap path.

### What happened to Bunni on Unichain?

On 2 September 2025 an attacker took about $8.4M from two Bunni V2 pools, one of them weETH/ETH on Unichain, through a rounding direction in withdrawals. Bunni shut down in October 2025, saying it could not afford a secure relaunch.

### Is Unichain an OP Stack chain?

Yes, Hacken lists it with OP Mainnet and Base among the Superchain chains that its OP Stack audit grants cover.

### Can QuillShield audit a Uniswap v4 hook for Unichain?

Yes, when the hook is Solidity in a Foundry project. Run a full audit before launch, keep pull request checks on for later changes, and request a manual audit from QuillAudits for a mainnet release.

## Sources

- [Superchain audit grants, Hacken](https://hacken.io/services/superchain-audit-grants/) · checked 3 December 2026
- [Unichain project page, CertiK Skynet](https://skynet.certik.com/projects/unichain) · checked 3 December 2026
- [Uniswap Flashtestations audit, OpenZeppelin](https://www.openzeppelin.com/news/uniswap-flashtestations-audit-1) · checked 3 December 2026
- [Building secure Uniswap v4 hooks, Trail of Bits](https://blog.trailofbits.com/2026/07/30/building-secure-uniswap-v4-hooks/) · checked 24 November 2026
- [Bunni cites smart contract rounding error for $8.4 million flash loan exploit, The Block](https://www.theblock.co/post/369564/bunni-smart-contract-rounding-error) · checked 24 November 2026
- [Bunni incident: repeated small withdrawals compound a rounding error into an $8.4M drain, BlockSec](https://blocksec.com/blog/bunni-incident-repeated-small-withdrawals-compound-a-rounding-error-into-an-8.4m-drain) · checked 24 November 2026
- [Bunni DEX shuts down after $8.4 million exploit, The Block](https://www.theblock.co/post/375813/bunni-dex-shuts-down) · checked 24 November 2026
