MetaMask / MetaMask/core

[GNS] Remove usage of #chainId and current selected network from AssetsContractController

Open
#5,579 0 comments 0 reactions 0 assignees View on GitHub
Remove GNS team-assets
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

The function #getCorrectChainId currently falls back to the currently selected network and initializes the private property #chainId. This implicit behavior can lead to inconsistencies and unexpected results, especially in multi-network contexts.

### 🎯 Goal

- Remove the use of the private property `#chainId`
- Refactor all functions that rely on `#chainId` to **explicitly require a `chainId` or `networkClientId` parameter**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating AssetsContractController and its getCorrectChainId function, then trace every function that reads the private chainId or the currently selected network. Refactor those entry points to require chainId or networkClientId explicitly, and verify that no implicit selected-network fallback or private chainId usage remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.