diff --git a/src/Vm.sol b/src/Vm.sol index 20f91a14..d98d0812 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); @@ -777,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 @@ -788,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 @@ -800,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 @@ -811,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 @@ -818,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 @@ -1928,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); @@ -1998,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 @@ -2360,13 +2372,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( 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"); } }