I have a contract (ERC-20) created on the Binance Smart Chain (BSC) with a limited supply.
I want my users to be able to claim some tokens from the wallet contract that they earn on my website (server decide how much tokens they can claim), but i want my users to pay for the transaction fees.
If i understand this correctly, for this to work i need my server to sign parameters transaction (parameter containing the amount of coins the user is allowed to claim and its destination address) with the contract privatekey and then pass the signed parameters to the user so he can sign the transaction in Metamask and pay the fee to send it.
Then the contract must somehow be able to retrieve/decode parameters to know how much tokens to give and to who.
Is this the correct way ? I didn't find any good ressources that explain this.. I ve managed to handle everything else (deposit, confirmations, signing transactions..).
I'm using web3 on both server (nodejs) and client (js) side.