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.
180 wallets affected and the vulnerability was just integer rounding. compound forks keep getting hit by the same class of bugs
compound forks keep getting hit because nobody patches the original integer bug. they just copy the code and deploy. 180 wallets paid the price
compound forks are the copy paste culture of defi. nobody audits, nobody tests edge cases, just deploy and farm TVL
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
borrowing 500 WBTC on aave to exploit an empty pool. the attacker literally needed like $0 to pull this off, just gas fees
^ exactly. empty markets on lending protocols are basically a loaded gun. every fork should have minimum liquidity checks
attacker needed aave not their own capital. flash loans turning defi into a playground for exploiters with zero skin in the game
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
zero capital exploits are the scariest thing in defi. you cant even track the attacker because they never risked anything traceable
180 wallets drained because nobody thought to add a minimum liquidity check. this bug class was known since the bZx exploits in 2020. three years later same vulnerability different protocol
Pavel R. bZx in 2020 then Hundred in 2023. three years apart same empty market exploit. protocols keep forking compound without the patches and nobody learns
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
safu_dev_ minimum liquidity floors would help but the real fix is pausing new markets below a threshold. aave does this on some deployments, compound forks just skip it
500 WBTC flash loan from aave to drain an empty pool. the attack cost was basically gas. lending protocols need flash loan caps or this keeps happening
500 WBTC flash loan from Aave to drain an empty pool worth basically nothing. the attacker used $15M of borrowed capital to exploit a protocol with no liquidity. peak DeFi absurdity
Konrad Z. the real issue is Hundred Finance deployed the market without testing the empty state. one unit test would have caught this. compound forks skip QA like its optional
the $7.4M attack cost the attacker basically gas fees. this exploit will keep happening until lending protocols actually patch their integer rounding bugs
reading the victim comments and 180 wallets got drained because nobody tested an empty pool scenario. classic copy-paste deployment
this is why institutional money stays away from defi. even after all these years, basic contract vulnerabilities still drain millions
Birk A. bZx in 2020 then Hundred in 2023. three years apart same empty market exploit. compound forks are copy paste with zero QA and everybody acts surprised
bzx_echo_ three years apart same exploit is the real indictment. compound forks treat security audits as a launch checklist item not an ongoing process
flash_cap above mentioned flash loan caps. aave should add exploiter blacklisting after incidents like this but that goes against the whole permissionless ethos
Saanvi R. aave adding blacklists defeats the purpose but at some point protocols need circuit breakers. hundred finance had zero protection on an empty market and 180 wallets paid for it
180 wallets affected and the attacker spent maybe $50 in gas. the asymmetry between attack cost and damage is why this keeps happening