Skip to content
Merged
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
13 changes: 4 additions & 9 deletions contracts/predictify-hybrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,13 +995,8 @@ impl PredictifyHybrid {
&reason,
);

// Trigger automatic payout distribution for dispute resolution
// Note: This can be called separately, but we include it here for convenience
// In production, you might want to make this optional or separate
match Self::distribute_payouts(env.clone(), market_id.clone()) {
Ok(_) => (),
Err(e) => panic_with_error!(env, e),
}
// Note: Payout distribution should be called separately via distribute_payouts()
// This allows for better control and testing of the payout process
}

/// Fetches oracle result for a market from external oracle contracts.
Expand Down Expand Up @@ -1508,7 +1503,7 @@ impl PredictifyHybrid {
let mut total_distributed: i128 = 0;
let mut winning_total = 0;
for (voter, outcome) in market.votes.iter() {
if &outcome == winning_outcome {
if outcome == *winning_outcome {
winning_total += market.stakes.get(voter.clone()).unwrap_or(0);
}
}
Expand All @@ -1521,7 +1516,7 @@ impl PredictifyHybrid {

// Distribute payouts to all winners
for (user, outcome) in market.votes.iter() {
if &outcome == winning_outcome {
if outcome == *winning_outcome {
if market.claimed.get(user.clone()).unwrap_or(false) {
continue;
}
Expand Down