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

Unable to send tokens which are available only on L1 network #21292

Open
pavloburykh opened this issue Sep 19, 2024 · 5 comments
Open

Unable to send tokens which are available only on L1 network #21292

pavloburykh opened this issue Sep 19, 2024 · 5 comments

Comments

@pavloburykh
Copy link
Contributor

pavloburykh commented Sep 19, 2024

Fro reproduction you can use SNT

Steps:

  1. Restore the account which has SNT
  2. Proceed with sending flow
  3. See if the routes are built after entering valid amount

Actual result:

Status-debug-logs - 2024-09-19T171851.912.zip

On mobile I receive different errors, like transfer amount exceeds balance or not available for chain ID

photo_2024-09-19 17 04 50
photo_2024-09-19 17 04 55

Same on Desktop:

Status Desktop 2024-09-19 17-09-01

cc @saledjenic @anastasiyaig

Additional Information

  • Status version: nightly
  • Operating System: Android, iOS
@anastasiyaig
Copy link

i was able to send snt just 2 days ago. i dont have any context besides that. maybe something got broken recently

@virginiabalducci can you pls check?

@virginiabalducci
Copy link

virginiabalducci commented Sep 19, 2024

I was able to do a send tx in testnet but I'm reproducing the same issue in mainnet
Screenshot 2024-09-19 at 11 28 57 AM

https://github.com/user-attachments/assets/0112d279-f6ec-45c9-9eab-958dbf00f5c4
app_20240917_124336.log

If needed, adding addresses I tested with:
From: 0x32e12fd7c2c7984dd6de153691d901445fc8aa07
To: 0x69af29dedbe58f4001bcf14803963cb7894112b3

@anastasiyaig
Copy link

thanks @virginiabalducci
@saledjenic @dlipicar do you know the root cause?

@saledjenic
Copy link

@virginiabalducci I was able to reproduce your case with 0x32e12fd7c2c7984dd6de153691d901445fc8aa07 address.

So let's analyze it:

  • you want to send 1 SNT from the 0x32e12fd7c2c7984dd6de153691d901445fc8aa07 from any of the supported chains (mainnet, opt, arb) to the recipient address to any chain (mainnet, opt, arb)
  • what are possible options (since you have a positive balance for SNT only on mainnet):
    1. mainnet -> mainnet (transfer)
    2. mainnet -> optimism (bridge)
    3. mainnet -> arbitrum (bridge)
  • let's look now at how the router sees that request since all chains are available on both from and to sides:
    1. check transfer for mainnet -> mainnet -> this returns insufficient funds for gas * price + value: address 0x32e12fD7C2C7984DD6de153691D901445fC8AA07 have 16773029697747188 want 235096461785385998
    2. check transfer optimism -> optimism (transfer) -> execution reverted: ERC20: transfer amount exceeds balance cause you have 0 SNT on optimism
    3. check transfer arbitrum -> arbitrum (transfer) -> execution reverted: ERC20: transfer amount exceeds balance cause you have 0 SNT on arbitrum
    4. check bridge mainnet -> optimism -> not available for chainID means there is no contract for bridging SNT
    5. check bridge mainnet -> arbitrum -> not available for chainID means there is no contract for bridging SNT
    6. check bridge optimism -> mainnet -> not available for chainID means there is no contract for bridging SNT
    7. check bridge optimism -> arbitrum -> not available for chainID means there is no contract for bridging SNT
    8. check bridge arbitrum -> mainnet -> not available for chainID means there is no contract for bridging SNT
    9. check bridge arbitrum -> optimism -> not available for chainID means there is no contract for bridging SNT
  • now looking at the previous point we confirmed that there is no route that can be made, which is correct, that's what the router says, but a question is about the error, which one of those is the most meaningful for you? You cannot choose one, but the right way would be to return all of them, right? Displaying all of them was rejected as an idea in one of my PRs and then we had to choose one to display. There is some logic for selecting the most meaningful error which is working quite well, but in case like this one where all chains are in play on the "from" and "to" side is hard to select one (especially when we have different processor orders among router runs) cause all are valid errors.

To summarize and conclude, there is no error in the router logic.
@virginiabalducci @anastasiyaig @pavloburykh @alwx

@pavloburykh
Copy link
Contributor Author

To summarize and conclude, there is no error in the router logic.
@virginiabalducci @anastasiyaig @pavloburykh @alwx

Thank you for the comment @saledjenic

I have couple of questions here:

  1. Regarding insufficient funds error: we have an open issue Insufficient funds for gas error is thrown when building L1-L1 routes despite user has enough funds to cover fee #20970. Could you please leave a comment in that issue summarising your findings regrading this problem. I remember that recently there have been much discussions in different Discord channels, but unfortunately there is no summary in the ticket. Currently we are not able to perform L1-L1 transactions in Status app, at the same time I am able to perform same transaction with the same account using Metamask.

  2. At which point do we understand that token is available only on L1 and thus there is no sense to try building any routes except L1-L1? Can we prevent from trying to perform mainnet -> optimism (bridge), mainnet -> arbitrum (bridge) etc steps if we know that only mainnet-mainnet is available? To be honest, this is very confusing that we are showing user the irrelevant errors like transfer amount exceeds balance or not available for chain ID while app UI shows that we are trying to build L1-L1 route and both errors have nothing to do with L1-L1 in this case. Why we are not showing insufficient funds here which is related to L1-L1 route building?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants