#dao #dfinity #icp #internet-computer #nnsdao

nnsdao_sdk_basic

Basic functionality to build a DAO

2 releases

0.1.2 Aug 15, 2022
0.1.1 Jun 21, 2022
0.1.0 Jun 19, 2022

#37 in #icp

34 downloads per month

Apache-2.0

12KB
158 lines

nnsdao_sdk_basic

This SDK provides the basic functionality to build a DAO, which can be imported and used.To use it, you need to implement DaoCustomFn Trait and customize the business logic.

Documentation Crates.io License Downloads

Documentation:

Usage

Add this to your Cargo.toml:

[dependencies]
nnsdao_sdk_basic = "0.1.0"
#[derive(Clone, Debug, Default, CandidType, Deserialize)]
struct CustomFn{}
#[async_trait]
impl DaoCustomFn for CustomFn {
 async fn is_member(&self, _member: Principal) -> Result<bool, String> {
    Ok(true)
 }
 async fn handle_proposal(&self) -> Result<(), String> {
    Ok(())
 }
}
let dao_basic = DaoBasic::new(CustomFn::default());
dao_basic.get_proposal(1);

License

nnsdao_sdk_basic is distributed under the terms of both the MIT license.

See LICENSE.

Dependencies

~4–7MB
~99K SLoC