Skip to content

feat: implement global protocol configuration module with 2-step gove… - #150

Merged
El-swaggerito merged 2 commits into
Raegis-RWA:mainfrom
NovusCyber:feat/protocol-configuration
Jul 28, 2026
Merged

feat: implement global protocol configuration module with 2-step gove…#150
El-swaggerito merged 2 commits into
Raegis-RWA:mainfrom
NovusCyber:feat/protocol-configuration

Conversation

@NovusCyber

Copy link
Copy Markdown
Contributor

Closes #35

Description

This PR introduces a robust, reusable Global Protocol Configuration module for the Aegis Contracts. It provides a secure way to manage flexible RWA parameters independently of other critical global states (like Emergency Pause and Supply Caps), optimizing gas costs and scaling security.
To prevent human error (fat-finger mistakes), the module employs a 2-step governance model, exclusively accessible by the Supreme Admin, alongside strict data validation guardrails.

Acceptance Criteria Met

  • Global protocol configuration module is implemented: ProtocolConfig and its governance methods are fully functional and integrated into AegisContract.
  • Relevant edge cases and failure states are handled: Added input validations (e.g., rejecting max_batch_size == 0 or negative limits), handled missing proposal errors, and ensured require_not_paused blocks mutations during emergencies.
  • Security and compliance-sensitive assumptions are documented: The separation of concerns, transition matrix, and strict disclaimer stating this does not constitute legal/financial advice are documented.
  • Tests, fixtures, or review checklists are added: 100% test coverage for the new module (src/config_test.rs). Maintained the matrix integrity in src/test.rs and added explicit event scenarios to tests/sdk_fixtures.rs to generate exact JSON payloads for downstream indexers and SDKs.
  • README or docs link to the new guidance: Added docs/protocol-configuration.md, updated the API signatures in docs/contract-spec.md, and linked the documentation under the Security & Compliance section in README.md.
  • Compatible with the Aegis ecosystem: Follows the established 2-step governance pattern, maintains matching capabilities standards, and introduces zero breaking changes to existing transfer/minting logic.

Files or Areas Affected

  • src/config.rs & src/config_test.rs (New module implementation and tests)
  • src/lib.rs & src/capabilities.rs (Module registration and interface exposure)
  • src/test.rs (Integration test alignments)
  • tests/sdk_fixtures.rs (SDK event fixtures)
  • docs/protocol-configuration.md, docs/contract-spec.md, README.md (Documentation)

…rnance

This commit introduces the  module to manage flexible protocol-level parameters (e.g., min_transfer_amount, max_batch_size) safely, separating them from high-frequency checks like emergency pause or tokenomics.

Changes:
- Implement  and  data structures in .
- Add 2-step governance workflow (, , ) restricted to Supreme Admin.
- Add strict parameter guardrails (reject negative limits and zeroed batch sizes) to prevent accidental protocol bricking.
- Integrate role-based access control and emergency pause blocking.
- Update  and  to expose the new configuration capabilities.
- Fix and align existing compliance integration tests in .
- Add comprehensive unit tests covering edge cases in .
- Generate SDK integration scenarios for  and  events in .
- Create  to document the security model, and link it in the main  and API specifications.
@El-swaggerito

Copy link
Copy Markdown
Contributor
\nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged.

@El-swaggerito
El-swaggerito merged commit 95503ec into Raegis-RWA:main Jul 28, 2026
1 check passed
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.

Add global protocol configuration module

2 participants