This is the UI for the Pandasia backend, the backend is in three parts:
- A Go server that stores validator's P-Chain addresses as leafs in a merkle tree. The full trees are quite large and therefore cannot be stored directly on the Avax Network, they are instead stored in a SQLite database that the Go server accesses.
- A
pandasia.sol
contract deployed to the Avalanche Network that contains only the merkle root(s) of the trees in the SQLite DB. - A Supabase database for authorization to create airdrops as well as add and withdraw funds from airdrops.
More information and the code for the Go server and pandasia.sol
can be found at the pandasia repository.
Quick Summary:
Pandasia is an attempt to give airdrops to validators by connecting their P-Chain address
(used to deploy validator nodes) to their C-Chain address. The merkle trees allow us to verify validators
on the Avax network, and can deposit airdrop rewards to their respective wallet.
Project built using NextJS, we use src/
folder format instead of next 13's app/
router method.
Easier to make Supabase work and server side rendering is kinda confusing since we use the window.ethereum
object client side because of how connected wallet clients inject window.ethereum
onto the window object.
Supabase is our backend connection for airdrop info. Supabase is a postgreSQL wrapper, includes some nice auth client automatically.
Rainbowkit is the wallet connection black box of the website, it makes it easy to connect your wallet and gives a nice UI, at the expense of dark magic making it happen. Wagmi is the React hook libary that Rainbowkit uses, so it must be included as a dependency. Wagmi uses Tanstack Query under the hood.
Viem is a way to make direct calls to the blockchain, it uses native bigint
from ES2020.
It also allows for finer grained control of calls. This is our preferred method for calling contracts
whenever possible.
Axios is a nice way to make HTTP requests.
Only tailwind for styling, no React CSS library solutions.
Lottie is an animation library, takes json.
To run the development server:
yarn dev