From 03a373cda10bc5a78cf9db611ae3fc5b70921790 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 26 Jul 2024 08:56:25 +0000 Subject: [PATCH 1/3] add broadcastRawTransaction cheatcode --- src/Vm.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Vm.sol b/src/Vm.sol index bc83cb3c4..6081313e9 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -409,6 +409,9 @@ interface VmSafe { /// Gets the address for a given private key. function addr(uint256 privateKey) external pure returns (address keyAddr); + /// Takes a signed transaction and broadcasts it to the network. + function broadcastRawTransaction(bytes calldata data) external; + /// Gets all the logs according to specified filter. function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) external From 55ccc958f3df0178a494a416db0088aa7e860764 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 26 Jul 2024 09:02:05 +0000 Subject: [PATCH 2/3] update interface id --- test/Vm.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Vm.t.sol b/test/Vm.t.sol index cbf433a4a..566865c63 100644 --- a/test/Vm.t.sol +++ b/test/Vm.t.sol @@ -9,7 +9,7 @@ contract VmTest is Test { // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is // added to or removed from Vm or VmSafe. function test_interfaceId() public pure { - assertEq(type(VmSafe).interfaceId, bytes4(0xe745b84f), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0x6b49caaf), "VmSafe"); assertEq(type(Vm).interfaceId, bytes4(0x1316b43e), "Vm"); } } From e3249dbb0055faf19fe98665f3d0daa9074da892 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Fri, 26 Jul 2024 09:13:58 +0000 Subject: [PATCH 3/3] move to scripting section --- src/Vm.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Vm.sol b/src/Vm.sol index 6081313e9..04d8db79e 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -409,9 +409,6 @@ interface VmSafe { /// Gets the address for a given private key. function addr(uint256 privateKey) external pure returns (address keyAddr); - /// Takes a signed transaction and broadcasts it to the network. - function broadcastRawTransaction(bytes calldata data) external; - /// Gets all the logs according to specified filter. function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) external @@ -830,6 +827,9 @@ interface VmSafe { // ======== Scripting ======== + /// Takes a signed transaction and broadcasts it to the network. + function broadcastRawTransaction(bytes calldata data) external; + /// Has the next call (at this call depth only) create transactions that can later be signed and sent onchain. /// Broadcasting address is determined by checking the following in order: /// 1. If `--sender` argument was provided, that address is used.