Skip to content

Commit

Permalink
[SDK] Fix getting domain separator error (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
retocrooman committed Jan 18, 2023
1 parent af32007 commit 73dc026
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/purple-stingrays-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/sdk": patch
---

Getting the domain separator is not a required function. If an error occurs there, the permit it self will not be possible. Therefore, error handling should be performed appropriately.
9 changes: 8 additions & 1 deletion packages/sdk/src/evm/common/permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ async function getDomainSeperator(signer: Signer, contractAddress: string) {
try {
return await contract.DOMAIN_SEPARATOR();
} catch (err) {
return await contract.getDomainSeperator();
try {
return await contract.getDomainSeperator();
} catch (err2) {
console.error(
'Error getting domain separator',
err2
)
}
}
}

Expand Down

0 comments on commit 73dc026

Please sign in to comment.