WAVS Monorepo Template
Template for getting started with developing WAVS applications
A template for developing WebAssembly AVS applications using Rust and Solidity, configured for Windows WSL, Linux, and MacOS. The sample oracle service fetches the current price of a cryptocurrency from CoinMarketCap and saves it on chain via the operators.
Languages
Follow the instructions in README_SETUP.md to ensure your system is set up with the necessary tools and dependencies.
Then install dependencies:
# Install packages (pnpm & forge submodules)
task -y setupThis project supports pnpm packages, you can add git submodules if you need.
# Build the contracts
task build:forge
# Run the solidity tests
task testBuild the WASI components into the compiled output directory.
Warning
If you get: error: no registry configured for namespace "wavs"
run, wkg config --default-registry wa.dev
Warning
If you get: failed to find the 'wasm32-wasip1' target and 'rustup' is not available
brew uninstall rust & install it from https://rustup.rs
# Remove `WASI_BUILD_DIR` to build all components.
WASI_BUILD_DIR=components/evm-price-oracle task -y build:wasiValidate business logic before on-chain deployment. An ID of 1 is Bitcoin.
INPUT_DATA="1" COMPONENT_FILENAME=evm_price_oracle.wasm task wasi:execExpected output:
Decoded crypto ID: 1
resp_data: PriceFeedData { symbol: "BTC", timestamp: "2025-10-01T18:12:11", price: 116999.97 }
INFO Fuel used: 702137
Time elapsed (ms): 123
Result (hex encoded): 7b2273796d626f6c2...
Result (utf8): {"symbol":"BTC","timestamp":"2025-10-01T18:12:11","price":116999.97}
Ordering: 0Note
This must remain running in your terminal. Use new terminals to run other commands. You can stop the services with ctrl+c. Some terminals require pressing it twice.
# Create a .env file from the example
cp .env.example .env
# Starts anvil + IPFS and WARG registry.
task -y start-all-localThis script automates the complete WAVS deployment process, including contract deployments, component uploads, and operator registration, in a single command:
task deploy-fullAnyone can now call the trigger contract to emit the trigger event WAVS is watching for. WAVS then calls the service and saves the result on-chain.
# Get the trigger address from the deployment summary
export SERVICE_TRIGGER_ADDR=`jq -r '.evmpriceoracle_trigger.deployedTo' .docker/deployment_summary.json`
export RPC_URL=`task get-rpc`
export FUNDED_KEY=`task config:funded-key`
# Request BTC price from CoinMarketCap (ID=1)
export INPUT_DATA=`cast abi-encode "addTrigger(string)" "1"`
forge script ./src/script/Trigger.s.sol ${SERVICE_TRIGGER_ADDR} ${INPUT_DATA} --sig 'run(string,string)' --rpc-url ${RPC_URL} --broadcast --private-key ${FUNDED_KEY}Query the latest submission from the previous request.
RPC_URL=${RPC_URL} forge script ./src/script/ShowResult.s.sol ${SERVICE_TRIGGER_ADDR} --sig 'trigger(string)' --rpc-url ${RPC_URL}export SERVICE_SUBMIT_ADDR=`jq -r '.evmpriceoracle_submit.deployedTo' .docker/deployment_summary.json`
RPC_URL=${RPC_URL} forge script ./src/script/ShowResult.s.sol ${SERVICE_SUBMIT_ADDR} 1 --sig 'data(string,uint64)' --rpc-url ${RPC_URL}This template contains rulefiles for building components with Claude Code and Cursor. Read the AI-powered component creation guide for usage instructions.
To spin up a sandboxed instance of Claude Code in a Docker container that only has access to this project's files, run the following command:
pnpm run claude-code
# or with no restrictions (--dangerously-skip-permissions)
pnpm run claude-code:unrestricted