Move away from global variables
- Dominant language
- Go
- Stars
- 164
- Forks
- 213
- Avg merge
- 3d 58m
- Merged PRs (30d)
- 12
Description
Instead of using global variables, we should be passing data from module to module. Move these variables from global variables/getters to objects passed to improve encapsulation:
* [**chainConfig**](https://github.com/cosmos/evm/blob/73bc2435c3886d7ae181b992a7e6dd2e1c04093b/x/vm/types/chain_config.go#L18)
* [These functions as well](https://github.com/cosmos/evm/blob/e5c1f5937d753176e03a2ecdb42bfffdaf24a1f3/x/vm/types/config.go#L52-L60)
* [Decimal/Denom Getters](https://github.com/cosmos/evm/blob/b72eb13d069b1c4582fd90f4f067d44f59002578/x/vm/types/denom_config.go#L58-L77)
Contributor guide
Research direction
Start by reading x/vm/types/chain_config.go, config.go, and denom_config.go, then trace their callers to understand how the globals, getters, and configuration data move between modules. Done means chain configuration and decimal/denom data are passed through objects rather than accessed through global variables or getters, with existing behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100