> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inco.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Setup your repo

## Using the lightning-rod template (recommended)

We recommend using our [template](https://github.com/Inco-fhevm/lightning-rod/tree/main) which comes with foundry already setup.

```bash theme={null}
git clone git@github.com:Inco-fhevm/lightning-rod.git
cd lightning-rod
bun install
```

Using the template, you may want to skip to the [cheatcodes reference](/quickstart/cheatcodes-reference).

## Or setup manually

<Warning>
  You do not need to follow these steps if you are using the lightning-rod template.
</Warning>

Follow these steps to add inco to your existing project, or manually setup a new one.

### Download the inco libraries

Inco uses npm packages to provide its solidity library.

```bash theme={null}
bun add @inco/lightning
```

Alternatively, you can use npm/yarn/pnpm.

### Setup remappings

Create a file `remappings.txt` at the root of your contracts directory.

```bash theme={null}
touch remappings.txt
```

Edit your remappings paths according to your setup.

```txt theme={null}
forge-std/=your/path/to/forge-std/src/
ds-test/=your/path/to/ds-test/src/
@inco/=path/to/your/node_modules/@inco/
@openzeppelin/=path/to/your/node_modules/@openzeppelin/
```

Due to how solidity imports and remappings work, your remappings have to follow
the idiomatic form. Here are the requirements so your project compiles while using inco:

* left to the `=` sign, have the following names
  * `forge-std/`
  * `ds-test/`
  * `@inco/`
  * `@openzeppelin/`
* right to the `=` sign, have the path to the corresponding library
  * `forge-std/` should point to the `src/` directory of your local `forge-std` library
  * `ds-test/` should point to the `src/` directory of your local `ds-test` library
  * `@inco/` should point to the `@inco` directory in your `node_modules` directory, and not to the `@inco/lightning` or `@inco/shared` directories
  * In the same way `@openzeppelin/` should point to the `@openzeppelin` directory in your `node_modules` directory

To simplify this process, we recommend using bun/npm to import all the dependencies (including `foundry-std` and `ds-test`) like so:

```bash theme={null}
bun add  @inco/lightning https://github.com/dapphub/ds-test https://github.com/foundry-rs/forge-std @openzeppelin/contracts
```

and using this remapping file (supposing that your `node_modules` sit one directory up from your contracts directory):

```txt theme={null}
@openzeppelin/=../node_modules/@openzeppelin/
forge-std/=../node_modules/forge-std/src/
ds-test/=../node_modules/ds-test/src/
@inco/=../node_modules/@inco/
```
