diff --git a/src/Vm.sol b/src/Vm.sol index cd883706..c028bc80 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -430,6 +430,13 @@ interface VmSafe { /// Signs `digest` with `privateKey` using the secp256r1 curve. function signP256(uint256 privateKey, bytes32 digest) external pure returns (bytes32 r, bytes32 s); + /// Signs `digest` with `privateKey` on the secp256k1 curve, using the given `nonce` + /// as the raw ephemeral k value in ECDSA (instead of deriving it deterministically). + function signWithNonceUnsafe(uint256 privateKey, bytes32 digest, uint256 nonce) + external + pure + returns (uint8 v, bytes32 r, bytes32 s); + /// Signs data with a `Wallet`. function sign(Wallet calldata wallet, bytes32 digest) external returns (uint8 v, bytes32 r, bytes32 s); @@ -646,6 +653,10 @@ interface VmSafe { /// See https://github.com/foundry-rs/foundry/issues/6180 function getChainId() external view returns (uint256 blockChainId); + /// Returns the test or script execution evm version. + /// **Note:** The execution evm version is not the same as the compilation one. + function getEvmVersion() external pure returns (string memory evm); + /// Gets the map key and parent of a mapping at a given slot, for a given address. function getMappingKeyAndParentOf(address target, bytes32 elementSlot) external @@ -681,6 +692,12 @@ interface VmSafe { /// Returns an array of `StorageAccess` from current `vm.stateStateDiffRecording` session function getStorageAccesses() external view returns (StorageAccess[] memory storageAccesses); + /// Returns an array of storage slots occupied by the specified variable. + function getStorageSlots(address target, string calldata variableName) + external + view + returns (uint256[] memory slots); + /// Gets the gas used in the last call from the callee perspective. function lastCallGas() external view returns (Gas memory gas); @@ -711,6 +728,10 @@ interface VmSafe { external returns (bytes memory data); + /// Set the exact test or script execution evm version, e.g. `berlin`, `cancun`. + /// **Note:** The execution evm version is not the same as the compilation one. + function setEvmVersion(string calldata evm) external; + /// Records the debug trace during the run. function startDebugTraceRecording() external; diff --git a/test/Vm.t.sol b/test/Vm.t.sol index 1b99e3db..c0840d03 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(0xe02727c3), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0xc6a84458), "VmSafe"); } }