Skip to content

Commit

Permalink
add install plugin proposal for TreasuryPlugin (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
pause125 committed Nov 16, 2022
1 parent bfd8fa6 commit a98de9e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sources/daospaceplugin/TreasuryPlugin.move
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module StarcoinFramework::TreasuryPlugin {
use StarcoinFramework::Treasury;
use StarcoinFramework::Token::Token;
use StarcoinFramework::CoreAddresses;
use StarcoinFramework::InstallPluginProposalPlugin;

const ERR_NOT_AUTHORIZED: u64 = 101;
/// Only receiver can execute treasury withdraw proposal
Expand Down Expand Up @@ -167,4 +168,31 @@ module StarcoinFramework::TreasuryPlugin {
let cap = DAOSpace::acquire_modify_config_cap<DAOT, TreasuryPlugin>(&plugin);
DAOSpace::set_custom_config<DAOT, TreasuryPlugin, QuorumScale>(&mut cap, QuorumScale { scale });
}

public fun install_plugin_proposal<DAOT: store>(
sender: &signer,
title:vector<u8>,
introduction:vector<u8>,
extend: vector<u8>,
action_delay: u64
) {
InstallPluginProposalPlugin::create_proposal<DAOT, TreasuryPlugin>(
sender,
required_caps(),
title,
introduction,
extend,
action_delay
);
}

public(script) fun install_plugin_proposal_entry<DAOT: store>(
sender: signer,
title:vector<u8>,
introduction:vector<u8>,
extend: vector<u8>,
action_delay: u64
) {
install_plugin_proposal<DAOT>(&sender, title, introduction, extend, action_delay);
}
}

0 comments on commit a98de9e

Please sign in to comment.