Skip to content

Commit 35c6883

Browse files
committed
allows immediate launching of team-sponsored proposals.
1 parent bc7baef commit 35c6883

File tree

3 files changed

+393
-7
lines changed

3 files changed

+393
-7
lines changed

programs/futarchy/src/instructions/launch_proposal.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ impl LaunchProposal<'_> {
4646

4747
require_keys_eq!(self.proposal.dao, self.dao.key());
4848

49-
// Check if sufficient stake has been accumulated
50-
if let ProposalState::Draft { amount_staked } = self.proposal.state {
51-
require_gte!(
52-
amount_staked,
53-
self.dao.base_to_stake,
54-
FutarchyError::InsufficientStakeToLaunch
55-
);
49+
// If the proposal is not team sponsored, check if sufficient stake has been accumulated
50+
if !self.proposal.is_team_sponsored {
51+
if let ProposalState::Draft { amount_staked } = self.proposal.state {
52+
require_gte!(
53+
amount_staked,
54+
self.dao.base_to_stake,
55+
FutarchyError::InsufficientStakeToLaunch
56+
);
57+
}
5658
}
5759

5860
// Ensure the squads proposal is not invalidated by a previous config transaction

tests/futarchy/main.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import futarchyAmm from "./integration/futarchyAmm.test.js";
22

33
import initializeDao from "./unit/initializeDao.test.js";
44
import initializeProposal from "./unit/initializeProposal.test.js";
5+
import launchProposal from "./unit/launchProposal.test.js";
56
import finalizeProposal from "./unit/finalizeProposal.test.js";
67

78
import collectFees from "./unit/collectFees.test.js";
@@ -44,6 +45,7 @@ export default function suite() {
4445
});
4546
describe("#initialize_dao", initializeDao);
4647
describe("#initialize_proposal", initializeProposal);
48+
describe("#launch_proposal", launchProposal);
4749
describe("#finalize_proposal", finalizeProposal);
4850

4951
describe("#collect_fees", collectFees);

0 commit comments

Comments
 (0)