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

[wip] Add support for OZ5's AccessManager permission management #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gnpar
Copy link
Contributor

@gnpar gnpar commented Feb 5, 2025

Already working: obtain the current permissions, export as a snapshot, compare the current state with a given snapshot.

Still pending:

  • Tests for the new functionality
  • Optimize the node calls, no need to do a separate call for each event if we can get all in a single call
  • Add support for delays
  • Implement callback support for address and role name resolutions
  • Refactor the object model to fully type the event stream and the snapshot, and to reference actual role objects instead of keeping the int id
  • Build the graph for access manager

Example output for python -m eth_permissions 0xa29DF9825F283B2fA7a26B4627F84aDa80cDD79a on polygon:

{
  "0": {
    "label": "ADMIN_ROLE",
    "id": 0,
    "guardian": 0,
    "admin": 0,
    "members": [
      "0xCfcd29CD20B6c64A4C0EB56e29E5ce3CD69336D2"
    ],
    "targets": {}
  },
  "18446744073709551615": {
    "label": "PUBLIC_ROLE",
    "id": 18446744073709551615,
    "guardian": 0,
    "admin": 0,
    "members": [],
    "targets": {
      "0x90F9B3B51632a530B065F7D2285FAF8F93DE3efA": [
        "0x95d89b41",
        "0x5b2c3837",
        [...]
        "0xd9f9027f",
        "0x38d52e0f",
        "0xce96cb77"
      ],
      "0x14F6DFEE761455247C6bf2b2b052a1F6245dD6FB": [
        "0x95d89b41",
        "0x51a2d6d1",
        [...]
        "0xd9f9027f",
        "0x38d52e0f",
        "0xce96cb77"
      ]
    }
  }
  ...
}

Still pending:

- Tests for the new functionality
- Implement callback support for address and role name resolutions
- Refactor the object model to fully type the event stream and the snapshot, and to reference actual role objects instead of keeping the int id
@gnpar
Copy link
Contributor Author

gnpar commented Feb 6, 2025

In the compare output, make it method calls directly.

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.

1 participant