feat(dao-mcp): dao_register accepts Phase-4 fields in one call
Closes the gap between DaoConfig schema (already has fields) and the dao_register tool (was rejecting/ignoring them). Now Sulkta DAO can be registered with all audit-discovered values in one call: proposal_addr / stake_st_policy / proposal_st_policy + 5 reference UTxO refs (governor / stake / proposal validators + StakeST / ProposalST minting policies). All fields remain optional. dao_proposal_create_unsigned errors clearly when one's missing. Future dao_discover_scripts tool will auto-populate from chain queries.
This commit is contained in:
parent
207dcae971
commit
bd62894aa8
1 changed files with 52 additions and 7 deletions
|
|
@ -1310,7 +1310,7 @@ impl WalletService {
|
||||||
|
|
||||||
#[tool(
|
#[tool(
|
||||||
name = "dao_register",
|
name = "dao_register",
|
||||||
description = "Register a DAO config (Sulkta, Bob's, etc) at $ALDABRA_DATA/daos/<name>.json. First-registered DAO becomes active automatically. Args: name (lowercase letters/digits/underscore/dash), governor_addr, stakes_addr, treasury_addr (all bech32), gov_token_policy (56 hex chars), gov_token_name_hex (hex of asset name), initial_spend (txhash#index, the Agora bootstrap tx ref), max_cosigners (u32), treasury_ref_config (56 hex chars). Optional: description, network (mainnet/preprod/preview, default mainnet)."
|
description = "Register a DAO config (Sulkta, Bob's, etc) at $ALDABRA_DATA/daos/<name>.json. First-registered DAO becomes active automatically. Required: name (lowercase letters/digits/underscore/dash), governor_addr, stakes_addr, treasury_addr (all bech32), gov_token_policy (56 hex chars), gov_token_name_hex (hex of asset name), initial_spend (txhash#index, the Agora bootstrap tx ref), max_cosigners (u32), treasury_ref_config (56 hex chars). Optional: description, network (mainnet/preprod/preview, default mainnet), and Phase-4 prerequisites — proposal_addr, stake_st_policy, proposal_st_policy (56 hex), plus reference UTxO refs (`txhash#index`) for governor_validator / stake_validator / proposal_validator / stake_st_policy / proposal_st_policy. The optional Phase-4 fields can be populated now or later via dao_discover_scripts (when shipped)."
|
||||||
)]
|
)]
|
||||||
async fn dao_register(
|
async fn dao_register(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -1326,6 +1326,14 @@ impl WalletService {
|
||||||
max_cosigners,
|
max_cosigners,
|
||||||
treasury_ref_config,
|
treasury_ref_config,
|
||||||
network,
|
network,
|
||||||
|
proposal_addr,
|
||||||
|
stake_st_policy,
|
||||||
|
proposal_st_policy,
|
||||||
|
governor_validator_ref,
|
||||||
|
stake_validator_ref,
|
||||||
|
proposal_validator_ref,
|
||||||
|
stake_st_policy_ref,
|
||||||
|
proposal_st_policy_ref,
|
||||||
}: DaoRegisterArgs,
|
}: DaoRegisterArgs,
|
||||||
) -> Result<String, String> {
|
) -> Result<String, String> {
|
||||||
let cfg = DaoConfig {
|
let cfg = DaoConfig {
|
||||||
|
|
@ -1344,12 +1352,17 @@ impl WalletService {
|
||||||
Some("preview") => DaoNetwork::Preview,
|
Some("preview") => DaoNetwork::Preview,
|
||||||
_ => DaoNetwork::Mainnet,
|
_ => DaoNetwork::Mainnet,
|
||||||
},
|
},
|
||||||
// Optional discovery fields — populated by `dao_discover_scripts`
|
proposal_addr,
|
||||||
// after registration.
|
stake_st_policy,
|
||||||
proposal_addr: None,
|
proposal_st_policy,
|
||||||
stake_st_policy: None,
|
script_refs: ScriptRefs {
|
||||||
proposal_st_policy: None,
|
governor_validator: governor_validator_ref,
|
||||||
script_refs: ScriptRefs::default(),
|
stake_validator: stake_validator_ref,
|
||||||
|
proposal_validator: proposal_validator_ref,
|
||||||
|
treasury_validator: None,
|
||||||
|
stake_st_policy: stake_st_policy_ref,
|
||||||
|
proposal_st_policy: proposal_st_policy_ref,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
self.inner
|
self.inner
|
||||||
.dao_store
|
.dao_store
|
||||||
|
|
@ -1680,6 +1693,38 @@ pub struct DaoRegisterArgs {
|
||||||
/// "mainnet" | "preprod" | "preview". Default mainnet.
|
/// "mainnet" | "preprod" | "preview". Default mainnet.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub network: Option<String>,
|
pub network: Option<String>,
|
||||||
|
|
||||||
|
// ─── Phase 4 prerequisites — all optional ─────────────────────────────
|
||||||
|
//
|
||||||
|
// Populate these to unlock dao_proposal_create_unsigned and the
|
||||||
|
// upcoming vote/cosign/advance tools. Each can be discovered via
|
||||||
|
// chain queries (the audit pattern at internal notes*.md);
|
||||||
|
// a future dao_discover_scripts MCP tool will fill them automatically.
|
||||||
|
|
||||||
|
/// Proposal validator address (bech32). Where new proposal UTxOs land.
|
||||||
|
#[serde(default)]
|
||||||
|
pub proposal_addr: Option<String>,
|
||||||
|
/// 56 hex chars — StakeST minting policy id.
|
||||||
|
#[serde(default)]
|
||||||
|
pub stake_st_policy: Option<String>,
|
||||||
|
/// 56 hex chars — ProposalST minting policy id.
|
||||||
|
#[serde(default)]
|
||||||
|
pub proposal_st_policy: Option<String>,
|
||||||
|
/// `txhash#index` reference UTxO carrying the governor validator script.
|
||||||
|
#[serde(default)]
|
||||||
|
pub governor_validator_ref: Option<String>,
|
||||||
|
/// `txhash#index` reference UTxO carrying the stake validator script.
|
||||||
|
#[serde(default)]
|
||||||
|
pub stake_validator_ref: Option<String>,
|
||||||
|
/// `txhash#index` reference UTxO carrying the proposal validator script.
|
||||||
|
#[serde(default)]
|
||||||
|
pub proposal_validator_ref: Option<String>,
|
||||||
|
/// `txhash#index` reference UTxO carrying the StakeST minting policy script.
|
||||||
|
#[serde(default)]
|
||||||
|
pub stake_st_policy_ref: Option<String>,
|
||||||
|
/// `txhash#index` reference UTxO carrying the ProposalST minting policy script.
|
||||||
|
#[serde(default)]
|
||||||
|
pub proposal_st_policy_ref: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, schemars::JsonSchema)]
|
#[derive(Debug, Deserialize, schemars::JsonSchema)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue