You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Record a decision on-chain by deciding a case using the stored constitution.
108
+
109
+
The `case` parameter is a Prolog dict term string (typically `ctx{...}`) representing the decision context provided by the caller.
110
+
111
+
Before evaluation, the contract enriches the case with contract-derived facts:
112
+
113
+
`prolog ctx{ 'gov:module': module{ id: <atom>, version: <atom> }, 'gov:cosmwasm': cosmwasm{ message: message{ sender: <atom>, % Bech32 address of message sender funds: [coin(Amount, Denom), ...] % List of coins sent with message }, block: block{ height: <integer>, % Block height time: <integer>, % Block timestamp (seconds since epoch) tx_index: <integer> % Transaction index (optional) } }, <caller_provided_keys>: <caller_provided_values> } `
114
+
115
+
Injected keys are authoritative and overwrite any caller-provided value under the same keys.
116
+
117
+
The contract evaluates `governance:decide/2` or `governance:decide/3` depending on `motivated`, and records the resulting verdict (and optional motivation) as a durable decision record.
|`record_decision.case`|_(Required.) _ **string**. The decision context. |
123
+
|`record_decision.motivated`|**boolean\|null**. Whether to request a motivated decision (defaults to `false`).<br /><br />- If `false`, the contract calls `governance:decide/2` and records only the verdict. - If `true`, the contract calls `governance:decide/3` and records both verdict and motivation. |
124
+
105
125
### ExecuteMsg::revise_constitution
106
126
107
127
Propose a constitutional revision (constitutional amendment).
108
128
109
129
The contract asks the **current** constitution to decide whether the revision is allowed by evaluating a case that includes the intent `gov:revise_constitution`.
110
130
111
-
The contract builds the decision case by merging the caller-provided `case` (if any) with contract-enriched context. The complete case structure is:
131
+
The complete case structure is (keys containing `:` are quoted atoms):
112
132
113
-
`prolog ctx{ intent: 'gov:revise_constitution', 'gov:proposed_constitution_hash': <hex_string>, % SHA256 of constitution bytes (authoritative) 'gov:module': module{ id: <atom>, % Contract module ID (e.g., 'axone:axone-gov') version: <atom> % Contract version (e.g., '1.2.3') }, 'gov:cosmwasm': cosmwasm{ message: message{ sender: <atom>, % Bech32 address of message sender funds: [coin(Amount, Denom), ...] % List of coins sent with message }, block: block{ height: <integer>, % Block height time: <integer>, % Block timestamp (seconds since epoch) tx_index: <integer> % Transaction index } }, <caller_provided_keys>: <caller_provided_values> % Any additional keys from caller's case } `
133
+
`prolog ctx{ intent: 'gov:revise_constitution', 'gov:proposed_constitution_hash': <atom>, % Hex string atom (authoritative SHA256 of payload) 'gov:module': module{ id: <atom>, % Contract module ID (e.g., 'axone:axone-gov') version: <atom> % Contract version (e.g., '1.2.3') }, 'gov:cosmwasm': cosmwasm{ message: message{ sender: <atom>, % Bech32 address of message sender funds: [coin(Amount, Denom), ...] % List of coins sent with message }, block: block{ height: <integer>, % Block height time: <integer>, % Block timestamp (seconds since epoch) tx_index: <integer> % Transaction index } }, <caller_provided_keys>: <caller_provided_values> % Any additional keys from caller's case } `
114
134
115
135
The revision is applied only if the decision verdict is exactly the atom `gov:permitted`. Any other verdict (atom or compound term) refuses the revision.
- If `motivated` is `false`, the contract calls `decide/2` and returns only the verdict. - If `motivated` is `true`, the contract calls `decide/3` and returns both verdict and motivation.
154
-
155
173
The returned `verdict` is an arbitrary Prolog term (atom or compound), for example:
The optional `motivation` is an arbitrary Prolog term returned by the constitution and intended to justify the verdict (e.g. grounds/articles, findings, interpretation rules).
|`decide.case`|_(Required.) _ **string**. The decision context. |
187
+
|`decide.motivated`|**boolean\|null**. Whether to request a motivated decision (defaults to `false`).<br /><br />- If `false`, the contract calls `governance:decide/2` and returns only the verdict. - If `true`, the contract calls `governance:decide/3` and returns both verdict and motivation. |
188
+
189
+
### QueryMsg::decision
190
+
191
+
Return a recorded decision by its unique identifier.
192
+
193
+
The returned record is created by `ExecuteMsg::RecordDecision` and includes the decision payload (case/verdict, optional motivation) along with constitution metadata (revision/hash) and block metadata.
|`author`|_(Required.) _ **string**. The author Bech32 address. |
299
+
|`block_height`|_(Required.) _ **integer**. The block height at which the decision was recorded. |
300
+
|`block_time_seconds`|_(Required.) _ **integer**. The block time (seconds since epoch) at which the decision was recorded. |
301
+
|`case`|_(Required.) _ **string**. The case term as a Prolog term string. |
302
+
|`case_hash`|_(Required.) _ **[Binary](#binary)**. The case hash (32 bytes, sha256). |
303
+
|`constitution_hash`|_(Required.) _ **[Binary](#binary)**. The constitution hash at the time of decision (32 bytes, sha256). |
304
+
|`constitution_revision`|_(Required.) _ **integer**. The constitution revision number at the time of decision. |
305
+
|`decision_id`|_(Required.) _ **integer**. The unique decision identifier. |
306
+
|`motivation`|**string\|null**. Optional motivation term as a Prolog term string. |
307
+
|`motivation_hash`|**[Binary](#binary)\|null**. The motivation hash (32 bytes, sha256). |
308
+
|`verdict`|_(Required.) _ **string**. The verdict term as a Prolog term string. |
309
+
|`verdict_hash`|_(Required.) _ **[Binary](#binary)**. The verdict hash (32 bytes, sha256). |
310
+
220
311
---
221
312
222
-
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-gov.json` (`9c380ee3f4499a8b`)_
313
+
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-gov.json` (`5f5c92435d2b7af4`)_
0 commit comments