Skip to content

Commit e02fde6

Browse files
committed
fix: liveness escape hatch for start_cancel with unclaimed winners
If a Single-release winner cannot authenticate (lost key, contract without signer), escrow is permanently locked — claim_prize requires recipient auth and start_cancel rejects unclaimed winners. Allow cancellation after the event deadline passes: the deadline is the natural claim window. Winners who haven't claimed by then forfeit their prize, and the manager can recover remaining escrow.
1 parent ac9be2d commit e02fde6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

contracts/events/src/event_ops.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,17 @@ pub fn start_cancel(env: &Env, event_id: u64, op_id: BytesN<32>) -> Result<(), E
294294
}
295295

296296
// Prevent cancel after winners selected for Single-release (pull-model).
297-
// The manager must not be able to drain escrow before winners claim.
297+
// The manager must not be able to drain escrow before winners claim,
298+
// unless the event deadline has passed (liveness escape hatch for
299+
// winners who cannot authenticate).
298300
if matches!(event.release_kind, ReleaseKind::Single) && has_unclaimed_single_winner(env, event_id)
299301
{
300-
return Err(Error::WinnersAlreadySelected);
302+
let deadline_passed = event
303+
.deadline
304+
.map_or(false, |d| env.ledger().timestamp() > d);
305+
if !deadline_passed {
306+
return Err(Error::WinnersAlreadySelected);
307+
}
301308
}
302309

303310
resolve_manager(env, event_id, &event.owner).require_auth();

0 commit comments

Comments
 (0)