Fix token gate to use community-config tokens with systemConfig fallback#1763
Fix token gate to use community-config tokens with systemConfig fallback#1763Jhonattan2121 wants to merge 1 commit intocanaryfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe changes implement a SystemConfig context provider pattern, enabling components to access system configuration through context or props with fallback support. Additionally, the Nouns community NFT token configuration is updated with a new contract address, symbol (nOGs), and network (base). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Summary
This PR fixes a token gate regression where access checks could fail even for eligible users (e.g. holding
$SPACEand/ornOGs) whensystemConfigwas not explicitly passed to certain client components.Root Cause
Token gate logic depends on
systemConfig.community.tokens(fromcommunity_configs).Some UI paths rendered gate components without a
systemConfigprop, causing token resolution to fail in those contexts.Changes
SystemConfigcontext:src/common/providers/SystemConfigProvider.tsxsystemConfigglobally:src/common/providers/index.tsxsrc/app/layout.tsxprop systemConfig->SystemConfig contextsrc/common/lib/hooks/useTokenGate.tsNogsGateButtonto use the same fallback for both ERC20 and NFT checks:src/common/components/organisms/NogsGateButton.tsxImpact
Token gate now consistently uses the current community token config from
community_configs, including flows wheresystemConfigwas previously not passed down explicitly.Summary by CodeRabbit
New Features
Chores