-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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.