Skip to main content
In this guide, we will show you how to setup the DATA Foundation smart contract development environment in just a few minutes.

Prerequisites

Creating a Project

  1. Run foundryup to automatically install the latest stable version of the precompiled binaries: forge, cast, anvil, and chisel
  2. Run the following command in a new directory: forge init. This will create a foundry.toml and example project files in the project root. By default, forge init will also initialize a new git repository.
  3. Initialize a new yarn project: yarn init. (⚠️ Note: Only Yarn is compatible with the packages used in this project. Using npm or pnpm may result in dependency conflicts.)
  4. Open up your root-level foundry.toml file (located in the top directory of your project) and replace it with this:
  1. Remove the example contract files: rm src/Counter.sol script/Counter.s.sol test/Counter.t.sol

Installing Dependencies

Now, we are ready to start installing our dependencies. To incorporate the DATA Foundation core and periphery modules, run the following to have them added to your package.json. We will also install openzeppelin and erc6551 as a dependency for the contract and test.
Additionally, for working with Foundry’s test kit, we also recommend adding the following devDependencies:
Now we are ready to build a simple test registration contract!