Comments (5)
@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
from mexa.
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.
from mexa.
Here is one of the technical threads
https://twitter.com/schin_tomar/status/1375477475493416961?s=21
from mexa.
I have a similar question. What happens if a transaction involves an ERC20 transfer that happens to be the same token as req.token
? For example, a user who initially holds 10 USDC wants to make a transfer of 8 USDC, that costs 3 USDC in fees. The user would end up with 2 USDC after executing the inner txn, causing the _transferHandler
to revert the txn, with a non-refundable gas cost. I was wondering if there's a good preventive measure for users to not execute such transactions, that could end up with them not being able to pay for fees?
My main concern here is that users may intentionally submit failed txns to dry out the relayer's funds. Would really appreciate some insights.
from mexa.
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.
from mexa.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mexa.