Skip to content

[bug] escrow-vault: approve_release only blocks Released state — approvals accepted on Refunded and Disputed escrows #723

Description

@gboigwe

Summary

approve_release checks if escrow.state == EscrowState::Released { panic!("already released") }. Only the Released terminal state blocks new approvals. A Refunded escrow (funds already returned to depositor) or a Disputed escrow (held for fraud review) can still receive new approvals from required approvers, incrementing ApprovalCount on a closed or locked escrow. These approvals are meaningless but waste storage rent.

Location

contracts/escrow-vault/src/lib.rs, approve_release

if escrow.state == EscrowState::Released {
    panic!("already released"); // ❌ Refunded and Disputed not blocked
}

Fix

Block all terminal states:

match escrow.state {
    EscrowState::Released | EscrowState::Refunded | EscrowState::Disputed => {
        panic!("escrow is not in an approvable state");
    }
    _ => {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    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