VITE_APP_REFERRAL_ADDRESS unvalidated: empty env kills all bond purchases

Component: ghost-dao-interface @ a911859, src/containers/Bond/components/BondConfirmModal.jsx:109; .env.template ships it empty.

Description: const referral = import.meta.env.VITE_APP_REFERRAL_ADDRESS; is passed raw into purchaseBond → deposit(id, amount, maxPrice, user, referral). No isAddress check, no fallback (e.g. zero address).

Impact: Local PoC with viem 2.31.0 (the repo’s version) proves encodeFunctionData throws InvalidAddressError: Address "undefined" is invalid for undefined and for malformed strings. So ALL bond purchases fail at the simulation stage and the user only sees a generic “Bond transaction failed” toast. Fail-closed feature DoS (safe for funds, but confusing).

Reproduction: Build/run without VITE_APP_REFERRAL_ADDRESS → click “Confirm Bond Purchase” → error toast; or run the viem PoC with args=[..., undefined] (executed locally in /tmp/viemtest, no network touched).

Severity: Low. Reason: feature DoS (not fund loss), depends on deploy configuration; but the official .env.template ships it empty, so the default deployment is broken.

Recommendation: Validate with isAddress() at startup; fall back to 0x000...000 or show an explicit “referral address misconfigured” error instead of a generic toast.

Verification: VERIFIED.

Thank you for your report!

This is a correct assumption, but take a look at the latest contract version. We are removing the referral address from the deposit function entirely, so it will be removed from the UI side in any case.