opyn Hack

TOTAL LOST $371K
Low Other

Summarize with AI

Affected Chain 2020 Incident surface
Recovered $371K 100.0% returned
All-Time Rank #1087 By amount stolen
Auditors 1 Prior security audit

Incident Overview

The example transaction of the attack:

https://etherscan.io/tx/0xd06378b7…9ef000

This exploit was carried out by using exercise() function with more than two vaults containing ETH as the underlying asset. Because the implementation interprets the same batch of ETH as many batches of ETH receptions, the hacker re-uses that batch of ETH to recover the collateral USDC and profit. Opyn allowed anyone to exercise a vault with underlying assets and oTokens. By burning the oTokens and taking in the underlying assets, the Option Contracts payout collateral assets to the caller of exercise().

The Opyn ETH Put contract must take in the underlying assets and burn oTokens inside the _exercise() method before paying out collateral assets. The transferFrom() function is used to transfer assets from the msg.sender to address(this), which is a very typical approach. When the underlying asset is ETH, the treatment is completely different. In Solidity, msg.value refers to the amount of ETH carried by the current transaction that would be collected by the smart contract with a payable interface (in this example, exercise()).

Incident Report

Protocol / Project opyn
Date of Incident
Attack Technique Other
Classification Other

Protocol Information

Protocol Type Exploit/Other
Affected Token oToken
Official Website www.opyn.co/
Protocol Twitter/X @opyn_

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in opyn's contract logic - root cause: other
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Likely — with a thorough Other audit checklist and test coverage
Audited by OpenZeppelin — still lost $371K. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to opyn, these are the critical security checks that could have prevented this incident (August 2020).

  • Verify all logic paths related to Other are guarded by proper access controls and input validation
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Funds Recovery

100.0%

Recovered

$371K

Net Loss

0

Security Audit History

Sources & References

Learn to Prevent the Next opyn

The opyn hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial