From b175b46db6c73375d5ded53812dfbf5ba1ec5c54 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 10 Nov 2025 13:29:52 +0100 Subject: [PATCH 1/3] fix fmt --- src/Vm.sol | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/Vm.sol b/src/Vm.sol index 20f91a14..ad5e960c 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -372,12 +372,10 @@ interface VmSafe { /// Derive a private key from a provided mnemonic string (or mnemonic file path) in the specified language /// at `{derivationPath}{index}`. - function deriveKey( - string calldata mnemonic, - string calldata derivationPath, - uint32 index, - string calldata language - ) external pure returns (uint256 privateKey); + function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index, string calldata language) + external + pure + returns (uint256 privateKey); /// Derives secp256r1 public key from the provided `privateKey`. function publicKeyP256(uint256 privateKey) external pure returns (uint256 publicKeyX, uint256 publicKeyY); @@ -2360,13 +2358,8 @@ interface Vm is VmSafe { /// Prepare an expected anonymous log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData.). /// Call this function, then emit an anonymous event, then call a function. Internally after the call, we check if /// logs were emitted in the expected order with the expected topics and data (as specified by the booleans). - function expectEmitAnonymous( - bool checkTopic0, - bool checkTopic1, - bool checkTopic2, - bool checkTopic3, - bool checkData - ) external; + function expectEmitAnonymous(bool checkTopic0, bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) + external; /// Same as the previous method, but also checks supplied address against emitting contract. function expectEmitAnonymous( From 61639b9b3cf16878a4a7a5c7adf35748e2bce403 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 10 Nov 2025 13:30:45 +0100 Subject: [PATCH 2/3] bump vm --- src/Vm.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Vm.sol b/src/Vm.sol index ad5e960c..d98d0812 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -775,10 +775,12 @@ interface VmSafe { /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. function deployCode(string calldata artifactPath) external returns (address deployedAddress); /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts abi-encoded constructor arguments. function deployCode(string calldata artifactPath, bytes calldata constructorArgs) external @@ -786,11 +788,13 @@ interface VmSafe { /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts `msg.value`. function deployCode(string calldata artifactPath, uint256 value) external returns (address deployedAddress); /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts abi-encoded constructor arguments and `msg.value`. function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value) external @@ -798,10 +802,12 @@ interface VmSafe { /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. function deployCode(string calldata artifactPath, bytes32 salt) external returns (address deployedAddress); /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts abi-encoded constructor arguments. function deployCode(string calldata artifactPath, bytes calldata constructorArgs, bytes32 salt) external @@ -809,6 +815,7 @@ interface VmSafe { /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts `msg.value`. function deployCode(string calldata artifactPath, uint256 value, bytes32 salt) external @@ -816,6 +823,7 @@ interface VmSafe { /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the /// artifact in the form of :: where and parts are optional. + /// Reverts if the target artifact contains unlinked library placeholders. /// Additionally accepts abi-encoded constructor arguments and `msg.value`. function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value, bytes32 salt) external @@ -1926,6 +1934,9 @@ interface VmSafe { /// Returns ENS namehash for provided string. function ensNamehash(string calldata name) external pure returns (bytes32); + /// RLP decodes an RLP payload into a list of bytes. + function fromRlp(bytes calldata rlp) external pure returns (bytes[] memory data); + /// Gets the label for the specified address. function getLabel(address account) external view returns (string memory currentLabel); @@ -1996,6 +2007,9 @@ interface VmSafe { /// Encodes a `string` value to a base64 string. function toBase64(string calldata data) external pure returns (string memory); + + /// RLP encodes a list of bytes into an RLP payload. + function toRlp(bytes[] calldata data) external pure returns (bytes memory); } /// The `Vm` interface does allow manipulation of the EVM state. These are all intended to be used From 6cca5424c2085a3982da9f97da62e63e72f1167d Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Mon, 10 Nov 2025 13:36:48 +0100 Subject: [PATCH 3/3] fix interface --- 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 c0840d03..4b6e48a4 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(0xc6a84458), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0x7f58f7be), "VmSafe"); } }