# keyExistsToml

Description: keyExistsToml cheatcode documentation

Note: This document was authored using MDX

  Source: https://github.com/NomicFoundation/hardhat-website/tree/main/src/content/docs/docs/reference/cheatcodes/External/key-exists-toml.mdx

{/* This document contains content copied/adapted from the Foundry Book (MIT licensed). See LICENSE in the parent directory. */}

### Signature

```solidity
// Check if a key exists in a TOML table.
vm.keyExistsToml(string memory toml, string memory key) returns (bool)
```

### Description

Checks if a key exists in a TOML table.

### Examples

```solidity
string memory path = "./path/to/tomlfile.toml";
string memory toml = vm.readFile(path);
bool exists = vm.keyExistsToml(toml, ".key");
assertTrue(exists);
```
