Skip to content

Important: prize_pool field and actual escrow balance can drift #25

@0xdevcollins

Description

@0xdevcollins

Severity: Important (correctness)

The Hackathon struct stores prize_pool: i128. The actual amount in escrow is tracked separately by core_escrow.EscrowPool.total_deposited. For hackathons (funded once, locked), these should always match — but they're stored separately, so refactors can drift them.

Fix

  • Remove prize_pool from the Hackathon struct.
  • Provide a derived query: get_prize_pool(hackathon_id) that reads the escrow's total_deposited via cross-contract call.
  • Update internal callers to use the derived value.

Risk

Storage layout change → migration required for live hackathons. Plan as part of mainnet pre-launch.

Tests

  • Derived getter returns correct amount post-create
  • After partial release (via claim), derived value unchanged (we want gross, not net) — confirm the right semantic

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit-findingSurfaced during internal audit / reviewbugSomething isn't workingenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions