coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.68k stars 1.35k forks source link

lang: add token account constraint that verifies a token account is "clean" #1341

Open paul-schaaf opened 2 years ago

paul-schaaf commented 2 years ago

token::clean -> account must have: no delegate, no close authority

paul-schaaf commented 2 years ago

blocked by https://github.com/project-serum/anchor/issues/1222

paul-schaaf commented 2 years ago

maybe it would be even better to forbid delegate and close authority by default instead and then have two attributes to enable them if needed.

armaniferrante commented 2 years ago

Agreed. Let's force accounts to be clean and require programs to opt in to dirty.