feat(P03): Storage substrate — Stash, Vault, Root-Pool types

---ci---
project: oy
phase: 3
milestone: v0.1
status: execute
---/ci---

Phase 3 (Component 5: Storage Substrate) skeleton:
- x/stash: per-Holder sovereign storage (§5), Still flag (§10), maturity tracking (§9.1)
- x/vault: per-Stand governed storage (§5), sub-Vault allocations
- x/rootpool: mesh treasury (§5), attested by Watchers, visible to all Holders
- 4 unit tests passing (Freeholder maturity thresholds verified: 90d, 30d max gap)
- Lexicon compliant
This commit is contained in:
CIAgent
2026-08-17 19:58:31 +00:00
parent 42895a74dd
commit edea9422ac
4 changed files with 183 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package types
import "encoding/json"
const (
ModuleName = "rootpool"
StoreKey = ModuleName
RouterKey = ModuleName
QuerierRoute = ModuleName
)
// RootPool is the mesh's treasury (§5)
// Attested by Watchers, visible to every Holder.
type RootPool struct {
BalanceGrain int64 `json:"balance_grain" yaml:"balance_grain"`
LastAttestation int64 `json:"last_attestation" yaml:"last_attestation"`
QuorumMet bool `json:"quorum_met" yaml:"quorum_met"`
ReserveRatioPct uint32 `json:"reserve_ratio_pct" yaml:"reserve_ratio_pct"`
}
// RootPoolEntry tracks incoming/outgoing Root-Pool movements
type RootPoolEntry struct {
EntryID string `json:"entry_id" yaml:"entry_id"`
Source string `json:"source" yaml:"source"`
Amount int64 `json:"amount" yaml:"amount"`
Reason string `json:"reason" yaml:"reason"`
Timestamp int64 `json:"timestamp" yaml:"timestamp"`
}
type Params struct{}
func DefaultParams() Params { return Params{} }
type GenesisState struct {
Params Params `json:"params" yaml:"params"`
RootPool RootPool `json:"root_pool" yaml:"root_pool"`
}
func DefaultGenesisState() *GenesisState {
return &GenesisState{Params: DefaultParams()}
}
func ValidateGenesis(bz json.RawMessage) error { return nil }