status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.9k stars 985 forks source link

Swap transaction fails with "Error-status-proxy-0.error: execution reverted" when attempting to approve token one more time #21424

Open VolodLytvynenko opened 1 week ago

VolodLytvynenko commented 1 week ago

Preconditions:

Current User has:

Steps:

  1. Select L1 network.
  2. Enter 13,500 SNT to swap to ETH.
  3. Approve the transaction (approval is successful https://etherscan.io/tx/0x8c5a4450b2a7eed54a9376b0848b88b41854d5df893923688197d3fa68ac6bf7).
  4. Enter a higher amount of SNT (e.g., between 13,501 and 15,000 SNT).

Actual Result:

The swap transaction fails, and the error message "Error-status-proxy-0.error: execution reverted" is shown. Moblie: Image

Desktop Image

Expected Result:

The swap transaction should build successfully without errors, and the swap should proceed smoothly.

OS:

IOS, Android, Desktop

Logs

Mobile Status-debug-logs (2).zip Desktop desktop swap (1).txt

saledjenic commented 4 days ago

@VolodLytvynenko a reason for this issue is Grove in Swap. So this is not an issue in swap logic or so, we just need to remove Grove as an option.

shivekkhurana commented 4 days ago

If it's a Grove issue, then shouldn't this PR fix it already: https://github.com/status-im/status-go/pull/5904 ?

alwx commented 1 day ago

Could you re-check it? It should've been fixed by the status-go PR.

VolodLytvynenko commented 1 day ago

If it's a Grove issue, then shouldn't this PR fix it already: status-im/status-go#5904 ?

Hi @alwx still reproducible in the scope of this PR both on mobile and desktop

alwx commented 1 day ago

@VolodLytvynenko ok, checking it right now but it still seems to be a status-go issue :(

saledjenic commented 1 day ago

@VolodLytvynenko I've done some tests and figured out that call eth_EstimateGas to estimate approval tx to SNT contract https://etherscan.io/address/0x744d70fdbe2ba4cf95131626614a1763df805b9e for a higher value than one already set return execution reverted error, while that's not the case for other contracts, tested with https://etherscan.io/address/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.

That's not the case when you're setting approval for the first time (if it was 0 before that).

Why it's like that I have no idea, except that's something up to our SNT contract.

In the video below you can see how it looks (for both contracts, USDC and SNT, I have some amount already approved, when no approvals works fine for SNT contract as well):

https://github.com/user-attachments/assets/8f62978d-c2db-46b1-a8b9-8abb82c04568

jrainville commented 1 day ago

@saledjenic SNT is a MineMe contract, which has a couple more features than a normal ERC20 token. That's probably why. It makes most transactions cost a little more.

I'm not sure what we can do to fix it though. It's not like we can update the contract.

churik commented 1 day ago

Thank you @saledjenic