-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/Ending recurring base donation #4901
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/components/views/userProfile/donationsTab/recurringTab/EndStreamModal.tsx (2)
131-131
: LGTM! Consider adding network validation.The dynamic chainId in the backend call maintains consistency with the Superfluid Framework initialization.
Consider adding network validation middleware in the backend to ensure the chainId matches the supported networks before processing the transaction.
Line range hint
108-121
: Consider enhancing network-specific token loading.The current token loading logic uses separate conditions for each network. As more networks are added, this could become harder to maintain.
Consider refactoring to use a network configuration map:
- const _superToken = - recurringNetworkId === config.OPTIMISM_NETWORK_NUMBER - ? config.OPTIMISM_CONFIG.SUPER_FLUID_TOKENS.find( - s => s.underlyingToken.symbol === donation.currency, - ) - : config.BASE_CONFIG.SUPER_FLUID_TOKENS.find( - s => s.underlyingToken.symbol === donation.currency, - ); + const networkConfigs = { + [config.OPTIMISM_NETWORK_NUMBER]: config.OPTIMISM_CONFIG, + [config.BASE_NETWORK_NUMBER]: config.BASE_CONFIG, + }; + const networkConfig = networkConfigs[recurringNetworkId]; + if (!networkConfig) { + throw new Error('Unsupported network'); + } + const _superToken = networkConfig.SUPER_FLUID_TOKENS.find( + s => s.underlyingToken.symbol === donation.currency, + );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/views/userProfile/donationsTab/recurringTab/EndStreamModal.tsx
(2 hunks)
🔇 Additional comments (1)
src/components/views/userProfile/donationsTab/recurringTab/EndStreamModal.tsx (1)
105-105
: LGTM! Verify network compatibility.
The dynamic chainId setting is correct and necessary for supporting multiple networks. This fixes the Base network support.
Let's verify the supported networks configuration:
✅ Verification successful
Based on the search results, I can see that the codebase has proper network configurations for both Optimism and Base networks, with their respective network numbers and Superfluid token configurations. Let me verify the Superfluid tokens configuration to ensure complete compatibility.
LGTM! The dynamic chainId setting is properly supported.
The codebase has proper Superfluid token configurations for both Optimism and Base networks. The EndStreamModal correctly uses the dynamic recurringNetworkId
to:
- Initialize Superfluid Framework with the correct network
- Find the appropriate Superfluid token configuration based on the network
- Handle both Optimism and Base network tokens through their respective configurations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check network configurations and Superfluid token definitions
rg -A 5 "SUPERFLUID_TOKENS"
rg -A 2 "NETWORK_NUMBER"
Length of output: 40931
Script:
#!/bin/bash
# Check Superfluid token configurations for both networks
rg -A 10 "SUPER_FLUID_TOKENS"
Length of output: 13891
Summary by CodeRabbit
chainId
parameter during the deletion of recurring donations.