Skip to main content

foundry_cheatcodes_spec/
vm.rs

1// We don't document function parameters individually so we can't enable `missing_docs` for this
2// module. Instead, we emit custom diagnostics in `#[derive(Cheatcode)]`.
3#![allow(missing_docs)]
4
5use super::*;
6use crate::Vm::ForgeContext;
7use alloy_sol_types::sol;
8use foundry_macros::Cheatcode;
9
10sol! {
11// Cheatcodes are marked as view/pure/none using the following rules:
12// 0. A call's observable behaviour includes its return value, logs, reverts and state writes,
13// 1. If you can influence a later call's observable behaviour, you're neither `view` nor `pure`
14//    (you are modifying some state be it the EVM, interpreter, filesystem, etc),
15// 2. Otherwise if you can be influenced by an earlier call, or if reading some state, you're `view`,
16// 3. Otherwise you're `pure`.
17
18/// Foundry cheatcodes interface.
19#[derive(Debug, Cheatcode)] // Keep this list small to avoid unnecessary bloat.
20#[sol(abi)]
21interface Vm {
22    //  ======== Types ========
23
24    /// Error thrown by cheatcodes.
25    error CheatcodeError(string message);
26
27    /// A modification applied to either `msg.sender` or `tx.origin`. Returned by `readCallers`.
28    enum CallerMode {
29        /// No caller modification is currently active.
30        None,
31        /// A one time broadcast triggered by a `vm.broadcast()` call is currently active.
32        Broadcast,
33        /// A recurrent broadcast triggered by a `vm.startBroadcast()` call is currently active.
34        RecurrentBroadcast,
35        /// A one time prank triggered by a `vm.prank()` call is currently active.
36        Prank,
37        /// A recurrent prank triggered by a `vm.startPrank()` call is currently active.
38        RecurrentPrank,
39    }
40
41    /// The kind of account access that occurred.
42    enum AccountAccessKind {
43        /// The account was called.
44        Call,
45        /// The account was called via delegatecall.
46        DelegateCall,
47        /// The account was called via callcode.
48        CallCode,
49        /// The account was called via staticcall.
50        StaticCall,
51        /// The account was created.
52        Create,
53        /// The account was selfdestructed.
54        SelfDestruct,
55        /// Synthetic access indicating the current context has resumed after a previous sub-context (AccountAccess).
56        Resume,
57        /// The account's balance was read.
58        Balance,
59        /// The account's codesize was read.
60        Extcodesize,
61        /// The account's codehash was read.
62        Extcodehash,
63        /// The account's code was copied.
64        Extcodecopy,
65    }
66
67    /// Forge execution contexts.
68    enum ForgeContext {
69        /// Test group execution context (test, coverage or snapshot).
70        TestGroup,
71        /// `forge test` execution context.
72        Test,
73        /// `forge coverage` execution context.
74        Coverage,
75        /// `forge snapshot` execution context.
76        Snapshot,
77        /// Script group execution context (dry run, broadcast or resume).
78        ScriptGroup,
79        /// `forge script` execution context.
80        ScriptDryRun,
81        /// `forge script --broadcast` execution context.
82        ScriptBroadcast,
83        /// `forge script --resume` execution context.
84        ScriptResume,
85        /// Unknown `forge` execution context.
86        Unknown,
87    }
88
89    /// An Ethereum log. Returned by `getRecordedLogs`.
90    struct Log {
91        /// The topics of the log, including the signature, if any.
92        bytes32[] topics;
93        /// The raw data of the log.
94        bytes data;
95        /// The address of the log's emitter.
96        address emitter;
97    }
98
99    /// Gas used. Returned by `lastCallGas`.
100    struct Gas {
101        /// The gas limit of the call.
102        uint64 gasLimit;
103        /// The total gas used.
104        uint64 gasTotalUsed;
105        /// DEPRECATED: The amount of gas used for memory expansion. Ref: <https://github.com/foundry-rs/foundry/pull/7934#pullrequestreview-2069236939>
106        uint64 gasMemoryUsed;
107        /// The amount of gas refunded.
108        int64 gasRefunded;
109        /// The amount of gas remaining.
110        uint64 gasRemaining;
111    }
112
113    /// An RPC URL and its alias. Returned by `rpcUrlStructs`.
114    struct Rpc {
115        /// The alias of the RPC URL.
116        string key;
117        /// The RPC URL.
118        string url;
119    }
120
121    /// An RPC log object. Returned by `eth_getLogs`.
122    struct EthGetLogs {
123        /// The address of the log's emitter.
124        address emitter;
125        /// The topics of the log, including the signature, if any.
126        bytes32[] topics;
127        /// The raw data of the log.
128        bytes data;
129        /// The block hash.
130        bytes32 blockHash;
131        /// The block number.
132        uint64 blockNumber;
133        /// The transaction hash.
134        bytes32 transactionHash;
135        /// The transaction index in the block.
136        uint64 transactionIndex;
137        /// The log index.
138        uint256 logIndex;
139        /// Whether the log was removed.
140        bool removed;
141    }
142
143    /// A single entry in a directory listing. Returned by `readDir`.
144    struct DirEntry {
145        /// The error message, if any.
146        string errorMessage;
147        /// The path of the entry.
148        string path;
149        /// The depth of the entry.
150        uint64 depth;
151        /// Whether the entry is a directory.
152        bool isDir;
153        /// Whether the entry is a symlink.
154        bool isSymlink;
155    }
156
157    /// Metadata information about a file.
158    ///
159    /// This structure is returned from the `fsMetadata` function and represents known
160    /// metadata about a file such as its permissions, size, modification
161    /// times, etc.
162    struct FsMetadata {
163        /// True if this metadata is for a directory.
164        bool isDir;
165        /// True if this metadata is for a symlink.
166        bool isSymlink;
167        /// The size of the file, in bytes, this metadata is for.
168        uint256 length;
169        /// True if this metadata is for a readonly (unwritable) file.
170        bool readOnly;
171        /// The last modification time listed in this metadata.
172        uint256 modified;
173        /// The last access time of this metadata.
174        uint256 accessed;
175        /// The creation time listed in this metadata.
176        uint256 created;
177    }
178
179    /// A wallet with a public and private key.
180    struct Wallet {
181        /// The wallet's address.
182        address addr;
183        /// The wallet's public key `X`.
184        uint256 publicKeyX;
185        /// The wallet's public key `Y`.
186        uint256 publicKeyY;
187        /// The wallet's private key.
188        uint256 privateKey;
189    }
190
191    /// The result of a `tryFfi` call.
192    struct FfiResult {
193        /// The exit code of the call.
194        int32 exitCode;
195        /// The optionally hex-decoded `stdout` data.
196        bytes stdout;
197        /// The `stderr` data.
198        bytes stderr;
199    }
200
201    /// Information on the chain and fork.
202    struct ChainInfo {
203        /// The fork identifier. Set to zero if no fork is active.
204        uint256 forkId;
205        /// The chain ID of the current fork.
206        uint256 chainId;
207    }
208
209    /// Information about a blockchain.
210    struct Chain {
211        /// The chain name.
212        string name;
213        /// The chain's Chain ID.
214        uint256 chainId;
215        /// The chain's alias. (i.e. what gets specified in `foundry.toml`).
216        string chainAlias;
217        /// A default RPC endpoint for this chain.
218        string rpcUrl;
219    }
220
221    /// The storage accessed during an `AccountAccess`.
222    struct StorageAccess {
223        /// The account whose storage was accessed.
224        address account;
225        /// The slot that was accessed.
226        bytes32 slot;
227        /// If the access was a write.
228        bool isWrite;
229        /// The previous value of the slot.
230        bytes32 previousValue;
231        /// The new value of the slot.
232        bytes32 newValue;
233        /// If the access was reverted.
234        bool reverted;
235    }
236
237    /// An EIP-2930 access list item.
238    struct AccessListItem {
239        /// The address to be added in access list.
240        address target;
241        /// The storage keys to be added in access list.
242        bytes32[] storageKeys;
243    }
244
245    /// The result of a `stopAndReturnStateDiff` call.
246    struct AccountAccess {
247        /// The chain and fork the access occurred.
248        ChainInfo chainInfo;
249        /// The kind of account access that determines what the account is.
250        /// If kind is Call, DelegateCall, StaticCall or CallCode, then the account is the callee.
251        /// If kind is Create, then the account is the newly created account.
252        /// If kind is SelfDestruct, then the account is the selfdestruct recipient.
253        /// If kind is a Resume, then account represents a account context that has resumed.
254        AccountAccessKind kind;
255        /// The account that was accessed.
256        /// It's either the account created, callee or a selfdestruct recipient for CREATE, CALL or SELFDESTRUCT.
257        address account;
258        /// What accessed the account.
259        address accessor;
260        /// If the account was initialized or empty prior to the access.
261        /// An account is considered initialized if it has code, a
262        /// non-zero nonce, or a non-zero balance.
263        bool initialized;
264        /// The previous balance of the accessed account.
265        uint256 oldBalance;
266        /// The potential new balance of the accessed account.
267        /// That is, all balance changes are recorded here, even if reverts occurred.
268        uint256 newBalance;
269        /// Code of the account deployed by CREATE.
270        bytes deployedCode;
271        /// Value passed along with the account access
272        uint256 value;
273        /// Input data provided to the CREATE or CALL
274        bytes data;
275        /// If this access reverted in either the current or parent context.
276        bool reverted;
277        /// An ordered list of storage accesses made during an account access operation.
278        StorageAccess[] storageAccesses;
279        /// Call depth traversed during the recording of state differences
280        uint64 depth;
281        /// The previous nonce of the accessed account.
282        uint64 oldNonce;
283        /// The new nonce of the accessed account.
284        uint64 newNonce;
285    }
286
287    /// The result of the `stopDebugTraceRecording` call
288    struct DebugStep {
289        /// The stack before executing the step of the run.
290        /// stack\[0\] represents the top of the stack.
291        /// and only stack data relevant to the opcode execution is contained.
292        uint256[] stack;
293        /// The memory input data before executing the step of the run.
294        /// only input data relevant to the opcode execution is contained.
295        ///
296        /// e.g. for MLOAD, it will have memory\[offset:offset+32\] copied here.
297        /// the offset value can be get by the stack data.
298        bytes memoryInput;
299        /// The opcode that was accessed.
300        uint8 opcode;
301        /// The call depth of the step.
302        uint64 depth;
303        /// Whether the call end up with out of gas error.
304        bool isOutOfGas;
305        /// The contract address where the opcode is running
306        address contractAddr;
307    }
308
309    /// The transaction type (`txType`) of the broadcast.
310    enum BroadcastTxType {
311        /// Represents a CALL broadcast tx.
312        Call,
313        /// Represents a CREATE broadcast tx.
314        Create,
315        /// Represents a CREATE2 broadcast tx.
316        Create2
317    }
318
319    /// Represents a transaction's broadcast details.
320    struct BroadcastTxSummary {
321        /// The hash of the transaction that was broadcasted
322        bytes32 txHash;
323        /// Represent the type of transaction among CALL, CREATE, CREATE2
324        BroadcastTxType txType;
325        /// The address of the contract that was called or created.
326        /// This is address of the contract that is created if the txType is CREATE or CREATE2.
327        address contractAddress;
328        /// The block number the transaction landed in.
329        uint64 blockNumber;
330        /// Status of the transaction, retrieved from the transaction receipt.
331        bool success;
332    }
333
334    /// Holds a signed EIP-7702 authorization for an authority account to delegate to an implementation.
335    struct SignedDelegation {
336        /// The y-parity of the recovered secp256k1 signature (0 or 1).
337        uint8 v;
338        /// First 32 bytes of the signature.
339        bytes32 r;
340        /// Second 32 bytes of the signature.
341        bytes32 s;
342        /// The current nonce of the authority account at signing time.
343        /// Used to ensure signature can't be replayed after account nonce changes.
344        uint64 nonce;
345        /// Address of the contract implementation that will be delegated to.
346        /// Gets encoded into delegation code: 0xef0100 || implementation.
347        address implementation;
348    }
349
350    /// Represents a "potential" revert reason from a single subsequent call when using `vm.assumeNoReverts`.
351    /// Reverts that match will result in a FOUNDRY::ASSUME rejection, whereas unmatched reverts will be surfaced
352    /// as normal.
353    struct PotentialRevert {
354        /// The allowed origin of the revert opcode; address(0) allows reverts from any address
355        address reverter;
356        /// When true, only matches on the beginning of the revert data, otherwise, matches on entire revert data
357        bool partialMatch;
358        /// The data to use to match encountered reverts
359        bytes revertData;
360    }
361
362    // ======== EVM ========
363
364    /// Gets the address for a given private key.
365    #[cheatcode(group = Evm, safety = Safe)]
366    function addr(uint256 privateKey) external pure returns (address keyAddr);
367
368    /// Dump a genesis JSON file's `allocs` to disk.
369    #[cheatcode(group = Evm, safety = Unsafe)]
370    function dumpState(string calldata pathToStateJson) external;
371
372    /// Gets the nonce of an account.
373    #[cheatcode(group = Evm, safety = Safe)]
374    function getNonce(address account) external view returns (uint64 nonce);
375
376    /// Get the nonce of a `Wallet`.
377    #[cheatcode(group = Evm, safety = Safe)]
378    function getNonce(Wallet calldata wallet) external view returns (uint64 nonce);
379
380    /// Loads a storage slot from an address.
381    #[cheatcode(group = Evm, safety = Safe)]
382    function load(address target, bytes32 slot) external view returns (bytes32 data);
383
384    /// Load a genesis JSON file's `allocs` into the in-memory EVM state.
385    #[cheatcode(group = Evm, safety = Unsafe)]
386    function loadAllocs(string calldata pathToAllocsJson) external;
387
388    // -------- Record Debug Traces --------
389
390    /// Records the debug trace during the run.
391    #[cheatcode(group = Evm, safety = Safe)]
392    function startDebugTraceRecording() external;
393
394    /// Stop debug trace recording and returns the recorded debug trace.
395    #[cheatcode(group = Evm, safety = Safe)]
396    function stopAndReturnDebugTraceRecording() external returns (DebugStep[] memory step);
397
398
399    /// Clones a source account code, state, balance and nonce to a target account and updates in-memory EVM state.
400    #[cheatcode(group = Evm, safety = Unsafe)]
401    function cloneAccount(address source, address target) external;
402
403    // -------- Record Storage --------
404
405    /// Records all storage reads and writes. Use `accesses` to get the recorded data.
406    /// Subsequent calls to `record` will clear the previous data.
407    #[cheatcode(group = Evm, safety = Safe)]
408    function record() external;
409
410    /// Stops recording storage reads and writes.
411    #[cheatcode(group = Evm, safety = Safe)]
412    function stopRecord() external;
413
414    /// Gets all accessed reads and write slot from a `vm.record` session, for a given address.
415    #[cheatcode(group = Evm, safety = Safe)]
416    function accesses(address target) external view returns (bytes32[] memory readSlots, bytes32[] memory writeSlots);
417
418    /// Record all account accesses as part of CREATE, CALL or SELFDESTRUCT opcodes in order,
419    /// along with the context of the calls
420    #[cheatcode(group = Evm, safety = Safe)]
421    function startStateDiffRecording() external;
422
423    /// Returns an ordered array of all account accesses from a `vm.startStateDiffRecording` session.
424    #[cheatcode(group = Evm, safety = Safe)]
425    function stopAndReturnStateDiff() external returns (AccountAccess[] memory accountAccesses);
426
427    /// Returns state diffs from current `vm.startStateDiffRecording` session.
428    #[cheatcode(group = Evm, safety = Safe)]
429    function getStateDiff() external view returns (string memory diff);
430
431    /// Returns state diffs from current `vm.startStateDiffRecording` session, in json format.
432    #[cheatcode(group = Evm, safety = Safe)]
433    function getStateDiffJson() external view returns (string memory diff);
434
435    /// Returns an array of storage slots occupied by the specified variable.
436    #[cheatcode(group = Evm, safety = Safe)]
437    function getStorageSlots(address target, string calldata variableName) external view returns (uint256[] memory slots);
438
439    /// Returns an array of `StorageAccess` from current `vm.stateStateDiffRecording` session
440    #[cheatcode(group = Evm, safety = Safe)]
441    function getStorageAccesses() external view returns (StorageAccess[] memory storageAccesses);
442
443    // -------- Recording Map Writes --------
444
445    /// Starts recording all map SSTOREs for later retrieval.
446    #[cheatcode(group = Evm, safety = Safe)]
447    function startMappingRecording() external;
448
449    /// Stops recording all map SSTOREs for later retrieval and clears the recorded data.
450    #[cheatcode(group = Evm, safety = Safe)]
451    function stopMappingRecording() external;
452
453    /// Gets the number of elements in the mapping at the given slot, for a given address.
454    #[cheatcode(group = Evm, safety = Safe)]
455    function getMappingLength(address target, bytes32 mappingSlot) external view returns (uint256 length);
456
457    /// Gets the elements at index idx of the mapping at the given slot, for a given address. The
458    /// index must be less than the length of the mapping (i.e. the number of keys in the mapping).
459    #[cheatcode(group = Evm, safety = Safe)]
460    function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external view returns (bytes32 value);
461
462    /// Gets the map key and parent of a mapping at a given slot, for a given address.
463    #[cheatcode(group = Evm, safety = Safe)]
464    function getMappingKeyAndParentOf(address target, bytes32 elementSlot)
465        external
466        view
467        returns (bool found, bytes32 key, bytes32 parent);
468
469    // -------- Block and Transaction Properties --------
470
471    /// Gets the current `block.chainid` of the currently selected environment.
472    /// You should use this instead of `block.chainid` if you use `vm.selectFork` or `vm.createSelectFork`, as `block.chainid` could be assumed
473    /// to be constant across a transaction, and as a result will get optimized out by the compiler.
474    /// See https://github.com/foundry-rs/foundry/issues/6180
475    #[cheatcode(group = Evm, safety = Safe)]
476    function getChainId() external view returns (uint256 blockChainId);
477
478    /// Sets `block.chainid`.
479    #[cheatcode(group = Evm, safety = Unsafe)]
480    function chainId(uint256 newChainId) external;
481
482    /// Sets `block.coinbase`.
483    #[cheatcode(group = Evm, safety = Unsafe)]
484    function coinbase(address newCoinbase) external;
485
486    /// Sets `block.difficulty`.
487    /// Not available on EVM versions from Paris onwards. Use `prevrandao` instead.
488    /// Reverts if used on unsupported EVM versions.
489    #[cheatcode(group = Evm, safety = Unsafe)]
490    function difficulty(uint256 newDifficulty) external;
491
492    /// Sets `block.basefee`.
493    #[cheatcode(group = Evm, safety = Unsafe)]
494    function fee(uint256 newBasefee) external;
495
496    /// Sets `block.prevrandao`.
497    /// Not available on EVM versions before Paris. Use `difficulty` instead.
498    /// If used on unsupported EVM versions it will revert.
499    #[cheatcode(group = Evm, safety = Unsafe)]
500    function prevrandao(bytes32 newPrevrandao) external;
501    /// Sets `block.prevrandao`.
502    /// Not available on EVM versions before Paris. Use `difficulty` instead.
503    /// If used on unsupported EVM versions it will revert.
504    #[cheatcode(group = Evm, safety = Unsafe)]
505    function prevrandao(uint256 newPrevrandao) external;
506
507    /// Sets the blobhashes in the transaction.
508    /// Not available on EVM versions before Cancun.
509    /// If used on unsupported EVM versions it will revert.
510    #[cheatcode(group = Evm, safety = Unsafe)]
511    function blobhashes(bytes32[] calldata hashes) external;
512
513    /// Gets the blockhashes from the current transaction.
514    /// Not available on EVM versions before Cancun.
515    /// If used on unsupported EVM versions it will revert.
516    #[cheatcode(group = Evm, safety = Unsafe)]
517    function getBlobhashes() external view returns (bytes32[] memory hashes);
518
519    /// Sets `block.height`.
520    #[cheatcode(group = Evm, safety = Unsafe)]
521    function roll(uint256 newHeight) external;
522
523    /// Gets the current `block.number`.
524    /// You should use this instead of `block.number` if you use `vm.roll`, as `block.number` is assumed to be constant across a transaction,
525    /// and as a result will get optimized out by the compiler.
526    /// See https://github.com/foundry-rs/foundry/issues/6180
527    #[cheatcode(group = Evm, safety = Safe)]
528    function getBlockNumber() external view returns (uint256 height);
529
530    /// Sets `tx.gasprice`.
531    #[cheatcode(group = Evm, safety = Unsafe)]
532    function txGasPrice(uint256 newGasPrice) external;
533
534    /// Sets `block.timestamp`.
535    #[cheatcode(group = Evm, safety = Unsafe)]
536    function warp(uint256 newTimestamp) external;
537
538    /// Gets the current `block.timestamp`.
539    /// You should use this instead of `block.timestamp` if you use `vm.warp`, as `block.timestamp` is assumed to be constant across a transaction,
540    /// and as a result will get optimized out by the compiler.
541    /// See https://github.com/foundry-rs/foundry/issues/6180
542    #[cheatcode(group = Evm, safety = Safe)]
543    function getBlockTimestamp() external view returns (uint256 timestamp);
544
545    /// Gets the RLP encoded block header for a given block number.
546    /// Returns the block header in the same format as `cast block <block_number> --raw`.
547    #[cheatcode(group = Evm, safety = Safe)]
548    function getRawBlockHeader(uint256 blockNumber) external view returns (bytes memory rlpHeader);
549
550    /// Sets `block.blobbasefee`
551    #[cheatcode(group = Evm, safety = Unsafe)]
552    function blobBaseFee(uint256 newBlobBaseFee) external;
553
554    /// Gets the current `block.blobbasefee`.
555    /// You should use this instead of `block.blobbasefee` if you use `vm.blobBaseFee`, as `block.blobbasefee` is assumed to be constant across a transaction,
556    /// and as a result will get optimized out by the compiler.
557    /// See https://github.com/foundry-rs/foundry/issues/6180
558    #[cheatcode(group = Evm, safety = Safe)]
559    function getBlobBaseFee() external view returns (uint256 blobBaseFee);
560
561    /// Set blockhash for the current block.
562    /// It only sets the blockhash for blocks where `block.number - 256 <= number < block.number`.
563    #[cheatcode(group = Evm, safety = Unsafe)]
564    function setBlockhash(uint256 blockNumber, bytes32 blockHash) external;
565
566    /// Executes an RLP-encoded signed transaction with full EVM semantics (like `--isolate` mode).
567    /// The transaction is decoded from EIP-2718 format (type byte prefix + RLP payload) or legacy RLP.
568    /// Returns the execution output bytes.
569    ///
570    /// This cheatcode is not allowed in `forge script` contexts.
571    #[cheatcode(group = Evm, safety = Unsafe)]
572    function executeTransaction(bytes calldata rawTx) external returns (bytes memory);
573
574    // -------- Account State --------
575
576    /// Sets an address' balance.
577    #[cheatcode(group = Evm, safety = Unsafe)]
578    function deal(address account, uint256 newBalance) external;
579
580    /// Sets an address' code.
581    #[cheatcode(group = Evm, safety = Unsafe)]
582    function etch(address target, bytes calldata newRuntimeBytecode) external;
583
584    /// Resets the nonce of an account to 0 for EOAs and 1 for contract accounts.
585    #[cheatcode(group = Evm, safety = Unsafe)]
586    function resetNonce(address account) external;
587
588    /// Sets the nonce of an account. Must be higher than the current nonce of the account.
589    #[cheatcode(group = Evm, safety = Unsafe)]
590    function setNonce(address account, uint64 newNonce) external;
591
592    /// Sets the nonce of an account to an arbitrary value.
593    #[cheatcode(group = Evm, safety = Unsafe)]
594    function setNonceUnsafe(address account, uint64 newNonce) external;
595
596    /// Stores a value to an address' storage slot.
597    #[cheatcode(group = Evm, safety = Unsafe)]
598    function store(address target, bytes32 slot, bytes32 value) external;
599
600    /// Sets a TIP-20 token's logo URI directly in storage.
601    /// This bypasses the token admin check, but still validates the URI against T5 constraints.
602    #[cheatcode(group = Evm, safety = Unsafe)]
603    function setTip20LogoURI(address token, string calldata newLogoURI) external;
604
605    /// Sets a TIP-20 token's logo URI directly in storage.
606    /// This bypasses the token admin check, but still validates the URI against T5 constraints.
607    #[cheatcode(group = Evm, safety = Unsafe)]
608    function setLogoURI(address token, string calldata newLogoURI) external;
609
610    /// Marks the slots of an account and the account address as cold.
611    #[cheatcode(group = Evm, safety = Unsafe)]
612    function cool(address target) external;
613
614    /// Utility cheatcode to set an EIP-2930 access list for all subsequent transactions.
615    #[cheatcode(group = Evm, safety = Unsafe)]
616    function accessList(AccessListItem[] calldata access) external;
617
618    /// Utility cheatcode to remove any EIP-2930 access list set by `accessList` cheatcode.
619    #[cheatcode(group = Evm, safety = Unsafe)]
620    function noAccessList() external;
621
622    /// Utility cheatcode to mark specific storage slot as warm, simulating a prior read.
623    #[cheatcode(group = Evm, safety = Unsafe)]
624    function warmSlot(address target, bytes32 slot) external;
625
626    /// Utility cheatcode to mark specific storage slot as cold, simulating no prior read.
627    #[cheatcode(group = Evm, safety = Unsafe)]
628    function coolSlot(address target, bytes32 slot) external;
629
630    /// Returns the test or script execution evm version.
631    ///
632    /// **Note:** The execution evm version is not the same as the compilation one.
633    #[cheatcode(group = Evm, safety = Safe)]
634    function getEvmVersion() external pure returns (string memory evm);
635
636    /// Set the exact test or script execution evm version, e.g. `berlin`, `cancun`.
637    ///
638    /// **Note:** The execution evm version is not the same as the compilation one.
639    #[cheatcode(group = Evm, safety = Safe)]
640    function setEvmVersion(string calldata evm) external;
641
642    /// Returns `true` if `spender` is on the active Tempo hardfork's implicit-approval list,
643    /// meaning it can pull TIP-20 tokens from `msg.sender` without a prior `approve()`.
644    /// Returns `false` on non-Tempo networks.
645    #[cheatcode(group = Evm, safety = Safe)]
646    function isImplicitlyApproved(address spender) external view returns (bool implicitlyApproved);
647
648    /// Skips a fuzz/invariant input unless `spender` is implicitly approved.
649    #[cheatcode(group = Testing, safety = Safe)]
650    function assumeImplicitApproval(address spender) external view;
651
652    // -------- Call Manipulation --------
653    // --- Mocks ---
654
655    /// Clears all mocked calls.
656    #[cheatcode(group = Evm, safety = Unsafe)]
657    function clearMockedCalls() external;
658
659    /// Mocks a call to an address, returning specified data.
660    /// Calldata can either be strict or a partial match, e.g. if you only
661    /// pass a Solidity selector to the expected calldata, then the entire Solidity
662    /// function will be mocked.
663    #[cheatcode(group = Evm, safety = Unsafe)]
664    function mockCall(address callee, bytes calldata data, bytes calldata returnData) external;
665
666    /// Mocks a call to an address with a specific `msg.value`, returning specified data.
667    /// Calldata match takes precedence over `msg.value` in case of ambiguity.
668    #[cheatcode(group = Evm, safety = Unsafe)]
669    function mockCall(address callee, uint256 msgValue, bytes calldata data, bytes calldata returnData) external;
670
671    /// Mocks a call to an address, returning specified data.
672    /// Calldata can either be strict or a partial match, e.g. if you only
673    /// pass a Solidity selector to the expected calldata, then the entire Solidity
674    /// function will be mocked.
675    ///
676    /// Overload to pass the function selector directly `token.approve.selector` instead of `abi.encodeWithSelector(token.approve.selector)`.
677    #[cheatcode(group = Evm, safety = Unsafe)]
678    function mockCall(address callee, bytes4 data, bytes calldata returnData) external;
679
680    /// Mocks a call to an address with a specific `msg.value`, returning specified data.
681    /// Calldata match takes precedence over `msg.value` in case of ambiguity.
682    ///
683    /// Overload to pass the function selector directly `token.approve.selector` instead of `abi.encodeWithSelector(token.approve.selector)`.
684    #[cheatcode(group = Evm, safety = Unsafe)]
685    function mockCall(address callee, uint256 msgValue, bytes4 data, bytes calldata returnData) external;
686
687    /// Mocks multiple calls to an address, returning specified data for each call.
688    #[cheatcode(group = Evm, safety = Unsafe)]
689    function mockCalls(address callee, bytes calldata data, bytes[] calldata returnData) external;
690
691    /// Mocks multiple calls to an address with a specific `msg.value`, returning specified data for each call.
692    #[cheatcode(group = Evm, safety = Unsafe)]
693    function mockCalls(address callee, uint256 msgValue, bytes calldata data, bytes[] calldata returnData) external;
694
695    /// Reverts a call to an address with specified revert data.
696    #[cheatcode(group = Evm, safety = Unsafe)]
697    function mockCallRevert(address callee, bytes calldata data, bytes calldata revertData) external;
698
699    /// Reverts a call to an address with a specific `msg.value`, with specified revert data.
700    #[cheatcode(group = Evm, safety = Unsafe)]
701    function mockCallRevert(address callee, uint256 msgValue, bytes calldata data, bytes calldata revertData)
702        external;
703
704    /// Reverts a call to an address with specified revert data.
705    ///
706    /// Overload to pass the function selector directly `token.approve.selector` instead of `abi.encodeWithSelector(token.approve.selector)`.
707    #[cheatcode(group = Evm, safety = Unsafe)]
708    function mockCallRevert(address callee, bytes4 data, bytes calldata revertData) external;
709
710    /// Reverts a call to an address with a specific `msg.value`, with specified revert data.
711    ///
712    /// Overload to pass the function selector directly `token.approve.selector` instead of `abi.encodeWithSelector(token.approve.selector)`.
713    #[cheatcode(group = Evm, safety = Unsafe)]
714    function mockCallRevert(address callee, uint256 msgValue, bytes4 data, bytes calldata revertData)
715        external;
716
717    /// Whenever a call is made to `callee` with calldata `data`, this cheatcode instead calls
718    /// `target` with the same calldata. This functionality is similar to a delegate call made to
719    /// `target` contract from `callee`.
720    /// Can be used to substitute a call to a function with another implementation that captures
721    /// the primary logic of the original function but is easier to reason about.
722    /// If calldata is not a strict match then partial match by selector is attempted.
723    #[cheatcode(group = Evm, safety = Unsafe)]
724    function mockFunction(address callee, address target, bytes calldata data) external;
725
726    // --- Impersonation (pranks) ---
727
728    /// Sets the *next* call's `msg.sender` to be the input address.
729    #[cheatcode(group = Evm, safety = Unsafe)]
730    function prank(address msgSender) external;
731
732    /// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called.
733    #[cheatcode(group = Evm, safety = Unsafe)]
734    function startPrank(address msgSender) external;
735
736    /// Sets the *next* call's `msg.sender` to be the input address, and the `tx.origin` to be the second input.
737    #[cheatcode(group = Evm, safety = Unsafe)]
738    function prank(address msgSender, address txOrigin) external;
739
740    /// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called, and the `tx.origin` to be the second input.
741    #[cheatcode(group = Evm, safety = Unsafe)]
742    function startPrank(address msgSender, address txOrigin) external;
743
744    /// Sets the *next* delegate call's `msg.sender` to be the input address.
745    #[cheatcode(group = Evm, safety = Unsafe)]
746    function prank(address msgSender, bool delegateCall) external;
747
748    /// Sets all subsequent delegate calls' `msg.sender` to be the input address until `stopPrank` is called.
749    #[cheatcode(group = Evm, safety = Unsafe)]
750    function startPrank(address msgSender, bool delegateCall) external;
751
752    /// Sets the *next* delegate call's `msg.sender` to be the input address, and the `tx.origin` to be the second input.
753    #[cheatcode(group = Evm, safety = Unsafe)]
754    function prank(address msgSender, address txOrigin, bool delegateCall) external;
755
756    /// Sets all subsequent delegate calls' `msg.sender` to be the input address until `stopPrank` is called, and the `tx.origin` to be the second input.
757    #[cheatcode(group = Evm, safety = Unsafe)]
758    function startPrank(address msgSender, address txOrigin, bool delegateCall) external;
759
760    /// Resets subsequent calls' `msg.sender` to be `address(this)`.
761    #[cheatcode(group = Evm, safety = Unsafe)]
762    function stopPrank() external;
763
764    /// Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification.
765    #[cheatcode(group = Evm, safety = Unsafe)]
766    function readCallers() external view returns (CallerMode callerMode, address msgSender, address txOrigin);
767
768    // ----- Arbitrary Snapshots -----
769
770    /// Snapshot capture an arbitrary numerical value by name.
771    /// The group name is derived from the contract name.
772    #[cheatcode(group = Evm, safety = Unsafe)]
773    function snapshotValue(string calldata name, uint256 value) external;
774
775    /// Snapshot capture an arbitrary numerical value by name in a group.
776    #[cheatcode(group = Evm, safety = Unsafe)]
777    function snapshotValue(string calldata group, string calldata name, uint256 value) external;
778
779    // -------- Gas Snapshots --------
780
781    /// Snapshot capture the gas usage of the last call by name from the callee perspective.
782    #[cheatcode(group = Evm, safety = Unsafe)]
783    function snapshotGasLastCall(string calldata name) external returns (uint256 gasUsed);
784
785    /// Snapshot capture the gas usage of the last call by name in a group from the callee perspective.
786    #[cheatcode(group = Evm, safety = Unsafe)]
787    function snapshotGasLastCall(string calldata group, string calldata name) external returns (uint256 gasUsed);
788
789    /// Start a snapshot capture of the current gas usage by name.
790    /// The group name is derived from the contract name.
791    #[cheatcode(group = Evm, safety = Unsafe)]
792    function startSnapshotGas(string calldata name) external;
793
794    /// Start a snapshot capture of the current gas usage by name in a group.
795    #[cheatcode(group = Evm, safety = Unsafe)]
796    function startSnapshotGas(string calldata group, string calldata name) external;
797
798    /// Stop the snapshot capture of the current gas by latest snapshot name, capturing the gas used since the start.
799    #[cheatcode(group = Evm, safety = Unsafe)]
800    function stopSnapshotGas() external returns (uint256 gasUsed);
801
802    /// Stop the snapshot capture of the current gas usage by name, capturing the gas used since the start.
803    /// The group name is derived from the contract name.
804    #[cheatcode(group = Evm, safety = Unsafe)]
805    function stopSnapshotGas(string calldata name) external returns (uint256 gasUsed);
806
807    /// Stop the snapshot capture of the current gas usage by name in a group, capturing the gas used since the start.
808    #[cheatcode(group = Evm, safety = Unsafe)]
809    function stopSnapshotGas(string calldata group, string calldata name) external returns (uint256 gasUsed);
810
811    // -------- State Snapshots --------
812
813    /// `snapshot` is being deprecated in favor of `snapshotState`. It will be removed in future versions.
814    #[cheatcode(group = Evm, safety = Unsafe, status = Deprecated(Some("replaced by `snapshotState`")))]
815    function snapshot() external returns (uint256 snapshotId);
816
817    /// Snapshot the current state of the evm.
818    /// Returns the ID of the snapshot that was created.
819    /// To revert a snapshot use `revertToState`.
820    #[cheatcode(group = Evm, safety = Unsafe)]
821    function snapshotState() external returns (uint256 snapshotId);
822
823    /// `revertTo` is being deprecated in favor of `revertToState`. It will be removed in future versions.
824    #[cheatcode(group = Evm, safety = Unsafe, status = Deprecated(Some("replaced by `revertToState`")))]
825    function revertTo(uint256 snapshotId) external returns (bool success);
826
827    /// Revert the state of the EVM to a previous snapshot
828    /// Takes the snapshot ID to revert to.
829    ///
830    /// Returns `true` if the snapshot was successfully reverted.
831    /// Returns `false` if the snapshot does not exist.
832    ///
833    /// **Note:** This does not automatically delete the snapshot. To delete the snapshot use `deleteStateSnapshot`.
834    #[cheatcode(group = Evm, safety = Unsafe)]
835    function revertToState(uint256 snapshotId) external returns (bool success);
836
837    /// `revertToAndDelete` is being deprecated in favor of `revertToStateAndDelete`. It will be removed in future versions.
838    #[cheatcode(group = Evm, safety = Unsafe, status = Deprecated(Some("replaced by `revertToStateAndDelete`")))]
839    function revertToAndDelete(uint256 snapshotId) external returns (bool success);
840
841    /// Revert the state of the EVM to a previous snapshot and automatically deletes the snapshots
842    /// Takes the snapshot ID to revert to.
843    ///
844    /// Returns `true` if the snapshot was successfully reverted and deleted.
845    /// Returns `false` if the snapshot does not exist.
846    #[cheatcode(group = Evm, safety = Unsafe)]
847    function revertToStateAndDelete(uint256 snapshotId) external returns (bool success);
848
849    /// `deleteSnapshot` is being deprecated in favor of `deleteStateSnapshot`. It will be removed in future versions.
850    #[cheatcode(group = Evm, safety = Unsafe, status = Deprecated(Some("replaced by `deleteStateSnapshot`")))]
851    function deleteSnapshot(uint256 snapshotId) external returns (bool success);
852
853    /// Removes the snapshot with the given ID created by `snapshot`.
854    /// Takes the snapshot ID to delete.
855    ///
856    /// Returns `true` if the snapshot was successfully deleted.
857    /// Returns `false` if the snapshot does not exist.
858    #[cheatcode(group = Evm, safety = Unsafe)]
859    function deleteStateSnapshot(uint256 snapshotId) external returns (bool success);
860
861    /// `deleteSnapshots` is being deprecated in favor of `deleteStateSnapshots`. It will be removed in future versions.
862    #[cheatcode(group = Evm, safety = Unsafe, status = Deprecated(Some("replaced by `deleteStateSnapshots`")))]
863    function deleteSnapshots() external;
864
865    /// Removes _all_ snapshots previously created by `snapshot`.
866    #[cheatcode(group = Evm, safety = Unsafe)]
867    function deleteStateSnapshots() external;
868
869    // -------- Forking --------
870    // --- Creation and Selection ---
871
872    /// Returns the identifier of the currently active fork. Reverts if no fork is currently active.
873    #[cheatcode(group = Evm, safety = Unsafe)]
874    function activeFork() external view returns (uint256 forkId);
875
876    /// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork.
877    #[cheatcode(group = Evm, safety = Unsafe)]
878    function createFork(string calldata urlOrAlias) external returns (uint256 forkId);
879    /// Creates a new fork with the given endpoint and block and returns the identifier of the fork.
880    #[cheatcode(group = Evm, safety = Unsafe)]
881    function createFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId);
882    /// Creates a new fork with the given endpoint and at the block the given transaction was mined in,
883    /// replays all transaction mined in the block before the transaction, and returns the identifier of the fork.
884    #[cheatcode(group = Evm, safety = Unsafe)]
885    function createFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId);
886
887    /// Creates and also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork.
888    #[cheatcode(group = Evm, safety = Unsafe)]
889    function createSelectFork(string calldata urlOrAlias) external returns (uint256 forkId);
890    /// Creates and also selects a new fork with the given endpoint and block and returns the identifier of the fork.
891    #[cheatcode(group = Evm, safety = Unsafe)]
892    function createSelectFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId);
893    /// Creates and also selects new fork with the given endpoint and at the block the given transaction was mined in,
894    /// replays all transaction mined in the block before the transaction, returns the identifier of the fork.
895    #[cheatcode(group = Evm, safety = Unsafe)]
896    function createSelectFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId);
897
898    /// Updates the currently active fork to given block number
899    /// This is similar to `roll` but for the currently active fork.
900    #[cheatcode(group = Evm, safety = Unsafe)]
901    function rollFork(uint256 blockNumber) external;
902    /// Updates the currently active fork to given transaction. This will `rollFork` with the number
903    /// of the block the transaction was mined in and replays all transaction mined before it in the block.
904    #[cheatcode(group = Evm, safety = Unsafe)]
905    function rollFork(bytes32 txHash) external;
906    /// Updates the given fork to given block number.
907    #[cheatcode(group = Evm, safety = Unsafe)]
908    function rollFork(uint256 forkId, uint256 blockNumber) external;
909    /// Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block.
910    #[cheatcode(group = Evm, safety = Unsafe)]
911    function rollFork(uint256 forkId, bytes32 txHash) external;
912
913    /// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
914    #[cheatcode(group = Evm, safety = Unsafe)]
915    function selectFork(uint256 forkId) external;
916
917    /// Fetches the given transaction from the active fork and executes it on the current state.
918    #[cheatcode(group = Evm, safety = Unsafe)]
919    function transact(bytes32 txHash) external;
920    /// Fetches the given transaction from the given fork and executes it on the current state.
921    #[cheatcode(group = Evm, safety = Unsafe)]
922    function transact(uint256 forkId, bytes32 txHash) external;
923
924    /// Performs an Ethereum JSON-RPC request to the current fork URL.
925    #[cheatcode(group = Evm, safety = Safe)]
926    function rpc(string calldata method, string calldata params) external returns (bytes memory data);
927
928    /// Performs an Ethereum JSON-RPC request to the given endpoint.
929    #[cheatcode(group = Evm, safety = Safe)]
930    function rpc(string calldata urlOrAlias, string calldata method, string calldata params)
931        external
932        returns (bytes memory data);
933
934    /// Performs an Ethereum JSON-RPC request to the current fork URL and returns the JSON result.
935    #[cheatcode(group = Evm, safety = Safe)]
936    function rpcJson(string calldata method, string calldata params) external returns (string memory data);
937
938    /// Performs an Ethereum JSON-RPC request to the given endpoint and returns the JSON result.
939    #[cheatcode(group = Evm, safety = Safe)]
940    function rpcJson(string calldata urlOrAlias, string calldata method, string calldata params)
941        external
942        returns (string memory data);
943
944    /// Gets all the logs according to specified filter.
945    #[cheatcode(group = Evm, safety = Safe)]
946    function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics)
947        external
948        view
949        returns (EthGetLogs[] memory logs);
950
951    // --- Behavior ---
952
953    /// In forking mode, explicitly grant the given address cheatcode access.
954    #[cheatcode(group = Evm, safety = Unsafe)]
955    function allowCheatcodes(address account) external;
956
957    /// Marks that the account(s) should use persistent storage across fork swaps in a multifork setup
958    /// Meaning, changes made to the state of this account will be kept when switching forks.
959    #[cheatcode(group = Evm, safety = Unsafe)]
960    function makePersistent(address account) external;
961    /// See `makePersistent(address)`.
962    #[cheatcode(group = Evm, safety = Unsafe)]
963    function makePersistent(address account0, address account1) external;
964    /// See `makePersistent(address)`.
965    #[cheatcode(group = Evm, safety = Unsafe)]
966    function makePersistent(address account0, address account1, address account2) external;
967    /// See `makePersistent(address)`.
968    #[cheatcode(group = Evm, safety = Unsafe)]
969    function makePersistent(address[] calldata accounts) external;
970
971    /// Revokes persistent status from the address, previously added via `makePersistent`.
972    #[cheatcode(group = Evm, safety = Unsafe)]
973    function revokePersistent(address account) external;
974    /// See `revokePersistent(address)`.
975    #[cheatcode(group = Evm, safety = Unsafe)]
976    function revokePersistent(address[] calldata accounts) external;
977
978    /// Returns true if the account is marked as persistent.
979    #[cheatcode(group = Evm, safety = Unsafe)]
980    function isPersistent(address account) external view returns (bool persistent);
981
982    // -------- Record Logs --------
983
984    /// Record all the transaction logs.
985    #[cheatcode(group = Evm, safety = Safe)]
986    function recordLogs() external;
987
988    /// Gets all the recorded logs.
989    #[cheatcode(group = Evm, safety = Safe)]
990    function getRecordedLogs() external view returns (Log[] memory logs);
991
992    /// Gets all the recorded logs, in JSON format.
993    #[cheatcode(group = Evm, safety = Safe)]
994    function getRecordedLogsJson() external view returns (string memory logsJson);
995
996    // -------- Gas Metering --------
997
998    // It's recommend to use the `noGasMetering` modifier included with forge-std, instead of
999    // using these functions directly.
1000
1001    /// Pauses gas metering (i.e. gas usage is not counted). Noop if already paused.
1002    #[cheatcode(group = Evm, safety = Safe)]
1003    function pauseGasMetering() external;
1004
1005    /// Resumes gas metering (i.e. gas usage is counted again). Noop if already on.
1006    #[cheatcode(group = Evm, safety = Safe)]
1007    function resumeGasMetering() external;
1008
1009    /// Reset gas metering (i.e. gas usage is set to gas limit).
1010    #[cheatcode(group = Evm, safety = Safe)]
1011    function resetGasMetering() external;
1012
1013    // -------- Gas Measurement --------
1014
1015    /// Gets the gas used in the last call from the callee perspective.
1016    #[cheatcode(group = Evm, safety = Safe)]
1017    function lastCallGas() external view returns (Gas memory gas);
1018
1019    // ======== Test Assertions and Utilities ========
1020
1021    /// If the condition is false, discard this run's fuzz inputs and generate new ones.
1022    #[cheatcode(group = Testing, safety = Safe)]
1023    function assume(bool condition) external pure;
1024
1025    /// Discard this run's fuzz inputs and generate new ones if next call reverted.
1026    #[cheatcode(group = Testing, safety = Safe)]
1027    function assumeNoRevert() external pure;
1028
1029    /// Discard this run's fuzz inputs and generate new ones if next call reverts with the potential revert parameters.
1030    #[cheatcode(group = Testing, safety = Safe)]
1031    function assumeNoRevert(PotentialRevert calldata potentialRevert) external pure;
1032
1033    /// Discard this run's fuzz inputs and generate new ones if next call reverts with the any of the potential revert parameters.
1034    #[cheatcode(group = Testing, safety = Safe)]
1035    function assumeNoRevert(PotentialRevert[] calldata potentialReverts) external pure;
1036
1037    /// Writes a breakpoint to jump to in the debugger.
1038    #[cheatcode(group = Testing, safety = Safe)]
1039    function breakpoint(string calldata char) external pure;
1040
1041    /// Writes a conditional breakpoint to jump to in the debugger.
1042    #[cheatcode(group = Testing, safety = Safe)]
1043    function breakpoint(string calldata char, bool value) external pure;
1044
1045    /// Returns the Foundry version.
1046    /// Format: <cargo_version>-<tag>+<git_sha_short>.<unix_build_timestamp>.<profile>
1047    /// Sample output: 0.3.0-nightly+3cb96bde9b.1737036656.debug
1048    /// Note: Build timestamps may vary slightly across platforms due to separate CI jobs.
1049    /// For reliable version comparisons, use UNIX format (e.g., >= 1700000000)
1050    /// to compare timestamps while ignoring minor time differences.
1051    #[cheatcode(group = Testing, safety = Safe)]
1052    function getFoundryVersion() external view returns (string memory version);
1053
1054    /// Returns the RPC url for the given alias.
1055    #[cheatcode(group = Testing, safety = Safe)]
1056    function rpcUrl(string calldata rpcAlias) external view returns (string memory json);
1057
1058    /// Returns all rpc urls and their aliases `[alias, url][]`.
1059    #[cheatcode(group = Testing, safety = Safe)]
1060    function rpcUrls() external view returns (string[2][] memory urls);
1061
1062    /// Returns all rpc urls and their aliases as structs.
1063    #[cheatcode(group = Testing, safety = Safe)]
1064    function rpcUrlStructs() external view returns (Rpc[] memory urls);
1065
1066    /// Returns a Chain struct for specific alias
1067    #[cheatcode(group = Testing, safety = Safe)]
1068    function getChain(string calldata chainAlias) external view returns (Chain memory chain);
1069
1070    /// Returns a Chain struct for specific chainId
1071    #[cheatcode(group = Testing, safety = Safe)]
1072    function getChain(uint256 chainId) external view returns (Chain memory chain);
1073
1074    /// Suspends execution of the main thread for `duration` milliseconds.
1075    #[cheatcode(group = Testing, safety = Safe)]
1076    function sleep(uint256 duration) external;
1077
1078    /// Expects a call to an address with the specified calldata.
1079    /// Calldata can either be a strict or a partial match.
1080    #[cheatcode(group = Testing, safety = Unsafe)]
1081    function expectCall(address callee, bytes calldata data) external;
1082
1083    /// Expects given number of calls to an address with the specified calldata.
1084    #[cheatcode(group = Testing, safety = Unsafe)]
1085    function expectCall(address callee, bytes calldata data, uint64 count) external;
1086
1087    /// Expects a call to an address with the specified `msg.value` and calldata.
1088    #[cheatcode(group = Testing, safety = Unsafe)]
1089    function expectCall(address callee, uint256 msgValue, bytes calldata data) external;
1090
1091    /// Expects given number of calls to an address with the specified `msg.value` and calldata.
1092    #[cheatcode(group = Testing, safety = Unsafe)]
1093    function expectCall(address callee, uint256 msgValue, bytes calldata data, uint64 count) external;
1094
1095    /// Expect a call to an address with the specified `msg.value`, gas, and calldata.
1096    #[cheatcode(group = Testing, safety = Unsafe)]
1097    function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data) external;
1098
1099    /// Expects given number of calls to an address with the specified `msg.value`, gas, and calldata.
1100    #[cheatcode(group = Testing, safety = Unsafe)]
1101    function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data, uint64 count) external;
1102
1103    /// Expect a call to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas.
1104    #[cheatcode(group = Testing, safety = Unsafe)]
1105    function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data) external;
1106
1107    /// Expect given number of calls to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas.
1108    #[cheatcode(group = Testing, safety = Unsafe)]
1109    function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data, uint64 count)
1110        external;
1111
1112    /// Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData.).
1113    /// Call this function, then emit an event, then call a function. Internally after the call, we check if
1114    /// logs were emitted in the expected order with the expected topics and data (as specified by the booleans).
1115    /// Must be placed immediately before the call you want to assert on. If the next call reverts and the
1116    /// revert is caught by the caller (low-level call or try/catch), the expectation remains active and may
1117    /// be satisfied by a log emitted from a later call.
1118    #[cheatcode(group = Testing, safety = Unsafe)]
1119    function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) external;
1120
1121    /// Same as the previous method, but also checks supplied address against emitting contract.
1122    #[cheatcode(group = Testing, safety = Unsafe)]
1123    function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter)
1124        external;
1125
1126    /// Prepare an expected log with all topic and data checks enabled.
1127    /// Call this function, then emit an event, then call a function. Internally after the call, we check if
1128    /// logs were emitted in the expected order with the expected topics and data.
1129    /// Must be placed immediately before the call you want to assert on. If the next call reverts and the
1130    /// revert is caught by the caller (low-level call or try/catch), the expectation remains active and may
1131    /// be satisfied by a log emitted from a later call.
1132    #[cheatcode(group = Testing, safety = Unsafe)]
1133    function expectEmit() external;
1134
1135    /// Same as the previous method, but also checks supplied address against emitting contract.
1136    #[cheatcode(group = Testing, safety = Unsafe)]
1137    function expectEmit(address emitter) external;
1138
1139    /// Expect a given number of logs with the provided topics.
1140    #[cheatcode(group = Testing, safety = Unsafe)]
1141    function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, uint64 count) external;
1142
1143    /// Expect a given number of logs from a specific emitter with the provided topics.
1144    #[cheatcode(group = Testing, safety = Unsafe)]
1145    function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter, uint64 count)
1146        external;
1147
1148    /// Expect a given number of logs with all topic and data checks enabled.
1149    #[cheatcode(group = Testing, safety = Unsafe)]
1150    function expectEmit(uint64 count) external;
1151
1152    /// Expect a given number of logs from a specific emitter with all topic and data checks enabled.
1153    #[cheatcode(group = Testing, safety = Unsafe)]
1154    function expectEmit(address emitter, uint64 count) external;
1155
1156    /// Prepare an expected anonymous log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData.).
1157    /// Call this function, then emit an anonymous event, then call a function. Internally after the call, we check if
1158    /// logs were emitted in the expected order with the expected topics and data (as specified by the booleans).
1159    #[cheatcode(group = Testing, safety = Unsafe)]
1160    function expectEmitAnonymous(bool checkTopic0, bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) external;
1161
1162    /// Same as the previous method, but also checks supplied address against emitting contract.
1163    #[cheatcode(group = Testing, safety = Unsafe)]
1164    function expectEmitAnonymous(bool checkTopic0, bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter)
1165        external;
1166
1167    /// Prepare an expected anonymous log with all topic and data checks enabled.
1168    /// Call this function, then emit an anonymous event, then call a function. Internally after the call, we check if
1169    /// logs were emitted in the expected order with the expected topics and data.
1170    #[cheatcode(group = Testing, safety = Unsafe)]
1171    function expectEmitAnonymous() external;
1172
1173    /// Same as the previous method, but also checks supplied address against emitting contract.
1174    #[cheatcode(group = Testing, safety = Unsafe)]
1175    function expectEmitAnonymous(address emitter) external;
1176
1177    /// Expects the deployment of the specified bytecode by the specified address using the CREATE opcode
1178    #[cheatcode(group = Testing, safety = Unsafe)]
1179    function expectCreate(bytes calldata bytecode, address deployer) external;
1180
1181    /// Expects the deployment of the specified bytecode by the specified address using the CREATE2 opcode
1182    #[cheatcode(group = Testing, safety = Unsafe)]
1183    function expectCreate2(bytes calldata bytecode, address deployer) external;
1184
1185    /// Expects a TIP-20 `LogoURIUpdated(address indexed updater, string newLogoURI)` event.
1186    #[cheatcode(group = Testing, safety = Unsafe)]
1187    function expectTip20LogoURIUpdated(address token, address updater, string calldata newLogoURI) external;
1188
1189    /// Expects a TIP-20 `LogoURIUpdated(address indexed updater, string newLogoURI)` event.
1190    #[cheatcode(group = Testing, safety = Unsafe)]
1191    function expectLogoURIUpdated(address token, address updater, string calldata newLogoURI) external;
1192
1193    /// Expects an error on next call with any revert data.
1194    #[cheatcode(group = Testing, safety = Unsafe)]
1195    function expectRevert() external;
1196
1197    /// Expects an error on next call that exactly matches the revert data.
1198    #[cheatcode(group = Testing, safety = Unsafe)]
1199    function expectRevert(bytes4 revertData) external;
1200
1201    /// Expects an error on next call that exactly matches the revert data.
1202    #[cheatcode(group = Testing, safety = Unsafe)]
1203    function expectRevert(bytes calldata revertData) external;
1204
1205    /// Expects an error with any revert data on next call to reverter address.
1206    ///
1207    /// The `reverter` argument is matched against the address associated with
1208    /// the frame that produced the revert:
1209    ///   - For a CALL: the address that was called.
1210    ///   - For a CREATE / CREATE2: the would-be deployed address of the failed
1211    ///     deployment (computed from the deployer + nonce, or salt + initcode).
1212    ///
1213    /// For a single expected revert, the innermost reverting frame wins in
1214    /// nested CALL, CREATE, or mixed chains. With `count > 1`, nested
1215    /// CREATE / CREATE2 chains apply the same rule independently to each
1216    /// iteration; nested CALL chains keep their existing
1217    /// outermost-call-per-iteration behavior.
1218    #[cheatcode(group = Testing, safety = Unsafe)]
1219    function expectRevert(address reverter) external;
1220
1221    /// Expects an error from reverter address on next call, with any revert data.
1222    /// See `expectRevert(address)` for `reverter` matching semantics.
1223    #[cheatcode(group = Testing, safety = Unsafe)]
1224    function expectRevert(bytes4 revertData, address reverter) external;
1225
1226    /// Expects an error from reverter address on next call, that exactly matches the revert data.
1227    /// See `expectRevert(address)` for `reverter` matching semantics.
1228    #[cheatcode(group = Testing, safety = Unsafe)]
1229    function expectRevert(bytes calldata revertData, address reverter) external;
1230
1231    /// Expects a `count` number of reverts from the upcoming calls with any revert data or reverter.
1232    #[cheatcode(group = Testing, safety = Unsafe)]
1233    function expectRevert(uint64 count) external;
1234
1235    /// Expects a `count` number of reverts from the upcoming calls that match the revert data.
1236    #[cheatcode(group = Testing, safety = Unsafe)]
1237    function expectRevert(bytes4 revertData, uint64 count) external;
1238
1239    /// Expects a `count` number of reverts from the upcoming calls that exactly match the revert data.
1240    #[cheatcode(group = Testing, safety = Unsafe)]
1241    function expectRevert(bytes calldata revertData, uint64 count) external;
1242
1243    /// Expects a `count` number of reverts from the upcoming calls from the reverter address.
1244    /// See `expectRevert(address)` for `reverter` matching semantics.
1245    #[cheatcode(group = Testing, safety = Unsafe)]
1246    function expectRevert(address reverter, uint64 count) external;
1247
1248    /// Expects a `count` number of reverts from the upcoming calls from the reverter address that match the revert data.
1249    /// See `expectRevert(address)` for `reverter` matching semantics.
1250    #[cheatcode(group = Testing, safety = Unsafe)]
1251    function expectRevert(bytes4 revertData, address reverter, uint64 count) external;
1252
1253    /// Expects a `count` number of reverts from the upcoming calls from the reverter address that exactly match the revert data.
1254    /// See `expectRevert(address)` for `reverter` matching semantics.
1255    #[cheatcode(group = Testing, safety = Unsafe)]
1256    function expectRevert(bytes calldata revertData, address reverter, uint64 count) external;
1257
1258    /// Expects an error on next call that starts with the revert data.
1259    #[cheatcode(group = Testing, safety = Unsafe)]
1260    function expectPartialRevert(bytes4 revertData) external;
1261
1262    /// Expects an error on next call to reverter address, that starts with the revert data.
1263    /// See `expectRevert(address)` for `reverter` matching semantics.
1264    #[cheatcode(group = Testing, safety = Unsafe)]
1265    function expectPartialRevert(bytes4 revertData, address reverter) external;
1266
1267    /// Expects an error on next cheatcode call with any revert data.
1268    #[cheatcode(group = Testing, safety = Unsafe, status = Internal)]
1269    function _expectCheatcodeRevert() external;
1270
1271    /// Expects an error on next cheatcode call that starts with the revert data.
1272    #[cheatcode(group = Testing, safety = Unsafe, status = Internal)]
1273    function _expectCheatcodeRevert(bytes4 revertData) external;
1274
1275    /// Expects an error on next cheatcode call that exactly matches the revert data.
1276    #[cheatcode(group = Testing, safety = Unsafe, status = Internal)]
1277    function _expectCheatcodeRevert(bytes calldata revertData) external;
1278
1279    /// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the current subcontext. If any other
1280    /// memory is written to, the test will fail. Can be called multiple times to add more ranges to the set.
1281    #[cheatcode(group = Testing, safety = Unsafe)]
1282    function expectSafeMemory(uint64 min, uint64 max) external;
1283
1284    /// Stops all safe memory expectation in the current subcontext.
1285    #[cheatcode(group = Testing, safety = Unsafe)]
1286    function stopExpectSafeMemory() external;
1287
1288    /// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the next created subcontext.
1289    /// If any other memory is written to, the test will fail. Can be called multiple times to add more ranges
1290    /// to the set.
1291    #[cheatcode(group = Testing, safety = Unsafe)]
1292    function expectSafeMemoryCall(uint64 min, uint64 max) external;
1293
1294    /// Marks a test as skipped. Must be called at the top level of a test.
1295    #[cheatcode(group = Testing, safety = Unsafe)]
1296    function skip(bool skipTest) external;
1297
1298    /// Marks a test as skipped with a reason. Must be called at the top level of a test.
1299    #[cheatcode(group = Testing, safety = Unsafe)]
1300    function skip(bool skipTest, string calldata reason) external;
1301
1302    /// Asserts that the given condition is true.
1303    #[cheatcode(group = Testing, safety = Safe)]
1304    function assertTrue(bool condition) external pure;
1305
1306    /// Asserts that the given condition is true and includes error message into revert string on failure.
1307    #[cheatcode(group = Testing, safety = Safe)]
1308    function assertTrue(bool condition, string calldata err) external pure;
1309
1310    /// Asserts that the given condition is false.
1311    #[cheatcode(group = Testing, safety = Safe)]
1312    function assertFalse(bool condition) external pure;
1313
1314    /// Asserts that the given condition is false and includes error message into revert string on failure.
1315    #[cheatcode(group = Testing, safety = Safe)]
1316    function assertFalse(bool condition, string calldata err) external pure;
1317
1318    /// Asserts that two `bool` values are equal.
1319    #[cheatcode(group = Testing, safety = Safe)]
1320    function assertEq(bool left, bool right) external pure;
1321
1322    /// Asserts that two `bool` values are equal and includes error message into revert string on failure.
1323    #[cheatcode(group = Testing, safety = Safe)]
1324    function assertEq(bool left, bool right, string calldata err) external pure;
1325
1326    /// Asserts that two `uint256` values are equal.
1327    #[cheatcode(group = Testing, safety = Safe)]
1328    function assertEq(uint256 left, uint256 right) external pure;
1329
1330    /// Asserts that two `uint256` values are equal and includes error message into revert string on failure.
1331    #[cheatcode(group = Testing, safety = Safe)]
1332    function assertEq(uint256 left, uint256 right, string calldata err) external pure;
1333
1334    /// Asserts that two `int256` values are equal.
1335    #[cheatcode(group = Testing, safety = Safe)]
1336    function assertEq(int256 left, int256 right) external pure;
1337
1338    /// Asserts that two `int256` values are equal and includes error message into revert string on failure.
1339    #[cheatcode(group = Testing, safety = Safe)]
1340    function assertEq(int256 left, int256 right, string calldata err) external pure;
1341
1342    /// Asserts that two `address` values are equal.
1343    #[cheatcode(group = Testing, safety = Safe)]
1344    function assertEq(address left, address right) external pure;
1345
1346    /// Asserts that two `address` values are equal and includes error message into revert string on failure.
1347    #[cheatcode(group = Testing, safety = Safe)]
1348    function assertEq(address left, address right, string calldata err) external pure;
1349
1350    /// Asserts that two `bytes32` values are equal.
1351    #[cheatcode(group = Testing, safety = Safe)]
1352    function assertEq(bytes32 left, bytes32 right) external pure;
1353
1354    /// Asserts that two `bytes32` values are equal and includes error message into revert string on failure.
1355    #[cheatcode(group = Testing, safety = Safe)]
1356    function assertEq(bytes32 left, bytes32 right, string calldata err) external pure;
1357
1358    /// Asserts that two `string` values are equal.
1359    #[cheatcode(group = Testing, safety = Safe)]
1360    function assertEq(string calldata left, string calldata right) external pure;
1361
1362    /// Asserts that two `string` values are equal and includes error message into revert string on failure.
1363    #[cheatcode(group = Testing, safety = Safe)]
1364    function assertEq(string calldata left, string calldata right, string calldata err) external pure;
1365
1366    /// Asserts that two `bytes` values are equal.
1367    #[cheatcode(group = Testing, safety = Safe)]
1368    function assertEq(bytes calldata left, bytes calldata right) external pure;
1369
1370    /// Asserts that two `bytes` values are equal and includes error message into revert string on failure.
1371    #[cheatcode(group = Testing, safety = Safe)]
1372    function assertEq(bytes calldata left, bytes calldata right, string calldata err) external pure;
1373
1374    /// Asserts that two arrays of `bool` values are equal.
1375    #[cheatcode(group = Testing, safety = Safe)]
1376    function assertEq(bool[] calldata left, bool[] calldata right) external pure;
1377
1378    /// Asserts that two arrays of `bool` values are equal and includes error message into revert string on failure.
1379    #[cheatcode(group = Testing, safety = Safe)]
1380    function assertEq(bool[] calldata left, bool[] calldata right, string calldata err) external pure;
1381
1382    /// Asserts that two arrays of `uint256 values are equal.
1383    #[cheatcode(group = Testing, safety = Safe)]
1384    function assertEq(uint256[] calldata left, uint256[] calldata right) external pure;
1385
1386    /// Asserts that two arrays of `uint256` values are equal and includes error message into revert string on failure.
1387    #[cheatcode(group = Testing, safety = Safe)]
1388    function assertEq(uint256[] calldata left, uint256[] calldata right, string calldata err) external pure;
1389
1390    /// Asserts that two arrays of `int256` values are equal.
1391    #[cheatcode(group = Testing, safety = Safe)]
1392    function assertEq(int256[] calldata left, int256[] calldata right) external pure;
1393
1394    /// Asserts that two arrays of `int256` values are equal and includes error message into revert string on failure.
1395    #[cheatcode(group = Testing, safety = Safe)]
1396    function assertEq(int256[] calldata left, int256[] calldata right, string calldata err) external pure;
1397
1398    /// Asserts that two arrays of `address` values are equal.
1399    #[cheatcode(group = Testing, safety = Safe)]
1400    function assertEq(address[] calldata left, address[] calldata right) external pure;
1401
1402    /// Asserts that two arrays of `address` values are equal and includes error message into revert string on failure.
1403    #[cheatcode(group = Testing, safety = Safe)]
1404    function assertEq(address[] calldata left, address[] calldata right, string calldata err) external pure;
1405
1406    /// Asserts that two arrays of `bytes32` values are equal.
1407    #[cheatcode(group = Testing, safety = Safe)]
1408    function assertEq(bytes32[] calldata left, bytes32[] calldata right) external pure;
1409
1410    /// Asserts that two arrays of `bytes32` values are equal and includes error message into revert string on failure.
1411    #[cheatcode(group = Testing, safety = Safe)]
1412    function assertEq(bytes32[] calldata left, bytes32[] calldata right, string calldata err) external pure;
1413
1414    /// Asserts that two arrays of `string` values are equal.
1415    #[cheatcode(group = Testing, safety = Safe)]
1416    function assertEq(string[] calldata left, string[] calldata right) external pure;
1417
1418    /// Asserts that two arrays of `string` values are equal and includes error message into revert string on failure.
1419    #[cheatcode(group = Testing, safety = Safe)]
1420    function assertEq(string[] calldata left, string[] calldata right, string calldata err) external pure;
1421
1422    /// Asserts that two arrays of `bytes` values are equal.
1423    #[cheatcode(group = Testing, safety = Safe)]
1424    function assertEq(bytes[] calldata left, bytes[] calldata right) external pure;
1425
1426    /// Asserts that two arrays of `bytes` values are equal and includes error message into revert string on failure.
1427    #[cheatcode(group = Testing, safety = Safe)]
1428    function assertEq(bytes[] calldata left, bytes[] calldata right, string calldata err) external pure;
1429
1430    /// Asserts that two `uint256` values are equal, formatting them with decimals in failure message.
1431    #[cheatcode(group = Testing, safety = Safe)]
1432    function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1433
1434    /// Asserts that two `uint256` values are equal, formatting them with decimals in failure message.
1435    /// Includes error message into revert string on failure.
1436    #[cheatcode(group = Testing, safety = Safe)]
1437    function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1438
1439    /// Asserts that two `int256` values are equal, formatting them with decimals in failure message.
1440    #[cheatcode(group = Testing, safety = Safe)]
1441    function assertEqDecimal(int256 left, int256 right, uint256 decimals) external pure;
1442
1443    /// Asserts that two `int256` values are equal, formatting them with decimals in failure message.
1444    /// Includes error message into revert string on failure.
1445    #[cheatcode(group = Testing, safety = Safe)]
1446    function assertEqDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1447
1448    /// Asserts that two `bool` values are not equal.
1449    #[cheatcode(group = Testing, safety = Safe)]
1450    function assertNotEq(bool left, bool right) external pure;
1451
1452    /// Asserts that two `bool` values are not equal and includes error message into revert string on failure.
1453    #[cheatcode(group = Testing, safety = Safe)]
1454    function assertNotEq(bool left, bool right, string calldata err) external pure;
1455
1456    /// Asserts that two `uint256` values are not equal.
1457    #[cheatcode(group = Testing, safety = Safe)]
1458    function assertNotEq(uint256 left, uint256 right) external pure;
1459
1460    /// Asserts that two `uint256` values are not equal and includes error message into revert string on failure.
1461    #[cheatcode(group = Testing, safety = Safe)]
1462    function assertNotEq(uint256 left, uint256 right, string calldata err) external pure;
1463
1464    /// Asserts that two `int256` values are not equal.
1465    #[cheatcode(group = Testing, safety = Safe)]
1466    function assertNotEq(int256 left, int256 right) external pure;
1467
1468    /// Asserts that two `int256` values are not equal and includes error message into revert string on failure.
1469    #[cheatcode(group = Testing, safety = Safe)]
1470    function assertNotEq(int256 left, int256 right, string calldata err) external pure;
1471
1472    /// Asserts that two `address` values are not equal.
1473    #[cheatcode(group = Testing, safety = Safe)]
1474    function assertNotEq(address left, address right) external pure;
1475
1476    /// Asserts that two `address` values are not equal and includes error message into revert string on failure.
1477    #[cheatcode(group = Testing, safety = Safe)]
1478    function assertNotEq(address left, address right, string calldata err) external pure;
1479
1480    /// Asserts that two `bytes32` values are not equal.
1481    #[cheatcode(group = Testing, safety = Safe)]
1482    function assertNotEq(bytes32 left, bytes32 right) external pure;
1483
1484    /// Asserts that two `bytes32` values are not equal and includes error message into revert string on failure.
1485    #[cheatcode(group = Testing, safety = Safe)]
1486    function assertNotEq(bytes32 left, bytes32 right, string calldata err) external pure;
1487
1488    /// Asserts that two `string` values are not equal.
1489    #[cheatcode(group = Testing, safety = Safe)]
1490    function assertNotEq(string calldata left, string calldata right) external pure;
1491
1492    /// Asserts that two `string` values are not equal and includes error message into revert string on failure.
1493    #[cheatcode(group = Testing, safety = Safe)]
1494    function assertNotEq(string calldata left, string calldata right, string calldata err) external pure;
1495
1496    /// Asserts that two `bytes` values are not equal.
1497    #[cheatcode(group = Testing, safety = Safe)]
1498    function assertNotEq(bytes calldata left, bytes calldata right) external pure;
1499
1500    /// Asserts that two `bytes` values are not equal and includes error message into revert string on failure.
1501    #[cheatcode(group = Testing, safety = Safe)]
1502    function assertNotEq(bytes calldata left, bytes calldata right, string calldata err) external pure;
1503
1504    /// Asserts that two arrays of `bool` values are not equal.
1505    #[cheatcode(group = Testing, safety = Safe)]
1506    function assertNotEq(bool[] calldata left, bool[] calldata right) external pure;
1507
1508    /// Asserts that two arrays of `bool` values are not equal and includes error message into revert string on failure.
1509    #[cheatcode(group = Testing, safety = Safe)]
1510    function assertNotEq(bool[] calldata left, bool[] calldata right, string calldata err) external pure;
1511
1512    /// Asserts that two arrays of `uint256` values are not equal.
1513    #[cheatcode(group = Testing, safety = Safe)]
1514    function assertNotEq(uint256[] calldata left, uint256[] calldata right) external pure;
1515
1516    /// Asserts that two arrays of `uint256` values are not equal and includes error message into revert string on failure.
1517    #[cheatcode(group = Testing, safety = Safe)]
1518    function assertNotEq(uint256[] calldata left, uint256[] calldata right, string calldata err) external pure;
1519
1520    /// Asserts that two arrays of `int256` values are not equal.
1521    #[cheatcode(group = Testing, safety = Safe)]
1522    function assertNotEq(int256[] calldata left, int256[] calldata right) external pure;
1523
1524    /// Asserts that two arrays of `int256` values are not equal and includes error message into revert string on failure.
1525    #[cheatcode(group = Testing, safety = Safe)]
1526    function assertNotEq(int256[] calldata left, int256[] calldata right, string calldata err) external pure;
1527
1528    /// Asserts that two arrays of `address` values are not equal.
1529    #[cheatcode(group = Testing, safety = Safe)]
1530    function assertNotEq(address[] calldata left, address[] calldata right) external pure;
1531
1532    /// Asserts that two arrays of `address` values are not equal and includes error message into revert string on failure.
1533    #[cheatcode(group = Testing, safety = Safe)]
1534    function assertNotEq(address[] calldata left, address[] calldata right, string calldata err) external pure;
1535
1536    /// Asserts that two arrays of `bytes32` values are not equal.
1537    #[cheatcode(group = Testing, safety = Safe)]
1538    function assertNotEq(bytes32[] calldata left, bytes32[] calldata right) external pure;
1539
1540    /// Asserts that two arrays of `bytes32` values are not equal and includes error message into revert string on failure.
1541    #[cheatcode(group = Testing, safety = Safe)]
1542    function assertNotEq(bytes32[] calldata left, bytes32[] calldata right, string calldata err) external pure;
1543
1544    /// Asserts that two arrays of `string` values are not equal.
1545    #[cheatcode(group = Testing, safety = Safe)]
1546    function assertNotEq(string[] calldata left, string[] calldata right) external pure;
1547
1548    /// Asserts that two arrays of `string` values are not equal and includes error message into revert string on failure.
1549    #[cheatcode(group = Testing, safety = Safe)]
1550    function assertNotEq(string[] calldata left, string[] calldata right, string calldata err) external pure;
1551
1552    /// Asserts that two arrays of `bytes` values are not equal.
1553    #[cheatcode(group = Testing, safety = Safe)]
1554    function assertNotEq(bytes[] calldata left, bytes[] calldata right) external pure;
1555
1556    /// Asserts that two arrays of `bytes` values are not equal and includes error message into revert string on failure.
1557    #[cheatcode(group = Testing, safety = Safe)]
1558    function assertNotEq(bytes[] calldata left, bytes[] calldata right, string calldata err) external pure;
1559
1560    /// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message.
1561    #[cheatcode(group = Testing, safety = Safe)]
1562    function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1563
1564    /// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message.
1565    /// Includes error message into revert string on failure.
1566    #[cheatcode(group = Testing, safety = Safe)]
1567    function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1568
1569    /// Asserts that two `int256` values are not equal, formatting them with decimals in failure message.
1570    #[cheatcode(group = Testing, safety = Safe)]
1571    function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) external pure;
1572
1573    /// Asserts that two `int256` values are not equal, formatting them with decimals in failure message.
1574    /// Includes error message into revert string on failure.
1575    #[cheatcode(group = Testing, safety = Safe)]
1576    function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1577
1578    /// Compares two `uint256` values. Expects first value to be greater than second.
1579    #[cheatcode(group = Testing, safety = Safe)]
1580    function assertGt(uint256 left, uint256 right) external pure;
1581
1582    /// Compares two `uint256` values. Expects first value to be greater than second.
1583    /// Includes error message into revert string on failure.
1584    #[cheatcode(group = Testing, safety = Safe)]
1585    function assertGt(uint256 left, uint256 right, string calldata err) external pure;
1586
1587    /// Compares two `int256` values. Expects first value to be greater than second.
1588    #[cheatcode(group = Testing, safety = Safe)]
1589    function assertGt(int256 left, int256 right) external pure;
1590
1591    /// Compares two `int256` values. Expects first value to be greater than second.
1592    /// Includes error message into revert string on failure.
1593    #[cheatcode(group = Testing, safety = Safe)]
1594    function assertGt(int256 left, int256 right, string calldata err) external pure;
1595
1596    /// Compares two `uint256` values. Expects first value to be greater than second.
1597    /// Formats values with decimals in failure message.
1598    #[cheatcode(group = Testing, safety = Safe)]
1599    function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1600
1601    /// Compares two `uint256` values. Expects first value to be greater than second.
1602    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1603    #[cheatcode(group = Testing, safety = Safe)]
1604    function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1605
1606    /// Compares two `int256` values. Expects first value to be greater than second.
1607    /// Formats values with decimals in failure message.
1608    #[cheatcode(group = Testing, safety = Safe)]
1609    function assertGtDecimal(int256 left, int256 right, uint256 decimals) external pure;
1610
1611    /// Compares two `int256` values. Expects first value to be greater than second.
1612    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1613    #[cheatcode(group = Testing, safety = Safe)]
1614    function assertGtDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1615
1616    /// Compares two `uint256` values. Expects first value to be greater than or equal to second.
1617    #[cheatcode(group = Testing, safety = Safe)]
1618    function assertGe(uint256 left, uint256 right) external pure;
1619
1620    /// Compares two `uint256` values. Expects first value to be greater than or equal to second.
1621    /// Includes error message into revert string on failure.
1622    #[cheatcode(group = Testing, safety = Safe)]
1623    function assertGe(uint256 left, uint256 right, string calldata err) external pure;
1624
1625    /// Compares two `int256` values. Expects first value to be greater than or equal to second.
1626    #[cheatcode(group = Testing, safety = Safe)]
1627    function assertGe(int256 left, int256 right) external pure;
1628
1629    /// Compares two `int256` values. Expects first value to be greater than or equal to second.
1630    /// Includes error message into revert string on failure.
1631    #[cheatcode(group = Testing, safety = Safe)]
1632    function assertGe(int256 left, int256 right, string calldata err) external pure;
1633
1634    /// Compares two `uint256` values. Expects first value to be greater than or equal to second.
1635    /// Formats values with decimals in failure message.
1636    #[cheatcode(group = Testing, safety = Safe)]
1637    function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1638
1639    /// Compares two `uint256` values. Expects first value to be greater than or equal to second.
1640    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1641    #[cheatcode(group = Testing, safety = Safe)]
1642    function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1643
1644    /// Compares two `int256` values. Expects first value to be greater than or equal to second.
1645    /// Formats values with decimals in failure message.
1646    #[cheatcode(group = Testing, safety = Safe)]
1647    function assertGeDecimal(int256 left, int256 right, uint256 decimals) external pure;
1648
1649    /// Compares two `int256` values. Expects first value to be greater than or equal to second.
1650    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1651    #[cheatcode(group = Testing, safety = Safe)]
1652    function assertGeDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1653
1654    /// Compares two `uint256` values. Expects first value to be less than second.
1655    #[cheatcode(group = Testing, safety = Safe)]
1656    function assertLt(uint256 left, uint256 right) external pure;
1657
1658    /// Compares two `uint256` values. Expects first value to be less than second.
1659    /// Includes error message into revert string on failure.
1660    #[cheatcode(group = Testing, safety = Safe)]
1661    function assertLt(uint256 left, uint256 right, string calldata err) external pure;
1662
1663    /// Compares two `int256` values. Expects first value to be less than second.
1664    #[cheatcode(group = Testing, safety = Safe)]
1665    function assertLt(int256 left, int256 right) external pure;
1666
1667    /// Compares two `int256` values. Expects first value to be less than second.
1668    /// Includes error message into revert string on failure.
1669    #[cheatcode(group = Testing, safety = Safe)]
1670    function assertLt(int256 left, int256 right, string calldata err) external pure;
1671
1672    /// Compares two `uint256` values. Expects first value to be less than second.
1673    /// Formats values with decimals in failure message.
1674    #[cheatcode(group = Testing, safety = Safe)]
1675    function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1676
1677    /// Compares two `uint256` values. Expects first value to be less than second.
1678    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1679    #[cheatcode(group = Testing, safety = Safe)]
1680    function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1681
1682    /// Compares two `int256` values. Expects first value to be less than second.
1683    /// Formats values with decimals in failure message.
1684    #[cheatcode(group = Testing, safety = Safe)]
1685    function assertLtDecimal(int256 left, int256 right, uint256 decimals) external pure;
1686
1687    /// Compares two `int256` values. Expects first value to be less than second.
1688    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1689    #[cheatcode(group = Testing, safety = Safe)]
1690    function assertLtDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1691
1692    /// Compares two `uint256` values. Expects first value to be less than or equal to second.
1693    #[cheatcode(group = Testing, safety = Safe)]
1694    function assertLe(uint256 left, uint256 right) external pure;
1695
1696    /// Compares two `uint256` values. Expects first value to be less than or equal to second.
1697    /// Includes error message into revert string on failure.
1698    #[cheatcode(group = Testing, safety = Safe)]
1699    function assertLe(uint256 left, uint256 right, string calldata err) external pure;
1700
1701    /// Compares two `int256` values. Expects first value to be less than or equal to second.
1702    #[cheatcode(group = Testing, safety = Safe)]
1703    function assertLe(int256 left, int256 right) external pure;
1704
1705    /// Compares two `int256` values. Expects first value to be less than or equal to second.
1706    /// Includes error message into revert string on failure.
1707    #[cheatcode(group = Testing, safety = Safe)]
1708    function assertLe(int256 left, int256 right, string calldata err) external pure;
1709
1710    /// Compares two `uint256` values. Expects first value to be less than or equal to second.
1711    /// Formats values with decimals in failure message.
1712    #[cheatcode(group = Testing, safety = Safe)]
1713    function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) external pure;
1714
1715    /// Compares two `uint256` values. Expects first value to be less than or equal to second.
1716    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1717    #[cheatcode(group = Testing, safety = Safe)]
1718    function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata err) external pure;
1719
1720    /// Compares two `int256` values. Expects first value to be less than or equal to second.
1721    /// Formats values with decimals in failure message.
1722    #[cheatcode(group = Testing, safety = Safe)]
1723    function assertLeDecimal(int256 left, int256 right, uint256 decimals) external pure;
1724
1725    /// Compares two `int256` values. Expects first value to be less than or equal to second.
1726    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1727    #[cheatcode(group = Testing, safety = Safe)]
1728    function assertLeDecimal(int256 left, int256 right, uint256 decimals, string calldata err) external pure;
1729
1730    /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
1731    #[cheatcode(group = Testing, safety = Safe)]
1732    function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta) external pure;
1733
1734    /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
1735    /// Includes error message into revert string on failure.
1736    #[cheatcode(group = Testing, safety = Safe)]
1737    function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string calldata err) external pure;
1738
1739    /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
1740    #[cheatcode(group = Testing, safety = Safe)]
1741    function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta) external pure;
1742
1743    /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
1744    /// Includes error message into revert string on failure.
1745    #[cheatcode(group = Testing, safety = Safe)]
1746    function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta, string calldata err) external pure;
1747
1748    /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
1749    /// Formats values with decimals in failure message.
1750    #[cheatcode(group = Testing, safety = Safe)]
1751    function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals) external pure;
1752
1753    /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`.
1754    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1755    #[cheatcode(group = Testing, safety = Safe)]
1756    function assertApproxEqAbsDecimal(
1757        uint256 left,
1758        uint256 right,
1759        uint256 maxDelta,
1760        uint256 decimals,
1761        string calldata err
1762    ) external pure;
1763
1764    /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
1765    /// Formats values with decimals in failure message.
1766    #[cheatcode(group = Testing, safety = Safe)]
1767    function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals) external pure;
1768
1769    /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`.
1770    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1771    #[cheatcode(group = Testing, safety = Safe)]
1772    function assertApproxEqAbsDecimal(
1773        int256 left,
1774        int256 right,
1775        uint256 maxDelta,
1776        uint256 decimals,
1777        string calldata err
1778    ) external pure;
1779
1780    /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1781    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1782    #[cheatcode(group = Testing, safety = Safe)]
1783    function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta) external pure;
1784
1785    /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1786    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1787    /// Includes error message into revert string on failure.
1788    #[cheatcode(group = Testing, safety = Safe)]
1789    function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta, string calldata err) external pure;
1790
1791    /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1792    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1793    #[cheatcode(group = Testing, safety = Safe)]
1794    function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta) external pure;
1795
1796    /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1797    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1798    /// Includes error message into revert string on failure.
1799    #[cheatcode(group = Testing, safety = Safe)]
1800    function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta, string calldata err) external pure;
1801
1802    /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1803    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1804    /// Formats values with decimals in failure message.
1805    #[cheatcode(group = Testing, safety = Safe)]
1806    function assertApproxEqRelDecimal(
1807        uint256 left,
1808        uint256 right,
1809        uint256 maxPercentDelta,
1810        uint256 decimals
1811    ) external pure;
1812
1813    /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1814    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1815    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1816    #[cheatcode(group = Testing, safety = Safe)]
1817    function assertApproxEqRelDecimal(
1818        uint256 left,
1819        uint256 right,
1820        uint256 maxPercentDelta,
1821        uint256 decimals,
1822        string calldata err
1823    ) external pure;
1824
1825    /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1826    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1827    /// Formats values with decimals in failure message.
1828    #[cheatcode(group = Testing, safety = Safe)]
1829    function assertApproxEqRelDecimal(
1830        int256 left,
1831        int256 right,
1832        uint256 maxPercentDelta,
1833        uint256 decimals
1834    ) external pure;
1835
1836    /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`.
1837    /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100%
1838    /// Formats values with decimals in failure message. Includes error message into revert string on failure.
1839    #[cheatcode(group = Testing, safety = Safe)]
1840    function assertApproxEqRelDecimal(
1841        int256 left,
1842        int256 right,
1843        uint256 maxPercentDelta,
1844        uint256 decimals,
1845        string calldata err
1846    ) external pure;
1847
1848    /// Returns true if the current Foundry version is greater than or equal to the given version.
1849    /// The given version string must be in the format `major.minor.patch`.
1850    ///
1851    /// This is equivalent to `foundryVersionCmp(version) >= 0`.
1852    #[cheatcode(group = Testing, safety = Safe)]
1853    function foundryVersionAtLeast(string calldata version) external view returns (bool);
1854
1855    /// Compares the current Foundry version with the given version string.
1856    /// The given version string must be in the format `major.minor.patch`.
1857    ///
1858    /// Returns:
1859    /// -1 if current Foundry version is less than the given version
1860    /// 0 if current Foundry version equals the given version
1861    /// 1 if current Foundry version is greater than the given version
1862    ///
1863    /// This result can then be used with a comparison operator against `0`.
1864    /// For example, to check if the current Foundry version is greater than or equal to `1.0.0`:
1865    /// `if (foundryVersionCmp("1.0.0") >= 0) { ... }`
1866    #[cheatcode(group = Testing, safety = Safe)]
1867    function foundryVersionCmp(string calldata version) external view returns (int256);
1868
1869    // ======== OS and Filesystem ========
1870
1871    // -------- Metadata --------
1872
1873    /// Returns true if the given path points to an existing entity, else returns false.
1874    #[cheatcode(group = Filesystem)]
1875    function exists(string calldata path) external view returns (bool result);
1876
1877    /// Given a path, query the file system to get information about a file, directory, etc.
1878    #[cheatcode(group = Filesystem)]
1879    function fsMetadata(string calldata path) external view returns (FsMetadata memory metadata);
1880
1881    /// Returns true if the path exists on disk and is pointing at a directory, else returns false.
1882    #[cheatcode(group = Filesystem)]
1883    function isDir(string calldata path) external view returns (bool result);
1884
1885    /// Returns true if the path exists on disk and is pointing at a regular file, else returns false.
1886    #[cheatcode(group = Filesystem)]
1887    function isFile(string calldata path) external view returns (bool result);
1888
1889    /// Get the path of the current project root.
1890    #[cheatcode(group = Filesystem)]
1891    function projectRoot() external view returns (string memory path);
1892
1893    /// Get the source file path of the currently running test or script contract,
1894    /// relative to the project root.
1895    #[cheatcode(group = Filesystem)]
1896    function currentFilePath() external view returns (string memory path);
1897
1898    /// Returns the time since unix epoch in milliseconds.
1899    #[cheatcode(group = Filesystem)]
1900    function unixTime() external view returns (uint256 milliseconds);
1901
1902    // -------- Reading and writing --------
1903
1904    /// Closes file for reading, resetting the offset and allowing to read it from beginning with readLine.
1905    /// `path` is relative to the project root.
1906    #[cheatcode(group = Filesystem)]
1907    function closeFile(string calldata path) external;
1908
1909    /// Copies the contents of one file to another. This function will **overwrite** the contents of `to`.
1910    /// On success, the total number of bytes copied is returned and it is equal to the length of the `to` file as reported by `metadata`.
1911    /// Both `from` and `to` are relative to the project root.
1912    #[cheatcode(group = Filesystem)]
1913    function copyFile(string calldata from, string calldata to) external returns (uint64 copied);
1914
1915    /// Creates a new, empty directory at the provided path.
1916    /// This cheatcode will revert in the following situations, but is not limited to just these cases:
1917    /// - User lacks permissions to modify `path`.
1918    /// - A parent of the given path doesn't exist and `recursive` is false.
1919    /// - `path` already exists and `recursive` is false.
1920    /// `path` is relative to the project root.
1921    #[cheatcode(group = Filesystem)]
1922    function createDir(string calldata path, bool recursive) external;
1923
1924    /// Reads the directory at the given path recursively, up to `maxDepth`.
1925    /// `maxDepth` defaults to 1, meaning only the direct children of the given directory will be returned.
1926    /// Follows symbolic links if `followLinks` is true.
1927    #[cheatcode(group = Filesystem)]
1928    function readDir(string calldata path) external view returns (DirEntry[] memory entries);
1929    /// See `readDir(string)`.
1930    #[cheatcode(group = Filesystem)]
1931    function readDir(string calldata path, uint64 maxDepth) external view returns (DirEntry[] memory entries);
1932    /// See `readDir(string)`.
1933    #[cheatcode(group = Filesystem)]
1934    function readDir(string calldata path, uint64 maxDepth, bool followLinks)
1935        external
1936        view
1937        returns (DirEntry[] memory entries);
1938
1939    /// Reads the entire content of file to string. `path` is relative to the project root.
1940    #[cheatcode(group = Filesystem)]
1941    function readFile(string calldata path) external view returns (string memory data);
1942
1943    /// Reads the entire content of file as binary. `path` is relative to the project root.
1944    #[cheatcode(group = Filesystem)]
1945    function readFileBinary(string calldata path) external view returns (bytes memory data);
1946
1947    /// Reads next line of file to string.
1948    #[cheatcode(group = Filesystem)]
1949    function readLine(string calldata path) external view returns (string memory line);
1950
1951    /// Reads a symbolic link, returning the path that the link points to.
1952    /// This cheatcode will revert in the following situations, but is not limited to just these cases:
1953    /// - `path` is not a symbolic link.
1954    /// - `path` does not exist.
1955    #[cheatcode(group = Filesystem)]
1956    function readLink(string calldata linkPath) external view returns (string memory targetPath);
1957
1958    /// Removes a directory at the provided path.
1959    /// This cheatcode will revert in the following situations, but is not limited to just these cases:
1960    /// - `path` doesn't exist.
1961    /// - `path` isn't a directory.
1962    /// - User lacks permissions to modify `path`.
1963    /// - The directory is not empty and `recursive` is false.
1964    /// `path` is relative to the project root.
1965    #[cheatcode(group = Filesystem)]
1966    function removeDir(string calldata path, bool recursive) external;
1967
1968    /// Removes a file from the filesystem.
1969    /// This cheatcode will revert in the following situations, but is not limited to just these cases:
1970    /// - `path` points to a directory.
1971    /// - The file doesn't exist.
1972    /// - The user lacks permissions to remove the file.
1973    /// `path` is relative to the project root.
1974    #[cheatcode(group = Filesystem)]
1975    function removeFile(string calldata path) external;
1976
1977    /// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
1978    /// `path` is relative to the project root.
1979    #[cheatcode(group = Filesystem)]
1980    function writeFile(string calldata path, string calldata data) external;
1981
1982    /// Writes binary data to a file, creating a file if it does not exist, and entirely replacing its contents if it does.
1983    /// `path` is relative to the project root.
1984    #[cheatcode(group = Filesystem)]
1985    function writeFileBinary(string calldata path, bytes calldata data) external;
1986
1987    /// Writes line to file, creating a file if it does not exist.
1988    /// `path` is relative to the project root.
1989    #[cheatcode(group = Filesystem)]
1990    function writeLine(string calldata path, string calldata data) external;
1991
1992    /// Gets the artifact path from code (aka. creation code).
1993    #[cheatcode(group = Filesystem)]
1994    function getArtifactPathByCode(bytes calldata code) external view returns (string memory path);
1995
1996    /// Gets the artifact path from deployed code (aka. runtime code).
1997    #[cheatcode(group = Filesystem)]
1998    function getArtifactPathByDeployedCode(bytes calldata deployedCode) external view returns (string memory path);
1999
2000    /// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file or the path to the
2001    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2002    /// <version>/<profile> parts are optional. Use <profile> to select artifacts compiled with a specific profile
2003    /// from foundry.toml.
2004    #[cheatcode(group = Filesystem)]
2005    function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode);
2006
2007    /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
2008    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2009    /// <version>/<profile> parts are optional.
2010    /// Reverts if the target artifact contains unlinked library placeholders.
2011    #[cheatcode(group = Filesystem)]
2012    function deployCode(string calldata artifactPath) external returns (address deployedAddress);
2013
2014    /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
2015    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2016    /// <version>/<profile> parts are optional.
2017    /// Reverts if the target artifact contains unlinked library placeholders.
2018    ///
2019    /// Additionally accepts abi-encoded constructor arguments.
2020    #[cheatcode(group = Filesystem)]
2021    function deployCode(string calldata artifactPath, bytes calldata constructorArgs) external returns (address deployedAddress);
2022
2023    /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
2024    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2025    /// <version>/<profile> parts are optional.
2026    /// Reverts if the target artifact contains unlinked library placeholders.
2027    ///
2028    /// Additionally accepts `msg.value`.
2029    #[cheatcode(group = Filesystem)]
2030    function deployCode(string calldata artifactPath, uint256 value) external returns (address deployedAddress);
2031
2032    /// Deploys a contract from an artifact file. Takes in the relative path to the json file or the path to the
2033    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2034    /// <version>/<profile> parts are optional.
2035    /// Reverts if the target artifact contains unlinked library placeholders.
2036    ///
2037    /// Additionally accepts abi-encoded constructor arguments and `msg.value`.
2038    #[cheatcode(group = Filesystem)]
2039    function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value) external returns (address deployedAddress);
2040
2041    /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
2042    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2043    /// <version>/<profile> parts are optional.
2044    /// Reverts if the target artifact contains unlinked library placeholders.
2045    #[cheatcode(group = Filesystem)]
2046    function deployCode(string calldata artifactPath, bytes32 salt) external returns (address deployedAddress);
2047
2048    /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
2049    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2050    /// <version>/<profile> parts are optional.
2051    /// Reverts if the target artifact contains unlinked library placeholders.
2052    ///
2053    /// Additionally accepts abi-encoded constructor arguments.
2054    #[cheatcode(group = Filesystem)]
2055    function deployCode(string calldata artifactPath, bytes calldata constructorArgs, bytes32 salt) external returns (address deployedAddress);
2056
2057    /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
2058    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2059    /// <version>/<profile> parts are optional.
2060    /// Reverts if the target artifact contains unlinked library placeholders.
2061    ///
2062    /// Additionally accepts `msg.value`.
2063    #[cheatcode(group = Filesystem)]
2064    function deployCode(string calldata artifactPath, uint256 value, bytes32 salt) external returns (address deployedAddress);
2065
2066    /// Deploys a contract from an artifact file, using the CREATE2 salt. Takes in the relative path to the json file or the path to the
2067    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2068    /// <version>/<profile> parts are optional.
2069    /// Reverts if the target artifact contains unlinked library placeholders.
2070    ///
2071    /// Additionally accepts abi-encoded constructor arguments and `msg.value`.
2072    #[cheatcode(group = Filesystem)]
2073    function deployCode(string calldata artifactPath, bytes calldata constructorArgs, uint256 value, bytes32 salt) external returns (address deployedAddress);
2074
2075    /// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file or the path to the
2076    /// artifact in the form of <path>:<contract>:<version> or <path>:<contract>:<profile> where <contract> and
2077    /// <version>/<profile> parts are optional.
2078    #[cheatcode(group = Filesystem)]
2079    function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode);
2080
2081    /// Returns the most recent broadcast for the given contract on `chainId` matching `txType`.
2082    ///
2083    /// For example:
2084    ///
2085    /// The most recent deployment can be fetched by passing `txType` as `CREATE` or `CREATE2`.
2086    ///
2087    /// The most recent call can be fetched by passing `txType` as `CALL`.
2088    #[cheatcode(group = Filesystem)]
2089    function getBroadcast(string calldata contractName, uint64 chainId, BroadcastTxType txType) external view returns (BroadcastTxSummary memory);
2090
2091    /// Returns all broadcasts for the given contract on `chainId` with the specified `txType`.
2092    ///
2093    /// Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber.
2094    #[cheatcode(group = Filesystem)]
2095    function getBroadcasts(string calldata contractName, uint64 chainId, BroadcastTxType txType) external view returns (BroadcastTxSummary[] memory);
2096
2097    /// Returns all broadcasts for the given contract on `chainId`.
2098    ///
2099    /// Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber.
2100    #[cheatcode(group = Filesystem)]
2101    function getBroadcasts(string calldata contractName, uint64 chainId) external view returns (BroadcastTxSummary[] memory);
2102
2103    /// Returns the most recent deployment for the current `chainId`.
2104    #[cheatcode(group = Filesystem)]
2105    function getDeployment(string calldata contractName) external view returns (address deployedAddress);
2106
2107    /// Returns the most recent deployment for the given contract on `chainId`
2108    #[cheatcode(group = Filesystem)]
2109    function getDeployment(string calldata contractName, uint64 chainId) external view returns (address deployedAddress);
2110
2111    /// Returns all deployments for the given contract on `chainId`
2112    ///
2113    /// Sorted in descending order of deployment time i.e descending order of BroadcastTxSummary.blockNumber.
2114    ///
2115    /// The most recent deployment is the first element, and the oldest is the last.
2116    #[cheatcode(group = Filesystem)]
2117    function getDeployments(string calldata contractName, uint64 chainId) external view returns (address[] memory deployedAddresses);
2118
2119    // -------- Foreign Function Interface --------
2120
2121    /// Performs a foreign function call via the terminal.
2122    #[cheatcode(group = Filesystem)]
2123    function ffi(string[] calldata commandInput) external returns (bytes memory result);
2124
2125    /// Performs a foreign function call via terminal and returns the exit code, stdout, and stderr.
2126    #[cheatcode(group = Filesystem)]
2127    function tryFfi(string[] calldata commandInput) external returns (FfiResult memory result);
2128
2129    // -------- User Interaction --------
2130
2131    /// Prompts the user for a string value in the terminal.
2132    #[cheatcode(group = Filesystem)]
2133    function prompt(string calldata promptText) external returns (string memory input);
2134
2135    /// Prompts the user for a hidden string value in the terminal.
2136    #[cheatcode(group = Filesystem)]
2137    function promptSecret(string calldata promptText) external returns (string memory input);
2138
2139    /// Prompts the user for hidden uint256 in the terminal (usually pk).
2140    #[cheatcode(group = Filesystem)]
2141    function promptSecretUint(string calldata promptText) external returns (uint256);
2142
2143    /// Prompts the user for an address in the terminal.
2144    #[cheatcode(group = Filesystem)]
2145    function promptAddress(string calldata promptText) external returns (address);
2146
2147    /// Prompts the user for uint256 in the terminal.
2148    #[cheatcode(group = Filesystem)]
2149    function promptUint(string calldata promptText) external returns (uint256);
2150
2151    // ======== Environment Variables ========
2152
2153    /// Resolves the env variable placeholders of a given input string.
2154    #[cheatcode(group = Environment)]
2155    function resolveEnv(string calldata input) external returns (string memory);
2156
2157    /// Sets environment variables.
2158    #[cheatcode(group = Environment)]
2159    function setEnv(string calldata name, string calldata value) external;
2160
2161    /// Gets the environment variable `name` and returns true if it exists, else returns false.
2162    #[cheatcode(group = Environment)]
2163    function envExists(string calldata name) external view returns (bool result);
2164
2165    /// Gets the environment variable `name` and parses it as `bool`.
2166    /// Reverts if the variable was not found or could not be parsed.
2167    #[cheatcode(group = Environment)]
2168    function envBool(string calldata name) external view returns (bool value);
2169    /// Gets the environment variable `name` and parses it as `uint256`.
2170    /// Reverts if the variable was not found or could not be parsed.
2171    #[cheatcode(group = Environment)]
2172    function envUint(string calldata name) external view returns (uint256 value);
2173    /// Gets the environment variable `name` and parses it as `int256`.
2174    /// Reverts if the variable was not found or could not be parsed.
2175    #[cheatcode(group = Environment)]
2176    function envInt(string calldata name) external view returns (int256 value);
2177    /// Gets the environment variable `name` and parses it as `address`.
2178    /// Reverts if the variable was not found or could not be parsed.
2179    #[cheatcode(group = Environment)]
2180    function envAddress(string calldata name) external view returns (address value);
2181    /// Gets the environment variable `name` and parses it as `bytes32`.
2182    /// Reverts if the variable was not found or could not be parsed.
2183    #[cheatcode(group = Environment)]
2184    function envBytes32(string calldata name) external view returns (bytes32 value);
2185    /// Gets the environment variable `name` and parses it as `string`.
2186    /// Reverts if the variable was not found or could not be parsed.
2187    #[cheatcode(group = Environment)]
2188    function envString(string calldata name) external view returns (string memory value);
2189    /// Gets the environment variable `name` and parses it as `bytes`.
2190    /// Reverts if the variable was not found or could not be parsed.
2191    #[cheatcode(group = Environment)]
2192    function envBytes(string calldata name) external view returns (bytes memory value);
2193
2194    /// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`.
2195    /// Reverts if the variable was not found or could not be parsed.
2196    #[cheatcode(group = Environment)]
2197    function envBool(string calldata name, string calldata delim) external view returns (bool[] memory value);
2198    /// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`.
2199    /// Reverts if the variable was not found or could not be parsed.
2200    #[cheatcode(group = Environment)]
2201    function envUint(string calldata name, string calldata delim) external view returns (uint256[] memory value);
2202    /// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`.
2203    /// Reverts if the variable was not found or could not be parsed.
2204    #[cheatcode(group = Environment)]
2205    function envInt(string calldata name, string calldata delim) external view returns (int256[] memory value);
2206    /// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`.
2207    /// Reverts if the variable was not found or could not be parsed.
2208    #[cheatcode(group = Environment)]
2209    function envAddress(string calldata name, string calldata delim) external view returns (address[] memory value);
2210    /// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`.
2211    /// Reverts if the variable was not found or could not be parsed.
2212    #[cheatcode(group = Environment)]
2213    function envBytes32(string calldata name, string calldata delim) external view returns (bytes32[] memory value);
2214    /// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`.
2215    /// Reverts if the variable was not found or could not be parsed.
2216    #[cheatcode(group = Environment)]
2217    function envString(string calldata name, string calldata delim) external view returns (string[] memory value);
2218    /// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`.
2219    /// Reverts if the variable was not found or could not be parsed.
2220    #[cheatcode(group = Environment)]
2221    function envBytes(string calldata name, string calldata delim) external view returns (bytes[] memory value);
2222
2223    /// Gets the environment variable `name` and parses it as `bool`.
2224    /// Reverts if the variable could not be parsed.
2225    /// Returns `defaultValue` if the variable was not found.
2226    #[cheatcode(group = Environment)]
2227    function envOr(string calldata name, bool defaultValue) external view returns (bool value);
2228    /// Gets the environment variable `name` and parses it as `uint256`.
2229    /// Reverts if the variable could not be parsed.
2230    /// Returns `defaultValue` if the variable was not found.
2231    #[cheatcode(group = Environment)]
2232    function envOr(string calldata name, uint256 defaultValue) external view returns (uint256 value);
2233    /// Gets the environment variable `name` and parses it as `int256`.
2234    /// Reverts if the variable could not be parsed.
2235    /// Returns `defaultValue` if the variable was not found.
2236    #[cheatcode(group = Environment)]
2237    function envOr(string calldata name, int256 defaultValue) external view returns (int256 value);
2238    /// Gets the environment variable `name` and parses it as `address`.
2239    /// Reverts if the variable could not be parsed.
2240    /// Returns `defaultValue` if the variable was not found.
2241    #[cheatcode(group = Environment)]
2242    function envOr(string calldata name, address defaultValue) external view returns (address value);
2243    /// Gets the environment variable `name` and parses it as `bytes32`.
2244    /// Reverts if the variable could not be parsed.
2245    /// Returns `defaultValue` if the variable was not found.
2246    #[cheatcode(group = Environment)]
2247    function envOr(string calldata name, bytes32 defaultValue) external view returns (bytes32 value);
2248    /// Gets the environment variable `name` and parses it as `string`.
2249    /// Reverts if the variable could not be parsed.
2250    /// Returns `defaultValue` if the variable was not found.
2251    #[cheatcode(group = Environment)]
2252    function envOr(string calldata name, string calldata defaultValue) external view returns (string memory value);
2253    /// Gets the environment variable `name` and parses it as `bytes`.
2254    /// Reverts if the variable could not be parsed.
2255    /// Returns `defaultValue` if the variable was not found.
2256    #[cheatcode(group = Environment)]
2257    function envOr(string calldata name, bytes calldata defaultValue) external view returns (bytes memory value);
2258
2259    /// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`.
2260    /// Reverts if the variable could not be parsed.
2261    /// Returns `defaultValue` if the variable was not found.
2262    #[cheatcode(group = Environment)]
2263    function envOr(string calldata name, string calldata delim, bool[] calldata defaultValue)
2264        external view
2265        returns (bool[] memory value);
2266    /// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`.
2267    /// Reverts if the variable could not be parsed.
2268    /// Returns `defaultValue` if the variable was not found.
2269    #[cheatcode(group = Environment)]
2270    function envOr(string calldata name, string calldata delim, uint256[] calldata defaultValue)
2271        external view
2272        returns (uint256[] memory value);
2273    /// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`.
2274    /// Reverts if the variable could not be parsed.
2275    /// Returns `defaultValue` if the variable was not found.
2276    #[cheatcode(group = Environment)]
2277    function envOr(string calldata name, string calldata delim, int256[] calldata defaultValue)
2278        external view
2279        returns (int256[] memory value);
2280    /// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`.
2281    /// Reverts if the variable could not be parsed.
2282    /// Returns `defaultValue` if the variable was not found.
2283    #[cheatcode(group = Environment)]
2284    function envOr(string calldata name, string calldata delim, address[] calldata defaultValue)
2285        external view
2286        returns (address[] memory value);
2287    /// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`.
2288    /// Reverts if the variable could not be parsed.
2289    /// Returns `defaultValue` if the variable was not found.
2290    #[cheatcode(group = Environment)]
2291    function envOr(string calldata name, string calldata delim, bytes32[] calldata defaultValue)
2292        external view
2293        returns (bytes32[] memory value);
2294    /// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`.
2295    /// Reverts if the variable could not be parsed.
2296    /// Returns `defaultValue` if the variable was not found.
2297    #[cheatcode(group = Environment)]
2298    function envOr(string calldata name, string calldata delim, string[] calldata defaultValue)
2299        external view
2300        returns (string[] memory value);
2301    /// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`.
2302    /// Reverts if the variable could not be parsed.
2303    /// Returns `defaultValue` if the variable was not found.
2304    #[cheatcode(group = Environment)]
2305    function envOr(string calldata name, string calldata delim, bytes[] calldata defaultValue)
2306        external view
2307        returns (bytes[] memory value);
2308
2309    /// Returns true if `forge` command was executed in given context.
2310    #[cheatcode(group = Environment)]
2311    function isContext(ForgeContext context) external view returns (bool result);
2312
2313    // ======== Scripts ========
2314    // -------- Broadcasting Transactions --------
2315
2316    /// Has the next call (at this call depth only) create transactions that can later be signed and sent onchain.
2317    ///
2318    /// Broadcasting address is determined by checking the following in order:
2319    /// 1. If `--sender` argument was provided, that address is used.
2320    /// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used.
2321    /// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used.
2322    #[cheatcode(group = Scripting)]
2323    function broadcast() external;
2324
2325    /// Has the next call (at this call depth only) create a transaction with the address provided
2326    /// as the sender that can later be signed and sent onchain.
2327    #[cheatcode(group = Scripting)]
2328    function broadcast(address signer) external;
2329
2330    /// Has the next call (at this call depth only) create a transaction with the private key
2331    /// provided as the sender that can later be signed and sent onchain.
2332    #[cheatcode(group = Scripting)]
2333    function broadcast(uint256 privateKey) external;
2334
2335    /// Has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain.
2336    ///
2337    /// Broadcasting address is determined by checking the following in order:
2338    /// 1. If `--sender` argument was provided, that address is used.
2339    /// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used.
2340    /// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used.
2341    #[cheatcode(group = Scripting)]
2342    function startBroadcast() external;
2343
2344    /// Has all subsequent calls (at this call depth only) create transactions with the address
2345    /// provided that can later be signed and sent onchain.
2346    #[cheatcode(group = Scripting)]
2347    function startBroadcast(address signer) external;
2348
2349    /// Has all subsequent calls (at this call depth only) create transactions with the private key
2350    /// provided that can later be signed and sent onchain.
2351    #[cheatcode(group = Scripting)]
2352    function startBroadcast(uint256 privateKey) external;
2353
2354    /// Stops collecting onchain transactions.
2355    #[cheatcode(group = Scripting)]
2356    function stopBroadcast() external;
2357
2358    /// Takes a signed transaction and broadcasts it to the network.
2359    #[cheatcode(group = Scripting)]
2360    function broadcastRawTransaction(bytes calldata data) external;
2361
2362    /// Sign an EIP-7702 authorization for delegation
2363    #[cheatcode(group = Scripting)]
2364    function signDelegation(address implementation, uint256 privateKey) external returns (SignedDelegation memory signedDelegation);
2365
2366    /// Sign an EIP-7702 authorization for delegation for specific nonce
2367    #[cheatcode(group = Scripting)]
2368    function signDelegation(address implementation, uint256 privateKey, uint64 nonce) external returns (SignedDelegation memory signedDelegation);
2369
2370    /// Sign an EIP-7702 authorization for delegation, with optional cross-chain validity.
2371    #[cheatcode(group = Scripting)]
2372    function signDelegation(address implementation, uint256 privateKey, bool crossChain) external returns (SignedDelegation memory signedDelegation);
2373
2374    /// Designate the next call as an EIP-7702 transaction
2375    #[cheatcode(group = Scripting)]
2376    function attachDelegation(SignedDelegation calldata signedDelegation) external;
2377
2378    /// Designate the next call as an EIP-7702 transaction, with optional cross-chain validity.
2379    #[cheatcode(group = Scripting)]
2380    function attachDelegation(SignedDelegation calldata signedDelegation, bool crossChain) external;
2381
2382    /// Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction
2383    #[cheatcode(group = Scripting)]
2384    function signAndAttachDelegation(address implementation, uint256 privateKey) external returns (SignedDelegation memory signedDelegation);
2385
2386    /// Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction for specific nonce
2387    #[cheatcode(group = Scripting)]
2388    function signAndAttachDelegation(address implementation, uint256 privateKey, uint64 nonce) external returns (SignedDelegation memory signedDelegation);
2389
2390    /// Sign an EIP-7702 authorization and designate the next call as an EIP-7702 transaction, with optional cross-chain validity.
2391    #[cheatcode(group = Scripting)]
2392    function signAndAttachDelegation(address implementation, uint256 privateKey, bool crossChain) external returns (SignedDelegation memory signedDelegation);
2393
2394    /// Attach an EIP-4844 blob to the next call
2395    #[cheatcode(group = Scripting)]
2396    function attachBlob(bytes calldata blob) external;
2397
2398    /// Returns addresses of available unlocked wallets in the script environment.
2399    #[cheatcode(group = Scripting)]
2400    function getWallets() external view returns (address[] memory wallets);
2401
2402    // ======== Utilities ========
2403
2404    // -------- Strings --------
2405
2406    /// Converts the given value to a `string`.
2407    #[cheatcode(group = String)]
2408    function toString(address value) external pure returns (string memory stringifiedValue);
2409    /// Converts the given value to a `string`.
2410    #[cheatcode(group = String)]
2411    function toString(bytes calldata value) external pure returns (string memory stringifiedValue);
2412    /// Converts the given value to a `string`.
2413    #[cheatcode(group = String)]
2414    function toString(bytes32 value) external pure returns (string memory stringifiedValue);
2415    /// Converts the given value to a `string`.
2416    #[cheatcode(group = String)]
2417    function toString(bool value) external pure returns (string memory stringifiedValue);
2418    /// Converts the given value to a `string`.
2419    #[cheatcode(group = String)]
2420    function toString(uint256 value) external pure returns (string memory stringifiedValue);
2421    /// Converts the given value to a `string`.
2422    #[cheatcode(group = String)]
2423    function toString(int256 value) external pure returns (string memory stringifiedValue);
2424
2425    /// Parses the given `string` into `bytes`.
2426    #[cheatcode(group = String)]
2427    function parseBytes(string calldata stringifiedValue) external pure returns (bytes memory parsedValue);
2428    /// Parses the given `string` into an `address`.
2429    #[cheatcode(group = String)]
2430    function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue);
2431    /// Parses the given `string` into a `uint256`.
2432    #[cheatcode(group = String)]
2433    function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue);
2434    /// Parses the given `string` into a `int256`.
2435    #[cheatcode(group = String)]
2436    function parseInt(string calldata stringifiedValue) external pure returns (int256 parsedValue);
2437    /// Parses the given `string` into a `bytes32`.
2438    #[cheatcode(group = String)]
2439    function parseBytes32(string calldata stringifiedValue) external pure returns (bytes32 parsedValue);
2440    /// Parses the given `string` into a `bool`.
2441    #[cheatcode(group = String)]
2442    function parseBool(string calldata stringifiedValue) external pure returns (bool parsedValue);
2443
2444    /// Converts the given `string` value to Lowercase.
2445    #[cheatcode(group = String)]
2446    function toLowercase(string calldata input) external pure returns (string memory output);
2447    /// Converts the given `string` value to Uppercase.
2448    #[cheatcode(group = String)]
2449    function toUppercase(string calldata input) external pure returns (string memory output);
2450    /// Trims leading and trailing whitespace from the given `string` value.
2451    #[cheatcode(group = String)]
2452    function trim(string calldata input) external pure returns (string memory output);
2453    /// Replaces occurrences of `from` in the given `string` with `to`.
2454    #[cheatcode(group = String)]
2455    function replace(string calldata input, string calldata from, string calldata to) external pure returns (string memory output);
2456    /// Splits the given `string` into an array of strings divided by the `delimiter`.
2457    #[cheatcode(group = String)]
2458    function split(string calldata input, string calldata delimiter) external pure returns (string[] memory outputs);
2459    /// Returns the index of the first occurrence of a `key` in an `input` string.
2460    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `key` is not found.
2461    /// Returns 0 in case of an empty `key`.
2462    #[cheatcode(group = String)]
2463    function indexOf(string calldata input, string calldata key) external pure returns (uint256);
2464    /// Returns true if `search` is found in `subject`, false otherwise.
2465    #[cheatcode(group = String)]
2466    function contains(string calldata subject, string calldata search) external pure returns (bool result);
2467
2468    // ======== JSON Parsing and Manipulation ========
2469
2470    // -------- Reading --------
2471
2472    // NOTE: Please read https://book.getfoundry.sh/cheatcodes/parse-json to understand the
2473    // limitations and caveats of the JSON parsing cheats.
2474
2475    /// Checks if `key` exists in a JSON object
2476    /// `keyExists` is being deprecated in favor of `keyExistsJson`. It will be removed in future versions.
2477    #[cheatcode(group = Json, status = Deprecated(Some("replaced by `keyExistsJson`")))]
2478    function keyExists(string calldata json, string calldata key) external view returns (bool);
2479    /// Checks if `key` exists in a JSON object.
2480    #[cheatcode(group = Json)]
2481    function keyExistsJson(string calldata json, string calldata key) external view returns (bool);
2482
2483    /// ABI-encodes a JSON object.
2484    #[cheatcode(group = Json)]
2485    function parseJson(string calldata json) external pure returns (bytes memory abiEncodedData);
2486    /// ABI-encodes a JSON object at `key`.
2487    #[cheatcode(group = Json)]
2488    function parseJson(string calldata json, string calldata key) external pure returns (bytes memory abiEncodedData);
2489
2490    // The following parseJson cheatcodes will do type coercion, for the type that they indicate.
2491    // For example, parseJsonUint will coerce all values to a uint256. That includes stringified numbers '12.'
2492    // and hex numbers '0xEF.'.
2493    // Type coercion works ONLY for discrete values or arrays. That means that the key must return a value or array, not
2494    // a JSON object.
2495
2496    /// Parses a string of JSON data at `key` and coerces it to `uint256`.
2497    #[cheatcode(group = Json)]
2498    function parseJsonUint(string calldata json, string calldata key) external pure returns (uint256);
2499    /// Parses a string of JSON data at `key` and coerces it to `uint256[]`.
2500    #[cheatcode(group = Json)]
2501    function parseJsonUintArray(string calldata json, string calldata key) external pure returns (uint256[] memory);
2502    /// Parses a string of JSON data at `key` and coerces it to `int256`.
2503    #[cheatcode(group = Json)]
2504    function parseJsonInt(string calldata json, string calldata key) external pure returns (int256);
2505    /// Parses a string of JSON data at `key` and coerces it to `int256[]`.
2506    #[cheatcode(group = Json)]
2507    function parseJsonIntArray(string calldata json, string calldata key) external pure returns (int256[] memory);
2508    /// Parses a string of JSON data at `key` and coerces it to `bool`.
2509    #[cheatcode(group = Json)]
2510    function parseJsonBool(string calldata json, string calldata key) external pure returns (bool);
2511    /// Parses a string of JSON data at `key` and coerces it to `bool[]`.
2512    #[cheatcode(group = Json)]
2513    function parseJsonBoolArray(string calldata json, string calldata key) external pure returns (bool[] memory);
2514    /// Parses a string of JSON data at `key` and coerces it to `address`.
2515    #[cheatcode(group = Json)]
2516    function parseJsonAddress(string calldata json, string calldata key) external pure returns (address);
2517    /// Parses a string of JSON data at `key` and coerces it to `address[]`.
2518    #[cheatcode(group = Json)]
2519    function parseJsonAddressArray(string calldata json, string calldata key)
2520        external
2521        pure
2522        returns (address[] memory);
2523    /// Parses a string of JSON data at `key` and coerces it to `string`.
2524    #[cheatcode(group = Json)]
2525    function parseJsonString(string calldata json, string calldata key) external pure returns (string memory);
2526    /// Parses a string of JSON data at `key` and coerces it to `string[]`.
2527    #[cheatcode(group = Json)]
2528    function parseJsonStringArray(string calldata json, string calldata key) external pure returns (string[] memory);
2529    /// Parses a string of JSON data at `key` and coerces it to `bytes`.
2530    #[cheatcode(group = Json)]
2531    function parseJsonBytes(string calldata json, string calldata key) external pure returns (bytes memory);
2532    /// Parses a string of JSON data at `key` and coerces it to `bytes[]`.
2533    #[cheatcode(group = Json)]
2534    function parseJsonBytesArray(string calldata json, string calldata key) external pure returns (bytes[] memory);
2535    /// Parses a string of JSON data at `key` and coerces it to `bytes32`.
2536    #[cheatcode(group = Json)]
2537    function parseJsonBytes32(string calldata json, string calldata key) external pure returns (bytes32);
2538    /// Parses a string of JSON data at `key` and coerces it to `bytes32[]`.
2539    #[cheatcode(group = Json)]
2540    function parseJsonBytes32Array(string calldata json, string calldata key)
2541        external
2542        pure
2543        returns (bytes32[] memory);
2544
2545    /// Parses a string of JSON data and coerces it to type corresponding to `typeDescription`.
2546    #[cheatcode(group = Json)]
2547    function parseJsonType(string calldata json, string calldata typeDescription) external pure returns (bytes memory);
2548    /// Parses a string of JSON data at `key` and coerces it to type corresponding to `typeDescription`.
2549    #[cheatcode(group = Json)]
2550    function parseJsonType(string calldata json, string calldata key, string calldata typeDescription) external pure returns (bytes memory);
2551    /// Parses a string of JSON data at `key` and coerces it to type array corresponding to `typeDescription`.
2552    #[cheatcode(group = Json)]
2553    function parseJsonTypeArray(string calldata json, string calldata key, string calldata typeDescription)
2554        external
2555        pure
2556        returns (bytes memory);
2557
2558    /// Returns an array of all the keys in a JSON object.
2559    #[cheatcode(group = Json)]
2560    function parseJsonKeys(string calldata json, string calldata key) external pure returns (string[] memory keys);
2561
2562    // -------- Writing --------
2563
2564    // NOTE: Please read https://book.getfoundry.sh/cheatcodes/serialize-json to understand how
2565    // to use the serialization cheats.
2566
2567    /// Serializes a key and value to a JSON object stored in-memory that can be later written to a file.
2568    /// Returns the stringified version of the specific JSON file up to that moment.
2569    #[cheatcode(group = Json)]
2570    function serializeJson(string calldata objectKey, string calldata value) external returns (string memory json);
2571
2572    /// See `serializeJson`.
2573    #[cheatcode(group = Json)]
2574    function serializeBool(string calldata objectKey, string calldata valueKey, bool value)
2575        external
2576        returns (string memory json);
2577    /// See `serializeJson`.
2578    #[cheatcode(group = Json)]
2579    function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value)
2580        external
2581        returns (string memory json);
2582    /// See `serializeJson`.
2583    #[cheatcode(group = Json)]
2584    function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value)
2585        external
2586        returns (string memory json);
2587    /// See `serializeJson`.
2588    #[cheatcode(group = Json)]
2589    function serializeInt(string calldata objectKey, string calldata valueKey, int256 value)
2590        external
2591        returns (string memory json);
2592    /// See `serializeJson`.
2593    #[cheatcode(group = Json)]
2594    function serializeAddress(string calldata objectKey, string calldata valueKey, address value)
2595        external
2596        returns (string memory json);
2597    /// See `serializeJson`.
2598    #[cheatcode(group = Json)]
2599    function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32 value)
2600        external
2601        returns (string memory json);
2602    /// See `serializeJson`.
2603    #[cheatcode(group = Json)]
2604    function serializeString(string calldata objectKey, string calldata valueKey, string calldata value)
2605        external
2606        returns (string memory json);
2607    /// See `serializeJson`.
2608    #[cheatcode(group = Json)]
2609    function serializeBytes(string calldata objectKey, string calldata valueKey, bytes calldata value)
2610        external
2611        returns (string memory json);
2612
2613    /// See `serializeJson`.
2614    #[cheatcode(group = Json)]
2615    function serializeBool(string calldata objectKey, string calldata valueKey, bool[] calldata values)
2616        external
2617        returns (string memory json);
2618    /// See `serializeJson`.
2619    #[cheatcode(group = Json)]
2620    function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values)
2621        external
2622        returns (string memory json);
2623    /// See `serializeJson`.
2624    #[cheatcode(group = Json)]
2625    function serializeInt(string calldata objectKey, string calldata valueKey, int256[] calldata values)
2626        external
2627        returns (string memory json);
2628    /// See `serializeJson`.
2629    #[cheatcode(group = Json)]
2630    function serializeAddress(string calldata objectKey, string calldata valueKey, address[] calldata values)
2631        external
2632        returns (string memory json);
2633    /// See `serializeJson`.
2634    #[cheatcode(group = Json)]
2635    function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32[] calldata values)
2636        external
2637        returns (string memory json);
2638    /// See `serializeJson`.
2639    #[cheatcode(group = Json)]
2640    function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values)
2641        external
2642        returns (string memory json);
2643    /// See `serializeJson`.
2644    #[cheatcode(group = Json)]
2645    function serializeBytes(string calldata objectKey, string calldata valueKey, bytes[] calldata values)
2646        external
2647        returns (string memory json);
2648    /// See `serializeJson`.
2649    #[cheatcode(group = Json)]
2650    function serializeJsonType(string calldata typeDescription, bytes calldata value)
2651        external
2652        pure
2653        returns (string memory json);
2654    /// See `serializeJson`.
2655    #[cheatcode(group = Json)]
2656    function serializeJsonType(string calldata objectKey, string calldata valueKey, string calldata typeDescription, bytes calldata value)
2657        external
2658        returns (string memory json);
2659
2660    // NOTE: Please read https://book.getfoundry.sh/cheatcodes/write-json to understand how
2661    // to use the JSON writing cheats.
2662
2663    /// Write a serialized JSON object to a file. If the file exists, it will be overwritten.
2664    #[cheatcode(group = Json)]
2665    function writeJson(string calldata json, string calldata path) external;
2666
2667    /// Write a serialized JSON object to an **existing** JSON file, replacing a value with key = <value_key.>
2668    /// This is useful to replace a specific value of a JSON file, without having to parse the entire thing.
2669    /// This cheatcode will create new keys if they didn't previously exist.
2670    #[cheatcode(group = Json)]
2671    function writeJson(string calldata json, string calldata path, string calldata valueKey) external;
2672
2673    // ======== TOML Parsing and Manipulation ========
2674
2675    // -------- Reading --------
2676
2677    // NOTE: Please read https://book.getfoundry.sh/cheatcodes/parse-toml to understand the
2678    // limitations and caveats of the TOML parsing cheat.
2679
2680    /// Checks if `key` exists in a TOML table.
2681    #[cheatcode(group = Toml)]
2682    function keyExistsToml(string calldata toml, string calldata key) external view returns (bool);
2683
2684    /// ABI-encodes a TOML table.
2685    #[cheatcode(group = Toml)]
2686    function parseToml(string calldata toml) external pure returns (bytes memory abiEncodedData);
2687
2688    /// ABI-encodes a TOML table at `key`.
2689    #[cheatcode(group = Toml)]
2690    function parseToml(string calldata toml, string calldata key) external pure returns (bytes memory abiEncodedData);
2691
2692    // The following parseToml cheatcodes will do type coercion, for the type that they indicate.
2693    // For example, parseTomlUint will coerce all values to a uint256. That includes stringified numbers '12.'
2694    // and hex numbers '0xEF.'.
2695    // Type coercion works ONLY for discrete values or arrays. That means that the key must return a value or array, not
2696    // a TOML table.
2697
2698    /// Parses a string of TOML data at `key` and coerces it to `uint256`.
2699    #[cheatcode(group = Toml)]
2700    function parseTomlUint(string calldata toml, string calldata key) external pure returns (uint256);
2701    /// Parses a string of TOML data at `key` and coerces it to `uint256[]`.
2702    #[cheatcode(group = Toml)]
2703    function parseTomlUintArray(string calldata toml, string calldata key) external pure returns (uint256[] memory);
2704    /// Parses a string of TOML data at `key` and coerces it to `int256`.
2705    #[cheatcode(group = Toml)]
2706    function parseTomlInt(string calldata toml, string calldata key) external pure returns (int256);
2707    /// Parses a string of TOML data at `key` and coerces it to `int256[]`.
2708    #[cheatcode(group = Toml)]
2709    function parseTomlIntArray(string calldata toml, string calldata key) external pure returns (int256[] memory);
2710    /// Parses a string of TOML data at `key` and coerces it to `bool`.
2711    #[cheatcode(group = Toml)]
2712    function parseTomlBool(string calldata toml, string calldata key) external pure returns (bool);
2713    /// Parses a string of TOML data at `key` and coerces it to `bool[]`.
2714    #[cheatcode(group = Toml)]
2715    function parseTomlBoolArray(string calldata toml, string calldata key) external pure returns (bool[] memory);
2716    /// Parses a string of TOML data at `key` and coerces it to `address`.
2717    #[cheatcode(group = Toml)]
2718    function parseTomlAddress(string calldata toml, string calldata key) external pure returns (address);
2719    /// Parses a string of TOML data at `key` and coerces it to `address[]`.
2720    #[cheatcode(group = Toml)]
2721    function parseTomlAddressArray(string calldata toml, string calldata key)
2722        external
2723        pure
2724        returns (address[] memory);
2725    /// Parses a string of TOML data at `key` and coerces it to `string`.
2726    #[cheatcode(group = Toml)]
2727    function parseTomlString(string calldata toml, string calldata key) external pure returns (string memory);
2728    /// Parses a string of TOML data at `key` and coerces it to `string[]`.
2729    #[cheatcode(group = Toml)]
2730    function parseTomlStringArray(string calldata toml, string calldata key) external pure returns (string[] memory);
2731    /// Parses a string of TOML data at `key` and coerces it to `bytes`.
2732    #[cheatcode(group = Toml)]
2733    function parseTomlBytes(string calldata toml, string calldata key) external pure returns (bytes memory);
2734    /// Parses a string of TOML data at `key` and coerces it to `bytes[]`.
2735    #[cheatcode(group = Toml)]
2736    function parseTomlBytesArray(string calldata toml, string calldata key) external pure returns (bytes[] memory);
2737    /// Parses a string of TOML data at `key` and coerces it to `bytes32`.
2738    #[cheatcode(group = Toml)]
2739    function parseTomlBytes32(string calldata toml, string calldata key) external pure returns (bytes32);
2740    /// Parses a string of TOML data at `key` and coerces it to `bytes32[]`.
2741    #[cheatcode(group = Toml)]
2742    function parseTomlBytes32Array(string calldata toml, string calldata key)
2743        external
2744        pure
2745        returns (bytes32[] memory);
2746
2747    /// Parses a string of TOML data and coerces it to type corresponding to `typeDescription`.
2748    #[cheatcode(group = Toml)]
2749    function parseTomlType(string calldata toml, string calldata typeDescription) external pure returns (bytes memory);
2750    /// Parses a string of TOML data at `key` and coerces it to type corresponding to `typeDescription`.
2751    #[cheatcode(group = Toml)]
2752    function parseTomlType(string calldata toml, string calldata key, string calldata typeDescription) external pure returns (bytes memory);
2753    /// Parses a string of TOML data at `key` and coerces it to type array corresponding to `typeDescription`.
2754    #[cheatcode(group = Toml)]
2755    function parseTomlTypeArray(string calldata toml, string calldata key, string calldata typeDescription)
2756        external
2757        pure
2758        returns (bytes memory);
2759
2760    /// Returns an array of all the keys in a TOML table.
2761    #[cheatcode(group = Toml)]
2762    function parseTomlKeys(string calldata toml, string calldata key) external pure returns (string[] memory keys);
2763
2764    // -------- Writing --------
2765
2766    // NOTE: Please read https://book.getfoundry.sh/cheatcodes/write-toml to understand how
2767    // to use the TOML writing cheat.
2768
2769    /// Takes serialized JSON, converts to TOML and write a serialized TOML to a file.
2770    #[cheatcode(group = Toml)]
2771    function writeToml(string calldata json, string calldata path) external;
2772
2773    /// Takes serialized JSON, converts to TOML and write a serialized TOML table to an **existing** TOML file, replacing a value with key = <value_key.>
2774    /// This is useful to replace a specific value of a TOML file, without having to parse the entire thing.
2775    /// This cheatcode will create new keys if they didn't previously exist.
2776    #[cheatcode(group = Toml)]
2777    function writeToml(string calldata json, string calldata path, string calldata valueKey) external;
2778
2779    // ======== Cryptography ========
2780
2781    // -------- Key Management --------
2782
2783    /// Derives a private key from the name, labels the account with that name, and returns the wallet.
2784    #[cheatcode(group = Crypto)]
2785    function createWallet(string calldata walletLabel) external returns (Wallet memory wallet);
2786
2787    /// Generates a wallet from the private key and returns the wallet.
2788    #[cheatcode(group = Crypto)]
2789    function createWallet(uint256 privateKey) external returns (Wallet memory wallet);
2790
2791    /// Generates a wallet from the private key, labels the account with that name, and returns the wallet.
2792    #[cheatcode(group = Crypto)]
2793    function createWallet(uint256 privateKey, string calldata walletLabel) external returns (Wallet memory wallet);
2794
2795    /// Signs data with a `Wallet`.
2796    #[cheatcode(group = Crypto)]
2797    function sign(Wallet calldata wallet, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
2798
2799    /// Signs data with a `Wallet`.
2800    ///
2801    /// Returns a compact signature (`r`, `vs`) as per EIP-2098, where `vs` encodes both the
2802    /// signature's `s` value, and the recovery id `v` in a single bytes32.
2803    /// This format reduces the signature size from 65 to 64 bytes.
2804    #[cheatcode(group = Crypto)]
2805    function signCompact(Wallet calldata wallet, bytes32 digest) external pure returns (bytes32 r, bytes32 vs);
2806
2807    /// Signs `digest` with `privateKey` using the secp256k1 curve.
2808    #[cheatcode(group = Crypto)]
2809    function sign(uint256 privateKey, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
2810
2811    /// Signs `digest` with `privateKey` on the secp256k1 curve, using the given `nonce`
2812    /// as the raw ephemeral k value in ECDSA (instead of deriving it deterministically).
2813    #[cheatcode(group = Crypto)]
2814    function signWithNonceUnsafe(uint256 privateKey, bytes32 digest, uint256 nonce) external pure returns (uint8 v, bytes32 r, bytes32 s);
2815
2816    /// Signs `digest` with `privateKey` using the secp256k1 curve.
2817    ///
2818    /// Returns a compact signature (`r`, `vs`) as per EIP-2098, where `vs` encodes both the
2819    /// signature's `s` value, and the recovery id `v` in a single bytes32.
2820    /// This format reduces the signature size from 65 to 64 bytes.
2821    #[cheatcode(group = Crypto)]
2822    function signCompact(uint256 privateKey, bytes32 digest) external pure returns (bytes32 r, bytes32 vs);
2823
2824    /// Signs `digest` with signer provided to script using the secp256k1 curve.
2825    ///
2826    /// If `--sender` is provided, the signer with provided address is used, otherwise,
2827    /// if exactly one signer is provided to the script, that signer is used.
2828    ///
2829    /// Raises error if signer passed through `--sender` does not match any unlocked signers or
2830    /// if `--sender` is not provided and not exactly one signer is passed to the script.
2831    #[cheatcode(group = Crypto)]
2832    function sign(bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
2833
2834    /// Signs `digest` with signer provided to script using the secp256k1 curve.
2835    ///
2836    /// Returns a compact signature (`r`, `vs`) as per EIP-2098, where `vs` encodes both the
2837    /// signature's `s` value, and the recovery id `v` in a single bytes32.
2838    /// This format reduces the signature size from 65 to 64 bytes.
2839    ///
2840    /// If `--sender` is provided, the signer with provided address is used, otherwise,
2841    /// if exactly one signer is provided to the script, that signer is used.
2842    ///
2843    /// Raises error if signer passed through `--sender` does not match any unlocked signers or
2844    /// if `--sender` is not provided and not exactly one signer is passed to the script.
2845    #[cheatcode(group = Crypto)]
2846    function signCompact(bytes32 digest) external pure returns (bytes32 r, bytes32 vs);
2847
2848    /// Signs `digest` with signer provided to script using the secp256k1 curve.
2849    ///
2850    /// Raises error if none of the signers passed into the script have provided address.
2851    #[cheatcode(group = Crypto)]
2852    function sign(address signer, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s);
2853
2854    /// Signs `digest` with signer provided to script using the secp256k1 curve.
2855    ///
2856    /// Returns a compact signature (`r`, `vs`) as per EIP-2098, where `vs` encodes both the
2857    /// signature's `s` value, and the recovery id `v` in a single bytes32.
2858    /// This format reduces the signature size from 65 to 64 bytes.
2859    ///
2860    /// Raises error if none of the signers passed into the script have provided address.
2861    #[cheatcode(group = Crypto)]
2862    function signCompact(address signer, bytes32 digest) external pure returns (bytes32 r, bytes32 vs);
2863
2864    /// Signs `digest` with `privateKey` using the secp256r1 curve.
2865    #[cheatcode(group = Crypto)]
2866    function signP256(uint256 privateKey, bytes32 digest) external pure returns (bytes32 r, bytes32 s);
2867
2868    /// Derives secp256r1 public key from the provided `privateKey`.
2869    #[cheatcode(group = Crypto)]
2870    function publicKeyP256(uint256 privateKey) external pure returns (uint256 publicKeyX, uint256 publicKeyY);
2871
2872    /// Generates an Ed25519 key pair from a deterministic salt.
2873    /// Returns (publicKey, privateKey) as 32-byte values.
2874    #[cheatcode(group = Crypto, safety = Safe)]
2875    function createEd25519Key(bytes32 salt) external pure returns (bytes32 publicKey, bytes32 privateKey);
2876
2877    /// Derives the Ed25519 public key from a private key.
2878    #[cheatcode(group = Crypto, safety = Safe)]
2879    function publicKeyEd25519(bytes32 privateKey) external pure returns (bytes32 publicKey);
2880
2881    /// Signs a message with namespace using Ed25519.
2882    /// The signature covers namespace || message for domain separation.
2883    /// Returns a 64-byte Ed25519 signature.
2884    #[cheatcode(group = Crypto, safety = Safe)]
2885    function signEd25519(bytes calldata namespace, bytes calldata message, bytes32 privateKey)
2886        external
2887        pure
2888        returns (bytes memory signature);
2889
2890    /// Verifies an Ed25519 signature over namespace || message.
2891    /// Returns true if signature is valid, false otherwise.
2892    #[cheatcode(group = Crypto, safety = Safe)]
2893    function verifyEd25519(
2894        bytes calldata signature,
2895        bytes calldata namespace,
2896        bytes calldata message,
2897        bytes32 publicKey
2898    ) external pure returns (bool valid);
2899
2900    /// Derive a private key from a provided mnemonic string (or mnemonic file path)
2901    /// at the derivation path `m/44'/60'/0'/0/{index}`.
2902    #[cheatcode(group = Crypto)]
2903    function deriveKey(string calldata mnemonic, uint32 index) external pure returns (uint256 privateKey);
2904    /// Derive a private key from a provided mnemonic string (or mnemonic file path)
2905    /// at `{derivationPath}{index}`.
2906    #[cheatcode(group = Crypto)]
2907    function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index)
2908        external
2909        pure
2910        returns (uint256 privateKey);
2911    /// Derive a private key from a provided mnemonic string (or mnemonic file path) in the specified language
2912    /// at the derivation path `m/44'/60'/0'/0/{index}`.
2913    #[cheatcode(group = Crypto)]
2914    function deriveKey(string calldata mnemonic, uint32 index, string calldata language)
2915        external
2916        pure
2917        returns (uint256 privateKey);
2918    /// Derive a private key from a provided mnemonic string (or mnemonic file path) in the specified language
2919    /// at `{derivationPath}{index}`.
2920    #[cheatcode(group = Crypto)]
2921    function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index, string calldata language)
2922        external
2923        pure
2924        returns (uint256 privateKey);
2925
2926    /// Adds a private key to the local forge wallet and returns the address.
2927    #[cheatcode(group = Crypto)]
2928    function rememberKey(uint256 privateKey) external returns (address keyAddr);
2929
2930    /// Derive a set number of wallets from a mnemonic at the derivation path `m/44'/60'/0'/0/{0..count}`.
2931    ///
2932    /// The respective private keys are saved to the local forge wallet for later use and their addresses are returned.
2933    #[cheatcode(group = Crypto)]
2934    function rememberKeys(string calldata mnemonic, string calldata derivationPath, uint32 count) external returns (address[] memory keyAddrs);
2935
2936    /// Derive a set number of wallets from a mnemonic in the specified language at the derivation path `m/44'/60'/0'/0/{0..count}`.
2937    ///
2938    /// The respective private keys are saved to the local forge wallet for later use and their addresses are returned.
2939    #[cheatcode(group = Crypto)]
2940    function rememberKeys(string calldata mnemonic, string calldata derivationPath, string calldata language, uint32 count)
2941        external
2942        returns (address[] memory keyAddrs);
2943
2944    // -------- Uncategorized Utilities --------
2945
2946    /// Labels an address in call traces.
2947    #[cheatcode(group = Utilities)]
2948    function label(address account, string calldata newLabel) external;
2949
2950    /// Gets the label for the specified address.
2951    #[cheatcode(group = Utilities)]
2952    function getLabel(address account) external view returns (string memory currentLabel);
2953
2954    /// Compute the address a contract will be deployed at for a given deployer address and nonce.
2955    #[cheatcode(group = Utilities)]
2956    function computeCreateAddress(address deployer, uint256 nonce) external pure returns (address);
2957
2958    /// Compute the address of a contract created with CREATE2 using the given CREATE2 deployer.
2959    #[cheatcode(group = Utilities)]
2960    function computeCreate2Address(bytes32 salt, bytes32 initCodeHash, address deployer) external pure returns (address);
2961
2962    /// Compute the address of a contract created with CREATE2 using the default CREATE2 deployer.
2963    #[cheatcode(group = Utilities)]
2964    function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) external pure returns (address);
2965
2966    /// Encodes a `bytes` value to a base64 string.
2967    #[cheatcode(group = Utilities)]
2968    function toBase64(bytes calldata data) external pure returns (string memory);
2969
2970    /// Encodes a `string` value to a base64 string.
2971    #[cheatcode(group = Utilities)]
2972    function toBase64(string calldata data) external pure returns (string memory);
2973
2974    /// Encodes a `bytes` value to a base64url string.
2975    #[cheatcode(group = Utilities)]
2976    function toBase64URL(bytes calldata data) external pure returns (string memory);
2977
2978    /// Encodes a `string` value to a base64url string.
2979    #[cheatcode(group = Utilities)]
2980    function toBase64URL(string calldata data) external pure returns (string memory);
2981
2982    /// Returns ENS namehash for provided string.
2983    #[cheatcode(group = Utilities)]
2984    function ensNamehash(string calldata name) external pure returns (bytes32);
2985
2986    /// Returns an uint256 value bounded in given range and different from the current one.
2987    #[cheatcode(group = Utilities)]
2988    function bound(uint256 current, uint256 min, uint256 max) external view returns (uint256);
2989
2990    /// Returns a random uint256 value.
2991    #[cheatcode(group = Utilities)]
2992    function randomUint() external view returns (uint256);
2993
2994    /// Returns random uint256 value between the provided range (=min..=max).
2995    #[cheatcode(group = Utilities)]
2996    function randomUint(uint256 min, uint256 max) external view returns (uint256);
2997
2998    /// Returns a random `uint256` value of given bits.
2999    #[cheatcode(group = Utilities)]
3000    function randomUint(uint256 bits) external view returns (uint256);
3001
3002    /// Returns a random `address`.
3003    #[cheatcode(group = Utilities)]
3004    function randomAddress() external view returns (address);
3005
3006    /// Returns an int256 value bounded in given range and different from the current one.
3007    #[cheatcode(group = Utilities)]
3008    function bound(int256 current, int256 min, int256 max) external view returns (int256);
3009
3010    /// Returns a random `int256` value.
3011    #[cheatcode(group = Utilities)]
3012    function randomInt() external view returns (int256);
3013
3014    /// Returns a random `int256` value of given bits.
3015    #[cheatcode(group = Utilities)]
3016    function randomInt(uint256 bits) external view returns (int256);
3017
3018    /// Returns a random `bool`.
3019    #[cheatcode(group = Utilities)]
3020    function randomBool() external view returns (bool);
3021
3022    /// Returns a random byte array value of the given length.
3023    #[cheatcode(group = Utilities)]
3024    function randomBytes(uint256 len) external view returns (bytes memory);
3025
3026    /// Returns a random fixed-size byte array of length 4.
3027    #[cheatcode(group = Utilities)]
3028    function randomBytes4() external view returns (bytes4);
3029
3030    /// Returns a random fixed-size byte array of length 8.
3031    #[cheatcode(group = Utilities)]
3032    function randomBytes8() external view returns (bytes8);
3033
3034    /// Pauses collection of call traces. Useful in cases when you want to skip tracing of
3035    /// complex calls which are not useful for debugging.
3036    #[cheatcode(group = Utilities)]
3037    function pauseTracing() external view;
3038
3039    /// Unpauses collection of call traces.
3040    #[cheatcode(group = Utilities)]
3041    function resumeTracing() external view;
3042
3043    /// Utility cheatcode to copy storage of `from` contract to another `to` contract.
3044    #[cheatcode(group = Utilities, safety = Unsafe)]
3045    function copyStorage(address from, address to) external;
3046
3047    /// Utility cheatcode to set arbitrary storage for given target address.
3048    #[cheatcode(group = Utilities, safety = Unsafe)]
3049    function setArbitraryStorage(address target) external;
3050
3051    /// Utility cheatcode to set arbitrary storage for given target address and overwrite
3052    /// any storage slots that have been previously set.
3053    #[cheatcode(group = Utilities, safety = Unsafe)]
3054    function setArbitraryStorage(address target, bool overwrite) external;
3055
3056    /// Sorts an array in ascending order.
3057    #[cheatcode(group = Utilities)]
3058    function sort(uint256[] calldata array) external returns (uint256[] memory);
3059
3060    /// Randomly shuffles an array.
3061    #[cheatcode(group = Utilities)]
3062    function shuffle(uint256[] calldata array) external returns (uint256[] memory);
3063
3064    /// Set RNG seed.
3065    #[cheatcode(group = Utilities)]
3066    function setSeed(uint256 seed) external;
3067
3068    /// Causes the next contract creation (via new) to fail and return its initcode in the returndata buffer.
3069    /// This allows type-safe access to the initcode payload that would be used for contract creation.
3070    /// Example usage:
3071    /// vm.interceptInitcode();
3072    /// bytes memory initcode;
3073    /// try new MyContract(param1, param2) { assert(false); }
3074    /// catch (bytes memory interceptedInitcode) { initcode = interceptedInitcode; }
3075    #[cheatcode(group = Utilities, safety = Unsafe)]
3076    function interceptInitcode() external;
3077
3078    /// Generates the hash of the canonical EIP-712 type representation.
3079    ///
3080    /// Supports 2 different inputs:
3081    ///  1. Name of the type (i.e. "Transaction"):
3082    ///     * requires previous binding generation with `forge bind-json`.
3083    ///     * bindings will be retrieved from the path configured in `foundry.toml`.
3084    ///
3085    ///  2. String representation of the type (i.e. "Foo(Bar bar) Bar(uint256 baz)").
3086    ///     * Note: the cheatcode will output the canonical type even if the input is malformated
3087    ///             with the wrong order of elements or with extra whitespaces.
3088    #[cheatcode(group = Utilities)]
3089    function eip712HashType(string calldata typeNameOrDefinition) external pure returns (bytes32 typeHash);
3090
3091    /// Generates the hash of the canonical EIP-712 type representation.
3092    /// Requires previous binding generation with `forge bind-json`.
3093    ///
3094    /// Params:
3095    ///  * `bindingsPath`: path where the output of `forge bind-json` is stored.
3096    ///  * `typeName`: Name of the type (i.e. "Transaction").
3097    #[cheatcode(group = Utilities)]
3098    function eip712HashType(string calldata bindingsPath, string calldata typeName) external pure returns (bytes32 typeHash);
3099
3100    /// Generates the struct hash of the canonical EIP-712 type representation and its abi-encoded data.
3101    ///
3102    /// Supports 2 different inputs:
3103    ///  1. Name of the type (i.e. "PermitSingle"):
3104    ///     * requires previous binding generation with `forge bind-json`.
3105    ///     * bindings will be retrieved from the path configured in `foundry.toml`.
3106    ///
3107    ///  2. String representation of the type (i.e. "Foo(Bar bar) Bar(uint256 baz)").
3108    ///     * Note: the cheatcode will use the canonical type even if the input is malformated
3109    ///             with the wrong order of elements or with extra whitespaces.
3110    #[cheatcode(group = Utilities)]
3111    function eip712HashStruct(string calldata typeNameOrDefinition, bytes calldata abiEncodedData) external pure returns (bytes32 typeHash);
3112
3113    /// Generates the struct hash of the canonical EIP-712 type representation and its abi-encoded data.
3114    /// Requires previous binding generation with `forge bind-json`.
3115    ///
3116    /// Params:
3117    ///  * `bindingsPath`: path where the output of `forge bind-json` is stored.
3118    ///  * `typeName`: Name of the type (i.e. "PermitSingle").
3119    ///  * `abiEncodedData`: ABI-encoded data for the struct that is being hashed.
3120    #[cheatcode(group = Utilities)]
3121    function eip712HashStruct(string calldata bindingsPath, string calldata typeName, bytes calldata abiEncodedData) external pure returns (bytes32 typeHash);
3122
3123    /// Generates a ready-to-sign digest of human-readable typed data following the EIP-712 standard.
3124    #[cheatcode(group = Utilities)]
3125    function eip712HashTypedData(string calldata jsonData) external pure returns (bytes32 digest);
3126
3127    /// RLP encodes a list of bytes into an RLP payload.
3128    #[cheatcode(group = Utilities)]
3129    function toRlp(bytes[] calldata data) external pure returns (bytes memory);
3130    /// RLP decodes an RLP payload into a list of bytes.
3131    #[cheatcode(group = Utilities)]
3132    function fromRlp(bytes calldata rlp) external pure returns (bytes[] memory data);
3133}
3134}
3135
3136impl PartialEq for ForgeContext {
3137    // Handles test group case (any of test, coverage or snapshot)
3138    // and script group case (any of dry run, broadcast or resume).
3139    fn eq(&self, other: &Self) -> bool {
3140        match (self, other) {
3141            (_, Self::TestGroup) => {
3142                matches!(self, Self::Test | Self::Snapshot | Self::Coverage)
3143            }
3144            (_, Self::ScriptGroup) => {
3145                matches!(self, Self::ScriptDryRun | Self::ScriptBroadcast | Self::ScriptResume)
3146            }
3147            (Self::Test, Self::Test)
3148            | (Self::Snapshot, Self::Snapshot)
3149            | (Self::Coverage, Self::Coverage)
3150            | (Self::ScriptDryRun, Self::ScriptDryRun)
3151            | (Self::ScriptBroadcast, Self::ScriptBroadcast)
3152            | (Self::ScriptResume, Self::ScriptResume)
3153            | (Self::Unknown, Self::Unknown) => true,
3154            _ => false,
3155        }
3156    }
3157}
3158
3159impl fmt::Display for Vm::CheatcodeError {
3160    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3161        self.message.fmt(f)
3162    }
3163}
3164
3165impl fmt::Display for Vm::VmErrors {
3166    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3167        match self {
3168            Self::CheatcodeError(err) => err.fmt(f),
3169        }
3170    }
3171}
3172
3173#[track_caller]
3174const fn panic_unknown_safety() -> ! {
3175    panic!("cannot determine safety from the group, add a `#[cheatcode(safety = ...)]` attribute")
3176}