feat: implement global protocol configuration module with 2-step gove… - #150
Merged
El-swaggerito merged 2 commits intoJul 28, 2026
Merged
Conversation
…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.
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. |
6 tasks
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.
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
ProtocolConfigand its governance methods are fully functional and integrated intoAegisContract.max_batch_size == 0or negative limits), handled missing proposal errors, and ensuredrequire_not_pausedblocks mutations during emergencies.src/config_test.rs). Maintained the matrix integrity insrc/test.rsand added explicit event scenarios totests/sdk_fixtures.rsto generate exact JSON payloads for downstream indexers and SDKs.docs/protocol-configuration.md, updated the API signatures indocs/contract-spec.md, and linked the documentation under the Security & Compliance section inREADME.md.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)