This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
The spec is SPEC.md.
This is a WAVS (WebAssembly AVS) monorepo template that integrates with Ethereum Attestation Service (EAS) for building verifiable offchain applications. The project combines:
- Solidity contracts for blockchain interaction (EAS attestations, triggers, submissions)
- Rust WASI components for WebAssembly execution in the WAVS runtime
- TypeScript/JavaScript components for alternative WASI implementations
- Foundry for Solidity development and testing
- Docker for containerized services and deployment
The system follows a trigger-response pattern:
- Trigger contracts emit events that WAVS monitors
- WASI components process these events and perform computations
- Submission contracts receive and store results from WAVS operators
- EAS integration enables attestation-based workflows
Key directories:
src/- Solidity contracts (triggers, submissions, EAS integration)docs/- Documentation for WAVScomponents/- WASI components in Rust and TypeScripttest/- Foundry unit testsscript/- Deployment and utility scripts
make setup # Install all dependencies (npm + forge)
make check-requirements # Verify system dependenciesmake build # Build all (Solidity + WASI components)
forge build # Build Solidity contracts only
make wasi-build # Build WASI components only
WASI_BUILD_DIR=components/eas-attest make wasi-build # Build specific componentforge test # Run all Solidity tests
forge test -vvv # Run with verbose output
npm run test:unit # Run unit tests specifically
npm run test:integration # Run integration testsnpm run lint:check # Check Solidity and formatting
npm run lint:fix # Fix linting and formatting issues
forge fmt # Format Solidity code
cargo fmt # Format Rust code# Test a component locally (example with Bitcoin price feed)
COIN_MARKET_CAP_ID=1 make wasi-execmake start-all-local # Start anvil, IPFS, WARG, telemetry services
# This creates .env from .env.example if it doesn't existLocated in components/*/src/lib.rs. Components must:
- Implement the
Guesttrait from bindings - Handle
TriggerActioninput and returnWasmResponse - Use the trigger module for encoding/decoding blockchain data
- Support both Ethereum (ABI-encoded) and CLI output destinations
Located in components/*/index.ts. Similar patterns to Rust but using:
- JavaScript/TypeScript instead of Rust
- Same trigger/response pattern
- Fetch API for HTTP requests
WavsTrigger.sol- Emits events for WAVS to monitorWavsSubmit.sol- Receives and stores computation results- EAS integration contracts in
src/contracts/for attestations
- Unit tests in
test/unit/ - Use Foundry's testing framework
- Mock external dependencies where appropriate
The deployment process involves multiple steps coordinated through shell scripts:
- Deploy EigenLayer contracts (
make wavs-middleware) - Deploy service contracts (
script/deploy-contracts.sh) - Build and upload WASI components (
script/upload-to-wasi-registry.sh) - Configure aggregator and WAVS operator instances
Key variables (see .env.example):
RPC_URL- Ethereum RPC endpointWAVS_ENDPOINT- WAVS service endpoint- Various contract addresses set during deployment
- Foundry - Solidity development (forge, cast, anvil)
- Cargo - Rust toolchain for WASI components
- Docker - Container orchestration
- Make - Build automation and task running
- Node.js v21+ - JavaScript runtime and npm packages