I'm creating a dapp and token (using openzeppelin). I just wonder how i can let the receiver pay the gas fee like pancakeswap or uniswap doing.
Dapp is create in nodejs / express JS.
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityYou'll need web3 or ethers in order to do it.
Transactions always have to be signed by someone - unless you're using burner wallets. In this case, let the users sign the transaction!
WEB3 syntax (more in the documentation):
web3.eth.sendTransaction(transactionObject [, callback])
Ethers syntax (more in the documentation):
signer.sendTransaction({data});