Skip to content

Commit

Permalink
docs: document allowCheatcodes (#642)
Browse files Browse the repository at this point in the history
* docs: document allowCheatcodes

* Update src/cheatcodes/allow-cheatcodes.md
  • Loading branch information
mattsse authored Sep 29, 2022
1 parent 6a033c7 commit 0f0d44e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
- [`makePersistent`](./cheatcodes/make-persistent.md)
- [`revokePersistent`](./cheatcodes/revoke-persistent.md)
- [`isPersistent`](./cheatcodes/is-persistent.md)
- [`allowCheatcodes`](./cheatcodes/allow-cheatcodes.md)
- [`transact`](./cheatcodes/transact.md)
- [External](./cheatcodes/external.md)
- [`ffi`](./cheatcodes/ffi.md)
Expand Down
19 changes: 19 additions & 0 deletions src/cheatcodes/allow-cheatcodes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## `allowCheatcodes`

### Signature

```solidity
function allowCheatcodes(address) external;
```

### Description

In forking mode, explicitly grant the given address cheatcode access.

By default, the test contract, and its deployer are allowed to access cheatcodes. In addition to that, cheat code
access is granted if the contract was deployed by an address that already has cheatcode access.
This will prevent cheatcode access from accounts already deployed on the forked network.

> ℹ️ **Note**
>
> This is only useful for complexer test setup in forking mode.

0 comments on commit 0f0d44e

Please sign in to comment.