{ "contract_name": "dao-voting-onft-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": [ "onft_collection" ], "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" } ] }, "onft_collection": { "description": "ONFT collection that will be staked.", "allOf": [ { "$ref": "#/definitions/OnftCollection" } ] }, "unstaking_duration": { "description": "Amount of time between unstaking and tokens being available. 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 } ] }, "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 } ] }, "OnftCollection": { "oneOf": [ { "description": "Uses an existing x/onft denom/collection.", "type": "object", "required": [ "existing" ], "properties": { "existing": { "type": "object", "required": [ "id" ], "properties": { "id": { "description": "ID of an already created x/onft denom/collection.", "type": "string" } }, "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": "Step 1/3 of the NFT staking process. x/onft doesn't support executing a smart contract on NFT transfer like cw721s do, so the stake process is broken up: 1. The sender calls `PrepareStake` to inform this staking contract of the NFTs that are about to be staked. This will succeed only if the sender currently owns the NFT(s). 2. The sender then transfers the NFT(s) to the staking contract. 3. The sender calls `ConfirmStake` on this staking contract which confirms the NFTs were transferred to it and registers the stake.\n\nPrepareStake overrides any previous PrepareStake calls, as long as the sender owns the NFT(s).", "type": "object", "required": [ "prepare_stake" ], "properties": { "prepare_stake": { "type": "object", "required": [ "token_ids" ], "properties": { "token_ids": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Step 3/3 of the NFT staking process. x/onft doesn't support executing a smart contract on NFT transfer like cw721s do, so the stake process is broken up: 1. The sender calls `PrepareStake` to inform this staking contract of the NFTs that are about to be staked. This will succeed only if the sender currently owns the NFT(s). 2. The sender then transfers the NFT(s) to the staking contract. 3. The sender calls `ConfirmStake` on this staking contract which confirms the NFTs were transferred to it and registers the stake.", "type": "object", "required": [ "confirm_stake" ], "properties": { "confirm_stake": { "type": "object", "required": [ "token_ids" ], "properties": { "token_ids": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "CancelStake serves as an undo function in case an NFT or stake gets into a bad state, either because the stake process was never completed, or because someone sent an NFT to the staking contract without preparing the stake first.\n\nIf called by: - the original stake preparer, the preparation will be canceled, and the NFT(s) will be sent back if the staking contract owns them. - the current NFT(s) owner, the preparation will be canceled, if any. - the DAO, the preparation will be canceled (if any exists), and the NFT(s) will be sent to the specified recipient (if the staking contract owns them). if no recipient is specified but the NFT was prepared, it will be sent back to the preparer.\n\nThe recipient field only applies when the sender is the DAO. In the other cases, the NFT(s) will always be sent back to the sender. Note: if the NFTs were sent to the staking contract, but no stake was prepared, only the DAO will be able to correct this and send them somewhere.", "type": "object", "required": [ "cancel_stake" ], "properties": { "cancel_stake": { "type": "object", "required": [ "token_ids" ], "properties": { "recipient": { "type": [ "string", "null" ] }, "token_ids": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } }, "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 } ] }, "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 } ] }, "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": [ "onft_collection_id" ], "properties": { "onft_collection_id": { "type": "string" }, "unstaking_duration": { "anyOf": [ { "$ref": "#/definitions/Duration" }, { "type": "null" } ] } }, "additionalProperties": false, "definitions": { "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" } } } } }