{ "contract_name": "dao-voting-cw20-staked", "contract_version": "2.6.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "type": "object", "required": [ "token_info" ], "properties": { "active_threshold": { "description": "The number or percentage of tokens that must be staked for the DAO to be active", "anyOf": [ { "$ref": "#/definitions/ActiveThreshold" }, { "type": "null" } ] }, "token_info": { "$ref": "#/definitions/TokenInfo" } }, "additionalProperties": false, "definitions": { "ActiveThreshold": { "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", "oneOf": [ { "description": "The absolute number of tokens that must be staked for the module to be active.", "type": "object", "required": [ "absolute_count" ], "properties": { "absolute_count": { "type": "object", "required": [ "count" ], "properties": { "count": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", "type": "object", "required": [ "percentage" ], "properties": { "percentage": { "type": "object", "required": [ "percent" ], "properties": { "percent": { "$ref": "#/definitions/Decimal" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "Binary": { "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Cw20Coin": { "type": "object", "required": [ "address", "amount" ], "properties": { "address": { "type": "string" }, "amount": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false }, "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 } ] }, "EmbeddedLogo": { "description": "This is used to store the logo on the blockchain in an accepted format. Enforce maximum size of 5KB on all variants.", "oneOf": [ { "description": "Store the Logo as an SVG file. The content must conform to the spec at https://en.wikipedia.org/wiki/Scalable_Vector_Graphics (The contract should do some light-weight sanity-check validation)", "type": "object", "required": [ "svg" ], "properties": { "svg": { "$ref": "#/definitions/Binary" } }, "additionalProperties": false }, { "description": "Store the Logo as a PNG file. This will likely only support up to 64x64 or so within the 5KB limit.", "type": "object", "required": [ "png" ], "properties": { "png": { "$ref": "#/definitions/Binary" } }, "additionalProperties": false } ] }, "InstantiateMarketingInfo": { "type": "object", "properties": { "description": { "type": [ "string", "null" ] }, "logo": { "anyOf": [ { "$ref": "#/definitions/Logo" }, { "type": "null" } ] }, "marketing": { "type": [ "string", "null" ] }, "project": { "type": [ "string", "null" ] } }, "additionalProperties": false }, "Logo": { "description": "This is used for uploading logo data, or setting it in InstantiateData", "oneOf": [ { "description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.", "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string" } }, "additionalProperties": false }, { "description": "Logo content stored on the blockchain. Enforce maximum size of 5KB on all variants", "type": "object", "required": [ "embedded" ], "properties": { "embedded": { "$ref": "#/definitions/EmbeddedLogo" } }, "additionalProperties": false } ] }, "StakingInfo": { "description": "Information about the staking contract to be used with this voting module.", "oneOf": [ { "type": "object", "required": [ "existing" ], "properties": { "existing": { "type": "object", "required": [ "staking_contract_address" ], "properties": { "staking_contract_address": { "description": "Address of an already instantiated staking contract.", "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "new" ], "properties": { "new": { "type": "object", "required": [ "staking_code_id" ], "properties": { "staking_code_id": { "description": "Code ID for staking contract to instantiate.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "unstaking_duration": { "description": "See corresponding field in cw20-stake's instantiation. This will be used when instantiating the new staking contract.", "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "TokenInfo": { "oneOf": [ { "type": "object", "required": [ "existing" ], "properties": { "existing": { "type": "object", "required": [ "address", "staking_contract" ], "properties": { "address": { "description": "Address of an already instantiated cw20 token contract.", "type": "string" }, "staking_contract": { "description": "Information about the staking contract to use.", "allOf": [ { "$ref": "#/definitions/StakingInfo" } ] } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "new" ], "properties": { "new": { "type": "object", "required": [ "code_id", "decimals", "initial_balances", "label", "name", "staking_code_id", "symbol" ], "properties": { "code_id": { "description": "Code ID for cw20 token contract.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "decimals": { "type": "integer", "format": "uint8", "minimum": 0.0 }, "initial_balances": { "type": "array", "items": { "$ref": "#/definitions/Cw20Coin" } }, "initial_dao_balance": { "anyOf": [ { "$ref": "#/definitions/Uint128" }, { "type": "null" } ] }, "label": { "description": "Label to use for instantiated cw20 contract.", "type": "string" }, "marketing": { "anyOf": [ { "$ref": "#/definitions/InstantiateMarketingInfo" }, { "type": "null" } ] }, "name": { "type": "string" }, "staking_code_id": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "symbol": { "type": "string" }, "unstaking_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] } }, "additionalProperties": false } }, "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" } } }, "execute": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ExecuteMsg", "oneOf": [ { "description": "Sets the active threshold to a new value. Only the instantiator this contract (a DAO most likely) may call this method.", "type": "object", "required": [ "update_active_threshold" ], "properties": { "update_active_threshold": { "type": "object", "properties": { "new_threshold": { "anyOf": [ { "$ref": "#/definitions/ActiveThreshold" }, { "type": "null" } ] } }, "additionalProperties": false } }, "additionalProperties": false } ], "definitions": { "ActiveThreshold": { "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", "oneOf": [ { "description": "The absolute number of tokens that must be staked for the module to be active.", "type": "object", "required": [ "absolute_count" ], "properties": { "absolute_count": { "type": "object", "required": [ "count" ], "properties": { "count": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", "type": "object", "required": [ "percentage" ], "properties": { "percentage": { "type": "object", "required": [ "percent" ], "properties": { "percent": { "$ref": "#/definitions/Decimal" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "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" }, "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" } } }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "oneOf": [ { "description": "Gets the address of the cw20-stake contract this voting module is wrapping.", "type": "object", "required": [ "staking_contract" ], "properties": { "staking_contract": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "active_threshold" ], "properties": { "active_threshold": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Returns the voting power for an address at a given height.", "type": "object", "required": [ "voting_power_at_height" ], "properties": { "voting_power_at_height": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" }, "height": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Returns the total voting power at a given block heigh.", "type": "object", "required": [ "total_power_at_height" ], "properties": { "total_power_at_height": { "type": "object", "properties": { "height": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Returns the address of the DAO this module belongs to.", "type": "object", "required": [ "dao" ], "properties": { "dao": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Returns contract version info.", "type": "object", "required": [ "info" ], "properties": { "info": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "token_contract" ], "properties": { "token_contract": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "is_active" ], "properties": { "is_active": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ] }, "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", "type": "object", "additionalProperties": false }, "sudo": null, "responses": { "active_threshold": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ActiveThresholdResponse", "type": "object", "properties": { "active_threshold": { "anyOf": [ { "$ref": "#/definitions/ActiveThreshold" }, { "type": "null" } ] } }, "additionalProperties": false, "definitions": { "ActiveThreshold": { "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", "oneOf": [ { "description": "The absolute number of tokens that must be staked for the module to be active.", "type": "object", "required": [ "absolute_count" ], "properties": { "absolute_count": { "type": "object", "required": [ "count" ], "properties": { "count": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", "type": "object", "required": [ "percentage" ], "properties": { "percentage": { "type": "object", "required": [ "percent" ], "properties": { "percent": { "$ref": "#/definitions/Decimal" } }, "additionalProperties": false } }, "additionalProperties": false } ] }, "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" }, "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" } } }, "dao": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "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" }, "info": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InfoResponse", "type": "object", "required": [ "info" ], "properties": { "info": { "$ref": "#/definitions/ContractVersion" } }, "additionalProperties": false, "definitions": { "ContractVersion": { "type": "object", "required": [ "contract", "version" ], "properties": { "contract": { "description": "contract is the crate name of the implementing contract, eg. `crate:cw20-base` we will use other prefixes for other languages, and their standard global namespacing", "type": "string" }, "version": { "description": "version is any string that this implementation knows. It may be simple counter \"1\", \"2\". or semantic version on release tags \"v0.7.0\", or some custom feature flag list. the only code that needs to understand the version parsing is code that knows how to migrate from the given contract (and is tied to it's implementation somehow)", "type": "string" } }, "additionalProperties": false } } }, "is_active": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Boolean", "type": "boolean" }, "staking_contract": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "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" }, "token_contract": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "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" }, "total_power_at_height": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "TotalPowerAtHeightResponse", "type": "object", "required": [ "height", "power" ], "properties": { "height": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "power": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false, "definitions": { "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" } } }, "voting_power_at_height": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "VotingPowerAtHeightResponse", "type": "object", "required": [ "height", "power" ], "properties": { "height": { "type": "integer", "format": "uint64", "minimum": 0.0 }, "power": { "$ref": "#/definitions/Uint128" } }, "additionalProperties": false, "definitions": { "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" } } } } }