Skip to content

Use safe ERC721 transfer semantics for prize payouts and refunds #118

Description

@starknetdev

Summary

ERC721 prize flows use transfer_from() when sending NFTs to arbitrary recipients. If the recipient is a contract that cannot manage or forward the NFT, the prize can become stuck.

Affected Code

  • packages/metagame/src/prize/prize_component.cairo:509
  • packages/metagame/src/prize/prize_component.cairo:536
  • packages/metagame/src/gpp/gpp_component.cairo:404
  • packages/metagame/src/gpp/gpp_component.cairo:468

Risk

Operational NFT lock on payout, refund, claim, or withdrawal to an incompatible contract recipient.

Suggested Fix

Use safe_transfer_from() where receiver compatibility is required, or explicitly validate/document that recipients must be trusted/account-compatible addresses.

Starknet account compatibility should be considered before replacing every transfer path globally.

Suggested Tests

Add a mock incompatible recipient contract and verify ERC721 prize payout/refund behavior is either rejected or intentionally documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions