Setup your repo
We recommend using our template which comes with foundry already setup.
Using the template, you may want to skip to the cheatcodes reference.
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.
Inco uses npm packages to provide its solidity library.
Alternatively, you can use npm/yarn/pnpm.
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:
=
sign, have the following names
forge-std/
ds-test/
@inco/
@openzeppelin/
=
sign, have the path to the corresponding library
forge-std/
should point to the src/
directory of your local forge-std
libraryds-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@openzeppelin/
should point to the @openzeppelin
directory in your node_modules
directoryTo 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):
Setup your repo
We recommend using our template which comes with foundry already setup.
Using the template, you may want to skip to the cheatcodes reference.
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.
Inco uses npm packages to provide its solidity library.
Alternatively, you can use npm/yarn/pnpm.
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:
=
sign, have the following names
forge-std/
ds-test/
@inco/
@openzeppelin/
=
sign, have the path to the corresponding library
forge-std/
should point to the src/
directory of your local forge-std
libraryds-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@openzeppelin/
should point to the @openzeppelin
directory in your node_modules
directoryTo 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):