{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "ConfigResponse", "description": "The governance module's configuration.", "type": "object", "required": [ "allow_revoting", "dao", "max_voting_period", "only_members_execute", "threshold" ], "properties": { "allow_revoting": { "description": "Allows changing votes before the proposal expires. If this is enabled proposals will not be able to complete early as final vote information is not known until the time of proposal expiration.", "type": "boolean" }, "dao": { "description": "The address of the DAO that this governance module is associated with.", "allOf": [ { "$ref": "#/definitions/Addr" } ] }, "deposit_info": { "description": "Information about the depost required to create a proposal. None if no deposit is required, Some otherwise.", "anyOf": [ { "$ref": "#/definitions/CheckedDepositInfo" }, { "type": "null" } ] }, "max_voting_period": { "description": "The default maximum amount of time a proposal may be voted on before expiring.", "allOf": [ { "$ref": "#/definitions/Duration" } ] }, "min_voting_period": { "description": "The minimum amount of time a proposal must be open before passing. A proposal may fail before this amount of time has elapsed, but it will not pass. This can be useful for preventing governance attacks wherein an attacker aquires a large number of tokens and forces a proposal through.", "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] }, "only_members_execute": { "description": "If set to true only members may execute passed proposals. Otherwise, any address may execute a passed proposal.", "type": "boolean" }, "threshold": { "description": "The threshold a proposal must reach to complete.", "allOf": [ { "$ref": "#/definitions/Threshold" } ] } }, "definitions": { "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, "CheckedDepositInfo": { "description": "Counterpart to the `DepositInfo` struct which has been processed.", "type": "object", "required": [ "deposit", "refund_failed_proposals", "token" ], "properties": { "deposit": { "description": "The number of tokens that must be deposited to create a proposal.", "allOf": [ { "$ref": "#/definitions/Uint128" } ] }, "refund_failed_proposals": { "description": "If failed proposals should have their deposits refunded.", "type": "boolean" }, "token": { "description": "The address of the cw20 token to be used for proposal deposits.", "allOf": [ { "$ref": "#/definitions/Addr" } ] } } }, "Decimal": { "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, "Duration": { "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", "oneOf": [ { "type": "object", "required": [ "height" ], "properties": { "height": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false }, { "description": "Time in seconds", "type": "object", "required": [ "time" ], "properties": { "time": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false } ] }, "PercentageThreshold": { "description": "A percentage of voting power that must vote yes for a proposal to pass. An example of why this is needed:\n\nIf a user specifies a 60% passing threshold, and there are 10 voters they likely expect that proposal to pass when there are 6 yes votes. This implies that the condition for passing should be `yes_votes >= total_votes * threshold`.\n\nWith this in mind, how should a user specify that they would like proposals to pass if the majority of voters choose yes? Selecting a 50% passing threshold with those rules doesn't properly cover that case as 5 voters voting yes out of 10 would pass the proposal. Selecting 50.0001% or or some variation of that also does not work as a very small yes vote which technically makes the majority yes may not reach that threshold.\n\nTo handle these cases we provide both a majority and percent option for all percentages. If majority is selected passing will be determined by `yes > total_votes * 0.5`. If percent is selected passing is determined by `yes >= total_votes * percent`.\n\nIn both of these cases a proposal with only abstain votes must fail. This requires a special case passing logic.", "oneOf": [ { "description": "The majority of voters must vote yes for the proposal to pass.", "type": "object", "required": [ "majority" ], "properties": { "majority": { "type": "object" } }, "additionalProperties": false }, { "description": "A percentage of voting power >= percent must vote yes for the proposal to pass.", "type": "object", "required": [ "percent" ], "properties": { "percent": { "$ref": "#/definitions/Decimal" } }, "additionalProperties": false } ] }, "Threshold": { "description": "The ways a proposal may reach its passing / failing threshold.", "oneOf": [ { "description": "Declares a percentage of the total weight that must cast Yes votes in order for a proposal to pass. See `ThresholdResponse::AbsolutePercentage` in the cw3 spec for details.", "type": "object", "required": [ "absolute_percentage" ], "properties": { "absolute_percentage": { "type": "object", "required": [ "percentage" ], "properties": { "percentage": { "$ref": "#/definitions/PercentageThreshold" } } } }, "additionalProperties": false }, { "description": "Declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. See `ThresholdResponse::ThresholdQuorum` in the cw3 spec for details.", "type": "object", "required": [ "threshold_quorum" ], "properties": { "threshold_quorum": { "type": "object", "required": [ "quorum", "threshold" ], "properties": { "quorum": { "$ref": "#/definitions/PercentageThreshold" }, "threshold": { "$ref": "#/definitions/PercentageThreshold" } } } }, "additionalProperties": false }, { "description": "An absolute number of votes needed for something to cross the threshold. Useful for multisig style voting.", "type": "object", "required": [ "absolute_count" ], "properties": { "absolute_count": { "type": "object", "required": [ "threshold" ], "properties": { "threshold": { "$ref": "#/definitions/Uint128" } } } }, "additionalProperties": false } ] }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" } } }