Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/permit-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/permit-utils",
"version": "0.6.0",
"version": "0.6.1-RC.0",
"type": "module",
"dependencies": {
"ethers": "^5.7.2",
Expand All @@ -16,4 +16,4 @@
"require": "./index.cjs"
}
}
}
}
8 changes: 4 additions & 4 deletions libs/permit-utils/src/lib/getTokenPermitInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ async function estimateTokenPermit(params: EstimateParams): Promise<GetTokenPerm

return gasLimit > minGasLimit
? {
type,
version,
name: tokenName,
}
type,
version,
name: tokenName,
}
: { ...UNSUPPORTED, name: tokenName }
}

Expand Down
13 changes: 13 additions & 0 deletions patches/@1inch+permit-signed-approvals-utils+1.4.10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@1inch/permit-signed-approvals-utils/eip-2612-permit.utils.js b/node_modules/@1inch/permit-signed-approvals-utils/eip-2612-permit.utils.js
index 3e41e2e..e2a7fee 100644
--- a/node_modules/@1inch/permit-signed-approvals-utils/eip-2612-permit.utils.js
+++ b/node_modules/@1inch/permit-signed-approvals-utils/eip-2612-permit.utils.js
@@ -161,7 +161,7 @@ class Eip2612PermitUtils {
.catch(() => this.getTokenNonceByMethod(tokenAddress, walletAddress, nonceMethodNameIndex + 1))
.then((res) => {
if (res === '0x' || Number.isNaN(Number(res))) {
- return Promise.reject(new Error('nonce is NaN'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which cases res is not a valid number? Some specific tokens?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That I don't know.
In the AAVE case specifically, it's returning 0x instead of throwing, which is a problem because it doesn't check the other nonce methods.
To be honest, I don't know why it started to not throw either, as I assume before it did given that we were able to call the right method in the past.
OR the AAVE token implementation changed 🤷

+ return this.getTokenNonceByMethod(tokenAddress, walletAddress, nonceMethodNameIndex + 1)
}
return Number(res);
});
Loading