I created a spl-token and I want to let users claim airdrops from my website.
My current implementation in short:
- Calculate associated token account
- Check if the token account exist
- If not, create the associated token account by sending tx (user pays gas fee)
- If exist, show claim airdrop button
Does creating the associated token account on the frontend side considered bad practice? Or is it possible to simplify the process and create the token account during claim airdrop?
Also, I would like to know if airdrops can only be done through programs(smart contracts) if I want to make sure an address only claimed once.
What if I want to add conditions to check the eligibility of the user, such as if the user holds more than 10 SOL, or the address holds 10 SOL for more than 2 years?
Thank you for the kind help!