Setup
Setup your repo
Using the lightning-rod template (recommended)
We recommend using our template which comes with foundry already setup.
Using the template, you may want to skip to the cheatcodes reference.
Or setup manually
You do not need to follow these steps if you are using the lightning-rod template.
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.
Alternatively, you can use npm/yarn/pnpm.
Setup remappings
Create a file remappings.txt
at the root of your contracts directory.
Edit your remappings paths according to your setup.
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 namesforge-std/
ds-test/
@inco/
@openzeppelin/
- right to the
=
sign, have the path to the corresponding libraryforge-std/
should point to thesrc/
directory of your localforge-std
libraryds-test/
should point to thesrc/
directory of your localds-test
library@inco/
should point to the@inco
directory in yournode_modules
directory, and not to the@inco/lightning
or@inco/shared
directories- In the same way
@openzeppelin/
should point to the@openzeppelin
directory in yournode_modules
directory
To simplify this process, we recommend using bun/npm to import all the dependencies (including foundry-std
and ds-test
) like so:
and using this remapping file (supposing that your node_modules
sit one directory up from your contracts directory):
Was this page helpful?