8000 'Nonce not supported': when sign the 2nd permit · Issue #5653 · cowprotocol/cowswap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

'Nonce not supported': when sign the 2nd permit #5653

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

Open
elena-zh opened this issue Apr 30, 2025 · 2 comments
Open

'Nonce not supported': when sign the 2nd permit #5653

elena-zh opened this issue Apr 30, 2025 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@elena-zh
Copy link
Contributor
elena-zh commented Apr 30, 2025

Threads:
https://cowservices.slack.com/archives/C0361CDG8GP/p1746611285016599
https://cowservices.slack.com/archives/C03NXGFJA2U/p1746594122655429

Steps:

  1. Connect to EOA wallet on Ethereum
  2. Pick a permittable token to sell that is not yet approved
  3. Sign the permit signature and place an order to buy AAVE/1Inch, USR tokens
  4. Wait till the order is executed
  5. Pick AAVE/1Inch, USR, not approved, permittable token to sell field
  6. Try signing the permit
    AR: impossible: Nonce is NAN error

Image

https://www.loom.com/share/e4778ade60be464aa9af04bc7f968f19
ER: it should be possible to place an order


Cases when user faced this error:

  1. Limit order - signing permit signature - with stkAAVE token
  2. swap USR for USDC
  3. Limit orders: Permit signature for 1inch token on Ethereum
  4. Limit order with AAVE/USDT
    Image

In most of cases the error happens with signing a permit request for a token.

@elena-zh elena-zh changed the title 'Nonce not supported': issue investigation 'Nonce not supported': when sign the 2nd permit May 7, 2025
@elena-zh elena-zh added Bug Something isn't working Critical Severity indicator for defects. ndicates complete shut-down of the process. Nothing can proceed furt and removed Critical Severity indicator for defects. ndicates complete shut-down of the process. Nothing can proceed furt labels May 7, 2025
@alfetopito alfetopito self-assigned this May 7, 2025
@alfetopito
Copy link
Collaborator

Essentially what seems to be happening is, the token is failing required Permit calls.

Image

This is AAVE on mainnet.
I removed locally the usage of the cached permit info from token-lists repo, forcing the permit check to be done on the fly.

Fetching the permit nonce is required and the whole thing fails if the nonce can't be fetched.

Quick solution to unblock users:

Image

This will force them to use the regular approval flow.

Long term solution:

  • Identify what's causing it to fail and if possible fix it

@alfetopito
Copy link
Collaborator

The way we used to call nonces probably changed on AAVE token proxy OR in the provider we are using, and nonces returns 0x.

In the lib we are using for checking the permits, when it finds a 0x, it assumes permit is not supported and returns an error.
I believe before the call used to throw, leading it to trigger the catch block and call itself again with the next method in the list of nonce methods (nonces, _nonces, nonce and getNonce).
However, now it isn't, causing it to NOT try the _nonces method, actually implemented in the AAVE proxy token contract https://etherscan.io/address/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9#readProxyContract

Image

alfetopito added a commit that referenced this issue May 8, 2025
* fix: patch 1inch lib to keep trying other nonce methods when we get a non-failure

* chore: pointless change just to trigger lib release

* chore: bump pkg version to 0.6.1-RC.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0