{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "type": "object", "required": [ "allow_revoting", "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" }, "deposit_info": { "description": "Information about the deposit required to create a proposal. None if there is no deposit requirement, Some otherwise.", "anyOf": [ { "$ref": "#/definitions/DepositInfo" }, { "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": { "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" }, "DepositInfo": { "description": "Information about the deposit required to create a proposal.", "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/DepositToken" } ] } } }, "DepositToken": { "description": "Information about the token to use for proposal deposits.", "oneOf": [ { "description": "Use a specific token address as the deposit token.", "type": "object", "required": [ "token" ], "properties": { "token": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" } } } }, "additionalProperties": false }, { "description": "Use the token address of the associated DAO's voting module. NOTE: in order to use the token address of the voting module the voting module must (1) use a cw20 token and (2) implement the `TokenContract {}` query type defined by `cw_core_macros::token_query`. Failing to implement that and using this option will cause instantiation to fail.", "type": "object", "required": [ "voting_module_token" ], "properties": { "voting_module_token": { "type": "object" } }, "additionalProperties": false } ] }, "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" } } }