feat: enforce blacklist for mGLO and mHYPER - #243
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new upgrade configuration, 'mtoken-blacklist-enforcement', to apply blacklist enforcement across several networks (Robinhood, Base, Main, Monad, Plasma, and Katana). It refactors the token upgrade execution and proposal scripts to dynamically retrieve configurations instead of relying on hardcoded values, and updates the Robinhood RPC URL to its mainnet endpoint. Feedback on the changes suggests improving the network validation logic in upgrade-contracts.ts to handle unconfigured networks gracefully and prevent misleading error messages.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (chainIds[networkName as Network] !== chainId) { | ||
| throw new Error( | ||
| `Network mismatch: ${networkName} is configured for chain ${ | ||
| chainIds[networkName as Network] | ||
| }, got ${chainId}`, | ||
| ); | ||
| } |
There was a problem hiding this comment.
If networkName is not configured in chainIds, chainIds[networkName as Network] will return undefined. This leads to a misleading error message: Network mismatch: <networkName> is configured for chain undefined, got <chainId>. Checking if the network is configured first provides a clearer error message.
| if (chainIds[networkName as Network] !== chainId) { | |
| throw new Error( | |
| `Network mismatch: ${networkName} is configured for chain ${ | |
| chainIds[networkName as Network] | |
| }, got ${chainId}`, | |
| ); | |
| } | |
| const configuredChainId = chainIds[networkName as Network]; | |
| if (configuredChainId === undefined) { | |
| throw new Error(`Network ${networkName} is not configured in chainIds`); | |
| } | |
| if (configuredChainId !== chainId) { | |
| throw new Error( | |
| `Network mismatch: ${networkName} is configured for chain ${configuredChainId}, got ${chainId}`, | |
| ); | |
| } |
No description provided.