solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.44k stars 2.02k forks source link

Suggestion: Add new authority for 'spl-token withdraw-excess-lamports' #6858

Open chudleigh2 opened 2 months ago

chudleigh2 commented 2 months ago

This may be a pointless request but if you don't ask, you don't get.

I believe the authority to withdraw excess lamports from a program owned account for SPL 2022 is set with Minth Authority.

Almost all tokens created will revoke the Mint Authority making this a pointless CLI command. I appreciate there are already a lot of authorities but but surely one more can't hurt?

Whether it's even possible to change this now is beyond me but doing so would make a huge amount of people happy.

joncinque commented 2 months ago

This is certainly possible -- here's how I'm thinking it would go:

And I think that's it. What do you think?

chudleigh2 commented 2 months ago

That makes sense!

I was hoping there might have been an even easier solution like giving an existing authority the ability to do it, perhaps even metadata update authority. A lot of tokens will have this extension active but not all.

your way would work for all tokens going forward and is a great idea.

Why not both?

joncinque commented 2 months ago

SPL Token is very careful to avoid overloading authorities, so I would go with the same approach if we add another authority, rather than spreading the ability to withdraw lamports across multiple authorities.