feat: add compliance-officer role across all three contracts - #162
Merged
Idaonoli merged 2 commits intoJul 30, 2026
Merged
Conversation
Add a compliance-officer role (single address in instance storage) that can perform day-to-day compliance operations while reserving role management to the existing admin/issuer. - denylist-gate: add_to_denylist/remove_from_denylist now accept admin OR compliance officer. New set_compliance_officer/revoke_compliance_officer are admin-only. - allowlist-token: add_to_allowlist/remove_from_allowlist now accept admin OR compliance officer. New set_compliance_officer/revoke_compliance_officer are admin-only. - jurisdiction-flag: set_jurisdiction now accepts issuer OR compliance officer. New set_compliance_officer/revoke_compliance_officer are issuer-only. Each contract gains a require_compliance_authority helper that checks admin/issuer first, then falls back to the compliance officer. Admin/issuer retains full access to all operations (additive, not a replacement). Tests cover: officer can perform delegated actions, officer cannot set/revoke the role, admin can set/revoke officer, revoked officer loses access, admin retains access. Closes stellar-compliance-kit#107
|
@odunfemisamuel-maker Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a compliance-officer role across all three contracts (, , ) so day-to-day compliance operations can be performed by a different team/key than the one that controls contract-level admin changes.
Design: Single Address
The compliance officer is stored as a single
Addressininstance()storage — consistent with the existing Admin/Issuer pattern, O(1) checks, and easy rotation viaset_compliance_officer.Per-contract changes
set_compliance_officer(admin, officer)revoke_compliance_officer(admin)add_to_denylist,remove_from_denylistnow accept admin or compliance officerset_compliance_officer(admin, officer)revoke_compliance_officer(admin)add_to_allowlist,remove_from_allowlistnow accept admin or compliance officerset_compliance_officer(issuer, officer)revoke_compliance_officer(issuer)set_jurisdictionnow accepts issuer or compliance officerEach contract gains a private
require_compliance_authorityhelper that checks admin/issuer first, then falls back to the compliance officer.Tests added (5 per contract = 15 total)
The
denylist-gate-consumerexample is unaffected (only calls the read-onlycheck()).Closes #107