fix(ethereum): add multiRewardDistributor for reward claims (MOO-413)#306
Merged
bprofiro merged 1 commit intoJun 15, 2026
Conversation
Add the on-chain-verified MRD_PROXY address (0x60142B8d76FaC5b88cfB422Ba1aA905d2171851c, the comptroller's rewardDistributor()) to Ethereum's contracts config, mirroring Base and Optimism. The SDK reads reward APRs from the views contract, but the frontend's reward-claim flow branches on this address: present => claim via the comptroller's claimReward; absent => fall back to the Moonbeam 0x..0808 precompile batchAll path, which reverts on Ethereum. Required so the WELL rewards MIP-X59 starts accruing on the four Ethereum Core markets are claimable, not just displayed. Locks the address with an environment invariant test.
Contributor
Quality Gate: ✅ PASS
Informational (non-gating)
NotesAll gated metrics held or improved. If this PR raised the floor (e.g., added tests), consider running |
Deploying moonwell-sdk with
|
| Latest commit: |
5c709c5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://24be04f3.moonwell-sdk.pages.dev |
| Branch Preview URL: | https://brenda-moo-413-add-multirewa.moonwell-sdk.pages.dev |
apokusin
approved these changes
Jun 15, 2026
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Merged
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
Adds the Ethereum
multiRewardDistributor(MRD_PROXY=0x60142B8d76FaC5b88cfB422Ba1aA905d2171851c) tosrc/environments/definitions/ethereum/contracts.ts, mirroring the Base and Optimism configs. Closes MOO-413.Why (the real reason — not what the ticket says)
The ticket claimed the missing address would make reward APRs display as 0%. That's inaccurate — reward APRs come from the on-chain
viewscontract / Lunar indexer, and the SDK never readsmultiRewardDistributordirectly.The actual consumer is the frontend
useUserRewardsData.tsx, which branches on this address to build the reward-claim transaction:multiRewardDistributordefined?comptroller.addressclaimReward(holders, mTokens, …)0x…0808precompilebatchAll(…)Ethereum, lacking it, fell into the Moonbeam precompile path — a claim tx to
0x…0808on Ethereum mainnet reverts. So once MIP-X59 makes WELL accrue on the four Ethereum Core markets (ETH, USDC, USDT, cbBTC), users would see rewards but fail to claim them. No frontend change needed — the frontend already branches on the value; this just supplies it.Verification
Comptroller(0xdec80bb…21be).rewardDistributor()on Ethereum mainnet returns exactly0x60142B8d76FaC5b88cfB422Ba1aA905d2171851c.pnpm typecheckclean ·pnpm lintclean.getUserRewardslive-RPC cases for Ethereum pass.Tests added
src/environments/definitions/ethereum/environment.test.ts— locks bothenv.config.contracts.multiRewardDistributor(raw config) andenv.contracts.multiRewardDistributor.address(wired viem contract), so dropping or mis-wiring the address fails CI. This closes the coverage gap that let the omission ship originally.Notes / follow-ups
multiRewardDistributoris?: Address(optional) in the config type but treated as required in the client contract type — which is why this could ship missing on Ethereum without a compile error. Worth tightening separately.