From 8efe3526b600952dc35841673dae83e48b11eb4a Mon Sep 17 00:00:00 2001 From: Vectorized Date: Mon, 27 Oct 2025 14:46:17 +0000 Subject: [PATCH] Fix fuzz test, add comment --- test/Lifebuoy.t.sol | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/Lifebuoy.t.sol b/test/Lifebuoy.t.sol index 2141368c5c..483d32c372 100644 --- a/test/Lifebuoy.t.sol +++ b/test/Lifebuoy.t.sol @@ -54,11 +54,15 @@ contract LifebuoyTest is SoladyTest { assertEq(_deployViaCreate(deployer, initcode), expected); } - function testLifebuoyCreateDeployment(address deployer, address owner, uint256 r) public { - while (deployer.code.length != 0 || uint160(deployer) < 0xffffffffff) { - deployer = _randomNonZeroAddress(); - } + function testLifebuoyCreateDeployment(address owner, uint256 r) public { + // We have to avoid using an address passed in via fuzz args, + // cuz etching to `console.log` address will break this test. + address deployer = _randomHashedAddress(); + + // This is a minimal contract that uses the 'CREATE' opcode to deploy + // the calldata and returns the addesss. vm.etch(deployer, hex"3d3d363d3d37363d34f09052602081f3"); + for (uint256 i; i != 3; ++i) { r = r >> 32; if (r & 31 == 0) {