Hey guys
hope you all be fine and doing well
Is there anybody knows about how we can have implement payments in dapp development, with using an ERC20 compatible token, other than native coin of the network?
Oct 25, 2023, 10:08 AM
Just configure the payment button on the dapp to take payments using the ERC20 token of your choice...
Oct 25, 2023, 11:02 AM
I meant, gas fees deductible with erc-20 tokens(other than ETH)
Oct 25, 2023, 1:06 PM
Gas fees by default are done using the native token. That cant be bypassed...
Oct 25, 2023, 1:07 PM
Yes, you’re saying by default. But with account abstraction in eip4337 it is possible to do gas abstraction
But I don’t know how exactly to implement it
Oct 25, 2023, 1:08 PM
I think you are getting the entire think mixed up mate...
Oct 25, 2023, 1:29 PM
?
Oct 25, 2023, 1:30 PM
First, a user creates a UserOperation object and submits it to the mempool. The Bundler then receives the UserOperation and submits it to the EntryPoint for verification and execution. The EntryPoint verifies the UserOperation is valid by checking the Contract Account and if needed the Paymaster and Aggregator, and then sends the call data to the Wallet Contract for execution. Any unused gas fees are refunded to the Wallet Contract or a function is called on the Paymaster Contract to run any post-execution logic.
https://docs.stackup.sh/docs/getting-started
You'll find more information here mate...
Oct 25, 2023, 1:37 PM
So how can we implement a system when user does not have eth in his balance and just have for example usdt, but be able to send transaction with gas reduction from usdc ?
Oct 25, 2023, 1:38 PM
The contract needs to have some native tokens in order to work even if the user doesn't...
Oct 25, 2023, 1:44 PM
In that case, Can we deduct the gas fee from user token balance when he as an example, wants to withdraw the funds?
Oct 25, 2023, 1:45 PM
That should work, then the contract will retain the funds then swap to ETH just to maintain the native balance for subsequent interactions with the contract...
Oct 25, 2023, 1:51 PM
I think it will do the job, do you think so?
Oct 25, 2023, 1:58 PM
Definitely, just implement the logic in the contract...
Oct 25, 2023, 1:58 PM
Thanks a lot for helping🙏
I guess know it is more clear to me
I guess know it is more clear to me
Oct 25, 2023, 2:00 PM
Always a pleasure mate...
Oct 25, 2023, 2:02 PM
Also I have seen in some platforms, they split gas fees into 2slices.
One slice goes to the miner, and the other slice goes to a different wallet.
I was very curious how it is happening like that?
One slice goes to the miner, and the other slice goes to a different wallet.
I was very curious how it is happening like that?
Oct 25, 2023, 2:02 PM
you have to use paymaster for that
1: User tokens get deducted,
2: Paymaster pays for the gas
3: User pays to pay master in tokens
4: Tokens swapped in the tx to eth/weth
1: User tokens get deducted,
2: Paymaster pays for the gas
3: User pays to pay master in tokens
4: Tokens swapped in the tx to eth/weth
but tokens will need the permit() function check out Oz's permit extension with paymaster contracts
Oct 27, 2023, 8:43 AM
Hi, shall we use this for production..
Oct 29, 2023, 8:01 AM
Yes you can...
Oct 29, 2023, 7:00 PM