Skip to content

feat: enforce blacklist for mGLO and mHYPER - #243

Open
dmytro-horbatenko wants to merge 1 commit into
mainfrom
feat/blacklist-enforcement-upgrades
Open

feat: enforce blacklist for mGLO and mHYPER#243
dmytro-horbatenko wants to merge 1 commit into
mainfrom
feat/blacklist-enforcement-upgrades

Conversation

@dmytro-horbatenko

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +49 to +55
if (chainIds[networkName as Network] !== chainId) {
throw new Error(
`Network mismatch: ${networkName} is configured for chain ${
chainIds[networkName as Network]
}, got ${chainId}`,
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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}`,
);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants