Using the lightning-rod template (recommended)
We recommend using our template which comes with foundry already setup.Or setup manually
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.Setup remappings
Create a fileremappings.txt at the root of your contracts directory.
- 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-stdlibraryds-test/should point to thesrc/directory of your localds-testlibrary@inco/should point to the@incodirectory in yournode_modulesdirectory, and not to the@inco/lightningor@inco/shareddirectories- In the same way
@openzeppelin/should point to the@openzeppelindirectory in yournode_modulesdirectory
foundry-std and ds-test) like so:
node_modules sit one directory up from your contracts directory):
Configure foundry.toml
Because node_modules sits outside your contracts directory, Foundry rejects the ../node_modules/… imports (Source … not found: File outside of allowed directories) unless you allow that path. List it under libs:
The
safe-smart-account/ remapping is needed to compile tests that extend IncoTest (see Test your contract).