Devtonic
Devtonic

Reputation: 46

Transferring sol out of token contract with private key

I have a number of private keys from making custom tokens for clients, a lot of these tokens have mistakingly had sol sent to them and there's actually a considerable amount in some of them.

So I know that the spl token program doesn't have a function to withdraw excess lamports while token 2022 does. When I try to transfer out using the sdk it says invalid fee payer, which is fair. But using a different fee payer it says that I can't do a system program transfer out of an account with data.

Is it possible in any way to transfer considering I do have the signing key for these tokens? I'm fairly convinced the answer is no, atleast not without an update to the program. I've tried in the past in a few different ways, but now I have gotten yet another message about an accidental transfer and I'm curious If anyone has found a way

I have tried withdrawing using the cli, and sdk, using an alternative fee payer. I expected it to fail, with all of my knowledge in solana I believe that this is not possible.

Upvotes: 0

Views: 299

Answers (0)

Related Questions