Skip to content
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

Frontend: Potential transfer failure due to dynamic transfer fees #2005

Open
GabrielBuragev opened this issue Jul 3, 2023 · 0 comments
Open
Labels
bug Something isn't working frontend 🍭

Comments

@GabrielBuragev
Copy link
Contributor

Rationale

In order to be able to optimize the ROI for our Agents, we had to implement dynamic transfer fees. This was especially important when integrating ETH L1 in the list of supported networks since the fees there can drastically vary from day to day.
Since this was not the case a year ago, the frontend was initially written to support transfering tokens with fixed fees.
Having the two steps ensureTokenAllowance & sendRequestTransaction separated opens the door for an edge-case bug.

This becomes even more apparent after integrating Safe.
Since we adapted our app to support Safe, we noticed a new transfer scenario on the frontend - transfers that can span throughout multiple days due to pending approval of transactions. This is due to the fact that some safes require multiple approval signatures before any transaction execution.

Lets see an example.
A user tries to submit a transfer on Sunday via Safe but he needs N signatures from his safe-mates.
First, the user submits the token allowance transaction which uses the amount = amountToTransfer + currentFeesForAmount (in tokens) as the amount to be approved for spending. He closes the app until his mates sign so he can proceed.
On Monday, the Beamer team updates the fees in the contracts so they are now higher compared to the previous day.
On Tuesday, the user has his transaction approved by his mates and opens our app to submit the transfer transaction. When the app tries to submit the transfer transaction it will fail due to insufficient token allowance due to the fee increase.

@GabrielBuragev GabrielBuragev added bug Something isn't working frontend 🍭 labels Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend 🍭
Projects
None yet
Development

No branches or pull requests

1 participant