---
# System prepended metadata

title: Syngergyland Code Review

---

# Syngergyland Code Review

## Dashboard

- [Task Tracker]: General Refactor
    - [Task]: General Refactor: TODOs
        - Remove old TODOs that are already finished
        - Add an issue for every remaining TODO in the code
    - [Task]: General Refactor: Remove magic numbers
        - QuestConfigurationPopup.tsx: `i === 6`, ` Array(8)`, ...
        - BoosterCard.tsx: `nftIndex === 6`
        - long etc

- [Task Tracker]: Refactor Pages
    - [Task]: Refactor Pages: index.tsx
        - Why usage of `useQuery` for airdrops instead of `useFetchAirdrops`
        - Sort synergianHolders function should be moved to lib
    - [Task]: Refactor Pages: General cleanup: remove unused code
        - Remove unnecessary classes, types, functions etc...
        - Sort and clean imports
        - Remove all `console.log`
        - ...


- [Task Tracker]: Refactor Hooks
    - [Task]: Refactor Hooks: Display a notification for every fast return at the begining, eg, connect wallet
    - [Task]: Refactor Hooks: General cleanup: remove unused code
        - Remove unnecessary classes, types, functions etc...
        - Sort and clean imports
        - Remove all `console.log`
        - ...
    - [Task]: Refactor Hooks: `useClaimReward`
        - code inside `setRewards` looks very similar 3 times, could be wrapper in a private function inside the hook
    - [Task]: Refactor Hooks: `useCountdown`
        - `getReturnValues` could be moved to `time` util/lib
    - [Task]: Refactor Hooks: `useLoot`
        - code inside `setLoots` looks very similar 2 times, could be wrapper in a private function inside the hook
    - [Task]: Refactor Hooks: `useMaintenance`
        - code inside the 2 `while` loops is very similar, could be wrapper in a private function inside the hook
    - [Task]: Refactor Hooks: `useManageNfts`
        - Do we need so mmuch logic in a single hook?
    - [Task]: Refactor Hooks: `useStartQuest`
        - what do the first 2 loops do? Why the magic numbers?
        - `startQuest` is huge, cant it be fractioned?


- [Task Tracker]: Refactor Lib
    - [Task]: Refactor Lib: Organize `lib` folder
        - `/synergyland`
            - `/airdrops`, `/boosters`, `/quests`, `/rewards`,`/traits`, `/seasons`, `/loots`, `notifications`, `time`
                - `constants`
                - `utils`
                - `types/interfaces`
                - `helpers`: these dont get exported
                - `stores`
                - `hooks`
                - ...
        - `/web3`
            - `/web3`, `/metaplex`, `/solana`, `/wallet`, `/gembank`...
                - `/classes` eg MetaplexClient, SolanaClient (unused INFT)
                - `actions`
                - `types/interfaces`
                - unused `interface INFT`
        - `/constants`
            - `environment`
            - ...: app constants
        - `/hooks`
            - app hooks, if necessary
        - `utils`
            - generic app utils. eg: time, env, trimmers, clipboard, etc... though I would split these into multiple files
        - `helpers`: these dont get exported, similar to utils but internal only
    - [Task]:  Refactor Lib: General cleanup
        - Make sure every element is in its corresponding file
        - `sleep` function is repeated N times
        - const `process.env.NEXT_PUBLIC_S3_ASSETS` repeated N times
        - Types and Interfaces namings, plural usually wrong
        - Add return types to all functions
        - Remove unnecessary classes, types, functions etc...
        - Sort and clean imports
        - Set logs as `console.error` when necessary
        - Remove all `console.log`
        - ...


- [Task Tracker]: Refactor Public
    - [Task]: Move buttons folder into assets


- [Task Tracker]: Refactor Components
    - TODO