3. Create your project
- After setting up your environment, open a terminal and run the following command to create your WAVS Foundry Template project. In this example, your project will be called
my-wavs
.
forge init --template Lay3rLabs/wavs-foundry-template my-wavs
- Then, enter your project:
cd my-wavs
- Run the following command to open your project in VS code, or open it in the editor of your choice:
code .
Explore the template
This template repo contains all the files you'll need to build, run, and test WAVS services locally.
The template already contains the necessary files for the oracle example to run. For example, the trigger (WavsTrigger.sol
) and submission (WavsSubmit.sol
) contracts can be found in the /my-wavs/src/contracts
folder.
In /eth-price-oracle/src/lib.rs
you'll find the oracle service component.
This template uses a Makefile
and environment variables to help with your developer experience. If you are ever curious about one of the Make
commands in the following sections, you can always look at the Makefile
to learn more.
You can run the following command from the root of the repo to see all of the commands and environment variable overrides available:
make help
The next sections will show you how to deploy your contracts and components, set up WAVS, and run the oracle example.
Build and test your contracts
Run the following commands from the root of your project to install necessary dependencies, build the template contracts, and run tests using Forge.
# Install dependenciesmake setup# Build the contractsforge build# Run the solidity tests.forge test
The last command runs a basic unit test which verifies that the SimpleTrigger
contract in /WavsTrigger.sol
correctly stores and retrieves trigger data.