You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(cheatcodes): improve overview page and remove category index pages
- Remove cheatcode category index pages (environment, assertions, etc.)
- Add redirects for removed pages to overview
- Update sidebar to remove links from category headers
- Replace overview page content with Cards component
- Add search hint tip
- Remove Vm.sol generation (no longer embedded, now links to GitHub)
- Streamline Forge Std and Contributing sections
Cheatcodes give you powerful assertions, the ability to alter the state of the EVM, mock data, and more.
4
6
5
7
Cheatcodes are made available through use of the cheatcode address (`0x7109709ECfa91a80626fF3989D68f67F5b1DD12D`).
6
8
9
+
:::tip[Finding Cheatcodes]
10
+
Use the sidebar to browse cheatcodes by category, or press `Ctrl+K` / `Cmd+K` to search for a specific cheatcode.
11
+
:::
12
+
7
13
:::note
8
14
If you encounter errors for this address when using fuzzed addresses in your tests, you may wish to
9
15
exclude it from your fuzz tests by using the following line:
@@ -16,35 +22,69 @@ exclude it from your fuzz tests by using the following line:
16
22
17
23
You can also access cheatcodes easily via `vm` available in Forge Standard Library's [`Test`](/reference/forge-std/overview) contract.
18
24
19
-
### Forge Standard Library Cheatcodes
20
-
21
-
Forge Std implements wrappers around cheatcodes, which combine multiple standard cheatcodes to improve development experience. These are not technically cheatcodes, but rather compositions of Forge's cheatcodes.
22
-
23
-
You can view the list of Forge Standard Library's cheatcode wrappers [in the references section](/reference/forge-std/std-cheats.mdx). You can reference the [Forge Std source code](https://github.com/foundry-rs/forge-std/blob/master/src/Test.sol) to learn more about how the wrappers work under the hood.
24
-
25
-
### Cheatcode Types
26
-
27
-
Below are some subsections for the different Forge cheatcodes.
28
-
29
-
-[Environment](/reference/cheatcodes/environment.mdx): Cheatcodes that alter the state of the EVM.
30
-
-[Assertions](/reference/cheatcodes/assertions.mdx): Cheatcodes that are powerful assertions
31
-
-[Fuzzer](/reference/cheatcodes/fuzzer.mdx): Cheatcodes that configure the fuzzer
32
-
-[External](/reference/cheatcodes/external.mdx): Cheatcodes that interact with external state (files, commands, ...)
33
-
-[Signing](/reference/cheatcodes/signing.mdx): Cheatcodes for signing
-[State snapshots](/reference/cheatcodes/state-snapshots.mdx): State snapshot cheatcodes
37
-
-[RPC](/reference/cheatcodes/rpc.mdx): RPC related cheatcodes
38
-
-[File](/reference/cheatcodes/fs.mdx): Cheatcodes for working with files
39
-
40
-
### Add a new cheatcode
41
-
42
-
If you need a new feature, consider [contributing to the Foundry's codebase](https://github.com/foundry-rs/foundry) to add the cheatcode.
25
+
### Cheatcode Categories
26
+
27
+
<Cards>
28
+
<Card
29
+
title="Environment"
30
+
description="Manipulate the EVM state: block timestamp, number, msg.sender, storage, balances, and more."
31
+
to="/reference/cheatcodes/warp"
32
+
/>
33
+
<Card
34
+
title="Assertions"
35
+
description="Expect reverts, events, and calls in your tests."
36
+
to="/reference/cheatcodes/expect-revert"
37
+
/>
38
+
<Card
39
+
title="Fuzzer"
40
+
description="Control fuzzer behavior with assumptions and constraints."
41
+
to="/reference/cheatcodes/assume"
42
+
/>
43
+
<Card
44
+
title="Forking"
45
+
description="Create and manage forks of live networks."
46
+
to="/reference/cheatcodes/create-fork"
47
+
/>
48
+
<Card
49
+
title="External"
50
+
description="Interact with the outside world: run commands, read environment variables, parse JSON/TOML."
51
+
to="/reference/cheatcodes/ffi"
52
+
/>
53
+
<Card
54
+
title="Signing"
55
+
description="Sign messages and EIP-7702 delegations."
56
+
to="/reference/cheatcodes/sign"
57
+
/>
58
+
<Card
59
+
title="Utilities"
60
+
description="Helper functions for addresses, labels, parsing, and wallets."
61
+
to="/reference/cheatcodes/addr"
62
+
/>
63
+
<Card
64
+
title="Files"
65
+
description="Read and write files from your tests and scripts."
66
+
to="/reference/cheatcodes/fs"
67
+
/>
68
+
<Card
69
+
title="RPC"
70
+
description="Register and interact with RPC endpoints."
71
+
to="/reference/cheatcodes/rpc"
72
+
/>
73
+
<Card
74
+
title="State Snapshots"
75
+
description="Snapshot and restore EVM state."
76
+
to="/reference/cheatcodes/state-snapshots"
77
+
/>
78
+
</Cards>
79
+
80
+
### Forge Standard Library
81
+
82
+
Forge Std implements wrappers around cheatcodes, which combine multiple standard cheatcodes to improve development experience. See [Std Cheats](/reference/forge-std/std-cheats) for more details.
83
+
84
+
### Contributing
85
+
86
+
If you need a new cheatcode, consider [contributing to the Foundry codebase](https://github.com/foundry-rs/foundry).
43
87
44
88
### Cheatcodes Interface
45
89
46
-
This is a Solidity interface for all of the cheatcodes present in Forge.
47
-
48
-
```solidity
49
-
// [!include ~/snippets/output/vm/Vm.sol]
50
-
```
90
+
The complete Solidity interface for all cheatcodes is available in the [forge-std repository](https://github.com/foundry-rs/forge-std/blob/master/src/Vm.sol).
0 commit comments