|
| 1 | +# Delegation Hub |
| 2 | + |
| 3 | +A simple web application for delegating AAVE, stkAAVE, and aAAVE voting power to a specified delegate address. Users can connect their wallet and delegate their voting power with a single click. |
| 4 | + |
| 5 | +## What It Does |
| 6 | + |
| 7 | +This website allows AAVE token holders to delegate their voting power (both VOTING and PROPOSITION) to a trusted delegate. It supports: |
| 8 | +- **AAVE** token delegation |
| 9 | +- **stkAAVE** token delegation |
| 10 | +- **aAAVE** token delegation |
| 11 | +- Delegation of all tokens at once |
| 12 | + |
| 13 | +Users connect their wallet, view their token balances, and can delegate or remove delegation with a simple interface. |
| 14 | + |
| 15 | +## How to Create Your Own Page |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +- [Bun](https://bun.sh) (or Node.js/npm) |
| 20 | +- An Ethereum wallet for testing |
| 21 | + |
| 22 | +### Setup |
| 23 | + |
| 24 | +1. **Clone or fork this repository** |
| 25 | + |
| 26 | +2. **Install dependencies** |
| 27 | + ```bash |
| 28 | + bun install |
| 29 | + ``` |
| 30 | + |
| 31 | +3. **Create a `.env` file** in the root directory: |
| 32 | + ```env |
| 33 | + VITE_DELEGATE_ADDRESS=0xYourDelegateAddressHere |
| 34 | + VITE_DELEGATE_NAME=Your Delegate Name |
| 35 | + VITE_LOGO_NAME=Your Logo Text |
| 36 | + |
| 37 | + # Optional: Customize colors |
| 38 | + VITE_MAIN_COLOR=#e8f8a6 |
| 39 | + VITE_MAIN_COLOR_DARK=#0d1208 |
| 40 | + |
| 41 | + # Optional: WalletConnect Project ID (for better wallet connection) |
| 42 | + VITE_WALLETCONNECT_PROJECT_ID=your-project-id |
| 43 | + ``` |
| 44 | + |
| 45 | +4. **Update the configuration** |
| 46 | + - Set `VITE_DELEGATE_ADDRESS` to the Ethereum address you want users to delegate to |
| 47 | + - Set `VITE_DELEGATE_NAME` to the display name (e.g., "No Trust Verify") |
| 48 | + - Set `VITE_LOGO_NAME` to the text shown in the header (defaults to delegate name) |
| 49 | + |
| 50 | +5. **Run the development server** |
| 51 | + ```bash |
| 52 | + bun run dev |
| 53 | + ``` |
| 54 | + |
| 55 | +6. **Build for production** |
| 56 | + ```bash |
| 57 | + bun run build |
| 58 | + ``` |
| 59 | + |
| 60 | +### Configuration Options |
| 61 | + |
| 62 | +- **`VITE_DELEGATE_ADDRESS`** (required): The Ethereum address to delegate voting power to |
| 63 | +- **`VITE_DELEGATE_NAME`** (required): Display name for the delegate |
| 64 | +- **`VITE_LOGO_NAME`** (optional): Logo text in header (defaults to delegate name) |
| 65 | +- **`VITE_MAIN_COLOR`** (optional): Light theme background color (default: `#e8f8a6`) |
| 66 | +- **`VITE_MAIN_COLOR_DARK`** (optional): Dark theme background color (default: `#0d1208`) |
| 67 | +- **`VITE_WALLETCONNECT_PROJECT_ID`** (optional): WalletConnect project ID for better wallet support |
| 68 | + |
| 69 | +### Deployment |
| 70 | + |
| 71 | +The project includes a GitHub Actions workflow for automatic deployment to GitHub Pages. Just push to the `main` branch and it will deploy automatically. |
| 72 | + |
| 73 | +For manual deployment, build the project and serve the `dist` folder: |
| 74 | +```bash |
| 75 | +bun run build |
| 76 | +# Serve the dist folder with your preferred static hosting service |
| 77 | +``` |
| 78 | + |
| 79 | +## How It Works |
| 80 | + |
| 81 | +The app interacts with AAVE governance contracts: |
| 82 | +- **AAVE Token**: `0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9` |
| 83 | +- **stkAAVE Token**: `0x4da27a545c0c5b758a6ba100e3a049001de870f5` |
| 84 | +- **aAAVE Token**: `0xa700b4eb416be35b2911fd5dee80678ff64ff6c9` |
| 85 | + |
| 86 | +It calls the `delegateByType(address, powerType)` function where: |
| 87 | +- `address`: The delegate address (or user's own address to remove delegation) |
| 88 | +- `powerType`: `0` for VOTING, `1` for PROPOSITION |
| 89 | + |
| 90 | +### Inspired By |
| 91 | + |
| 92 | +This project is inspired by [AaveChan's delegation interface](https://apps.aavechan.com/delegate). |
| 93 | + |
0 commit comments