Skip to content

Enforce Maximum Pending Transfers Per Pet #836

Description

@success-OG

Background:
The transfer-adoption contract allows initiating a transfer without cancelling previous ones. In theory, only one transfer can be pending at a time, but the code does not enforce this, allowing state confusion.

Problem:
initiate_transfer does not check if a transfer is already pending for the pet.

What "done" looks like:

  • initiate_transfer returns TransferError::TransferAlreadyPending if a pending transfer exists.
  • The caller must cancel the existing transfer before initiating a new one.
  • Tests cover: first transfer succeeds, second attempt fails, cancel + re-initiate succeeds.

Implementation guidelines:

  • Key file: stellar-contracts/contracts/pet-transfer-adoption/src/lib.rs.

PR must include:

  • Pending transfer check
  • Three tests
  • cargo test passing

Metadata

Metadata

Assignees

Labels

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