Skip to content
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: 2 additions & 0 deletions programs/autocrat/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ pub enum AutocratError {
InsufficientLpTokenBalance,
#[msg("The LP tokens passed in have less liquidity than the DAO's `min_quote_futarchic_liquidity` or `min_base_futachic_liquidity`")]
InsufficientLpTokenLock,
#[msg("Question must have exactly 2 outcomes for binary futarchy")]
QuestionMustBeBinary,
}
6 changes: 6 additions & 0 deletions programs/autocrat/src/instructions/initialize_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ impl InitializeProposal<'_> {
pub fn validate(&self) -> Result<()> {
let clock = Clock::get()?;

require_eq!(
self.question.num_outcomes(),
2,
AutocratError::QuestionMustBeBinary
);

for amm in [&self.pass_amm, &self.fail_amm] {
// an attacker is able to crank 5 observations before a proposal starts
require!(
Expand Down
Loading