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:
@@ -0,0 +1,42 @@
|
||||
package types
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
const (
|
||||
ModuleName = "vault"
|
||||
StoreKey = ModuleName
|
||||
RouterKey = ModuleName
|
||||
QuerierRoute = ModuleName
|
||||
)
|
||||
|
||||
// Vault is a per-Stand governed storage (§5)
|
||||
// Governed by the Stand Council (§19). Holds shared funds for a Stand.
|
||||
type Vault struct {
|
||||
VaultID string `json:"vault_id" yaml:"vault_id"`
|
||||
StandID string `json:"stand_id" yaml:"stand_id"`
|
||||
CreatedAt int64 `json:"created_at" yaml:"created_at"`
|
||||
BalanceGrain int64 `json:"balance_grain" yaml:"balance_grain"`
|
||||
}
|
||||
|
||||
// VaultAllocation tracks sub-Vault allocations within a Stand
|
||||
type VaultAllocation struct {
|
||||
VaultID string `json:"vault_id" yaml:"vault_id"`
|
||||
SubVaultID string `json:"sub_vault_id" yaml:"sub_vault_id"`
|
||||
Percentage uint32 `json:"percentage" yaml:"percentage"`
|
||||
Purpose string `json:"purpose" yaml:"purpose"`
|
||||
}
|
||||
|
||||
type Params struct{}
|
||||
|
||||
func DefaultParams() Params { return Params{} }
|
||||
|
||||
type GenesisState struct {
|
||||
Params Params `json:"params" yaml:"params"`
|
||||
Vaults []Vault `json:"vaults" yaml:"vaults"`
|
||||
}
|
||||
|
||||
func DefaultGenesisState() *GenesisState {
|
||||
return &GenesisState{Params: DefaultParams(), Vaults: []Vault{}}
|
||||
}
|
||||
|
||||
func ValidateGenesis(bz json.RawMessage) error { return nil }
|
||||
Reference in New Issue
Block a user