feat: add environment-based networks and swap navigation (#102, #103)#105
Open
dicethedev wants to merge 2 commits intoown-protocol:mainfrom
Open
feat: add environment-based networks and swap navigation (#102, #103)#105dicethedev wants to merge 2 commits intoown-protocol:mainfrom
dicethedev wants to merge 2 commits intoown-protocol:mainfrom
Conversation
Contributor
|
@dicethedev is attempting to deploy a commit to the Own Protocol Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
swetshaw
requested changes
Jan 26, 2026
Collaborator
swetshaw
left a comment
There was a problem hiding this comment.
Make swap the first item in the dropdown
swetshaw
approved these changes
Jan 27, 2026
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.
Summary
Implemented environment-based network configuration to ensure testnet (Base Sepolia) is only available in development and mainnet (Base Mainnet) is only available in production. The application now automatically detects and switches to the correct network based on the
NEXT_PUBLIC_ENVenvironment variable.Changes Made
1. Centralized Chain Configuration (
lib/chains.config.ts)NEXT_PUBLIC_ENVvariable with two modes:devandprod2. Updated Wagmi Configuration (
lib/wagmi.ts)supportedChainsfrom environment config instead of hardcoded chains3. Environment-Aware Contract Configuration (
config/contracts.ts)4. Environment-Aware Token Configuration (
config/tokens.ts)5. Chain Validation Hook (
hooks/useValidChain.ts)6. Updated UI Components
7. Environment Variables
.env.local:NEXT_PUBLIC_ENV=dev(for local development) orNEXT_PUBLIC_ENV=prod(for production deployment)Testing
Dev Mode (
NEXT_PUBLIC_ENV=dev)Prod Mode (
NEXT_PUBLIC_ENV=prod)Deployment Checklist
NEXT_PUBLIC_ENV=prodin Vercel/hosting production environment variablesNEXT_PUBLIC_ENV=devin Vercel/hosting preview/staging environment variables.env.localis in.gitignoreBenefits
Breaking Changes
None - existing functionality preserved, just restricted to appropriate environments
Files Changed
Related Issues
Closes #102 #103