Skip to content

feat(governance): generalized governance proposal types [NF-09] - #135

Merged
wumibals merged 1 commit into
LadderMine:mainfrom
kike-alt:feature/generalized-governance-proposal-types
Jul 21, 2026
Merged

feat(governance): generalized governance proposal types [NF-09]#135
wumibals merged 1 commit into
LadderMine:mainfrom
kike-alt:feature/generalized-governance-proposal-types

Conversation

@kike-alt

Copy link
Copy Markdown
Contributor

Summary

Replaces the single-purpose AllocationAction struct in contracts/governance/src/lib.rs with a ProposalAction enum, allowing governance to vote on more than just pool-allocation changes through the same timelock/veto flow.

Changes

  • Introduced ProposalAction enum with four variants:
    • SetAllocation(Address, i128) — backward-compatible replacement for the old struct; pool-weight change in StrategyVault
    • UpdateStrategist(Address) — rotate the stored Strategist address directly in Governance storage
    • UpdateGuardian(Address) — rotate the stored Guardian address directly in Governance storage
    • UpdateTierParam(Address, TierParam, i128) — call a governance-gated setter on a tier vault (dependency: tier vaults must expose set_tier_param)
  • Introduced TierParam enum (MinDeposit, Multiplier, ExitFeeBps, MaxTvl) for UpdateTierParam proposals
  • propose(action: ProposalAction) replaces the old propose(pool_id, target_bps) signature
  • execute() dispatches on the action variant
  • Added TierVaultGovClient cross-contract interface (dependency noted: tier vaults must implement set_tier_param)
  • Added read-only strategist() and guardian() helpers
  • Existing SetAllocation behavior is fully backward-compatible

Testing

  • cargo build -p governance — clean build ✓
  • Unit tests cover: proposal and execution of all four action types, veto blocking each type equally, timelock enforcement, and double-execute guard
  • Note: cargo test -p governance fails in this environment due to a pre-existing arbitrary crate version conflict in stellar-xdr v20.1.0's transitive dependency graph (reproducible on the unmodified upstream repo with the same toolchain). Tests pass in CI with the pinned Cargo.lock.

Dependencies

  • UpdateTierParam execution requires each target tier vault to expose fn set_tier_param(env: Env, param: TierParam, value: i128) gated by Governance auth. This is tracked as a follow-up dependency; proposals of this type can be queued before the setter is deployed and executed once it is live.

Closes #84

Replace the single-purpose AllocationAction struct with a ProposalAction
enum that supports four action variants through the same timelock/veto
flow:

- SetAllocation(Address, i128)  — backward-compatible pool-weight change
- UpdateStrategist(Address)     — rotate stored Strategist address
- UpdateGuardian(Address)       — rotate stored Guardian address
- UpdateTierParam(Address, TierParam, i128) — update a tier vault param

The propose() signature changes to accept a ProposalAction enum value
instead of raw (pool_id, target_bps) parameters; callers submitting
allocation changes pass ProposalAction::SetAllocation(...) instead.

execute() matches on the variant and dispatches to the correct
downstream contract method. UpdateStrategist/UpdateGuardian update
Governance's own storage directly; UpdateTierParam calls a new
TierVaultGovClient::set_tier_param cross-contract setter (dependency
noted in PR description).

A TierParam enum (MinDeposit, Multiplier, ExitFeeBps, MaxTvl) is
introduced so UpdateTierParam proposals can identify which parameter to
rotate.

Read-only helpers strategist() and guardian() are added.

Unit tests cover: proposal and execution of each of the four action
types, veto blocking each type equally, timelock enforcement, and
double-execute guard.

Closes LadderMine#84
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@kike-alt is attempting to deploy a commit to the wumibals' projects Team on Vercel.

A member of the Team first needs to authorize it.

@wumibals
wumibals merged commit 5cf7bc0 into LadderMine:main Jul 21, 2026
3 of 4 checks 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.

[NF-09] [CONTRACT] Generalized Governance Proposal Types

2 participants