-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you deduct user ERC20 tokens when user use ERC20 tokens to pay the gas fee? #46
Comments
It's the later. approve / gasless permit and contract does transfer from based on execution gas. Pricisely here : https://github.com/bcnmy/mexa/blob/master/contracts/6/forwarder/ERC20Forwarder.sol#L460 Besides execution gas, charge is calculated based on token price / eth price chainlink feeds. |
Here is one of the technical threads https://twitter.com/schin_tomar/status/1375477475493416961?s=21 |
I have a similar question. What happens if a transaction involves an ERC20 transfer that happens to be the same token as My main concern here is that users may intentionally submit failed txns to dry out the relayer's funds. Would really appreciate some insights. |
@preston4896 since the atomicity is maintained and we do gas estimation when transaction goes through relayer infra, If it was gonna fail we don't send it to the chain and stop relay with 417 error. Besides that in the sdk there are checks in place for user balance for transfer and fees, given allowance etc. so yeah there is no on chain check on this but when it goes through relayer infra these measures even the pre flight check (token / eth price volatility) is in place |
btw we added another contract for this specific use case of transferring tokens and paying gas fees in same. It allows deployer to sponsor ETH gas fees and same time charge tokens in gas with optional premium. |
Maybe user deposit ERC20 to specified contract firstly? Or deposit to your platform?
Or user approve ERC20 to your contract and this contract transferFrom user balance?
Your documents(https://docs.biconomy.io/guides/enable-paying-gas-in-erc20) doesn't describe this detail...
The text was updated successfully, but these errors were encountered: