Skip to content

Commit

Permalink
Revert "able to update DAOExt (#108)"
Browse files Browse the repository at this point in the history
This reverts commit fc7ac4a.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent 0eb2cde commit cb8c885
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 130 deletions.
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: A710EE5A9CB99AFE86615AD5840E39342DB78E8FB0F5F9509550D55526BF054D
source_digest: 695F4208154FB109E223367B79D9AD3C30261C91BF6F595A3B9D2226BC5103B0
build_flags:
dev_mode: false
test_mode: false
Expand Down
19 changes: 0 additions & 19 deletions integration-tests/daospace/dao_ext.exp

This file was deleted.

87 changes: 0 additions & 87 deletions integration-tests/daospace/dao_ext.move

This file was deleted.

24 changes: 1 addition & 23 deletions sources/daospace/DAOSpace.move
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module StarcoinFramework::DAOSpace {
const ERR_NFT_ERROR: u64 = 104;
const ERR_ALREADY_INIT: u64 = 105;
const ERR_TOKEN_ERROR: u64 = 106;
const ERR_DAO_EXT: u64 = 107;

/// member
const ERR_EXPECT_MEMBER: u64 = 200;
Expand Down Expand Up @@ -194,8 +193,6 @@ module StarcoinFramework::DAOSpace {
Vector::push_back(&mut caps, member_cap_type());
Vector::push_back(&mut caps, proposal_cap_type());
Vector::push_back(&mut caps, grant_cap_type());
Vector::push_back(&mut caps, token_mint_cap_type());
Vector::push_back(&mut caps, token_burn_cap_type());
caps
}

Expand Down Expand Up @@ -343,31 +340,12 @@ module StarcoinFramework::DAOSpace {
DAORootCap<DAOT>{}
}

/// Upgrade account to DAO account and create DAO
// Upgrade account to DAO account and create DAO
public fun upgrade_to_dao<DAOT: store>(sender: signer, name: vector<u8>, image_data:Option::Option<vector<u8>>, image_url:Option::Option<vector<u8>>, description:vector<u8>, ext: DAOT, config: DAOConfig): DAORootCap<DAOT> acquires DAOEvent{
let cap = DAOAccount::upgrade_to_dao(sender);
create_dao<DAOT>(cap, name, image_data, image_url, description, ext, config)
}

/// Take ext from DAOExt
public fun take_ext<DAOT: store>(_witness: &DAOT): DAOT
acquires DAOExt {
let dao_addr = dao_address<DAOT>();
assert!(exists<DAOExt<DAOT>>(dao_addr), Errors::not_published(ERR_DAO_EXT));
let DAOExt<DAOT> { ext } = move_from<DAOExt<DAOT>>(dao_addr);
ext
}

/// Save ext to DAOExt
public fun save_ext<DAOT: store>(ext: DAOT) acquires DAOAccountCapHolder {
let dao_addr = dao_address<DAOT>();
assert!(!exists<DAOExt<DAOT>>(dao_addr), Errors::already_published(ERR_DAO_EXT));
let dao_signer = dao_signer<DAOT>();
move_to(&dao_signer, DAOExt{
ext
});
}

/// Burn the root cap after init the DAO
public fun burn_root_cap<DAOT>(cap: DAORootCap<DAOT>) {
let DAORootCap{} = cap;
Expand Down

0 comments on commit cb8c885

Please sign in to comment.