Bug
proposal_status (used by get_proposals_by_status / get_active_proposals) determines Approved purely by yes_votes > no_votes, ignoring quorum and approval_bps. Meanwhile finalize_proposal and execute_proposal both apply quorum + approval BPS logic. The two code paths can return contradictory results for the same proposal.
File: contracts/scholarship_treasury/src/lib.rs
fn proposal_status(env: &Env, proposal: &Proposal) -> ProposalStatus {
// ...
} else if proposal.yes_votes > proposal.no_votes {
ProposalStatus::Approved // ← ignores quorum
} else {
ProposalStatus::Rejected
}
}
Impact
get_active_proposals may surface proposals as Approved when they would be Rejected by finalize_proposal.
- UI/indexers relying on
get_proposals_by_status(Approved) will show incorrect results.
Fix
Either remove proposal_status and derive status only from the finalized result stored in DataKey::FinalizedProposal, or apply the same quorum + approval BPS formula used in finalize_proposal.