multi-agent-smart-contracts / test_regex2.js
Tales-Cunha
Fix: change the agent
a23bb47
Raw
History Blame Contribute Delete
524 Bytes
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.includes("// target = address(new") ||
code.match(/\/\/\s*([a-zA-Z0-9_]+)\s*=\s*(address\()?new\s+[a-zA-Z0-9_]+/);
console.log(!!isTargetNotDeployed);