File size: 440 Bytes
a23bb47
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
const code = `
    function setUp() public virtual {
        // target = address(new Target());
        vm.startPrank(ATTACKER);
        vm.deal(ATTACKER, 100 ether);
    }
`;
const isTargetNotDeployed = code.includes("// target = new") || 
                            code.includes("//Target target = new") || 
                            code.match(/\/\/\s*([a-zA-Z0-9_]+)\s*=\s*new\s+[a-zA-Z0-9_]+/);
console.log(!!isTargetNotDeployed);