This is an example frontend that can be used to claim allocations.
The frontend is implemented with NextJS (React). It has the bare minimum functionality required to showcase the functionality.
Do not use this functionality directly in your own projects. Instead, adjust it to your own project.
This frontend has the following functionality:
- Connect your Starknet wallet
- Check how many tokens you have been allocated
- Check how many tokens you have already claimed
- Prepare to claim your tokens (retrieves some needed metadata)
- Claim your tokens. Requires that you first execute the preparation phase
All of the functionality is only for demonstration purposes. However, if you want to test it out yourself, you need to do at least the following changes to the code:
- Change the BASE_BACKEND_URL in page.tsx to point to your backend. Or leave as is, if you are testing locally (and running the backend in that address)
- Change the CONTRACT_ADDRESS to point to your deployed contract
- Change the used/supported networks in starknet-provider.tsx
- Make sure the used ABI is up to date (abi.json in the app folder)
When you implement this yourself, make sure of at least the following nasty details:
- All address are zero-padded at the beginning
This is a regular NextJS project with npm. Therefore, installation steps are:
- Run
npm install
- Run
npm run build
to build some metadata needed by NextJS - Run
npm run dev
to run locally