Skip to content

Implement resolve_appeal in the Soroban registry contract #6

Description

@Ryjen1

Problem

Once a link is appealed (issue #5), the contract needs an entry point for the configured arbiter to make a binding decision. Today resolve_appeal returns Error::NotImplemented.

Proposal

Implement resolve_appeal so the arbiter set at init time can resolve an appealed link by emitting a binding decision event that off-chain UIs and indexers can subscribe to.

Acceptance criteria

  • Define a Decision enum: ReleaseToRecipient = 1, RefundToCreator = 2, Cancel = 3.
  • resolve_appeal(env, link_id, decision):
    • Reads the arbiter from storage. If unset, return Error::Unauthorised.
    • Calls arbiter.require_auth().
    • Returns Error::LinkNotFound if the link doesn't exist.
    • Returns a new Error::NotAppealed if the link's appealed flag is false.
    • Returns a new Error::AlreadyResolved if record.resolution is already set.
    • Validates decision is one of the three legal values; otherwise Error::InvalidDecision.
    • Writes record.resolution = Some(decision) and emits a RESOLVE event with (arbiter, link_id, decision).
  • Add cargo tests covering: happy path for each decision, unauthorised non-arbiter caller, unknown link, not-yet-appealed link, double resolution.

Files involved

  • contracts/stellink-escrow/src/lib.rs
  • contracts/stellink-escrow/src/test.rs

Notes

The contract does NOT itself release any claimable balance. The decision event is the source of truth; off-chain claims (or a future on-chain helper) consume it.

Depends on #5 being merged first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contractsSoroban smart contract workhelp wantedExtra attention is needed

    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