From 5482494655d791438c02b4ac756ef4fb7e7d80cb Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:43:34 +0530 Subject: [PATCH] feat: `vm.getWallets()` (#620) Companion PR for https://github.com/foundry-rs/foundry/pull/9052 Adds the cheatcode `function getWallets() external returns (address[] memory wallets)` --- src/Vm.sol | 3 +++ test/Vm.t.sol | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Vm.sol b/src/Vm.sol index 753784d..0f2dc50 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -996,6 +996,9 @@ interface VmSafe { /// Stops collecting onchain transactions. function stopBroadcast() external; + /// Returns addresses of available unlocked wallets in the script environment. + function getWallets() external returns (address[] memory wallets); + // ======== String ======== /// Returns the index of the first occurrence of a `key` in an `input` string. diff --git a/test/Vm.t.sol b/test/Vm.t.sol index dccf50b..8642067 100644 --- a/test/Vm.t.sol +++ b/test/Vm.t.sol @@ -13,6 +13,6 @@ contract VmTest is Test { } function test_VmSafeInterfaceId() public pure { - assertEq(type(VmSafe).interfaceId, bytes4(0x6beed0a1), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0xb09496a4), "VmSafe"); } }