Skip to content

Escrow Account Should Probably Be Enforced To Be An ATA #46

@bonedaddy

Description

@bonedaddy

Overview

Currently the escrow account is only validated that the owner address is the wrapped mint authority. This has an edge case in which callers of the Wrap instruction provide a non ATA address that is still owned by the wrapped mint authority. This would pass the current validation, and thus allow successful wrapping of tokens, but fragmenting the actual balance of the escrowed tokens account potentially many different token accounts.

While this is probably unlikely to happen in practice, it's a potentially very annoying issue, and also very easy to fix.

Proposed Fix

Instead of just checking that the owner of the provided escrow account is the wrapped mint authority, derive the ATA for the unwrapped token + wrapped mint authority, and check that the provided escrow account is equal to the derived account.

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