I need help. I have a webpage, where user register and I create a new wallet address for him (I own private key). Then he receive erc20 tokens on that address and he can withdraw them to his own private wallet. Problem is that on that newly created wallet there is no native token (for example MATIC which is used to pay for transaction fee). How can I pay fee from another wallet for that transaction? Is that even possible? How else can this be solved?
Its kinda stupid that I need to send MATIC to that new wallet first, so I can pay for fees, isn't it? I will actually pay double fee for that.
What I want is kinda the same system as exchanges have. You can deposit tokens and withdraw them. But I am confused how they pay for transactions fees?
Paying gas fees for another address is not natively supported by EVM networks.
Exchanges usually withdraw tokens from their hot wallets that hold multiple tokens as well as the native token of the network.
When exactly they collect ERC-20 tokens from the deposit wallets, that's part of their business strategy. It might depend on: