OpenZeppelin / OpenZeppelin/ui-builder

Implement renounce operations in the Stellar access control adapter

Open
#340 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement stellar
Dominant language
TypeScript
Stars
48
Forks
23
Avg merge
3h 1m
Merged PRs (30d)
10

Description

Summary

The OpenZeppelin Stellar contracts (stellar-contracts) support three renounce operations that are not yet implemented in the Stellar adapter (adapter-stellar):

On-chain function Contract Stellar adapter status
renounce_ownership(e) Ownable Feature flag detected, but no action assembly or service method
renounce_role(e, role, caller) AccessControl hasRenounceRole hardcoded to false — no action or service method
renounce_admin(e) AccessControl No shared interface capability — not wired at all

The EVM adapter (adapter-evm-core) already implements renounceOwnership and renounceRole with full feature detection, action assembly, and service methods. The Stellar adapter should reach parity.

Context

  • The EVM adapter was implemented in branch 011-evm-access-control.
  • The Stellar feature-detection.ts already sets hasRenounceOwnership = true when the schema contains renounce_ownership, but the service has no corresponding method — clicking the UI button would throw "not supported by this adapter".
  • hasRenounceRole is hardcoded to false with the comment "Stellar uses revokeRole for self-revocation", which is inaccurate — the on-chain contracts have a dedicated renounce_role function.

Tasks

1. renounceOwnership
  • Add assembleRenounceOwnershipAction() in adapter-stellar/src/access-control/actions.ts — invoke renounce_ownership() with no args
  • Add renounceOwnership() method on StellarAccessControlService
  • Add tests
2. renounceRole
  • Add assembleRenounceRoleAction() in adapter-stellar/src/access-control/actions.ts — invoke renounce_role(role, caller)
  • Add renounceRole() method on StellarAccessControlService
  • Update feature detection: derive hasRenounceRole from schema (check for renounce_role) instead of hardcoding false
  • Add tests
3. renounceAdmin (optional / future)
  • Evaluate whether to add a hasRenounceAdmin capability to the shared AccessControlCapabilities type
  • If added, implement assembleRenounceAdminAction() and service method
  • Note: no EVM equivalent exists — this would be Stellar-specific

References

  • Stellar contracts source: stellar-contracts/packages/access/src/ownable/storage.rs and stellar-contracts/packages/access/src/access_control/storage.rs
  • EVM adapter implementation: adapter-evm-core/src/access-control/actions.ts, adapter-evm-core/src/access-control/service.ts
  • Shared types: ui-types/src/adapters/access-control.ts (AccessControlCapabilities)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with adapter-stellar/src/access-control/actions.ts, the Stellar access-control service, and feature-detection.ts; compare their structure with adapter-evm-core/src/access-control/actions.ts and service.ts. Review ui-types/src/adapters/access-control.ts and the referenced Stellar contract storage files before adding tests. Done means ownership and role renunciation are assembled, exposed by the service, detected from the schema, and covered by tests; the optional admin work requires a separate capability decision.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.