Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] DAOSpace add join_member_with_root_cap #164

Merged
merged 9 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: 4C96D09C5AAF229BF0BFA79CEEEC3E42D49C436FEBA79BBF776354A60A84F1BD
source_digest: 92C4BD219F80CC0A3708B819EA1E57967727A3ED42F5627ACA2408BCF40FC74C
build_flags:
dev_mode: false
test_mode: false
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/daospace/dao_proposal.exp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ task 9 'run'. lines 198-223:

task 11 'run'. lines 228-244:
{
"gas_used": 235032,
"gas_used": 239832,
"status": "Executed"
}

task 12 'run'. lines 246-262:
{
"gas_used": 235032,
"gas_used": 239832,
"status": "Executed"
}

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/daospace/stake_to_sbt_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task 5 'run'. lines 71-79:

task 6 'run'. lines 81-117:
{
"gas_used": 655792,
"gas_used": 660592,
"status": "Executed"
}

Expand Down Expand Up @@ -60,7 +60,7 @@ task 15 'run'. lines 204-219:

task 16 'run'. lines 221-232:
{
"gas_used": 307027,
"gas_used": 311827,
"status": {
"MoveAbort": {
"location": {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/mint_proposal_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ task 11 'run'. lines 110-123:

task 12 'run'. lines 125-139:
{
"gas_used": 264828,
"gas_used": 269638,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/salary_gov_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task 8 'run'. lines 267-275:

task 10 'run'. lines 280-295:
{
"gas_used": 279652,
"gas_used": 284462,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/starcoin_dao/starcoin_onchain_config.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processed 23 tasks

task 4 'run'. lines 10-25:
{
"gas_used": 875200,
"gas_used": 880000,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/starcoin_dao/starcoin_upgrade_module.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processed 26 tasks

task 4 'run'. lines 9-24:
{
"gas_used": 875200,
"gas_used": 880000,
"status": "Executed"
}

Expand Down
8 changes: 8 additions & 0 deletions sources/daospace/DAOSpace.move
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ module StarcoinFramework::DAOSpace {

/// Join DAO and get a membership
public fun join_member<DAOT: store, PluginT>(_cap: &DAOMemberCap<DAOT, PluginT>, to_address: address, image_data:Option::Option<vector<u8>>, image_url:Option::Option<vector<u8>>, init_sbt: u128) acquires DAONFTMintCapHolder, DAOSBTMintCapHolder, DAO, MemberEvent {
do_join_member<DAOT, PluginT>(to_address, image_data, image_url, init_sbt);
}

fun do_join_member<DAOT: store, PluginT>(to_address: address, image_data:Option::Option<vector<u8>>, image_url:Option::Option<vector<u8>>, init_sbt: u128) acquires DAONFTMintCapHolder, DAOSBTMintCapHolder, DAO, MemberEvent {
ensure_not_member<DAOT>(to_address);
let member_id = next_member_id<DAOT>();

Expand Down Expand Up @@ -673,6 +677,10 @@ module StarcoinFramework::DAOSpace {
(member_id, sbt_amount)
}

public fun join_member_with_root_cap<DAOT: store>(_cap: &DAORootCap<DAOT>, to_address: address, image_data:Option::Option<vector<u8>>, image_url:Option::Option<vector<u8>>, init_sbt: u128) acquires DAONFTMintCapHolder, DAOSBTMintCapHolder, DAO, MemberEvent {
do_join_member<DAOT, DAOT>(to_address, image_data, image_url, init_sbt);
}

/// Increment the member SBT
public fun increase_member_sbt<DAOT: store, PluginT>(_cap: &DAOMemberCap<DAOT, PluginT>, member_addr: address, amount: u128) acquires DAONFTUpdateCapHolder, DAOSBTMintCapHolder, MemberEvent {
ensure_member<DAOT>(member_addr);
Expand Down