Fix leaderboard: add missing contract environment variables#76
Open
Copilot wants to merge 3 commits into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
There was a problem hiding this comment.
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.localfile (should be.env.localin Next.js). - Added
.env.exampledocumenting required contract/chain configuration (and other related vars). - Updated
.gitignoreto keep ignoring env files while allowing.env.exampleto 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_KEYvalue. 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.
| @@ -0,0 +1,19 @@ | |||
| # Neynar API Key for Farcaster integration | |||
| NEYNAR_API_KEY=your_neynar_api_key_here | |||
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 |
| NEXT_PUBLIC_QUEST_MANAGER_ADDRESS=0x278Cc07A0C3662821C15dAd10c1BCe13d1d947F5 | ||
|
|
||
| # Chain Configuration | ||
| NEXT_PUBLIC_CHAIN_ID=8453 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leaderboard was not displaying because
NEXT_PUBLIC_CONTRACT_ADDRESSandNEXT_PUBLIC_CHAIN_IDwere missing. TheisContractConfigured()check inlib/contract.tsreturned false, causinggetLeaderboard()to short-circuit with an empty array.Changes
env.local- incorrectly named file (Next.js requires.env.localwith leading dot).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).gitignore- allow.env.examplewhile ignoring other env filesConfiguration
Users deploying this app should:
cp .env.example .env.local # Update NEYNAR_API_KEY with actual keyContract addresses are pre-configured for Base Mainnet. Optional
NEXT_PUBLIC_RPC_URLcan be set for dedicated RPC endpoints.Screenshot
Leaderboard now attempts to fetch on-chain data from the TriviaPoints contract. Requires network access to
mainnet.base.orgin 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/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/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
💡 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.