feat: implement geoblocking on musd reward claiming#40634
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/metamask-earn (4 files, +97 -4)
|
Builds ready [2eb1100]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
2eb1100 to
468625b
Compare
Matt561
left a comment
There was a problem hiding this comment.
The bug bot comments seems like a minor quick fix. Otherwise LGTM 👍
fe3851d to
203d8a7
Compare
203d8a7 to
4f99a67
Compare
Builds ready [4f99a67]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
20fdbdd
177b6d4 to
20fdbdd
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.
Builds ready [20fdbdd]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
Builds ready [a384f16]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|



Description
This PR uses the geoblocking logic from the MUSD conversion flow to also prevent claiming MUSD rewards in geoblocked regions
Changelog
CHANGELOG entry: Prevent MUSD reward claiming in Geoblocked regions.
Related issues
Fixes:
Manual testing steps
earnMerklCampaignClaimingfeature flagScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds geo-blocking checks that short-circuit reward fetching and transaction creation; risk is moderate because it changes who can see/claim rewards and could inadvertently block eligible users if the geo check misbehaves.
Overview
Extends existing mUSD geo-blocking to Merkl rewards by skipping reward lookups and claim transaction creation when
useMusdGeoBlockingreports the user is blocked.Updates unit/integration tests to mock
useMusdGeoBlockingconsistently and adds coverage ensuring geoblocked users neither call the Merkl API nor dispatch claim transactions.Written by Cursor Bugbot for commit a384f16. This will update automatically on new commits. Configure here.