Onyx Protocol oPEPE Empty-Market Donation Exploit (2023-11-01)
- Name: Onyx Protocol oPEPE empty-market donation exploit
- Date: 2023-11-01
- Protocol: Onyx Protocol
- Chain: Ethereum
- Category: empty-market exchange-rate inflation / precision-loss redemption / cross-market lending drain
- Loss: about $2.1 million
- Summary: The attacker executed Onyx governance proposal
OIP-22to list the newoPEPEmarket, then launched the first main exploit transaction exactly 60 seconds later: the proposal execution landed in Ethereum block18476508, and the first exploit tx followed in block18476513. Inside that fresh listing they recreated the post-Hundred empty-market exploit path. They minted a tinyoPEPEposition, redeemed almost all of it so only2 weiofoPEPEsupply remained, donated roughly2.52T PEPEdirectly into theoPEPEcontract to print an enormous exchange rate, borrowed stronger assets from sibling Onyx markets, and then used truncation in redemption math to pull the donated PEPE back out while burning only1 weiofoPEPE. The result was about1,156.9 ETHplus other tokens of bad debt across the rest of the protocol. The sharper launch lesson is thatmarket deployedand evensomeone deposited firstdid not create any durable supply floor; governance had opened a fresh market whose first meaningful actor still got to define the opening solvency state. - Trigger / entry point:
OIP-22added the PEPE market to Onyx without protective seed liquidity or a collateral quarantine, and the attacker executed that passed proposal themselves in transaction0xb91e0731a0f1eb0abf884717a065f7282a5daaacd172a0db8d4a61609c978ed8.- The new
oPEPEproxy at0x5fdbcd61bc9bd4b6d3fd1f49a5d253165ea11750inherited Compound-v2-style exchange-rate math that trusts raw underlying balance viagetCash(). - Because the market launched empty, the first meaningful user could drive
oPEPEsupply down to2 wei, making the exchange rate hyper-sensitive to direct PEPE donations. - Once the exchange rate was inflated, Onyx still accepted the manipulated
oPEPEcollateral for borrows from deeper-liquidity sibling markets.
- Root cause:
- Onyx listed a fresh Compound-style market without dead shares, immutable seed liquidity, or another supply floor that would have prevented near-zero
totalSupply. - The market’s solvency-critical exchange rate could be inflated by direct PEPE transfers that raised contract cash without minting proportional new
oPEPE. - Redemption math still contained the same tiny-supply truncation failure that had already been weaponized against Hundred Finance and other forks: at extreme exchange rates, almost
2 weiof shares could be economically required while integer division rounded the burn down to1 wei. - The deeper lifecycle failure was that a passed governance listing was treated as if the market had already earned collateral relevance. Deployment and first-use did not establish a durable opening state; they only exposed an attacker-ownable fresh market to the first actor who arrived.
- In short: governance opened a new empty market, the accounting let the first user print collateral value inside it, and precision loss turned that printed value back into withdrawable underlying.
- Onyx listed a fresh Compound-style market without dead shares, immutable seed liquidity, or another supply floor that would have prevented near-zero
- Exploit path:
- The attacker address
0x085bdff2c522e8637d4154039db8746bb8642bffmonitored proposalOIP-22, executed it through Onyx governance in block18476508, and then launched the main exploit exactly 60 seconds later in transaction0xf7c21600452939a81b599017ee24ee0dfd92aaaccd0a55d02819a7658a6ef635(block18476513). - They flash-borrowed
4,000 WETHfrom Aave, swapped it into roughly2.520870348093423681390050791472T PEPE, and routed the PEPE through helper contracts. - Using a helper at
0xf8e15371832aed6cd2741c572b961ffeaf751eaa, the attacker supplied1 PEPEand received5,000,000,000,000,000,000,000,000,000rawoPEPEunits (50,000,000,000,000,000,000oPEPEat 8 decimals). They then redeemed almost all of it so the market was left with only2 weiofoPEPEsupply. - They transferred roughly
2,520,870,348,093 PEPEdirectly intooPEPE, inflatingexchangeRate = (cash + borrows - reserves) / totalSupplyto an absurd level becausetotalSupplywas now2. - With the manipulated
oPEPEentered as collateral, the attacker borrowed about334 ETHin one loop and then repeated the pattern across additional Onyx markets, ultimately extracting about1,156.9 ETHplus roughly$60KinMATIC,UNI,APE,USDP, andWETHin the two main drain transactions. - The critical cash-out step came when the attacker redeemed almost all donated PEPE back out. With exchange rate near
1,260,435,174,046,711,840,695,025,395,736, redeeming2,520,870,348,093,423,681,390,050,791,470units of underlying required nearly2 weiofoPEPEeconomically, but integer truncation burned only1 wei. - The attacker then liquidated the residual PEPE debt position, repeated the loop against sibling markets, swapped proceeds back to ETH, repaid the flash loan, and retained the remainder as profit.
- The attacker address
- What the attacker needed to be true:
- The new
oPEPEmarket had to launch without dead shares or non-redeemable seed liquidity. - Direct PEPE transfers into the market contract had to increase solvency-critical
cashimmediately. - Onyx had to accept the inflated
oPEPEexchange rate as real collateral value quickly enough for cross-market borrowing. - Redemption math had to round in the attacker’s favor once supply was pushed down to
2 wei. - Sibling markets needed enough liquid reserves for fake
oPEPEsolvency to turn into real ETH and other borrowable assets.
- The new
- Technical anatomy worth remembering:
- This was not a novel bug; it was a fast replay of the empty-market Compound-fork exploit family after governance listed a fresh market without fixing the already-known launch hygiene problem.
- The governance step matters. The attacker did not need to seize governance; they only needed to watch a legitimate passed proposal and be the first actor through the newly opened attack surface. Onchain, that first-actor window was not metaphorical: the proposal execution and the first exploit tx were only five blocks and 60 seconds apart.
- The direct donation was only the inflation leg. The money was made by pairing that inflated exchange rate with cross-market collateralization and a truncating redemption path.
- Onyx shows how market-listing operations themselves are part of lending security: a proposal that is safe in broad terms can still be unsafe in its first minutes of execution.
- Representative transactions and artifacts:
- Attacker EOA:
0x085bdff2c522e8637d4154039db8746bb8642bff - First main exploit tx:
0xf7c21600452939a81b599017ee24ee0dfd92aaaccd0a55d02819a7658a6ef635(block18476513,2023-11-01 09:58:47 UTC) - Second drain tx:
0x27a3788d504af542681436bfdecf1823f7a8a691d04309ad33e6d3825e899746(block18476677,2023-11-01 10:32:11 UTC) - Proposal execution tx (
OIP-22):0xb91e0731a0f1eb0abf884717a065f7282a5daaacd172a0db8d4a61609c978ed8(block18476508,2023-11-01 09:57:47 UTC) - Governance proposal creation tx:
0x309f437ece123ee77b5cc2435783578424bb4e30448dedf6f845bd0c2a4e40a6(block18449299,2023-10-28 14:29:11 UTC) oPEPEproxy:0x5fdbcd61bc9bd4b6d3fd1f49a5d253165ea11750oPEPEimplementation:0x9dcb6bc351ab416f35aeab1351776e2ad295abc4- Governance contract:
0xdec2f31c3984f3440540dc78ef21b1369d4ef767
- Attacker EOA:
- Response / mitigation:
- The incident reinforced that Compound-v2 forks needed explicit empty-market hardening after Hundred rather than relying on normal market launch assumptions.
- It also showed that governance execution needs market-initialization safeguards: passed listings should not become immediately collateral-eligible without protected seeding or temporary isolation.
- Secondary writeups also noted that the issue had already been identified in prior audit work, including recommendations to mint or retain fresh supply at deployment rather than leave a zero-liquidity opening state. That made Onyx look less like a surprise and more like a known launch-state defect left live.
- The healthier mitigation is therefore sharper than
someone should seed the market quickly: a fresh listing needs either an irreversible floor that survives runtime reality or a still-binding collateral quarantine until real supplier breadth exists.
Three launch-authority promotions this incident collapsed
- A governance-approved market was still only an attacker-owned opening denominator
OIP-22execution madeoPEPEreachable, but it did not make the market economically mature.- The first meaningful user could still decide the opening capitalization table by minting, redeeming down to dust, and leaving only
2 weiofoPEPEsupply outstanding. - The important failure was not merely
PEPE got listed. It was that governance opened a market whose first live denominator was still attacker-authorable.
- That attacker-shaped opening state was still promoted into canonical collateral truth
- Direct PEPE donation into
oPEPEincreased rawgetCash()without minting proportional shares. - Onyx then converted that balance change into exchange-rate truth and exposed the result as ordinary collateral value, as if the market’s opening state had already earned money-good accounting status.
- The dangerous promotion was therefore not only
the market reports an exchange rate, butthis fresh, attacker-shaped exchange rate now counts as real solvency input for the rest of the protocol.
- That published fresh-market truth still inherited immediate sibling-market spending authority
- Deeper Onyx markets honored the manipulated
oPEPEmark quickly enough for the attacker to borrow ETH and other assets before any launch-window distrust boundary intervened. - The later under-burn in redemption math mattered because the protocol had already crossed the decisive line: a first-minute, first-actor, dust-supply market still retained cross-market borrowing and liquidation authority.
- The durable lesson is that
governance approved a listing,the protocol published one opening-state accounting object, andthat object may already spend sibling liquidityare three different promotions. Onyx failed all three.
Pattern tags
- empty-market-exchange-rate-inflation
- fresh-market-initialization-failure
- The preserved shape is sharper than generic
PEPE memecoin listing got exploited: Onyx let a governance-created market move fromproposal executedtoborrow-relevantwhile the opening denominator was still attacker-ownable dust, then reused the familiar Compound-v2 donation-plus-under-burn path inside that fresh listing window. - This is also a clean
launch happened, bootstrap never really finishedfailure. Onyx did not just inherit vulnerable exchange-rate and redemption math; it treatedmarket deployedandsomeone can mint nowas if they were already evidence of a durable supply floor and collateral-ready maturity.
Why the exploit worked
- Onyx granted a freshly listed PEPE market full collateral relevance before any irreversible denominator existed. Once
OIP-22executed, the first meaningful user could still decide what the market’s opening supply looked like, which meant the attacker inherited governance’s unfinished initialization state instead of attacking an already mature collateral object. - In that state, direct PEPE donation became solvency authorship. Raw token balance flowed into
getCash(),getCash()flowed into exchange-rate math, and the resulting printedoPEPEvalue was accepted as ordinary collateral truth by sibling markets even though no proportional new shares had been minted. - The rounding bug then completed the cash-out path rather than standing alone. Without the
redeemUnderlying-style under-burn, the attacker could have printed fake collateral but would have had a harder time recovering the donated PEPE; without the fresh-market dust-supply state, the same truncation would not have been economically meaningful. The exploit paid because launch sequencing, donation-sensitive pricing, and attacker-favorable burn math all lined up in one newly opened market. - The governance detail matters because the exploiter did not need to corrupt or capture the proposal process. They only needed to be the first serious actor after a legitimate listing became live. The protocol therefore failed at the exact lifecycle edge where
approved by governancewas treated as if it already meantsafe to define cross-market solvency. - That makes Onyx a clean operations-boundary case too: an authorized market-listing action was still allowed to behave like live balance-sheet authority. Governance execution was not just admin plumbing; it directly published borrow-relevant collateral truth before the opening denominator stopped being attacker-ownable.
- The preserved design lesson is broader than
fix the math: durable seed-floor design, launch-window collateral quarantine, governance execution sequencing, and tiny-supply redemption arithmetic were one security object, and Onyx split them apart.
Detection and audit pivots
- Ask whether market listing and collateral admission are one atomic safe lifecycle or merely adjacent governance actions. If a passed proposal can create a market that is reachable before an irreversible floor or quarantine exists, the most dangerous actor is often just the first user after execution.
- Reconstruct the publication path from raw PEPE balance to borrow power:
underlying transfer -> getCash() -> exchange rate -> collateral valuation. If direct donations can move that whole chain faster than proportional share issuance or collateral quarantine can respond, the market is still attacker-authored at launch. - Test fresh-market exploitability explicitly, not only dormant-market replay. The key simulation is
first meaningful mint -> redeem to dust -> direct donation -> borrow -> redeem underlying under extreme exchange rate, with supply pinned at2 weior similar microscopic states. - Check whether seed liquidity is durable or ceremonial. If the intended defense is
someone will seed it quickly,ops will execute right after governance, orwe can always add the first liquidity ourselves, the protocol still lacks an onchain answer to who owns the opening denominator when the team loses the race. - Look for a downstream distrust boundary. Can a just-listed memecoin market stay deployable while collateral factor remains
0, debt caps remain tiny, or recursive borrowing stays off until real breadth exists? If not, governance is still allowed to publish a market before the protocol can safely trust it.
Failure-prevention checklist
- Treat governance listing as the start of a quarantine lifecycle, not the end of review. A newly executed market proposal should stay collateral-factor
0, borrow-capped to dust, or otherwise locally isolated until irreversible seed liquidity and healthy supplier breadth already exist onchain. - Make the opening denominator non-reversible. Dead shares, non-redeemable seed liquidity, or another durable supply-floor design should prevent a fresh market from ever returning to an attacker-owned
2 weistate after the first mint / redeem sequence. - Keep direct donations from publishing collateral truth. If raw PEPE transfers can raise
getCash()and therefore exchange rate without minting proportionaloPEPE, then unsolicited balance changes are still solvency-authoritative writes. - Test the whole launch-window exploit pipeline as one object: proposal execution, first-user mint, redeem-to-dust, direct donation, cross-market borrow, under-burn redemption, and liquidation/reset steps should all fail safely together.
- Encode effective-freshness checks, not just initial-launch checks. If supplier breadth is microscopic, the market should automatically fall back into the same distrust mode regardless of whether it is one block old or one month old.
- Treat memecoin side listings as balance-sheet policy decisions. Thin-float assets should not gain full cross-market borrow authority merely because governance approved a listing and one user managed to seed the market first.
- Put blast-radius controls under the market anyway: small debt caps, temporary collateral disablement, and exchange-rate jump alarms should stop one fresh listing from draining deeper sibling pools before ops can react.
Audit prompts
- After a listing proposal executes, what exact onchain fact proves the new market is mature enough to define cross-market solvency rather than merely exist?
- Can the first meaningful actor still choose the denominator by minting, redeeming to dust, and then donating underlying before any irreversible floor or quarantine binds?
- Which balance changes flow from
PEPE transfertogetCash()toexchangeRateStoredto collateral valuation, and where is unsolicited balance growth supposed to be neutralized? - If the intended defense is
ops will seed right awayorsomeone can deposit first, what stops an attacker from simply winning that first-user race the way Onyx’s exploiter did within five blocks? - At pathological states like
2 weiofoPEPEsupply, how many shares shouldredeemUnderlyingburn economically, and where does floor division still let the protocol burn less than that? - Which controls would have stopped the exploit after proposal execution but before bad debt reached sibling markets: launch quarantine, non-burnable seed supply, collateral-factor delay, debt caps, or exchange-rate sanity clamps?
- If the market later becomes thin again, what exact mechanism demotes it back into effectively fresh quarantine instead of assuming that age alone means safety?
Lessons that should already be standard
Proposal executedis not the same thing asmarket safely initialized. Governance can authorize a new attack surface faster than the protocol can make that surface economically mature.- The first meaningful user is part of the threat model. If the opening denominator is attacker-choosable, then launch order is already security-critical state.
- Authorized listing actions should not be live money-good setters. If proposal execution can both create the market and publish borrow-relevant collateral truth, governance has become a launch-time balance-sheet oracle.
- Direct donation is already collateral authorship when raw token balance feeds exchange rate. Calling the transfer
external liquiditydoes not make it economically earned collateral. - Fresh-market bugs are not only arithmetic bugs. Supply-floor design, collateral-enable sequencing, and tiny-supply redemption math either defend together or fail together.
- Memecoin or long-tail listings deserve stronger distrust boundaries, not more optimism. Thin-float collateral should have to earn borrow relevance through real breadth, not inherit it from governance paperwork.
- The dangerous window can be the first minute live. If a protocol cannot survive an adversarial first actor immediately after listing, then the rollout is incomplete.
Why this incident matters
- Onyx is the cleanest
freshly listed memecoin marketreplay of the Hundred-family bug: same empty-market arithmetic, but with the extra operational lesson that the attacker can simply wait for governance to open the door. - It preserves the first-interactor version of the pattern, where launch sequencing rather than long-neglected dormant markets creates the empty-state opening.
- It is also a useful negative exemplar for fresh-market rollout discipline: a passed proposal, deployed market, and first deposit still did not amount to a durable supply floor or a reserve that deserved cross-market solvency authority.
- The case is a reminder that exploit surface is temporal as well as structural: the most dangerous moment for a new market can be its first minute live.
Internal linkages
- Core recurring pattern: empty-market-exchange-rate-inflation — the canonical Compound-v2 donation-plus-under-burn family that Onyx replayed inside a fresh PEPE listing.
- Launch-window subpattern: fresh-market-initialization-failure — the sharper lifecycle lens for why governance execution created a market whose opening denominator was still attacker-authorable.
- Positive-design companion: fresh-market-seeding-and-activation-discipline — the sharper upstream design follow-up is why
market listedandsomeone deposited firststill did not create a durable opening state before PEPE became borrow-relevant. - Positive-design companion: bootstrap-state-irreversibility-and-supply-floor-design — the lifecycle-side follow-up is why a fresh market’s opening denominator must become irreversible instead of remaining attacker-ownable dust after launch.
- Positive-design companion: effective-freshness-reclassification-and-dormant-market-quarantine — the broader lifecycle follow-up is why
listed by governanceis not the same thing aseconomically mature enough to define cross-market solvency, especially for low-breadth meme-token side markets. - Positive-design companion: collateral-admission-lag-and-borrow-side-quarantine — the downstream follow-up is why a just-listed PEPE market was allowed to become borrow-relevant before irreversible seed liquidity and a safe opening state existed onchain.
- Rollout / governance-ops companion: operator-experimentation-separation-from-live-balance-sheet-authority — the sharper operations lesson is that a legitimate listing execution path was still allowed to publish live collateral truth before the market’s opening state had become economically trustworthy.
Control surface
-
The decisive leverage sat in governance-controlled market listing, missing seed-liquidity / dead-share launch hygiene, raw-balance-sensitive exchange-rate math, and cross-market collateral policy that priced a two-wei market as if it were real solvency.
-
Onyx did not just inherit a rounding bug. It inherited a full exploit pipeline and then reopened it at market launch.
-
Sources:
- https://etherscan.io/tx/0x309f437ece123ee77b5cc2435783578424bb4e30448dedf6f845bd0c2a4e40a6
- https://etherscan.io/tx/0xb91e0731a0f1eb0abf884717a065f7282a5daaacd172a0db8d4a61609c978ed8
- https://etherscan.io/tx/0xf7c21600452939a81b599017ee24ee0dfd92aaaccd0a55d02819a7658a6ef635
- https://etherscan.io/tx/0x27a3788d504af542681436bfdecf1823f7a8a691d04309ad33e6d3825e899746
- https://etherscan.io/address/0x5fdbcd61bc9bd4b6d3fd1f49a5d253165ea11750
- https://etherscan.io/address/0xdec2f31c3984f3440540dc78ef21b1369d4ef767
- https://metatrust.io/blogs/post/how-onyxs-governance-and-vulnerability-became-hackers-golden-shovels
- https://www.certik.com/blog/post-mortem-onyx-protocol
- https://beosin.com/resources/analysis-of-218million-loss-in-hacker-attack-on-onyxprotocol
- https://blog.solidityscan.com/onyx-protocol-hack-analysis-372facda4a55/
-
Last reviewed: 2026-08-03 UTC