📈 Get daily crypto insights that make you smarter about your money

Hundred Finance Suffers $7.4 Million Exploit Through Integer Rounding Vulnerability on Optimism

The decentralized finance ecosystem faced another significant security incident on April 15, 2023, as the multi-chain lending protocol Hundred Finance fell victim to a sophisticated exploit on the Optimism layer-2 network. The attack resulted in the loss of approximately $7.4 million worth of cryptocurrency assets, affecting 180 individual wallets and sending shockwaves through the DeFi community.

The Exploit Mechanics

The attacker executed a carefully orchestrated flash loan attack that exploited an integer rounding vulnerability inherent in Hundred Finance’s smart contract logic. The sequence began when the attacker initiated a flash loan through Aave to borrow 500 Wrapped Bitcoin (WBTC). With Bitcoin trading around $30,315 at the time, this represented a substantial borrowing position worth approximately $15 million.

Critically, the attacker identified that the hWBTC lending pool on Hundred Finance had no current lending activity. This empty market condition was the key enabler of the entire exploit. The attacker deposited the borrowed WBTC into the empty pool, minting hWBTC tokens in the process, and then manipulated the protocol’s exchange rate function by depositing just 4 WBTC into a custom-crafted smart contract. Because the pool was previously empty, the exchange rate was abnormally high, and the attacker received an inflated amount of hWBTC tokens in return.

The attacker then transferred the remaining 500 WBTC to the pool, causing a dramatic surge in the value of hWBTC tokens. Since they were the sole holder of hWBTC, this effectively inflated their collateral value. Capitalizing on this artificial collateral, the attacker borrowed 1,021.91 ETH — worth approximately $2.16 million at the time — and repaid the initial flash loan with a tiny fraction of the borrowed ETH, keeping the majority of the stolen assets.

Affected Systems

The attack targeted Hundred Finance’s deployment on the Optimism layer-2 blockchain, a popular scaling solution for Ethereum. The vulnerability was rooted in the protocol’s redeemUnderlying function, which had an integer rounding error that manifested specifically when a market was empty — a condition that should have been guarded against in the contract design.

Notably, the contract code was largely derived from Compound’s codebase, one of the most widely used lending protocol implementations in DeFi. The Solidity version used was 0.5.16, and a calculation library was introduced to prevent overflow during calculations. However, this same library caused an unexpected behavior where the redemption of 500 WBTC required only 1 wei of hWBTC due to rounding-down mathematics inherent to the Ethereum Virtual Machine, which does not support floating-point numbers.

The attack affected 180 individual wallets that had funds deposited in the compromised lending pools on Optimism.

The Mitigation Strategy

In the immediate aftermath, Hundred Finance paused all affected markets to prevent further exploitation and alerted the community through official channels. The team began actively tracking the hacker’s on-chain movements and initiated discussions with multiple blockchain security firms.

The protocol issued a $500,000 open bounty for information leading to the hacker’s arrest and the return of all stolen funds. Hundred Finance also attempted to establish direct communication with the attacker, expressing hope for a mutually agreeable resolution — a strategy that has occasionally succeeded in the DeFi space.

For users affected by the hack who were located in the United States, specifically New York, Hundred Finance set up direct communication channels through their social media accounts and Discord server.

Lessons Learned

The Hundred Finance exploit underscores several critical lessons for the DeFi industry. First, empty or low-liquidity markets present a significant attack surface that must be explicitly addressed in smart contract design. Protocols should implement minimum liquidity thresholds or use time-locked deposits to prevent flash loan-enabled manipulation of empty pools.

Second, integer rounding vulnerabilities remain a persistent threat in Solidity-based smart contracts. Developers must carefully consider edge cases where rounding errors can compound, particularly in exchange rate calculations. Formal verification and comprehensive audits that specifically test empty-state conditions are essential.

Third, the incident highlights the risks of forking established codebases without fully understanding all edge cases. While Compound’s code was designed for markets with sufficient liquidity, deploying the same logic on smaller networks like Optimism — where pools may be empty — introduced vulnerabilities that were not anticipated.

User Action Required

Users who had funds deposited in Hundred Finance’s Optimism markets should monitor the protocol’s official communication channels for updates on fund recovery efforts. The broader DeFi community should exercise caution when depositing funds into lending pools with low liquidity, as these markets are inherently more vulnerable to manipulation attacks.

Developers building lending protocols should implement robust guards against empty-market exploitation, including minimum deposit requirements, exchange rate bounds, and flash loan resistance mechanisms. Security audits should explicitly test for integer rounding edge cases in all mathematical operations.

Disclaimer: This article is for informational purposes only and does not constitute financial or investment advice. Always conduct your own research before engaging with any DeFi protocol.

🌱 FOR BUSINESSES BitcoinsNews.com
Reach 100K+ Crypto Readers
Sponsored content, press releases, banner ads, and newsletter placements. Put your brand in front of Bitcoin's most engaged audience.

10 thoughts on “Hundred Finance Suffers $7.4 Million Exploit Through Integer Rounding Vulnerability on Optimism”

  1. 180 wallets affected and the vulnerability was just integer rounding. compound forks keep getting hit by the same class of bugs

    1. compound forks keep getting hit because nobody patches the original integer bug. they just copy the code and deploy. 180 wallets paid the price

      1. defi_auditor_

        compound forks are the copy paste culture of defi. nobody audits, nobody tests edge cases, just deploy and farm TVL

        1. rekt_economist_

          compound forks are copy paste culture because the audit costs 50k and the TVL opportunity is 5M. the math favors shipping fast over shipping safe

  2. borrowing 500 WBTC on aave to exploit an empty pool. the attacker literally needed like $0 to pull this off, just gas fees

    1. ^ exactly. empty markets on lending protocols are basically a loaded gun. every fork should have minimum liquidity checks

    2. compoundrefugee_

      attacker needed aave not their own capital. flash loans turning defi into a playground for exploiters with zero skin in the game

    3. zero capital exploits are the natural endpoint of flash loan design. aave basically gave attackers a free money printer and nobody talks about adding access controls

    4. zero capital exploits are the scariest thing in defi. you cant even track the attacker because they never risked anything traceable

  3. 180 wallets drained because an empty market had no slippage protection. every lending protocol should hardcode a minimum liquidity floor or pause deposits below a threshold

Leave a Comment

Your email address will not be published. Required fields are marked *

BTC$65,714.00+1.8%ETH$1,728.41+3.3%SOL$71.47+4.7%BNB$614.84+0.6%XRP$1.19+3.7%ADA$0.1809+6.4%DOGE$0.0886+1.7%DOT$1.01+4.2%AVAX$6.77+1.7%LINK$8.23+3.9%UNI$2.62+3.9%ATOM$1.98+1.9%LTC$45.68+3.4%ARB$0.0868+4.2%NEAR$2.40+13.6%FIL$0.8010+3.5%SUI$0.7935+4.5%BTC$65,714.00+1.8%ETH$1,728.41+3.3%SOL$71.47+4.7%BNB$614.84+0.6%XRP$1.19+3.7%ADA$0.1809+6.4%DOGE$0.0886+1.7%DOT$1.01+4.2%AVAX$6.77+1.7%LINK$8.23+3.9%UNI$2.62+3.9%ATOM$1.98+1.9%LTC$45.68+3.4%ARB$0.0868+4.2%NEAR$2.40+13.6%FIL$0.8010+3.5%SUI$0.7935+4.5%
Scroll to Top