feat: Implement governance & treasury features (issues #671-674) - #716
Merged
levi0005 merged 4 commits intoSep 1, 2026
Merged
Conversation
…ance - Add ResolveDispute action to AdminAction enum for governance-gated resolution - Add DisputeResolution storage key to access_control for contract address tracking - Implement set_dispute_resolution() function in access_control - Add dispute resolution handling in execute_action() workflow - Update resolve_dispute() documentation to clarify governance requirement - Implements multisig proposal/approval/execution with timelock for dispute resolution Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: 807b1fd
…th cooldown - Add CommunityProposal struct for staged community-submitted proposals - Add storage keys for community proposals and per-address cooldowns - Implement submit_community_proposal() with per-submitter cooldown enforcement - Implement get_community_proposal() for retrieving staged proposals - Implement sponsor_community_proposal() for signers to elevate proposals - Add COMMUNITY_PROPOSAL_COOLDOWN constant (1 day) to prevent spam - Enables broader community participation in governance while maintaining signer gatekeeping
…olicy contract - Add AssetAllocationPolicy struct to define target allocation ranges per asset - Add AllocationDrift struct to track when actual holdings deviate from policy - Add AssetAllocationPolicy storage key to treasury contract - Implement set_asset_allocation_policy() for governance-configurable policies - Implement get_asset_allocation_policy() to retrieve configured policies - Implement check_allocation_drift() read-only function for drift detection - Supports multiple assets with independent target ranges - Provides informational drift alerts without automated rebalancing
… definitions - Add versioned RiskTierDefinition struct to support configurable tier boundaries - Add score_to_tier() method for version-locked tier mapping - Add RiskTierDefinition storage keys for current and historical versions - Add AllocationDrift struct references (from Issue OpenLedger-Foundation#673) - Initialize default tier definition (AAA: 0-20, AA: 21-40, A: 41-60, B: 61-80, C: 81-100) - Implement get_current_risk_tier_definition() for active tier lookup - Implement get_risk_tier_definition_version() for version-locking support - Implement update_risk_tier_definition() for governance-controlled updates - Supports in-flight listings locked to tier definition at creation time - Provides foundational infrastructure for governance-gated tier boundaries
|
@Barbie-Dev 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! 🚀 |
Barbie-Dev
force-pushed
the
feature/issue-671-672-673-674
branch
from
August 31, 2026 05:52
ea548b8 to
439f407
Compare
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
This PR implements four major governance and treasury management features for the Kora Protocol:
All features integrate seamlessly with the existing access_control governance infrastructure and include comprehensive error handling, audit logging, and persistent storage management.
Issues Closed
Closes #671
Closes #672
Closes #673
Closes #674
Issue #671: Dispute Arbitration Governance
Objective
Transfer dispute resolution authority from single admin to governance mechanisms, applying multisig + timelock safeguards consistent with other critical protocol functions.
Implementation
ResolveDispute(Address, u64, bool)toAdminActionenum for governance-gated dispute resolutionDisputeResolutionstorage key to access_control for tracking dispute resolution contract addressset_dispute_resolution()to register the dispute resolution contractexecute_action()workflow with proper multisig validationresolve_dispute()comments to clarify governance requirementFiles Modified
contracts/shared/src/types.rs- AddedResolveDisputeaction variantcontracts/access_control/src/lib.rs- Added dispute resolution gating logiccontracts/dispute_resolution/src/lib.rs- Updated documentationKey Changes
Impact
Issue #672: Community Proposal Submission Threshold and Cooldown
Objective
Expand proposal submission beyond multisig signer group to broader community (accredited investors, verifiable entities) while maintaining signer gatekeeping authority.
Implementation
CommunityProposalfor staging non-signer proposals with submitter context and descriptionCommunityProposal(u64)- staged proposals by IDNextCommunityProposalId- monotonic counterCommunityProposalCooldown(Address)- per-submitter cooldown trackingCOMMUNITY_PROPOSAL_COOLDOWNconstant (1 day) to prevent spamsubmit_community_proposal()stages proposals with cooldown enforcementget_community_proposal()for reading staged proposalssponsor_community_proposal()allows signers to elevate proposals to formal governanceFiles Modified
contracts/shared/src/types.rs- AddedCommunityProposalstructcontracts/access_control/src/lib.rs- Added community proposal infrastructureKey Features
Impact
Issue #673: Treasury Diversification Policy Contract
Objective
Establish and enforce target asset allocation ranges for treasury holdings to prevent unintended concentration once multi-asset fee collection exists.
Implementation
AssetAllocationPolicywith min/max allocation targets per asset in basis pointsAllocationDriftfor reporting allocation deviationsAssetAllocationPolicy(Address)for asset-specific policiesset_asset_allocation_policy()for governance-configurable target rangesget_asset_allocation_policy()for reading current policiescheck_allocation_drift()read-only function identifying when holdings deviate from targetsFiles Modified
contracts/shared/src/types.rs- AddedAssetAllocationPolicyandAllocationDriftstructscontracts/treasury/src/lib.rs- Added allocation policy infrastructureKey Features
Impact
Issue #674: Governance-Gated Risk Tier Definitions
Objective
Convert hardcoded risk tier score-to-tier mappings into governed, versioned configuration that evolves with protocol's maturation and real default-rate data.
Implementation
RiskTierDefinitionstruct with:score_to_tier()method for tier lookupCurrentRiskTierDefinition- active tier definitionRiskTierDefinitionVersion(u32)- historical versions for version-lockingRiskTierDefinitionUpdatedAt- last update timestampcreate_default_risk_tier_definition()with standard boundaries:get_current_risk_tier_definition()- retrieve active definitionget_risk_tier_definition_version()- retrieve historical versionsupdate_risk_tier_definition()- governance-controlled updates with validationFiles Modified
contracts/shared/src/types.rs- AddedRiskTierDefinitionstruct with helper methodcontracts/risk_registry/src/lib.rs- Added tier definition management infrastructureKey Features
Impact
Technical Highlights
Governance Integration
All features integrate with existing access_control infrastructure:
Storage Management
Error Handling
Testing Ready
Files Changed
contracts/shared/src/types.rs- Added 5 new structs (CommunityProposal, AssetAllocationPolicy, AllocationDrift, RiskTierDefinition, etc.)contracts/access_control/src/lib.rs- Added governance infrastructure for disputes and community proposalscontracts/treasury/src/lib.rs- Added allocation policy managementcontracts/dispute_resolution/src/lib.rs- Updated documentation for governance requirementcontracts/risk_registry/src/lib.rs- Added versioned tier definition systemCommits
2619ce4- feat([High] Implement Dispute Arbitration Governance for Contested Defaults #671): Implement dispute arbitration governance654e0b6- feat([High] Add a Community Proposal Submission Threshold and Cooldown #672): Add community proposal submission with cooldown7041cd5- feat([High] Implement a Treasury Diversification Policy Contract #673): Implement treasury diversification policy contractea548b8- feat([High] Add Governance-Gated Risk Tier Definitions #674): Implement governance-gated risk tier definitionsTesting Recommendations
Checklist