2

I wonder if there's a mechanism of transferring assets with receiver fee payment. Something like permit functions in solidity language?

Is it possible to copy this approach with PDAs? Share some sources if u know.

1 Answer 1

1

This is certainly possible! In general, it's much safer to approve someone to take funds, rather than to transfer them yourself. For example, if I want to transfer 10 A tokens to you, I'll delegate 10 A tokens from my account to your wallet. That way, you can transfer them from my account yourself.

Unfortunately, I still need to pay a Solana transaction fee to delegate to you. Even if you go through an escrow account using your own program and PDAs, the sender must still pay a transaction fee to move their funds.

If you want to do this with the receiver paying the entire fee, you can go through some signing API. For example, you send a request to my off-chain server asking for 10 tokens, and I reply with a signed transaction that transfers 10 tokens from my account to yours, but with you as the fee payer. You add your signature and then send it off to the network.

2
  • Thanks for your reply! Think I got it. But one thing is not clear for me. In solidity we must extend our ERC20 token code with permit part that actually checks the signatures of tokens owner. On the other hand setting fee payer in solana is made by default. So, if I undestand correctly, in solana every token is 'permittable' as signatures verification works under the hood. Is it right?
    – Ruarin
    Mar 21, 2023 at 12:48
  • That's exactly correct.
    – Jon C
    Mar 23, 2023 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.