You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to accept 2 different offers regarding the same token. The blockchain retrieves an error afterward but the frontend confirms the Swap anyways.
Expected behavior
It shouldn't be possible to accept 2 token offers with the same token after the first swap is confirmed.
Steps to reproduce
Create 2 Token Offers for the same address with teh same token
Accept the first offer (everything is okay)
Accept the second offer (shouldn't be possible because the token is already swapped
Other information
The text was updated successfully, but these errors were encountered:
Hey @eduramme
I want to understand why the swap is being accepted in the front-end. As I remember, a swap is accepted in case the blockchain returns a successful transaction. And if the blockchain is returning an error, then the swap shouldn't be accepted in the front as the transaction reverting is a sign that we should not display the accept scenario.
I think the front-end is not handling the error correctly. Hence this is what I think needs to be done:
Await to handle the blockchain error and display the appropriate results
Simulate the transaction with Viem before actually casting it to make sure it is working
0xneves
changed the title
fix: Duplicate Acceptance of Offers Using Identical Tokens Due to Frontend Inconsistency
fix: duplicate acceptance of offers using same tokens
Apr 11, 2024
Bug Report
Current behavior
It's possible to accept 2 different offers regarding the same token. The blockchain retrieves an error afterward but the frontend confirms the Swap anyways.
Expected behavior
It shouldn't be possible to accept 2 token offers with the same token after the first swap is confirmed.
Steps to reproduce
Other information
The text was updated successfully, but these errors were encountered: