Skip to content

[Contract] Separate emergency guard guardian and admin roles - #1

Open
abbaskachia wants to merge 6 commits into
mainfrom
feature/issue-76-emergency-rbac
Open

[Contract] Separate emergency guard guardian and admin roles#1
abbaskachia wants to merge 6 commits into
mainfrom
feature/issue-76-emergency-rbac

Conversation

@abbaskachia

Copy link
Copy Markdown
Owner

Closes SoroLabs#634

Description

This PR refactors the Emergency Guard contract to introduce distinct role-based access control for Guardian and Admin responsibilities.

Changes

  • Separated Guardian and Admin permissions.
  • Added a dedicated Guardian role responsible for triggering emergency pause actions.
  • Restricted unpause operations and administrative role management to the Admin role.
  • Preserved existing initialization behavior while extending it to support explicit role-based initialization.
  • Added/updated authorization logic to reflect the new role separation.

Related Issues

Testing & Verification Notes

Commands attempted:

cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test

Note: My local Windows environment is currently missing the MSVC linker (link.exe), which prevented running the full Rust test suite. The modified files were verified for formatting and editor diagnostics, and the project's CI will perform the complete validation.

Checklist

  • Separated Guardian and Admin responsibilities.
  • Guardian can trigger emergency pause.
  • Admin controls unpause and role management.
  • Existing initialization behavior remains compatible.
  • Code formatted.
  • Ready for review.

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.

[Contract] Add Emergency Guard Role-Based Access Control (RBAC) and Admin Transfer

1 participant