Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vm): add mapping slot cheatcodes #448

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Vm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ interface VmSafe {
function pauseGasMetering() external;
// Resumes gas metering (i.e. gas usage is counted again). Noop if already on.
function resumeGasMetering() external;
// Starts recording all map SSTOREs for later retrieval.
function startMappingRecording() external;
// Stops recording all map SSTOREs for later retrieval and clears the recorded data.
function stopMappingRecording() external;
// Gets the length of a mapping at a given slot, for a given address.
function getMappingLength(address target, bytes32 slot) external returns (uint256 length);
// Gets the element at index idx of a mapping at a given slot, for a given address.
function getMappingSlotAt(address target, bytes32 slot, uint256 idx) external returns (bytes32 value);
// Gets the map key and parent of a mapping at a given slot, for a given address.
function getMappingKeyAndParentOf(address target, bytes32 slot)
external
returns (bool found, bytes32 key, bytes32 parent);
// Writes a breakpoint to jump to in the debugger
function breakpoint(string calldata char) external;
// Writes a conditional breakpoint to jump to in the debugger
Expand Down