Skip to content

Commit 9838df8

Browse files
Evalirmds1
andauthored
feat(vm): add mapping slot cheatcodes (#448)
* feat: add mapping slot cheatcodes * chore: name return params --------- Co-authored-by: Matt Solomon <[email protected]>
1 parent fe9d28a commit 9838df8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Vm.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@ interface VmSafe {
393393
function pauseGasMetering() external;
394394
// Resumes gas metering (i.e. gas usage is counted again). Noop if already on.
395395
function resumeGasMetering() external;
396+
// Starts recording all map SSTOREs for later retrieval.
397+
function startMappingRecording() external;
398+
// Stops recording all map SSTOREs for later retrieval and clears the recorded data.
399+
function stopMappingRecording() external;
400+
// Gets the length of a mapping at a given slot, for a given address.
401+
function getMappingLength(address target, bytes32 slot) external returns (uint256 length);
402+
// Gets the element at index idx of a mapping at a given slot, for a given address.
403+
function getMappingSlotAt(address target, bytes32 slot, uint256 idx) external returns (bytes32 value);
404+
// Gets the map key and parent of a mapping at a given slot, for a given address.
405+
function getMappingKeyAndParentOf(address target, bytes32 slot)
406+
external
407+
returns (bool found, bytes32 key, bytes32 parent);
396408
// Writes a breakpoint to jump to in the debugger
397409
function breakpoint(string calldata char) external;
398410
// Writes a conditional breakpoint to jump to in the debugger

0 commit comments

Comments
 (0)