cw721-roles
This is a non-transferable NFT contract intended for use with DAOs. cw721-roles
has an extension that allows for each NFT to have a weight
associated with it, and also implements much of the functionality behind the cw4-group contract (credit to Confio for their work on that).
All methods of this contract are only callable via the configurable minter
when the contract is created. It is primarily intended for use with DAOs.
The mint
, burn
, send
, and transfer
methods have all been overriden from their default cw721-base
versions, but work roughly the same with the caveat being they are only callable via the minter
. All methods related to approvals are unsupported.
Extensions
cw721-roles
contains the following extensions:
Token metadata has been extended with a weight and an optional human readable on-chain role which may be used in separate contracts for enforcing additional permissions.
The contract has an additional execution extension that includes the ability to add and remove hooks for membership change events, as well as update a particular token's token_uri
, weight
, and role
. All of these are only callable by the configured minter
.
The query extension implements queries that are compatible with the previously mentioned cw4-group contract.
pub enum QueryExt {
/// Total weight at a given height
#[returns(cw4::TotalWeightResponse)]
TotalWeight { at_height: Option<u64> },
/// Returns the weight of a certain member
#[returns(cw4::MemberResponse)]
Member {
addr: String,
at_height: Option<u64>,
},
/// Shows all registered hooks.
#[returns(cw_controllers::HooksResponse)]
Hooks {},
}