Giter Site home page Giter Site logo

Comments (5)

livingrockrises avatar livingrockrises commented on July 17, 2024 1

@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.

livingrock7 avatar livingrock7 commented on July 17, 2024

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.

livingrock7 avatar livingrock7 commented on July 17, 2024

Here is one of the technical threads

https://twitter.com/schin_tomar/status/1375477475493416961?s=21

from mexa.

preston4896 avatar preston4896 commented on July 17, 2024

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.

livingrockrises avatar livingrockrises commented on July 17, 2024

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.

https://github.com/bcnmy/mexa/blob/internal/forward-v2-RnD/contracts/6/forwarder/TransferHandlerCustom.sol

from mexa.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.