Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating global parameters #803

Open
tmigone opened this issue Sep 11, 2024 · 0 comments
Open

Allow creating global parameters #803

tmigone opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
status:ready This issue is ready to be worked on type:feature Fetaure request

Comments

@tmigone
Copy link

tmigone commented Sep 11, 2024

Describe the feature

Problem

Module parameters are great but sometimes you can have multiple modules requiring the exact same parameter which can become a bit tedious to manage.

For example, if I wanted to set the owner for a bunch of contracts on different modules I would have a config file like this:

{
  "GraphProxyAdmin": {
    "owner": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
    "pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
  },
  "Controller": {
    "owner": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
  },
  "RewardsManager": {
    "owner": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
    "issuancePerBlock": "114155251141552511415n"
  }
}

Solution

It would be nice to have global parameters that could be accessed from any module. Maybe use the global keyword to group them.

The config file in this case would be much cleaner, and the global parameters would immediately be recognized as such:

{
  "global": {
    "owner": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
    "pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
  },
  "RewardsManager": {
    "issuancePerBlock": "114155251141552511415n"
  }
}

Then for accessing the global parameters the API could be something like:

const owner = m.getGlobalParameter('owner')

Search terms

global, parameter, module parameter

@kanej kanej added status:ready This issue is ready to be worked on type:feature Fetaure request and removed status:triaging labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:feature Fetaure request
Projects
Status: Todo
Development

No branches or pull requests

3 participants