From badd6c35c9ce71c4e776508ab3db45691519da59 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Tue, 22 Apr 2025 20:33:22 -0400 Subject: [PATCH 01/12] chore(10027-cheatcode-mutability-tags): create checklist for cheatcodes that need a mutability modifier --- docs/dev/cheatcode-mutability-review.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/dev/cheatcode-mutability-review.md diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md new file mode 100644 index 0000000000000..837d1da003d88 --- /dev/null +++ b/docs/dev/cheatcode-mutability-review.md @@ -0,0 +1,19 @@ +# Cheatcode Mutability Review (`view` / `pure`) + +This document tracks the Foundry cheatcodes that are currently marked `external` with no `view` or `pure` mutability modifier. + +## Review Criteria + +From issue [#10027](https://github.com/foundry-rs/foundry/issues/10027): + +- If a cheatcode **modifies observable state for later cheatcode calls** (EVM, interpreter, filesystem), it is neither `view` nor `pure` +- If a cheatcode **depends on prior cheatcode calls or reads test environment state**, it is `view` +- If a cheatcode **has no side effects and doesn’t depend on test state**, it is `pure` + +## Checklist + +| Cheatcode ID | Function Signature | Proposed Mutability | +|--------------|--------------------|----------------------| +| `createWallet_1` | `function createWallet(uint256)` | `TBD` | +| `sign_0` | `function sign(...)` | `TBD` | +| ... | ... | ... | \ No newline at end of file From 89bbd1e05de0dd6743b273220a2acc5633899c98 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Wed, 23 Apr 2025 17:56:41 -0400 Subject: [PATCH 02/12] chore(10027-cheatcode-mutability-tags): review 231 external cheatcodes with no mutability and add mutability checklist --- docs/dev/cheatcode-mutability-review.md | 282 +++++++++++++++++++++++- 1 file changed, 271 insertions(+), 11 deletions(-) diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index 837d1da003d88..a93353e932507 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -1,19 +1,279 @@ -# Cheatcode Mutability Review (`view` / `pure`) +# Cheatcode Mutability Review Checklist -This document tracks the Foundry cheatcodes that are currently marked `external` with no `view` or `pure` mutability modifier. +This document tracks all cheatcodes currently marked `external` with no `view` or `pure` mutability modifier. + +Total reviewed: **231** + +--- + +## Summary + +| Mutability | Count | Description | +|------------|-------|-------------| +| `pure` | 1 | Stateless helper functions | +| `view` | 11 | Reads test environment state | +| `-` (keep as is) | 219 | Modifies test state or relies on test state | + +--- ## Review Criteria From issue [#10027](https://github.com/foundry-rs/foundry/issues/10027): -- If a cheatcode **modifies observable state for later cheatcode calls** (EVM, interpreter, filesystem), it is neither `view` nor `pure` -- If a cheatcode **depends on prior cheatcode calls or reads test environment state**, it is `view` -- If a cheatcode **has no side effects and doesn’t depend on test state**, it is `pure` +- If a cheatcode **modifies observable state** for later cheatcode calls (EVM, interpreter, filesystem), it is neither `view` nor `pure` +- If a cheatcode **reads** from prior cheatcode state or environment state, it is `view` +- If a cheatcode **has no side effects** and doesn’t depend on test stat, it is `pure` + +--- + +## Mutability Suggestions + +### Pure Cheatcodes + +Mark `pure`: + +- [ ] `contains`: `contains(string,string)` _suggested: `pure`_ + +--- + +### View Cheatcodes + +Mark `view`: + +- [ ] `accessList`: `accessList(address,bytes32[])` +- [ ] `accesses`: `accesses(address)` +- [ ] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` +- [ ] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` +- [ ] `getMappingLength`: `getMappingLength(address,bytes32)` +- [ ] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` +- [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` +- [ ] `getRecordedLogs`: `getRecordedLogs()` +- [ ] `getWallets`: `getWallets()` +- [ ] `noAccessList`: `noAccessList()` +- [ ] `readCallers`: `readCallers()` + +--- + +### Keep As Is -## Checklist +Not `view` nor `pure`: -| Cheatcode ID | Function Signature | Proposed Mutability | -|--------------|--------------------|----------------------| -| `createWallet_1` | `function createWallet(uint256)` | `TBD` | -| `sign_0` | `function sign(...)` | `TBD` | -| ... | ... | ... | \ No newline at end of file +- [ ] `_expectCheatcodeRevert_0`: `_expectCheatcodeRevert()` _suggested: keep as is_ +- [ ] `_expectCheatcodeRevert_1`: `_expectCheatcodeRevert(bytes4)` _suggested: keep as is_ +- [ ] `_expectCheatcodeRevert_2`: `_expectCheatcodeRevert(bytes)` _suggested: keep as is_ +- [ ] `allowCheatcodes`: `allowCheatcodes(address)` _suggested: keep as is_ +- [ ] `attachBlob`: `attachBlob(bytes)` _suggested: keep as is_ +- [ ] `attachDelegation`: `attachDelegation((uint8,bytes32,bytes32,uint64,address))` _suggested: keep as is_ +- [ ] `blobBaseFee`: `blobBaseFee(uint256)` _suggested: keep as is_ +- [ ] `blobhashes`: `blobhashes(bytes32[])` _suggested: keep as is_ +- [ ] `broadcastRawTransaction`: `broadcastRawTransaction(bytes)` _suggested: keep as is_ +- [ ] `broadcast_0`: `broadcast()` _suggested: keep as is_ +- [ ] `broadcast_1`: `broadcast(address)` _suggested: keep as is_ +- [ ] `broadcast_2`: `broadcast(uint256)` _suggested: keep as is_ +- [ ] `chainId`: `chainId(uint256)` _suggested: keep as is_ +- [ ] `clearMockedCalls`: `clearMockedCalls()` _suggested: keep as is_ +- [ ] `cloneAccount`: `cloneAccount(address,address)` _suggested: keep as is_ +- [ ] `closeFile`: `closeFile(string)` _suggested: keep as is_ +- [ ] `coinbase`: `coinbase(address)` _suggested: keep as is_ +- [ ] `cool`: `cool(address)` _suggested: keep as is_ +- [ ] `coolSlot`: `coolSlot(address,bytes32)` _suggested: keep as is_ +- [ ] `copyFile`: `copyFile(string,string)` _suggested: keep as is_ +- [ ] `copyStorage`: `copyStorage(address,address)` _suggested: keep as is_ +- [ ] `createDir`: `createDir(string,bool)` _suggested: keep as is_ +- [ ] `createFork_0`: `createFork(string)` _suggested: keep as is_ +- [ ] `createFork_1`: `createFork(string,uint256)` _suggested: keep as is_ +- [ ] `createFork_2`: `createFork(string,bytes32)` _suggested: keep as is_ +- [ ] `createSelectFork_0`: `createSelectFork(string)` _suggested: keep as is_ +- [ ] `createSelectFork_1`: `createSelectFork(string,uint256)` _suggested: keep as is_ +- [ ] `createSelectFork_2`: `createSelectFork(string,bytes32)` _suggested: keep as is_ +- [ ] `createWallet_0`: `createWallet(string)` _suggested: keep as is_ +- [ ] `createWallet_1`: `createWallet(uint256)` _suggested: keep as is_ +- [ ] `createWallet_2`: `createWallet(uint256,string)` _suggested: keep as is_ +- [ ] `deal`: `deal(address,uint256)` _suggested: keep as is_ +- [ ] `deleteSnapshot`: `deleteSnapshot(uint256)` _suggested: keep as is_ +- [ ] `deleteSnapshots`: `deleteSnapshots()` _suggested: keep as is_ +- [ ] `deleteStateSnapshot`: `deleteStateSnapshot(uint256)` _suggested: keep as is_ +- [ ] `deleteStateSnapshots`: `deleteStateSnapshots()` _suggested: keep as is_ +- [ ] `deployCode_0`: `deployCode(string)` _suggested: keep as is_ +- [ ] `deployCode_1`: `deployCode(string,bytes)` _suggested: keep as is_ +- [ ] `deployCode_2`: `deployCode(string,uint256)` _suggested: keep as is_ +- [ ] `deployCode_3`: `deployCode(string,bytes,uint256)` _suggested: keep as is_ +- [ ] `deployCode_4`: `deployCode(string,bytes32)` _suggested: keep as is_ +- [ ] `deployCode_5`: `deployCode(string,bytes,bytes32)` _suggested: keep as is_ +- [ ] `deployCode_6`: `deployCode(string,uint256,bytes32)` _suggested: keep as is_ +- [ ] `deployCode_7`: `deployCode(string,bytes,uint256,bytes32)` _suggested: keep as is_ +- [ ] `difficulty`: `difficulty(uint256)` _suggested: keep as is_ +- [ ] `dumpState`: `dumpState(string)` _suggested: keep as is_ +- [ ] `etch`: `etch(address,bytes)` _suggested: keep as is_ +- [ ] `expectCallMinGas_0`: `expectCallMinGas(address,uint256,uint64,bytes)` _suggested: keep as is_ +- [ ] `expectCallMinGas_1`: `expectCallMinGas(address,uint256,uint64,bytes,uint64)` _suggested: keep as is_ +- [ ] `expectCall_0`: `expectCall(address,bytes)` _suggested: keep as is_ +- [ ] `expectCall_1`: `expectCall(address,bytes,uint64)` _suggested: keep as is_ +- [ ] `expectCall_2`: `expectCall(address,uint256,bytes)` _suggested: keep as is_ +- [ ] `expectCall_3`: `expectCall(address,uint256,bytes,uint64)` _suggested: keep as is_ +- [ ] `expectCall_4`: `expectCall(address,uint256,uint64,bytes)` _suggested: keep as is_ +- [ ] `expectCall_5`: `expectCall(address,uint256,uint64,bytes,uint64)` _suggested: keep as is_ +- [ ] `expectCreate`: `expectCreate(bytes,address)`_suggested: keep as is_ +- [ ] `expectCreate2`: `expectCreate2(bytes,address)` _suggested: keep as is_ +- [ ] `expectEmitAnonymous_0`: `expectEmitAnonymous(bool,bool,bool,bool,bool)` _suggested: keep as is_ +- [ ] `expectEmitAnonymous_1`: `expectEmitAnonymous(bool,bool,bool,bool,bool,address)` _suggested: keep as is_ +- [ ] `expectEmitAnonymous_2`: `expectEmitAnonymous()` _suggested: keep as is_ +- [ ] `expectEmitAnonymous_3`: `expectEmitAnonymous(address)` _suggested: keep as is_ +- [ ] `expectEmit_0`: `expectEmit(bool,bool,bool,bool)` _suggested: keep as is_ +- [ ] `expectEmit_1`: `expectEmit(bool,bool,bool,bool,address)` _suggested: keep as is_ +- [ ] `expectEmit_2`: `expectEmit()` _suggested: keep as is_ +- [ ] `expectEmit_3`: `expectEmit(address)` _suggested: keep as is_ +- [ ] `expectEmit_4`: `expectEmit(bool,bool,bool,bool,uint64)` _suggested: keep as is_ +- [ ] `expectEmit_5`: `expectEmit(bool,bool,bool,bool,address,uint64)` _suggested: keep as is_ +- [ ] `expectEmit_6`: `expectEmit(uint64)` _suggested: keep as is_ +- [ ] `expectEmit_7`: `expectEmit(address,uint64)` _suggested: keep as is_ +- [ ] `expectPartialRevert_0`: `expectPartialRevert(bytes4)` _suggested: keep as is_ +- [ ] `expectPartialRevert_1`: `expectPartialRevert(bytes4,address)` _suggested: keep as is_ +- [ ] `expectRevert_0`: `expectRevert()` _suggested: keep as is_ +- [ ] `expectRevert_1`: `expectRevert(bytes4)` _suggested: keep as is_ +- [ ] `expectRevert_10`: `expectRevert(bytes4,address,uint64)` _suggested: keep as is_ +- [ ] `expectRevert_11`: `expectRevert(bytes,address,uint64)` _suggested: keep as is_ +- [ ] `expectRevert_2`: `expectRevert(bytes)` _suggested: keep as is_ +- [ ] `expectRevert_3`: `expectRevert(address)` _suggested: keep as is_ +- [ ] `expectRevert_4`: `expectRevert(bytes4,address)` _suggested: keep as is_ +- [ ] `expectRevert_5`: `expectRevert(bytes,address)` _suggested: keep as is_ +- [ ] `expectRevert_6`: `expectRevert(uint64)` _suggested: keep as is_ +- [ ] `expectRevert_7`: `expectRevert(bytes4,uint64)` _suggested: keep as is_ +- [ ] `expectRevert_8`: `expectRevert(bytes,uint64)` _suggested: keep as is_ +- [ ] `expectRevert_9`: `expectRevert(address,uint64)` _suggested: keep as is_ +- [ ] `expectSafeMemory`: `expectSafeMemory(uint64,uint64)` _suggested: keep as is_ +- [ ] `expectSafeMemoryCall`: `expectSafeMemoryCall(uint64,uint64)` _suggested: keep as is_ +- [ ] `fee`: `fee(uint256)` _suggested: keep as is_ +- [ ] `ffi`: `ffi(string[])` _suggested: keep as is_ +- [ ] `interceptInitcode`: `interceptInitcode()` _suggested: keep as is_ +- [ ] `label`: `label(address,string)` _suggested: keep as is_ +- [ ] `loadAllocs`: `loadAllocs(string)` _suggested: keep as is_ +- [ ] `makePersistent_0`: `makePersistent(address)` _suggested: keep as is_ +- [ ] `makePersistent_1`: `makePersistent(address,address)` _suggested: keep as is_ +- [ ] `makePersistent_2`: `makePersistent(address,address,address)` _suggested: keep as is_ +- [ ] `makePersistent_3`: `makePersistent(address[])` _suggested: keep as is_ +- [ ] `mockCallRevert_0`: `mockCallRevert(address,bytes,bytes)` _suggested: keep as is_ +- [ ] `mockCallRevert_1`: `mockCallRevert(address,uint256,bytes,bytes)` _suggested: keep as is_ +- [ ] `mockCallRevert_2`: `mockCallRevert(address,bytes4,bytes)` _suggested: keep as is_ +- [ ] `mockCallRevert_3`: `mockCallRevert(address,uint256,bytes4,bytes)` _suggested: keep as is_ +- [ ] `mockCall_0`: `mockCall(address,bytes,bytes)` _suggested: keep as is_ +- [ ] `mockCall_1`: `mockCall(address,uint256,bytes,bytes)` _suggested: keep as is_ +- [ ] `mockCall_2`: `mockCall(address,bytes4,bytes)` _suggested: keep as is_ +- [ ] `mockCall_3`: `mockCall(address,uint256,bytes4,bytes)` _suggested: keep as is_ +- [ ] `mockCalls_0`: `mockCalls(address,bytes,bytes[])` _suggested: keep as is_ +- [ ] `mockCalls_1`: `mockCalls(address,uint256,bytes,bytes[])` _suggested: keep as is_ +- [ ] `mockFunction`: `mockFunction(address,address,bytes)` _suggested: keep as is_ +- [ ] `pauseGasMetering`: `pauseGasMetering()` _suggested: keep as is_ +- [ ] `prank_0`: `prank(address)` _suggested: keep as is_ +- [ ] `prank_1`: `prank(address,address)` _suggested: keep as is_ +- [ ] `prank_2`: `prank(address,bool)` _suggested: keep as is_ +- [ ] `prank_3`: `prank(address,address,bool)` _suggested: keep as is_ +- [ ] `prevrandao_0`: `prevrandao(bytes32)` _suggested: keep as is_ +- [ ] `prevrandao_1`: `prevrandao(uint256)` _suggested: keep as is_ +- [ ] `prompt`: `prompt(string)` _suggested: keep as is_ +- [ ] `promptAddress`: `promptAddress(string)` _suggested: keep as is_ +- [ ] `promptSecret`: `promptSecret(string)` _suggested: keep as is_ +- [ ] `promptSecretUint`: `promptSecretUint(string)` _suggested: keep as is_ +- [ ] `promptUint`: `promptUint(string)` _suggested: keep as is_ +- [ ] `randomAddress`: `randomAddress()` _suggested: keep as is_ +- [ ] `randomUint_0`: `randomUint()` _suggested: keep as is_ +- [ ] `randomUint_1`: `randomUint(uint256,uint256)` _suggested: keep as is_ +- [ ] `record`: `record()` _suggested: keep as is_ +- [ ] `recordLogs`: `recordLogs()` _suggested: keep as is_ +- [ ] `rememberKey`: `rememberKey(uint256)` _suggested: keep as is_ +- [ ] `rememberKeys_0`: `rememberKeys(string,string,uint32)` _suggested: keep as is_ +- [ ] `rememberKeys_1`: `rememberKeys(string,string,string,uint32)` _suggested: keep as is_ +- [ ] `removeDir`: `removeDir(string,bool)` _suggested: keep as is_ +- [ ] `removeFile`: `removeFile(string)` _suggested: keep as is_ +- [ ] `resetGasMetering`: `resetGasMetering()` _suggested: keep as is_ +- [ ] `resetNonce`: `resetNonce(address)` _suggested: keep as is_ +- [ ] `resumeGasMetering`: `resumeGasMetering()` _suggested: keep as is_ +- [ ] `revertTo`: `revertTo(uint256)` _suggested: keep as is_ +- [ ] `revertToAndDelete`: `revertToAndDelete(uint256)` _suggested: keep as is_ +- [ ] `revertToState`: `revertToState(uint256)` _suggested: keep as is_ +- [ ] `revertToStateAndDelete`: `revertToStateAndDelete(uint256)` _suggested: keep as is_ +- [ ] `revokePersistent_0`: `revokePersistent(address)` _suggested: keep as is_ +- [ ] `revokePersistent_1`: `revokePersistent(address[])` _suggested: keep as is_ +- [ ] `roll`: `roll(uint256)` _suggested: keep as is_ +- [ ] `rollFork_0`: `rollFork(uint256)` _suggested: keep as is_ +- [ ] `rollFork_1`: `rollFork(bytes32)` _suggested: keep as is_ +- [ ] `rollFork_2`: `rollFork(uint256,uint256)` _suggested: keep as is_ +- [ ] `rollFork_3`: `rollFork(uint256,bytes32)` _suggested: keep as is_ +- [ ] `rpc_0`: `rpc(string,string)` _suggested: keep as is_ +- [ ] `rpc_1`: `rpc(string,string,string)` _suggested: keep as is_ +- [ ] `selectFork`: `selectFork(uint256)` _suggested: keep as is_ +- [ ] `serializeAddress_0`: `serializeAddress(string,string,address)` _suggested: keep as is_ +- [ ] `serializeAddress_1`: `serializeAddress(string,string,address[])` _suggested: keep as is_ +- [ ] `serializeBool_0`: `serializeBool(string,string,bool)` _suggested: keep as is_ +- [ ] `serializeBool_1`: `serializeBool(string,string,bool[])` _suggested: keep as is_ +- [ ] `serializeBytes32_0`: `serializeBytes32(string,string,bytes32)` _suggested: keep as is_ +- [ ] `serializeBytes32_1`: `serializeBytes32(string,string,bytes32[])` _suggested: keep as is_ +- [ ] `serializeBytes_0`: `serializeBytes(string,string,bytes)` _suggested: keep as is_ +- [ ] `serializeBytes_1`: `serializeBytes(string,string,bytes[])` _suggested: keep as is_ +- [ ] `serializeInt_0`: `serializeInt(string,string,int256)` _suggested: keep as is_ +- [ ] `serializeInt_1`: `serializeInt(string,string,int256[])` _suggested: keep as is_ +- [ ] `serializeJson`: `serializeJson(string,string)` _suggested: keep as is_ +- [ ] `serializeJsonType_1`: `serializeJsonType(string,string,string,bytes)` _suggested: keep as is_ +- [ ] `serializeString_0`: `serializeString(string,string,string)` _suggested: keep as is_ +- [ ] `serializeString_1`: `serializeString(string,string,string[])` _suggested: keep as is_ +- [ ] `serializeUintToHex`: `serializeUintToHex(string,string,uint256)` _suggested: keep as is_ +- [ ] `serializeUint_0`: `serializeUint(string,string,uint256)` _suggested: keep as is_ +- [ ] `serializeUint_1`: `serializeUint(string,string,uint256[])` _suggested: keep as is_ +- [ ] `setArbitraryStorage_0`: `setArbitraryStorage(address)` _suggested: keep as is_ +- [ ] `setArbitraryStorage_1`: `setArbitraryStorage(address,bool)` _suggested: keep as is_ +- [ ] `setBlockhash`: `setBlockhash(uint256,bytes32)` _suggested: keep as is_ +- [ ] `setEnv`: `setEnv(string,string)` _suggested: keep as is_ +- [ ] `setNonce`: `setNonce(address,uint64)` _suggested: keep as is_ +- [ ] `setNonceUnsafe`: `setNonceUnsafe(address,uint64)` _suggested: keep as is_ +- [ ] `shuffle`: `shuffle(uint256[])` _suggested: keep as is_ +- [ ] `signAndAttachDelegation_0`: `signAndAttachDelegation(address,uint256)` _suggested: keep as is_ +- [ ] `signAndAttachDelegation_1`: `signAndAttachDelegation(address,uint256,uint64)` _suggested: keep as is_ +- [ ] `signCompact_0`: `signCompact((address,uint256,uint256,uint256),bytes32)` _suggested: keep as is_ +- [ ] `signDelegation_0`: `signDelegation(address,uint256)` _suggested: keep as is_ +- [ ] `signDelegation_1`: `signDelegation(address,uint256,uint64)` _suggested: keep as is_ +- [ ] `sign_0`: `sign((address,uint256,uint256,uint256),bytes32)` _suggested: keep as is_ +- [ ] `skip_0`: `skip(bool)` _suggested: keep as is_ +- [ ] `skip_1`: `skip(bool,string)` _suggested: keep as is_ +- [ ] `sleep`: `sleep(uint256)` _suggested: keep as is_ +- [ ] `snapshot`: `snapshot()` _suggested: keep as is_ +- [ ] `snapshotGasLastCall_0`: `snapshotGasLastCall(string)` _suggested: keep as is_ +- [ ] `snapshotGasLastCall_1`: `snapshotGasLastCall(string,string)` _suggested: keep as is_ +- [ ] `snapshotState`: `snapshotState()` _suggested: keep as is_ +- [ ] `snapshotValue_0`: `snapshotValue(string,uint256)` _suggested: keep as is_ +- [ ] `snapshotValue_1`: `snapshotValue(string,string,uint256)` _suggested: keep as is_ +- [ ] `sort`: `sort(uint256[])` _suggested: keep as is_ +- [ ] `startBroadcast_0`: `startBroadcast()` _suggested: keep as is_ +- [ ] `startBroadcast_1`: `startBroadcast(address)` _suggested: keep as is_ +- [ ] `startBroadcast_2`: `startBroadcast(uint256)` _suggested: keep as is_ +- [ ] `startDebugTraceRecording`: `startDebugTraceRecording()` _suggested: keep as is_ +- [ ] `startMappingRecording`: `startMappingRecording()` _suggested: keep as is_ +- [ ] `startPrank_0`: `startPrank(address)` _suggested: keep as is_ +- [ ] `startPrank_1`: `startPrank(address,address)` _suggested: keep as is_ +- [ ] `startPrank_2`: `startPrank(address,bool)` _suggested: keep as is_ +- [ ] `startPrank_3`: `startPrank(address,address,bool)` _suggested: keep as is_ +- [ ] `startSnapshotGas_0`: `startSnapshotGas(string)` _suggested: keep as is_ +- [ ] `startSnapshotGas_1`: `startSnapshotGas(string,string)` _suggested: keep as is_ +- [ ] `startStateDiffRecording`: `startStateDiffRecording()` _suggested: keep as is_ +- [ ] `stopAndReturnDebugTraceRecording`: `stopAndReturnDebugTraceRecording()` _suggested: keep as is_ +- [ ] `stopAndReturnStateDiff`: `stopAndReturnStateDiff()` _suggested: keep as is_ +- [ ] `stopBroadcast`: `stopBroadcast()` _suggested: keep as is_ +- [ ] `stopExpectSafeMemory`: `stopExpectSafeMemory()` _suggested: keep as is_ +- [ ] `stopMappingRecording`: `stopMappingRecording()` _suggested: keep as is_ +- [ ] `stopPrank`: `stopPrank()` _suggested: keep as is_ +- [ ] `stopSnapshotGas_0`: `stopSnapshotGas()` _suggested: keep as is_ +- [ ] `stopSnapshotGas_1`: `stopSnapshotGas(string)` _suggested: keep as is_ +- [ ] `stopSnapshotGas_2`: `stopSnapshotGas(string,string)` _suggested: keep as is_ +- [ ] `store`: `store(address,bytes32,bytes32)` _suggested: keep as is_ +- [ ] `transact_0`: `transact(bytes32)` _suggested: keep as is_ +- [ ] `transact_1`: `transact(uint256,bytes32)` _suggested: keep as is_ +- [ ] `tryFfi`: `tryFfi(string[])` _suggested: keep as is_ +- [ ] `txGasPrice`: `txGasPrice(uint256)` _suggested: keep as is_ +- [ ] `warmSlot`: `warmSlot(address,bytes32)` _suggested: keep as is_ +- [ ] `warp`: `warp(uint256)` _suggested: keep as is_ +- [ ] `writeFile`: `writeFile(string,string)` _suggested: keep as is_ +- [ ] `writeFileBinary`: `writeFileBinary(string,bytes)` _suggested: keep as is_ +- [ ] `writeJson_0`: `writeJson(string,string)` _suggested: keep as is_ +- [ ] `writeJson_1`: `writeJson(string,string,string)` _suggested: keep as is_ +- [ ] `writeLine`: `writeLine(string,string)` _suggested: keep as is_ +- [ ] `writeToml_0`: `writeToml(string,string)` _suggested: keep as is_ +- [ ] `writeToml_1`: `writeToml(string,string,string)` _suggested: keep as is_ From 317e51e188c16dee13f4e715a66845ac4e87d551 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Wed, 23 Apr 2025 18:40:09 -0400 Subject: [PATCH 03/12] chore(10027-cheatcode-mutability-tags): mark contains(string,string) cheatcode as pure --- crates/cheatcodes/assets/cheatcodes.json | 2 +- crates/cheatcodes/spec/src/vm.rs | 2 +- docs/dev/cheatcode-mutability-review.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 5d46978a4fdb9..41a7ee9bdcf65 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -3596,7 +3596,7 @@ "description": "Returns true if `search` is found in `subject`, false otherwise.", "declaration": "function contains(string calldata subject, string calldata search) external returns (bool result);", "visibility": "external", - "mutability": "", + "mutability": "pure", "signature": "contains(string,string)", "selector": "0x3fb18aec", "selectorBytes": [ diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index afb687894f863..c96706df9238f 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -2313,7 +2313,7 @@ interface Vm { function indexOf(string calldata input, string calldata key) external pure returns (uint256); /// Returns true if `search` is found in `subject`, false otherwise. #[cheatcode(group = String)] - function contains(string calldata subject, string calldata search) external returns (bool result); + function contains(string calldata subject, string calldata search) external pure returns (bool result); // ======== JSON Parsing and Manipulation ======== diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index a93353e932507..2cb3231c2d3aa 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -32,7 +32,7 @@ From issue [#10027](https://github.com/foundry-rs/foundry/issues/10027): Mark `pure`: -- [ ] `contains`: `contains(string,string)` _suggested: `pure`_ +- [x] `contains`: `contains(string,string)` _suggested: `pure`_ --- From 8c6227d0090d1ea7ba993f7f2dff586f9e8a39b2 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Wed, 23 Apr 2025 20:44:51 -0400 Subject: [PATCH 04/12] chore(10027-cheatcode-mutability-tags): keep accesslist as is due to test indicating stateful behavior --- docs/dev/cheatcode-mutability-review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index 2cb3231c2d3aa..d7b9fa11b37c6 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -40,7 +40,7 @@ Mark `pure`: Mark `view`: -- [ ] `accessList`: `accessList(address,bytes32[])` +- [x] `accessList`: `accessList(address,bytes32[])` _resolved: not view, keep as is due to test coverage indicating stateful behavior_ - [ ] `accesses`: `accesses(address)` - [ ] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` - [ ] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` From 98ae17c252b234ae67473c225ef77e009c930866 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Wed, 23 Apr 2025 21:03:52 -0400 Subject: [PATCH 05/12] chore(10027-cheatcode-mutability-tags): accesses() confirmed to not have side effect logic --- crates/cheatcodes/assets/cheatcodes.json | 6 +++--- crates/cheatcodes/spec/src/vm.rs | 2 +- docs/dev/cheatcode-mutability-review.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 41a7ee9bdcf65..e5c4a5087d339 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -754,9 +754,9 @@ "func": { "id": "accesses", "description": "Gets all accessed reads and write slot from a `vm.record` session, for a given address.", - "declaration": "function accesses(address target) external returns (bytes32[] memory readSlots, bytes32[] memory writeSlots);", + "declaration": "function accesses(address target) external view returns (bytes32[] memory readSlots, bytes32[] memory writeSlots);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "accesses(address)", "selector": "0x65bc9481", "selectorBytes": [ @@ -3594,7 +3594,7 @@ "func": { "id": "contains", "description": "Returns true if `search` is found in `subject`, false otherwise.", - "declaration": "function contains(string calldata subject, string calldata search) external returns (bool result);", + "declaration": "function contains(string calldata subject, string calldata search) external pure returns (bool result);", "visibility": "external", "mutability": "pure", "signature": "contains(string,string)", diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index c96706df9238f..5b5d4d8ce42ed 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -410,7 +410,7 @@ interface Vm { /// Gets all accessed reads and write slot from a `vm.record` session, for a given address. #[cheatcode(group = Evm, safety = Safe)] - function accesses(address target) external returns (bytes32[] memory readSlots, bytes32[] memory writeSlots); + function accesses(address target) external view returns (bytes32[] memory readSlots, bytes32[] memory writeSlots); /// Record all account accesses as part of CREATE, CALL or SELFDESTRUCT opcodes in order, /// along with the context of the calls diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index d7b9fa11b37c6..94cd3b5b9c347 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -41,7 +41,7 @@ Mark `pure`: Mark `view`: - [x] `accessList`: `accessList(address,bytes32[])` _resolved: not view, keep as is due to test coverage indicating stateful behavior_ -- [ ] `accesses`: `accesses(address)` +- [x] `accesses`: `accesses(address)` _suggested: `view`_ - [ ] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` - [ ] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` - [ ] `getMappingLength`: `getMappingLength(address,bytes32)` From c8fbaa3bfbf9047db6ceda0cf4f44fb84fadfc1a Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Fri, 25 Apr 2025 16:07:08 -0400 Subject: [PATCH 06/12] feat(10027-cheatcode-mutability-tags): make eth_getLogs getMappingLength getMappingSlotAt view --- crates/cheatcodes/assets/cheatcodes.json | 16 ++++++++-------- crates/cheatcodes/spec/src/vm.rs | 6 ++++-- docs/dev/cheatcode-mutability-review.md | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index e5c4a5087d339..2b625cb2180e2 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -4898,9 +4898,9 @@ "func": { "id": "eth_getLogs", "description": "Gets all the logs according to specified filter.", - "declaration": "function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) external returns (EthGetLogs[] memory logs);", + "declaration": "function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) external view returns (EthGetLogs[] memory logs);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "eth_getLogs(uint256,uint256,address,bytes32[])", "selector": "0x35e1349b", "selectorBytes": [ @@ -6158,9 +6158,9 @@ "func": { "id": "getMappingKeyAndParentOf", "description": "Gets the map key and parent of a mapping at a given slot, for a given address.", - "declaration": "function getMappingKeyAndParentOf(address target, bytes32 elementSlot) external returns (bool found, bytes32 key, bytes32 parent);", + "declaration": "function getMappingKeyAndParentOf(address target, bytes32 elementSlot) external view returns (bool found, bytes32 key, bytes32 parent);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getMappingKeyAndParentOf(address,bytes32)", "selector": "0x876e24e6", "selectorBytes": [ @@ -6178,9 +6178,9 @@ "func": { "id": "getMappingLength", "description": "Gets the number of elements in the mapping at the given slot, for a given address.", - "declaration": "function getMappingLength(address target, bytes32 mappingSlot) external returns (uint256 length);", + "declaration": "function getMappingLength(address target, bytes32 mappingSlot) external view returns (uint256 length);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getMappingLength(address,bytes32)", "selector": "0x2f2fd63f", "selectorBytes": [ @@ -6198,9 +6198,9 @@ "func": { "id": "getMappingSlotAt", "description": "Gets the elements at index idx of the mapping at the given slot, for a given address. The\nindex must be less than the length of the mapping (i.e. the number of keys in the mapping).", - "declaration": "function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external returns (bytes32 value);", + "declaration": "function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external view returns (bytes32 value);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getMappingSlotAt(address,bytes32,uint256)", "selector": "0xebc73ab4", "selectorBytes": [ diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index 5b5d4d8ce42ed..2b797b7ea7557 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -441,17 +441,18 @@ interface Vm { /// Gets the number of elements in the mapping at the given slot, for a given address. #[cheatcode(group = Evm, safety = Safe)] - function getMappingLength(address target, bytes32 mappingSlot) external returns (uint256 length); + function getMappingLength(address target, bytes32 mappingSlot) external view returns (uint256 length); /// Gets the elements at index idx of the mapping at the given slot, for a given address. The /// index must be less than the length of the mapping (i.e. the number of keys in the mapping). #[cheatcode(group = Evm, safety = Safe)] - function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external returns (bytes32 value); + function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external view returns (bytes32 value); /// Gets the map key and parent of a mapping at a given slot, for a given address. #[cheatcode(group = Evm, safety = Safe)] function getMappingKeyAndParentOf(address target, bytes32 elementSlot) external + view returns (bool found, bytes32 key, bytes32 parent); // -------- Block and Transaction Properties -------- @@ -871,6 +872,7 @@ interface Vm { #[cheatcode(group = Evm, safety = Safe)] function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) external + view returns (EthGetLogs[] memory logs); // --- Behavior --- diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index 94cd3b5b9c347..d3e14d32937bb 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -42,10 +42,10 @@ Mark `view`: - [x] `accessList`: `accessList(address,bytes32[])` _resolved: not view, keep as is due to test coverage indicating stateful behavior_ - [x] `accesses`: `accesses(address)` _suggested: `view`_ -- [ ] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` +- [x] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` _suggested: `view`_ - [ ] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` -- [ ] `getMappingLength`: `getMappingLength(address,bytes32)` -- [ ] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` +- [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_ +- [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_ - [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` - [ ] `getRecordedLogs`: `getRecordedLogs()` - [ ] `getWallets`: `getWallets()` From d3ed9d77bf30330334eec2c7534b5f93111adf51 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Fri, 25 Apr 2025 16:11:55 -0400 Subject: [PATCH 07/12] feat(10027-cheatcode-mutability-tags): mark getMappingKeyAndParentOf as revised --- docs/dev/cheatcode-mutability-review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index d3e14d32937bb..b572d7b7ae55a 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -43,7 +43,7 @@ Mark `view`: - [x] `accessList`: `accessList(address,bytes32[])` _resolved: not view, keep as is due to test coverage indicating stateful behavior_ - [x] `accesses`: `accesses(address)` _suggested: `view`_ - [x] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` _suggested: `view`_ -- [ ] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` +- [x] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` _suggested: `view`_ - [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_ - [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_ - [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` From 4ce6d1a28ac10212931cca1af274d6a9b6104f51 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Fri, 25 Apr 2025 22:19:36 -0400 Subject: [PATCH 08/12] feat(10027-cheatcode-mutability-tags): noaccesslist and readcallers are external view --- crates/cheatcodes/assets/cheatcodes.json | 8 ++++---- crates/cheatcodes/spec/src/vm.rs | 4 ++-- docs/dev/cheatcode-mutability-review.md | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 2b625cb2180e2..31c2f4000f58b 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -6900,9 +6900,9 @@ "func": { "id": "noAccessList", "description": "Utility cheatcode to remove any EIP-2930 access list set by `accessList` cheatcode.", - "declaration": "function noAccessList() external;", + "declaration": "function noAccessList() external view;", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "noAccessList()", "selector": "0x238ad778", "selectorBytes": [ @@ -8340,9 +8340,9 @@ "func": { "id": "readCallers", "description": "Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification.", - "declaration": "function readCallers() external returns (CallerMode callerMode, address msgSender, address txOrigin);", + "declaration": "function readCallers() external view returns (CallerMode callerMode, address msgSender, address txOrigin);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "readCallers()", "selector": "0x4ad0bac9", "selectorBytes": [ diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index 2b797b7ea7557..5e7d205c148a0 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -576,7 +576,7 @@ interface Vm { /// Utility cheatcode to remove any EIP-2930 access list set by `accessList` cheatcode. #[cheatcode(group = Evm, safety = Unsafe)] - function noAccessList() external; + function noAccessList() external view; /// Utility cheatcode to mark specific storage slot as warm, simulating a prior read. #[cheatcode(group = Evm, safety = Unsafe)] @@ -700,7 +700,7 @@ interface Vm { /// Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification. #[cheatcode(group = Evm, safety = Unsafe)] - function readCallers() external returns (CallerMode callerMode, address msgSender, address txOrigin); + function readCallers() external view returns (CallerMode callerMode, address msgSender, address txOrigin); // ----- Arbitrary Snapshots ----- diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index b572d7b7ae55a..ccc22904c6ef1 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -49,8 +49,8 @@ Mark `view`: - [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` - [ ] `getRecordedLogs`: `getRecordedLogs()` - [ ] `getWallets`: `getWallets()` -- [ ] `noAccessList`: `noAccessList()` -- [ ] `readCallers`: `readCallers()` +- [x] `noAccessList`: `noAccessList()` _suggested: `view`_ +- [x] `readCallers`: `readCallers()` _suggested: `view`_ --- From 6093a2cbc0c2975527a72768f93d1bf6e8858b66 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Sat, 26 Apr 2025 11:56:38 -0400 Subject: [PATCH 09/12] feat(10027-cheatcode-mutability-tags): getrecordedlogs and getwallets are external view --- crates/cheatcodes/assets/cheatcodes.json | 8 ++++---- crates/cheatcodes/spec/src/vm.rs | 4 ++-- crates/forge/tests/cli/script.rs | 20 ++++++++++---------- docs/dev/cheatcode-mutability-review.md | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 31c2f4000f58b..92def3f2059a7 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -6258,9 +6258,9 @@ "func": { "id": "getRecordedLogs", "description": "Gets all the recorded logs.", - "declaration": "function getRecordedLogs() external returns (Log[] memory logs);", + "declaration": "function getRecordedLogs() external view returns (Log[] memory logs);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getRecordedLogs()", "selector": "0x191553a4", "selectorBytes": [ @@ -6318,9 +6318,9 @@ "func": { "id": "getWallets", "description": "Returns addresses of available unlocked wallets in the script environment.", - "declaration": "function getWallets() external returns (address[] memory wallets);", + "declaration": "function getWallets() external view returns (address[] memory wallets);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getWallets()", "selector": "0xdb7a4605", "selectorBytes": [ diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index 5e7d205c148a0..b6df5b2faac09 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -914,7 +914,7 @@ interface Vm { /// Gets all the recorded logs. #[cheatcode(group = Evm, safety = Safe)] - function getRecordedLogs() external returns (Log[] memory logs); + function getRecordedLogs() external view returns (Log[] memory logs); // -------- Gas Metering -------- @@ -2249,7 +2249,7 @@ interface Vm { /// Returns addresses of available unlocked wallets in the script environment. #[cheatcode(group = Scripting)] - function getWallets() external returns (address[] memory wallets); + function getWallets() external view returns (address[] memory wallets); // ======== Utilities ======== diff --git a/crates/forge/tests/cli/script.rs b/crates/forge/tests/cli/script.rs index 1b1180e793015..c3695127a210f 100644 --- a/crates/forge/tests/cli/script.rs +++ b/crates/forge/tests/cli/script.rs @@ -2259,7 +2259,7 @@ forgetest_init!(can_get_script_wallets, |prj, cmd| { import "forge-std/Script.sol"; interface Vm { - function getWallets() external returns (address[] memory wallets); + function getWallets() external view returns (address[] memory wallets); } contract WalletScript is Script { @@ -2575,14 +2575,14 @@ Chain 31337 accessList [] chainId 31337 -gasLimit 228231 +gasLimit 228247 gasPrice input [..] -maxFeePerBlobGas -maxFeePerGas -maxPriorityFeePerGas +maxFeePerBlobGas +maxFeePerGas +maxPriorityFeePerGas nonce 0 -to +to type 0 value 0 @@ -2591,11 +2591,11 @@ value 0 accessList [] chainId 31337 gasLimit 93856 -gasPrice +gasPrice input 0x7357f5d2000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000000000000000000000000000000000000000001c8 -maxFeePerBlobGas -maxFeePerGas -maxPriorityFeePerGas +maxFeePerBlobGas +maxFeePerGas +maxPriorityFeePerGas nonce 1 to 0x5FbDB2315678afecb367f032d93F642f64180aa3 type 0 diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index ccc22904c6ef1..8fa071bdb9521 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -47,8 +47,8 @@ Mark `view`: - [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_ - [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_ - [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` -- [ ] `getRecordedLogs`: `getRecordedLogs()` -- [ ] `getWallets`: `getWallets()` +- [x] `getRecordedLogs`: `getRecordedLogs()` _suggested: `view`_ +- [x] `getWallets`: `getWallets()` _suggested: `view`_ - [x] `noAccessList`: `noAccessList()` _suggested: `view`_ - [x] `readCallers`: `readCallers()` _suggested: `view`_ From 87460f01fe8854b050ccac42dc87345c3eb6fad1 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Sat, 26 Apr 2025 12:31:35 -0400 Subject: [PATCH 10/12] feat(10027-cheatcode-mutability-tags): getNonce_1 is external view --- crates/cheatcodes/assets/cheatcodes.json | 4 ++-- crates/cheatcodes/spec/src/vm.rs | 2 +- docs/dev/cheatcode-mutability-review.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/cheatcodes/assets/cheatcodes.json b/crates/cheatcodes/assets/cheatcodes.json index 92def3f2059a7..7024fedc3d428 100644 --- a/crates/cheatcodes/assets/cheatcodes.json +++ b/crates/cheatcodes/assets/cheatcodes.json @@ -6238,9 +6238,9 @@ "func": { "id": "getNonce_1", "description": "Get the nonce of a `Wallet`.", - "declaration": "function getNonce(Wallet calldata wallet) external returns (uint64 nonce);", + "declaration": "function getNonce(Wallet calldata wallet) external view returns (uint64 nonce);", "visibility": "external", - "mutability": "", + "mutability": "view", "signature": "getNonce((address,uint256,uint256,uint256))", "selector": "0xa5748aad", "selectorBytes": [ diff --git a/crates/cheatcodes/spec/src/vm.rs b/crates/cheatcodes/spec/src/vm.rs index b6df5b2faac09..5825e4c9922e0 100644 --- a/crates/cheatcodes/spec/src/vm.rs +++ b/crates/cheatcodes/spec/src/vm.rs @@ -372,7 +372,7 @@ interface Vm { /// Get the nonce of a `Wallet`. #[cheatcode(group = Evm, safety = Safe)] - function getNonce(Wallet calldata wallet) external returns (uint64 nonce); + function getNonce(Wallet calldata wallet) external view returns (uint64 nonce); /// Loads a storage slot from an address. #[cheatcode(group = Evm, safety = Safe)] diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md index 8fa071bdb9521..38f019b5530c5 100644 --- a/docs/dev/cheatcode-mutability-review.md +++ b/docs/dev/cheatcode-mutability-review.md @@ -46,7 +46,7 @@ Mark `view`: - [x] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` _suggested: `view`_ - [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_ - [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_ -- [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` +- [x] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` _suggested: `view`_ - [x] `getRecordedLogs`: `getRecordedLogs()` _suggested: `view`_ - [x] `getWallets`: `getWallets()` _suggested: `view`_ - [x] `noAccessList`: `noAccessList()` _suggested: `view`_ From 96b0ab4a76a7e63ff17f16e9631a88103be0cb3d Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Mon, 5 May 2025 21:21:08 -0400 Subject: [PATCH 11/12] feat(10027-cheatcode-mutability-tags): remove cheatcode-mutability-review.md --- docs/dev/cheatcode-mutability-review.md | 279 ------------------------ 1 file changed, 279 deletions(-) delete mode 100644 docs/dev/cheatcode-mutability-review.md diff --git a/docs/dev/cheatcode-mutability-review.md b/docs/dev/cheatcode-mutability-review.md deleted file mode 100644 index 38f019b5530c5..0000000000000 --- a/docs/dev/cheatcode-mutability-review.md +++ /dev/null @@ -1,279 +0,0 @@ -# Cheatcode Mutability Review Checklist - -This document tracks all cheatcodes currently marked `external` with no `view` or `pure` mutability modifier. - -Total reviewed: **231** - ---- - -## Summary - -| Mutability | Count | Description | -|------------|-------|-------------| -| `pure` | 1 | Stateless helper functions | -| `view` | 11 | Reads test environment state | -| `-` (keep as is) | 219 | Modifies test state or relies on test state | - ---- - -## Review Criteria - -From issue [#10027](https://github.com/foundry-rs/foundry/issues/10027): - -- If a cheatcode **modifies observable state** for later cheatcode calls (EVM, interpreter, filesystem), it is neither `view` nor `pure` -- If a cheatcode **reads** from prior cheatcode state or environment state, it is `view` -- If a cheatcode **has no side effects** and doesn’t depend on test stat, it is `pure` - ---- - -## Mutability Suggestions - -### Pure Cheatcodes - -Mark `pure`: - -- [x] `contains`: `contains(string,string)` _suggested: `pure`_ - ---- - -### View Cheatcodes - -Mark `view`: - -- [x] `accessList`: `accessList(address,bytes32[])` _resolved: not view, keep as is due to test coverage indicating stateful behavior_ -- [x] `accesses`: `accesses(address)` _suggested: `view`_ -- [x] `eth_getLogs`: `eth_getLogs(uint256,uint256,address,bytes32[])` _suggested: `view`_ -- [x] `getMappingKeyAndParentOf`: `getMappingKeyAndParentOf(address,bytes32)` _suggested: `view`_ -- [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_ -- [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_ -- [x] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)` _suggested: `view`_ -- [x] `getRecordedLogs`: `getRecordedLogs()` _suggested: `view`_ -- [x] `getWallets`: `getWallets()` _suggested: `view`_ -- [x] `noAccessList`: `noAccessList()` _suggested: `view`_ -- [x] `readCallers`: `readCallers()` _suggested: `view`_ - ---- - -### Keep As Is - -Not `view` nor `pure`: - -- [ ] `_expectCheatcodeRevert_0`: `_expectCheatcodeRevert()` _suggested: keep as is_ -- [ ] `_expectCheatcodeRevert_1`: `_expectCheatcodeRevert(bytes4)` _suggested: keep as is_ -- [ ] `_expectCheatcodeRevert_2`: `_expectCheatcodeRevert(bytes)` _suggested: keep as is_ -- [ ] `allowCheatcodes`: `allowCheatcodes(address)` _suggested: keep as is_ -- [ ] `attachBlob`: `attachBlob(bytes)` _suggested: keep as is_ -- [ ] `attachDelegation`: `attachDelegation((uint8,bytes32,bytes32,uint64,address))` _suggested: keep as is_ -- [ ] `blobBaseFee`: `blobBaseFee(uint256)` _suggested: keep as is_ -- [ ] `blobhashes`: `blobhashes(bytes32[])` _suggested: keep as is_ -- [ ] `broadcastRawTransaction`: `broadcastRawTransaction(bytes)` _suggested: keep as is_ -- [ ] `broadcast_0`: `broadcast()` _suggested: keep as is_ -- [ ] `broadcast_1`: `broadcast(address)` _suggested: keep as is_ -- [ ] `broadcast_2`: `broadcast(uint256)` _suggested: keep as is_ -- [ ] `chainId`: `chainId(uint256)` _suggested: keep as is_ -- [ ] `clearMockedCalls`: `clearMockedCalls()` _suggested: keep as is_ -- [ ] `cloneAccount`: `cloneAccount(address,address)` _suggested: keep as is_ -- [ ] `closeFile`: `closeFile(string)` _suggested: keep as is_ -- [ ] `coinbase`: `coinbase(address)` _suggested: keep as is_ -- [ ] `cool`: `cool(address)` _suggested: keep as is_ -- [ ] `coolSlot`: `coolSlot(address,bytes32)` _suggested: keep as is_ -- [ ] `copyFile`: `copyFile(string,string)` _suggested: keep as is_ -- [ ] `copyStorage`: `copyStorage(address,address)` _suggested: keep as is_ -- [ ] `createDir`: `createDir(string,bool)` _suggested: keep as is_ -- [ ] `createFork_0`: `createFork(string)` _suggested: keep as is_ -- [ ] `createFork_1`: `createFork(string,uint256)` _suggested: keep as is_ -- [ ] `createFork_2`: `createFork(string,bytes32)` _suggested: keep as is_ -- [ ] `createSelectFork_0`: `createSelectFork(string)` _suggested: keep as is_ -- [ ] `createSelectFork_1`: `createSelectFork(string,uint256)` _suggested: keep as is_ -- [ ] `createSelectFork_2`: `createSelectFork(string,bytes32)` _suggested: keep as is_ -- [ ] `createWallet_0`: `createWallet(string)` _suggested: keep as is_ -- [ ] `createWallet_1`: `createWallet(uint256)` _suggested: keep as is_ -- [ ] `createWallet_2`: `createWallet(uint256,string)` _suggested: keep as is_ -- [ ] `deal`: `deal(address,uint256)` _suggested: keep as is_ -- [ ] `deleteSnapshot`: `deleteSnapshot(uint256)` _suggested: keep as is_ -- [ ] `deleteSnapshots`: `deleteSnapshots()` _suggested: keep as is_ -- [ ] `deleteStateSnapshot`: `deleteStateSnapshot(uint256)` _suggested: keep as is_ -- [ ] `deleteStateSnapshots`: `deleteStateSnapshots()` _suggested: keep as is_ -- [ ] `deployCode_0`: `deployCode(string)` _suggested: keep as is_ -- [ ] `deployCode_1`: `deployCode(string,bytes)` _suggested: keep as is_ -- [ ] `deployCode_2`: `deployCode(string,uint256)` _suggested: keep as is_ -- [ ] `deployCode_3`: `deployCode(string,bytes,uint256)` _suggested: keep as is_ -- [ ] `deployCode_4`: `deployCode(string,bytes32)` _suggested: keep as is_ -- [ ] `deployCode_5`: `deployCode(string,bytes,bytes32)` _suggested: keep as is_ -- [ ] `deployCode_6`: `deployCode(string,uint256,bytes32)` _suggested: keep as is_ -- [ ] `deployCode_7`: `deployCode(string,bytes,uint256,bytes32)` _suggested: keep as is_ -- [ ] `difficulty`: `difficulty(uint256)` _suggested: keep as is_ -- [ ] `dumpState`: `dumpState(string)` _suggested: keep as is_ -- [ ] `etch`: `etch(address,bytes)` _suggested: keep as is_ -- [ ] `expectCallMinGas_0`: `expectCallMinGas(address,uint256,uint64,bytes)` _suggested: keep as is_ -- [ ] `expectCallMinGas_1`: `expectCallMinGas(address,uint256,uint64,bytes,uint64)` _suggested: keep as is_ -- [ ] `expectCall_0`: `expectCall(address,bytes)` _suggested: keep as is_ -- [ ] `expectCall_1`: `expectCall(address,bytes,uint64)` _suggested: keep as is_ -- [ ] `expectCall_2`: `expectCall(address,uint256,bytes)` _suggested: keep as is_ -- [ ] `expectCall_3`: `expectCall(address,uint256,bytes,uint64)` _suggested: keep as is_ -- [ ] `expectCall_4`: `expectCall(address,uint256,uint64,bytes)` _suggested: keep as is_ -- [ ] `expectCall_5`: `expectCall(address,uint256,uint64,bytes,uint64)` _suggested: keep as is_ -- [ ] `expectCreate`: `expectCreate(bytes,address)`_suggested: keep as is_ -- [ ] `expectCreate2`: `expectCreate2(bytes,address)` _suggested: keep as is_ -- [ ] `expectEmitAnonymous_0`: `expectEmitAnonymous(bool,bool,bool,bool,bool)` _suggested: keep as is_ -- [ ] `expectEmitAnonymous_1`: `expectEmitAnonymous(bool,bool,bool,bool,bool,address)` _suggested: keep as is_ -- [ ] `expectEmitAnonymous_2`: `expectEmitAnonymous()` _suggested: keep as is_ -- [ ] `expectEmitAnonymous_3`: `expectEmitAnonymous(address)` _suggested: keep as is_ -- [ ] `expectEmit_0`: `expectEmit(bool,bool,bool,bool)` _suggested: keep as is_ -- [ ] `expectEmit_1`: `expectEmit(bool,bool,bool,bool,address)` _suggested: keep as is_ -- [ ] `expectEmit_2`: `expectEmit()` _suggested: keep as is_ -- [ ] `expectEmit_3`: `expectEmit(address)` _suggested: keep as is_ -- [ ] `expectEmit_4`: `expectEmit(bool,bool,bool,bool,uint64)` _suggested: keep as is_ -- [ ] `expectEmit_5`: `expectEmit(bool,bool,bool,bool,address,uint64)` _suggested: keep as is_ -- [ ] `expectEmit_6`: `expectEmit(uint64)` _suggested: keep as is_ -- [ ] `expectEmit_7`: `expectEmit(address,uint64)` _suggested: keep as is_ -- [ ] `expectPartialRevert_0`: `expectPartialRevert(bytes4)` _suggested: keep as is_ -- [ ] `expectPartialRevert_1`: `expectPartialRevert(bytes4,address)` _suggested: keep as is_ -- [ ] `expectRevert_0`: `expectRevert()` _suggested: keep as is_ -- [ ] `expectRevert_1`: `expectRevert(bytes4)` _suggested: keep as is_ -- [ ] `expectRevert_10`: `expectRevert(bytes4,address,uint64)` _suggested: keep as is_ -- [ ] `expectRevert_11`: `expectRevert(bytes,address,uint64)` _suggested: keep as is_ -- [ ] `expectRevert_2`: `expectRevert(bytes)` _suggested: keep as is_ -- [ ] `expectRevert_3`: `expectRevert(address)` _suggested: keep as is_ -- [ ] `expectRevert_4`: `expectRevert(bytes4,address)` _suggested: keep as is_ -- [ ] `expectRevert_5`: `expectRevert(bytes,address)` _suggested: keep as is_ -- [ ] `expectRevert_6`: `expectRevert(uint64)` _suggested: keep as is_ -- [ ] `expectRevert_7`: `expectRevert(bytes4,uint64)` _suggested: keep as is_ -- [ ] `expectRevert_8`: `expectRevert(bytes,uint64)` _suggested: keep as is_ -- [ ] `expectRevert_9`: `expectRevert(address,uint64)` _suggested: keep as is_ -- [ ] `expectSafeMemory`: `expectSafeMemory(uint64,uint64)` _suggested: keep as is_ -- [ ] `expectSafeMemoryCall`: `expectSafeMemoryCall(uint64,uint64)` _suggested: keep as is_ -- [ ] `fee`: `fee(uint256)` _suggested: keep as is_ -- [ ] `ffi`: `ffi(string[])` _suggested: keep as is_ -- [ ] `interceptInitcode`: `interceptInitcode()` _suggested: keep as is_ -- [ ] `label`: `label(address,string)` _suggested: keep as is_ -- [ ] `loadAllocs`: `loadAllocs(string)` _suggested: keep as is_ -- [ ] `makePersistent_0`: `makePersistent(address)` _suggested: keep as is_ -- [ ] `makePersistent_1`: `makePersistent(address,address)` _suggested: keep as is_ -- [ ] `makePersistent_2`: `makePersistent(address,address,address)` _suggested: keep as is_ -- [ ] `makePersistent_3`: `makePersistent(address[])` _suggested: keep as is_ -- [ ] `mockCallRevert_0`: `mockCallRevert(address,bytes,bytes)` _suggested: keep as is_ -- [ ] `mockCallRevert_1`: `mockCallRevert(address,uint256,bytes,bytes)` _suggested: keep as is_ -- [ ] `mockCallRevert_2`: `mockCallRevert(address,bytes4,bytes)` _suggested: keep as is_ -- [ ] `mockCallRevert_3`: `mockCallRevert(address,uint256,bytes4,bytes)` _suggested: keep as is_ -- [ ] `mockCall_0`: `mockCall(address,bytes,bytes)` _suggested: keep as is_ -- [ ] `mockCall_1`: `mockCall(address,uint256,bytes,bytes)` _suggested: keep as is_ -- [ ] `mockCall_2`: `mockCall(address,bytes4,bytes)` _suggested: keep as is_ -- [ ] `mockCall_3`: `mockCall(address,uint256,bytes4,bytes)` _suggested: keep as is_ -- [ ] `mockCalls_0`: `mockCalls(address,bytes,bytes[])` _suggested: keep as is_ -- [ ] `mockCalls_1`: `mockCalls(address,uint256,bytes,bytes[])` _suggested: keep as is_ -- [ ] `mockFunction`: `mockFunction(address,address,bytes)` _suggested: keep as is_ -- [ ] `pauseGasMetering`: `pauseGasMetering()` _suggested: keep as is_ -- [ ] `prank_0`: `prank(address)` _suggested: keep as is_ -- [ ] `prank_1`: `prank(address,address)` _suggested: keep as is_ -- [ ] `prank_2`: `prank(address,bool)` _suggested: keep as is_ -- [ ] `prank_3`: `prank(address,address,bool)` _suggested: keep as is_ -- [ ] `prevrandao_0`: `prevrandao(bytes32)` _suggested: keep as is_ -- [ ] `prevrandao_1`: `prevrandao(uint256)` _suggested: keep as is_ -- [ ] `prompt`: `prompt(string)` _suggested: keep as is_ -- [ ] `promptAddress`: `promptAddress(string)` _suggested: keep as is_ -- [ ] `promptSecret`: `promptSecret(string)` _suggested: keep as is_ -- [ ] `promptSecretUint`: `promptSecretUint(string)` _suggested: keep as is_ -- [ ] `promptUint`: `promptUint(string)` _suggested: keep as is_ -- [ ] `randomAddress`: `randomAddress()` _suggested: keep as is_ -- [ ] `randomUint_0`: `randomUint()` _suggested: keep as is_ -- [ ] `randomUint_1`: `randomUint(uint256,uint256)` _suggested: keep as is_ -- [ ] `record`: `record()` _suggested: keep as is_ -- [ ] `recordLogs`: `recordLogs()` _suggested: keep as is_ -- [ ] `rememberKey`: `rememberKey(uint256)` _suggested: keep as is_ -- [ ] `rememberKeys_0`: `rememberKeys(string,string,uint32)` _suggested: keep as is_ -- [ ] `rememberKeys_1`: `rememberKeys(string,string,string,uint32)` _suggested: keep as is_ -- [ ] `removeDir`: `removeDir(string,bool)` _suggested: keep as is_ -- [ ] `removeFile`: `removeFile(string)` _suggested: keep as is_ -- [ ] `resetGasMetering`: `resetGasMetering()` _suggested: keep as is_ -- [ ] `resetNonce`: `resetNonce(address)` _suggested: keep as is_ -- [ ] `resumeGasMetering`: `resumeGasMetering()` _suggested: keep as is_ -- [ ] `revertTo`: `revertTo(uint256)` _suggested: keep as is_ -- [ ] `revertToAndDelete`: `revertToAndDelete(uint256)` _suggested: keep as is_ -- [ ] `revertToState`: `revertToState(uint256)` _suggested: keep as is_ -- [ ] `revertToStateAndDelete`: `revertToStateAndDelete(uint256)` _suggested: keep as is_ -- [ ] `revokePersistent_0`: `revokePersistent(address)` _suggested: keep as is_ -- [ ] `revokePersistent_1`: `revokePersistent(address[])` _suggested: keep as is_ -- [ ] `roll`: `roll(uint256)` _suggested: keep as is_ -- [ ] `rollFork_0`: `rollFork(uint256)` _suggested: keep as is_ -- [ ] `rollFork_1`: `rollFork(bytes32)` _suggested: keep as is_ -- [ ] `rollFork_2`: `rollFork(uint256,uint256)` _suggested: keep as is_ -- [ ] `rollFork_3`: `rollFork(uint256,bytes32)` _suggested: keep as is_ -- [ ] `rpc_0`: `rpc(string,string)` _suggested: keep as is_ -- [ ] `rpc_1`: `rpc(string,string,string)` _suggested: keep as is_ -- [ ] `selectFork`: `selectFork(uint256)` _suggested: keep as is_ -- [ ] `serializeAddress_0`: `serializeAddress(string,string,address)` _suggested: keep as is_ -- [ ] `serializeAddress_1`: `serializeAddress(string,string,address[])` _suggested: keep as is_ -- [ ] `serializeBool_0`: `serializeBool(string,string,bool)` _suggested: keep as is_ -- [ ] `serializeBool_1`: `serializeBool(string,string,bool[])` _suggested: keep as is_ -- [ ] `serializeBytes32_0`: `serializeBytes32(string,string,bytes32)` _suggested: keep as is_ -- [ ] `serializeBytes32_1`: `serializeBytes32(string,string,bytes32[])` _suggested: keep as is_ -- [ ] `serializeBytes_0`: `serializeBytes(string,string,bytes)` _suggested: keep as is_ -- [ ] `serializeBytes_1`: `serializeBytes(string,string,bytes[])` _suggested: keep as is_ -- [ ] `serializeInt_0`: `serializeInt(string,string,int256)` _suggested: keep as is_ -- [ ] `serializeInt_1`: `serializeInt(string,string,int256[])` _suggested: keep as is_ -- [ ] `serializeJson`: `serializeJson(string,string)` _suggested: keep as is_ -- [ ] `serializeJsonType_1`: `serializeJsonType(string,string,string,bytes)` _suggested: keep as is_ -- [ ] `serializeString_0`: `serializeString(string,string,string)` _suggested: keep as is_ -- [ ] `serializeString_1`: `serializeString(string,string,string[])` _suggested: keep as is_ -- [ ] `serializeUintToHex`: `serializeUintToHex(string,string,uint256)` _suggested: keep as is_ -- [ ] `serializeUint_0`: `serializeUint(string,string,uint256)` _suggested: keep as is_ -- [ ] `serializeUint_1`: `serializeUint(string,string,uint256[])` _suggested: keep as is_ -- [ ] `setArbitraryStorage_0`: `setArbitraryStorage(address)` _suggested: keep as is_ -- [ ] `setArbitraryStorage_1`: `setArbitraryStorage(address,bool)` _suggested: keep as is_ -- [ ] `setBlockhash`: `setBlockhash(uint256,bytes32)` _suggested: keep as is_ -- [ ] `setEnv`: `setEnv(string,string)` _suggested: keep as is_ -- [ ] `setNonce`: `setNonce(address,uint64)` _suggested: keep as is_ -- [ ] `setNonceUnsafe`: `setNonceUnsafe(address,uint64)` _suggested: keep as is_ -- [ ] `shuffle`: `shuffle(uint256[])` _suggested: keep as is_ -- [ ] `signAndAttachDelegation_0`: `signAndAttachDelegation(address,uint256)` _suggested: keep as is_ -- [ ] `signAndAttachDelegation_1`: `signAndAttachDelegation(address,uint256,uint64)` _suggested: keep as is_ -- [ ] `signCompact_0`: `signCompact((address,uint256,uint256,uint256),bytes32)` _suggested: keep as is_ -- [ ] `signDelegation_0`: `signDelegation(address,uint256)` _suggested: keep as is_ -- [ ] `signDelegation_1`: `signDelegation(address,uint256,uint64)` _suggested: keep as is_ -- [ ] `sign_0`: `sign((address,uint256,uint256,uint256),bytes32)` _suggested: keep as is_ -- [ ] `skip_0`: `skip(bool)` _suggested: keep as is_ -- [ ] `skip_1`: `skip(bool,string)` _suggested: keep as is_ -- [ ] `sleep`: `sleep(uint256)` _suggested: keep as is_ -- [ ] `snapshot`: `snapshot()` _suggested: keep as is_ -- [ ] `snapshotGasLastCall_0`: `snapshotGasLastCall(string)` _suggested: keep as is_ -- [ ] `snapshotGasLastCall_1`: `snapshotGasLastCall(string,string)` _suggested: keep as is_ -- [ ] `snapshotState`: `snapshotState()` _suggested: keep as is_ -- [ ] `snapshotValue_0`: `snapshotValue(string,uint256)` _suggested: keep as is_ -- [ ] `snapshotValue_1`: `snapshotValue(string,string,uint256)` _suggested: keep as is_ -- [ ] `sort`: `sort(uint256[])` _suggested: keep as is_ -- [ ] `startBroadcast_0`: `startBroadcast()` _suggested: keep as is_ -- [ ] `startBroadcast_1`: `startBroadcast(address)` _suggested: keep as is_ -- [ ] `startBroadcast_2`: `startBroadcast(uint256)` _suggested: keep as is_ -- [ ] `startDebugTraceRecording`: `startDebugTraceRecording()` _suggested: keep as is_ -- [ ] `startMappingRecording`: `startMappingRecording()` _suggested: keep as is_ -- [ ] `startPrank_0`: `startPrank(address)` _suggested: keep as is_ -- [ ] `startPrank_1`: `startPrank(address,address)` _suggested: keep as is_ -- [ ] `startPrank_2`: `startPrank(address,bool)` _suggested: keep as is_ -- [ ] `startPrank_3`: `startPrank(address,address,bool)` _suggested: keep as is_ -- [ ] `startSnapshotGas_0`: `startSnapshotGas(string)` _suggested: keep as is_ -- [ ] `startSnapshotGas_1`: `startSnapshotGas(string,string)` _suggested: keep as is_ -- [ ] `startStateDiffRecording`: `startStateDiffRecording()` _suggested: keep as is_ -- [ ] `stopAndReturnDebugTraceRecording`: `stopAndReturnDebugTraceRecording()` _suggested: keep as is_ -- [ ] `stopAndReturnStateDiff`: `stopAndReturnStateDiff()` _suggested: keep as is_ -- [ ] `stopBroadcast`: `stopBroadcast()` _suggested: keep as is_ -- [ ] `stopExpectSafeMemory`: `stopExpectSafeMemory()` _suggested: keep as is_ -- [ ] `stopMappingRecording`: `stopMappingRecording()` _suggested: keep as is_ -- [ ] `stopPrank`: `stopPrank()` _suggested: keep as is_ -- [ ] `stopSnapshotGas_0`: `stopSnapshotGas()` _suggested: keep as is_ -- [ ] `stopSnapshotGas_1`: `stopSnapshotGas(string)` _suggested: keep as is_ -- [ ] `stopSnapshotGas_2`: `stopSnapshotGas(string,string)` _suggested: keep as is_ -- [ ] `store`: `store(address,bytes32,bytes32)` _suggested: keep as is_ -- [ ] `transact_0`: `transact(bytes32)` _suggested: keep as is_ -- [ ] `transact_1`: `transact(uint256,bytes32)` _suggested: keep as is_ -- [ ] `tryFfi`: `tryFfi(string[])` _suggested: keep as is_ -- [ ] `txGasPrice`: `txGasPrice(uint256)` _suggested: keep as is_ -- [ ] `warmSlot`: `warmSlot(address,bytes32)` _suggested: keep as is_ -- [ ] `warp`: `warp(uint256)` _suggested: keep as is_ -- [ ] `writeFile`: `writeFile(string,string)` _suggested: keep as is_ -- [ ] `writeFileBinary`: `writeFileBinary(string,bytes)` _suggested: keep as is_ -- [ ] `writeJson_0`: `writeJson(string,string)` _suggested: keep as is_ -- [ ] `writeJson_1`: `writeJson(string,string,string)` _suggested: keep as is_ -- [ ] `writeLine`: `writeLine(string,string)` _suggested: keep as is_ -- [ ] `writeToml_0`: `writeToml(string,string)` _suggested: keep as is_ -- [ ] `writeToml_1`: `writeToml(string,string,string)` _suggested: keep as is_ From 5d97d85b39b1c04173187fbe863e02d13b7ef642 Mon Sep 17 00:00:00 2001 From: Mouzayan Delbourgo Date: Mon, 5 May 2025 21:45:18 -0400 Subject: [PATCH 12/12] feat(10027-cheatcode-mutability-tags): add back white space --- crates/forge/tests/cli/script.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/forge/tests/cli/script.rs b/crates/forge/tests/cli/script.rs index c3695127a210f..879dacc59eed5 100644 --- a/crates/forge/tests/cli/script.rs +++ b/crates/forge/tests/cli/script.rs @@ -2578,11 +2578,11 @@ chainId 31337 gasLimit 228247 gasPrice input [..] -maxFeePerBlobGas -maxFeePerGas -maxPriorityFeePerGas +maxFeePerBlobGas +maxFeePerGas +maxPriorityFeePerGas nonce 0 -to +to type 0 value 0 @@ -2591,11 +2591,11 @@ value 0 accessList [] chainId 31337 gasLimit 93856 -gasPrice +gasPrice input 0x7357f5d2000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000000000000000000000000000000000000000001c8 -maxFeePerBlobGas -maxFeePerGas -maxPriorityFeePerGas +maxFeePerBlobGas +maxFeePerGas +maxPriorityFeePerGas nonce 1 to 0x5FbDB2315678afecb367f032d93F642f64180aa3 type 0