From 592476c71b0b94c931fbbfda2a13bae8bf83b627 Mon Sep 17 00:00:00 2001 From: aaron Date: Wed, 27 Sep 2023 15:51:54 +0800 Subject: [PATCH] Handle when broadcast, have an active prank error. --- src/HuffConfig.sol | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/HuffConfig.sol b/src/HuffConfig.sol index a6f8b09..b2fbcb5 100644 --- a/src/HuffConfig.sol +++ b/src/HuffConfig.sol @@ -214,14 +214,19 @@ contract HuffConfig { cleanup[1] = string.concat("src/", tempFile, ".huff"); // set `msg.sender` for upcoming create context - vm.prank(deployer); - + if (!should_broadcast) { + vm.prank(deployer); + } vm.ffi(cleanup); } /// @notice get creation code of a contract plus encoded arguments - function creation_code_with_args(string memory file) public payable returns (bytes memory bytecode) { + function creation_code_with_args(string memory file) + public + payable + returns (bytes memory bytecode) + { bytecode = creation_code(file); return bytes.concat(bytecode, args); }