🔧 Scaffold-AVS is an open-source toolkit for building your own Eigenlayer AVS. This repository is designed to make it easier for any developer to create and deploy AVS smart contracts and build user interfaces that interact with those AVS contracts. This repository includes the Hello World AVS contracts and an intuitive frontend dashboard to interact with this AVS. It's easy to create a new AVS contracts and setup similar dashboards quickly.
⚙️ Built using Eigenlayer, NextJS, RainbowKit, Foundry, Wagmi, Viem, and Typescript.
- ✅ Contract Hot Reload: The frontend auto-adapts to your smart contract as you edit it.
- 🪝 Scaffold hooks: Collection of React hooks wrapper around wagmi to simplify interactions with smart contracts with typescript autocompletion.
- 🧱 Components: Collection of common web3 components to quickly build your frontend.
- 🔐 Integration with Wallet Providers: Connect to different wallet providers and interact with the AVS smart contracts.
Empty dashboard | Live dasboard |
---|---|
Multi-Prover AVS Committee dashboard | Multi-Prover AVS Quorum dasboard |
---|---|
This dApp uses the Hello World AVS smart contracts, which includes the most basic functionalties that your AVS will probably also have. Use the Hello World AVS, or deploy your own contracts, and interact with them on your frontend dashboard. Here's an overview of all functions to interact with the AVS via the dashboard. If you want to add more, you can modify the frontend or interact with the AVS contracts via the Debug
tab.
The first component checks if the connected wallet is registered with Eigenlayer and the AVS. Use the button to register or deregister.
This component is used to send a new task to the AVS. Connect your wallet to send a single task, or input your private keys and have the dApp send a task every 5 seconds.
The events component displays all tasks. Use the Watch Tasks
toggle to get live updates for new tasks. By clicking the Respond
button, the task information is copied to the Respond component fields.
This component is used to respond to task. Manually input the task information and response, or click the Respond
button in the Tasks monitor to autofill for a specific task. This is only available for registered operators.
Before you begin, you need to install the following tools:
To get started with Scaffold-AVS, follow the steps below:
- Install dependencies:
cd scaffold-avs
yarn install
-
Make sure Docker is running
-
Run a local network in the first terminal:
make start-chain-with-contracts-deployed
This command starts a local Ethereum network using Foundry. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in packages/foundry/foundry.toml
.
- Update the submodules
git submodule update --init --recursive
- On a second terminal, deploy the test contracts:
yarn deploy
This command deploys a test smart contract to the local network. The contract is located in packages/foundry/contracts
and can be modified to suit your needs. The yarn deploy
command uses the deploy script located in packages/foundry/script
to deploy the contract to the network. You can also customize the deploy script.
- On a third terminal, start your NextJS app:
yarn start
Visit your app on: http://localhost:3000
. You can interact with your smart contract using the Debug Contracts
page. You can tweak the app config in packages/nextjs/scaffold.config.ts
.
- Sign in as the operator and register with Eigenlayer and AVS on the frontend. Now you can create tasks (using any wallet) and respond to them (with a wallet registered as operator).
What's next:
- Edit your smart contract
HelloWorldServiceManager.sol
inpackages/foundry/contracts
- Edit your frontend homepage at
packages/nextjs/app/page.tsx
. For guidance on routing and configuring pages/layouts checkout the Next.js documentation. - Edit your deployment scripts in
packages/foundry/script
This project is still in progress, and here some of the things I want to add after the hackathon:
- Fix Signature errors when registering with AVS
- Migrate project to hardhat
Contributions to the project are welcome.
- Vercel deployment (requires local chain running)
- Vercel deployment Scaffold-AVS with Multi-Prover AVS (on Holesky)