{ "contract_name": "dao-voting-cw721-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": [ "nft_contract" ], "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" } ] }, "nft_contract": { "description": "Address of the cw721 NFT contract that may be staked.", "allOf": [ { "$ref": "#/definitions/NftContract" } ] }, "unstaking_duration": { "description": "Amount of time between unstaking and tokens being avaliable. To unstake with no delay, leave as `None`.", "anyOf": [ { "$ref": "#/definitions/Duration" }, { "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 } ] }, "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" }, "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 } ] }, "NftContract": { "oneOf": [ { "description": "Uses an existing cw721 or sg721 token contract.", "type": "object", "required": [ "existing" ], "properties": { "existing": { "type": "object", "required": [ "address" ], "properties": { "address": { "description": "Address of an already instantiated cw721 or sg721 token contract.", "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Creates a new NFT collection used for staking and governance.", "type": "object", "required": [ "new" ], "properties": { "new": { "type": "object", "required": [ "code_id", "initial_nfts", "label", "msg" ], "properties": { "code_id": { "description": "Code ID for cw721 token contract.", "type": "integer", "format": "uint64", "minimum": 0.0 }, "initial_nfts": { "description": "Initial NFTs to mint when creating the NFT contract. If empty, an error is thrown. The binary should be a valid mint message for the corresponding cw721 contract.", "type": "array", "items": { "$ref": "#/definitions/Binary" } }, "label": { "description": "Label to use for instantiated cw721 contract.", "type": "string" }, "msg": { "$ref": "#/definitions/Binary" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Uses a factory contract that must return the address of the NFT contract. The binary must serialize to a `WasmMsg::Execute` message. Validation happens in the factory contract itself, so be sure to use a trusted factory contract.", "type": "object", "required": [ "factory" ], "properties": { "factory": { "$ref": "#/definitions/Binary" } }, "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": "Used to stake NFTs. To stake a NFT send a cw721 send message to this contract with the NFT you would like to stake. The `msg` field is ignored.", "type": "object", "required": [ "receive_nft" ], "properties": { "receive_nft": { "$ref": "#/definitions/Cw721ReceiveMsg" } }, "additionalProperties": false }, { "description": "Unstakes the specified token_ids on behalf of the sender. token_ids must have unique values and have non-zero length.", "type": "object", "required": [ "unstake" ], "properties": { "unstake": { "type": "object", "required": [ "token_ids" ], "properties": { "token_ids": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Claim NFTs that have been unstaked for the specified duration.", "type": "object", "required": [ "claim_nfts" ], "properties": { "claim_nfts": { "type": "object", "required": [ "type" ], "properties": { "type": { "$ref": "#/definitions/ClaimType" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Updates the contract configuration, namely unstaking duration. Only callable by the DAO that initialized this voting contract.", "type": "object", "required": [ "update_config" ], "properties": { "update_config": { "type": "object", "properties": { "duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Adds a hook which is called on staking / unstaking events. Only callable by the DAO that initialized this voting contract.", "type": "object", "required": [ "add_hook" ], "properties": { "add_hook": { "type": "object", "required": [ "addr" ], "properties": { "addr": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Removes a hook which is called on staking / unstaking events. Only callable by the DAO that initialized this voting contract.", "type": "object", "required": [ "remove_hook" ], "properties": { "remove_hook": { "type": "object", "required": [ "addr" ], "properties": { "addr": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Sets the active threshold to a new value. Only callable by the DAO that initialized this voting contract.", "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 } ] }, "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" }, "ClaimType": { "oneOf": [ { "description": "Claims all legacy claims.", "type": "string", "enum": [ "legacy" ] }, { "description": "Claims all non-legacy claims.", "type": "string", "enum": [ "all" ] }, { "description": "Claims specific non-legacy NFTs.", "type": "object", "required": [ "specific" ], "properties": { "specific": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } ] }, "Cw721ReceiveMsg": { "description": "Cw721ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", "type": "object", "required": [ "msg", "sender", "token_id" ], "properties": { "msg": { "$ref": "#/definitions/Binary" }, "sender": { "type": "string" }, "token_id": { "type": "string" } }, "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 } ] }, "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": [ { "type": "object", "required": [ "config" ], "properties": { "config": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "nft_claims" ], "properties": { "nft_claims": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "start_after": { "type": [ "string", "null" ] } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "hooks" ], "properties": { "hooks": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "staked_nfts" ], "properties": { "staked_nfts": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "start_after": { "type": [ "string", "null" ] } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "active_threshold" ], "properties": { "active_threshold": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "is_active" ], "properties": { "is_active": { "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 } ] }, "migrate": null, "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" } } }, "config": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Config", "type": "object", "required": [ "nft_address" ], "properties": { "nft_address": { "$ref": "#/definitions/Addr" }, "unstaking_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] } }, "additionalProperties": false, "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" }, "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 } ] } } }, "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" }, "hooks": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "HooksResponse", "type": "object", "required": [ "hooks" ], "properties": { "hooks": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false }, "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" }, "nft_claims": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "NftClaimsResponse", "type": "object", "required": [ "nft_claims" ], "properties": { "nft_claims": { "type": "array", "items": { "$ref": "#/definitions/NftClaim" } } }, "additionalProperties": false, "definitions": { "Expiration": { "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", "oneOf": [ { "description": "AtHeight will expire when `env.block.height` >= height", "type": "object", "required": [ "at_height" ], "properties": { "at_height": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false }, { "description": "AtTime will expire when `env.block.time` >= time", "type": "object", "required": [ "at_time" ], "properties": { "at_time": { "$ref": "#/definitions/Timestamp" } }, "additionalProperties": false }, { "description": "Never will never expire. Used to express the empty variant", "type": "object", "required": [ "never" ], "properties": { "never": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ] }, "NftClaim": { "type": "object", "required": [ "legacy", "release_at", "token_id" ], "properties": { "legacy": { "description": "Whether the claim is a legacy claim.", "type": "boolean" }, "release_at": { "description": "The expiration time of the claim.", "allOf": [ { "$ref": "#/definitions/Expiration" } ] }, "token_id": { "description": "The token ID of the NFT being claimed.", "type": "string" } }, "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", "allOf": [ { "$ref": "#/definitions/Uint64" } ] }, "Uint64": { "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", "type": "string" } } }, "staked_nfts": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Array_of_String", "type": "array", "items": { "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" } } } } }