Skip to content

Fix leaderboard: add missing contract environment variables#76

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-leaderboard-visibility-issue
Open

Fix leaderboard: add missing contract environment variables#76
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-leaderboard-visibility-issue

Conversation

Copilot AI commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Leaderboard was not displaying because NEXT_PUBLIC_CONTRACT_ADDRESS and NEXT_PUBLIC_CHAIN_ID were missing. The isContractConfigured() check in lib/contract.ts returned false, causing getLeaderboard() to short-circuit with an empty array.

Changes

  • Removed env.local - incorrectly named file (Next.js requires .env.local with leading dot)
  • Added .env.example - documents all required environment variables including:
    • NEXT_PUBLIC_CONTRACT_ADDRESS=0x781158C06D333b31a58D42DF5eBB5872B0734cD5 (TriviaPoints contract on Base Mainnet)
    • NEXT_PUBLIC_CHAIN_ID=8453 (Base Mainnet)
  • Updated .gitignore - allow .env.example while ignoring other env files

Configuration

Users deploying this app should:

cp .env.example .env.local
# Update NEYNAR_API_KEY with actual key

Contract addresses are pre-configured for Base Mainnet. Optional NEXT_PUBLIC_RPC_URL can be set for dedicated RPC endpoints.

Screenshot

Leaderboard loading state

Leaderboard now attempts to fetch on-chain data from the TriviaPoints contract. Requires network access to mainnet.base.org in production.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Triviacast/Triviacast/node_modules/next/dist/server/lib/start-server.js (dns block)
  • mainnet.base.org
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Triviacast/Triviacast/node_modules/next/dist/server/lib/start-server.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Diagnose why leaderboard is not showing up. Fix


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
triviacast Ready Ready Preview, Comment Jan 19, 2026 3:54am

Copilot AI and others added 2 commits January 19, 2026 03:51
Co-authored-by: JesterInvestor <69546826+JesterInvestor@users.noreply.github.com>
Co-authored-by: JesterInvestor <69546826+JesterInvestor@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix leaderboard not showing up issue Fix leaderboard: add missing contract environment variables Jan 19, 2026
Copilot AI requested a review from JesterInvestor January 19, 2026 03:55
@JesterInvestor JesterInvestor marked this pull request as ready for review March 16, 2026 16:13
Copilot AI review requested due to automatic review settings March 16, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the leaderboard not rendering by ensuring the required contract configuration environment variables are documented and can be set correctly in a Next.js-compatible way.

Changes:

  • Removed incorrectly named env.local file (should be .env.local in Next.js).
  • Added .env.example documenting required contract/chain configuration (and other related vars).
  • Updated .gitignore to keep ignoring env files while allowing .env.example to be committed.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
env.local Removes a mistakenly named env file that was being relied on locally.
.gitignore Ensures .env.example can be committed while other .env* files remain ignored.
.env.example Provides a template for required env vars (notably contract address + chain id) to unblock leaderboard fetching.
Comments suppressed due to low confidence (1)

env.local:1

  • The removed file contained a real-looking NEYNAR_API_KEY value. Even though the file is deleted, the key remains exposed in git history; please rotate/revoke that key (and any other secrets that may have been in this file) and set a new value via .env.local/CI secrets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread .env.example
@@ -0,0 +1,19 @@
# Neynar API Key for Farcaster integration
NEYNAR_API_KEY=your_neynar_api_key_here
Comment thread .env.example
Comment on lines +4 to +19
# Smart Contract Addresses (Base Mainnet)
NEXT_PUBLIC_CONTRACT_ADDRESS=0x781158C06D333b31a58D42DF5eBB5872B0734cD5
NEXT_PUBLIC_JACKPOT_ADDRESS=0x835d7410E258FA8FDBEE2ddb2B5668d2Df37D678
NEXT_PUBLIC_IQPOINTS_ADDRESS=0xEe24FA5B7C3FC199F4c3B9C8eA7F1E02F8F653c8
NEXT_PUBLIC_QUEST_MANAGER_ADDRESS=0x278Cc07A0C3662821C15dAd10c1BCe13d1d947F5

# Chain Configuration
NEXT_PUBLIC_CHAIN_ID=8453

# Quest Configuration
NEXT_PUBLIC_QUEST_GASLESS=false

# Optional: RPC endpoint for blockchain access (defaults to public RPC if not set)
# NEXT_PUBLIC_RPC_URL=https://base-mainnet.infura.io/v3/your_key
# Or use Alchemy:
# NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_key
Comment thread .env.example
NEXT_PUBLIC_QUEST_MANAGER_ADDRESS=0x278Cc07A0C3662821C15dAd10c1BCe13d1d947F5

# Chain Configuration
NEXT_PUBLIC_CHAIN_ID=8453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants