-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add EVM adapter access control module #338
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
Open
pasevin
wants to merge
31
commits into
main
Choose a base branch
from
011-evm-access-control
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
546815d
docs(specs): add evm access control module specification
pasevin 7ad9a71
refactor(adapter-stellar): migrate to accessControlIndexerUrl and bum…
pasevin 1e79c97
docs(specs): update 011-evm-access-control phase 0 documentation
pasevin b711cf6
feat(adapter-evm-core): add access control module setup (phase 1)
pasevin d0a6222
feat(adapter-evm-core): add access control validation module (phase 2)
pasevin 2ff234a
feat(adapter-evm-core): add US1 — registration and capability detecti…
pasevin f6624a3
feat(adapter-evm-core): add US2 — ownership and admin state queries (…
pasevin e52821e
feat(adapter-evm-core): add US3 — view current role assignments (phas…
pasevin 53b5414
feat(adapter-evm-core): add US5 — default admin transfer operations (…
pasevin f5cb45d
feat(adapter-evm-core): add US6 — grant and revoke role operations (p…
pasevin 6943572
feat(adapter-evm-core): add US7 — query access control history (phase 9)
pasevin 81383a6
feat(adapter-evm-core): add US8 — export access control snapshot (pha…
pasevin 8573e8d
feat(adapter-evm-core): add US9 — discover role IDs via indexer (phas…
pasevin 9be12a6
feat(adapter-evm): integrate access control module (phase 12)
pasevin fd831e6
chore(adapter-evm-core): add changesets and complete phase 13 polish
pasevin 9c12533
test(adapter-evm-core): add live indexer integration tests (phase 14)
pasevin 63ee195
fix(adapter-evm-core): use bytes32 role IDs for ownership/admin histo…
pasevin 342e014
fix(adapter-evm-core): return trimmed value from validateRoleId
pasevin a568694
fix(adapter-evm-core): use composite role+account key in grant map
pasevin 1d34da5
feat(adapter-evm-core): add human-readable role labels for EVM access…
pasevin e4ce269
style(changeset): use double quotes in evm-access-control-role-labels…
pasevin 4993020
fix(adapter-evm-core): preserve external label precedence over ABI di…
pasevin 3f5454a
refactor(adapter-evm-core): extract shared viem public client factory
pasevin 288025d
fix(adapter-evm-core): use resolveRpcUrl for user RPC override support
pasevin e63edaf
fix(adapter-evm-core): normalize role IDs to lowercase for case-insen…
pasevin c394242
test(adapter-evm-core): expand role label coverage across all test su…
pasevin 9190716
feat(adapter-evm): add access control indexer url resolution and sett…
pasevin 2138a0b
fix(adapter-evm): populate role members from indexer for non-enumerab…
pasevin dea8024
test(adapter-evm-core): add non-enumerable indexer member population …
pasevin de81ddc
fix(adapter-evm-core): add defense-in-depth capability checks to serv…
pasevin e2fbb0d
fix(adapter-stellar): add defense-in-depth capability checks to servi…
pasevin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@openzeppelin/ui-builder-adapter-evm": minor | ||
| --- | ||
|
|
||
| Add access control service integration and indexer URL configuration | ||
|
|
||
| - Implement `getAccessControlService()` with lazy initialization on EvmAdapter | ||
| - Add `accessControlIndexerUrl` endpoints for all EVM mainnet networks (Ethereum, Polygon, Arbitrum, Optimism, Base, Avalanche, BSC, Gnosis, Celo, Scroll, ZKsync, Linea, Blast, Mantle, Mode) | ||
| - Add `accessControlIndexerUrl` endpoints for all EVM testnet networks (Sepolia, Amoy, Arbitrum Sepolia, Optimism Sepolia, Base Sepolia, Fuji, BSC Testnet, Chiado, Alfajores, Scroll Sepolia, ZKsync Sepolia, Linea Sepolia, Blast Sepolia, Mantle Sepolia, Mode Sepolia) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| "@openzeppelin/ui-builder-adapter-evm-core": minor | ||
| --- | ||
|
|
||
| Add access control module for EVM-compatible contracts | ||
|
|
||
| - Capability detection for Ownable, Ownable2Step, AccessControl, AccessControlEnumerable, and AccessControlDefaultAdminRules patterns via ABI analysis | ||
| - On-chain reads for ownership state, admin state, role assignments, and role enumeration via viem public client | ||
| - Transaction assembly for ownership transfer/accept/renounce, admin transfer/accept/cancel, admin delay change/rollback, and role grant/revoke/renounce as WriteContractParameters | ||
| - GraphQL indexer client for historical event queries with filtering and pagination, role discovery, pending transfer queries, and grant timestamp enrichment | ||
| - Input validation for EVM addresses and bytes32 role IDs | ||
| - Full API parity with the Stellar adapter's AccessControlService (13 unified methods + EVM-specific extensions) | ||
| - Graceful degradation when indexer is unavailable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| '@openzeppelin/ui-builder-adapter-evm-core': minor | ||
| --- | ||
|
|
||
| Add human-readable role labels for EVM access control | ||
|
|
||
| - Well-known role dictionary (DEFAULT_ADMIN_ROLE, MINTER_ROLE, PAUSER_ROLE, BURNER_ROLE, UPGRADER_ROLE) with resolveRoleLabel() | ||
| - ABI-based role constant extraction via findRoleConstantCandidates() and discoverRoleLabelsFromAbi() | ||
| - addKnownRoleIds() accepts { id, label } pairs for externally-provided labels | ||
| - roleLabelMap threaded through readCurrentRoles(), queryHistory(), and resolveRoleFromEvent() | ||
| - Label resolution precedence: external > ABI-extracted > well-known > undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| '@openzeppelin/ui-builder-adapter-stellar': patch | ||
| --- | ||
|
|
||
| Add defense-in-depth capability checks to Stellar access control service | ||
|
|
||
| - `getOwnership()` now validates `hasOwnable` capability before calling `get_owner()` when contract is registered | ||
| - `getAdminInfo()` now validates `hasTwoStepAdmin` capability before calling `get_admin()` when contract is registered | ||
| - `getAdminAccount()` now validates `hasTwoStepAdmin` capability before calling `get_admin()` when contract is registered | ||
| - Checks are soft — skipped when contract is not registered to preserve backward compatibility | ||
| - Throws descriptive `OperationFailed` errors instead of confusing on-chain failures | ||
| - Mirrors the defense-in-depth pattern added to the EVM adapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changeset claims
accessControlIndexerUrlendpoints were added for networks like Gnosis, Celo, Blast, Mantle, and Mode, but the updatedpackages/adapter-evm/src/networks/mainnet.tsandtestnet.tsin this PR only define a smaller subset of networks. Please either add the missing network configs/endpoints or adjust the release note to match what’s actually included.