...
代码块 | ||
---|---|---|
| ||
// DaoSpace.move module DaoSpace { struct Space { voting_delay: u128, // The delay between when a proposal is created, and when the voting starts. A voting_delay of 0 means that as soon as the proposal is created, anyone can vote. A voting_delay of 3600 means that voting will start 3600 seconds after the proposal is created. voting_duration: u128, // The duration of the voting period, i.e. how long people will be able to vote for a proposal. meta_data: vector<u8>, // 空间元数据,编码后存储在链上(可考虑存在链下) } struct NFTMeta { user: address, } struct NFTBody { weight: u128 } struct SpaceCapability { } // 创建 space,一个账号只能创建一个(是否只能一个账户创建一个,待讨论) public fun addcreate(signer: &signer, voting_delay: u128, voting_duration: u128, meta_data: &vector<u8>): (u64, SpaceCapability); public// fun modify(signer: &signer, voting_delay: u128, voting_duration: u128, cap: &SpaceCapability);查询 space public fun query(broker: address) : (u128, u128, u128); // 非托管账号 register public fun register(signer: &signer, space_broker: address, cap: &SpaceCapability) : NFT<NFTMeta, NFTBody>; // 非托管账号 unregister public fun unregister(signer: &signer, nft: NFT<NFTMeta, NFTBody>); // NFT 添加权重 public fun add_weight(signer: &signer, nft: &mut NFT<NFTMeta, NFTBody>); // NFT 减少权重 public fun reduce_weight(signer: &signer, nft: &mut NFT<NFTMeta, NFTBody>); } |
...