feat: integrate variational to defi referral program - #45582
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (3 files, +27 -0)
👨🔧 @MetaMask/core-extension-ux (1 files, +1 -0)
🫰 @MetaMask/core-platform (2 files, +106 -0)
👨🔧 @MetaMask/extension-platform (1 files, +2 -1)
🕵️ @MetaMask/extension-privacy-reviewers (1 files, +2 -1)
🧪 @MetaMask/qa (2 files, +4 -2)
|
7236606 to
041243e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 041243e. Configure here.
Builds ready [041243e]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 13 warn · 🔴 2 fail)
Bundle sizes
|
Builds ready [fb3e1a3]
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 6 warn · 🔴 3 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [606fd18]
⚡ Performance Benchmarks (Total: 🟢 12 pass · 🟡 9 warn · 🔴 3 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
|
Builds ready [e1faa52]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 12 warn · 🔴 2 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|




Description
This PR adds a referral prompt to Variational (variational.io) following the same logic as the other DeFi referral prompts. New strings and an image for Variational are added. One difference between Variational and the other partners is that they are in private beta and their referral prompt works as an access code right now. If the user is not on Arbitrum, a prompt on their side to switch to Arbitrum interrupts their access flow. Therefore we only show the prompt when the user is already on Arbitrum, to ensure that when accepted the referral code gets applied.
Changelog
CHANGELOG entry: Adds referral prompt to Variational
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
variational.metamask.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Changes extend an established referral-consent pattern with optional chain gating; no auth, signing, or payment logic is modified beyond deferring when the wrong chain is selected.
Overview
Adds Variational (
omni.variational.io) to the existing DeFi referral consent flow, including a newvariational_referral_consentapproval type, defaultreferrals.variationalpreference state, and partner-specific copy (variationalReferralSubtitle).Introduces optional
requiredChainIdon partner config (Variational uses Arbitrum0xa4b1). Before showing the referral prompt, the background service now resolves the dapp’s selected network viaSelectedNetworkController:getNetworkClientIdForDomainand returns without persisting referral state if the active chain doesn’t match—so the prompt can appear again after the user switches chains.Wiring updates mirror other partners: shared constants, confirmation templates/stories, and e2e fixture expectations for the new referral slot.
Reviewed by Cursor Bugbot for commit 041243e. Bugbot is set up for automated code reviews on this repo. Configure here.