-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: add unstoppable domains support #431
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, works nicely! Left only some minor comments.
packages/arb-token-bridge-ui/src/components/common/HeaderAccountPopover.tsx
Outdated
Show resolved
Hide resolved
packages/arb-token-bridge-ui/src/components/common/HeaderAccountPopover.tsx
Outdated
Show resolved
Hide resolved
async function tryLookupUD(address: string) { | ||
const UDresolution = Resolution.fromEthersProvider({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have the provider passed in and not rely on what the default provider in the library is, same as what we do with the ENS lookups:
async function tryLookupUD(address: string) { | |
const UDresolution = Resolution.fromEthersProvider({}); | |
async function tryLookupUD(provider: JsonRpcProvider, address: string) { | |
const UDresolution = Resolution.fromEthersProvider(provider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to include a polygon mainnet provider for it because behind the scenes their sdk is calling these 2 apis when the param is undefined:
https://eth-mainnet.alchemyapi.io/v2/GmQ8X1FHf-WDEry0BBSn0RgjVhjHkRmS
https://polygon-mainnet.g.alchemy.com/v2/iG-oHZ2FvjqC9D43O5q9sj62out5ubsy
To specify providers, the call has to be:
Resolution.fromEthersProvider({uns: {
locations: {
Layer1: {
network: 'mainnet',
provider: l1Provider
},
Layer2: {
network: 'polygon-mainnet',
provider: polygonProvider
}
}
}});
These are the networks they support for the network
string:
https://github.com/unstoppabledomains/resolution/blob/62dd1ccfc58fc192a6432269c046042b295d622d/src/types/index.ts#L119-L125
Should I add polygon to the rpcURLs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we only need the Mainnet provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on Slack, we'll pass in an empty object until UD updates their lib to support our use case.
Filed issue: unstoppabledomains/resolution#229
packages/arb-token-bridge-ui/src/components/common/HeaderAccountPopover.tsx
Outdated
Show resolved
Hide resolved
f1b6de2
to
5b4c14a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat: add unstoppable support * clean up code according to review comments * remove support for polygon UD names * rename methods
* Dev : Enhanced the L2 deposit failure state according to design * Dev : Fixed the text overlapping in mobile responsive mode * Dev - made the retryable days in failed deposit card - dynamic * Dev: minor label changes * Dev : enhanced retryable day handling logic, updated the design to latest * Dev : Refactored the expiry date logic to retryable util * Dev : updated the transaction table row expiry design according to figma * Dev : made the Retryable expiration getter method naming more apt * fix: update to correct L2 when switching networks (#429) * refactor: Detect corrects L1 and L2 when switching network * Restore unused component, fix undefined check * Properly override chainIdToDefaultL2ChainId in RegisterLocalNetwork * feat: add unstoppable domains support (#431) * feat: add unstoppable support * clean up code according to review comments * remove support for polygon UD names * rename methods * Dev : PR review pointers addressed * Dev : Revised the logic, PR review pointers addressed #2 Co-authored-by: Christophe Deveaux <[email protected]> Co-authored-by: Fionna Chan <[email protected]>
* Dev : Enhanced the L2 deposit failure state according to design * Dev : Fixed the text overlapping in mobile responsive mode * Dev - made the retryable days in failed deposit card - dynamic * Dev: minor label changes * Dev : enhanced retryable day handling logic, updated the design to latest * Dev : Refactored the expiry date logic to retryable util * Dev : updated the transaction table row expiry design according to figma * Dev : made the Retryable expiration getter method naming more apt * fix: update to correct L2 when switching networks (#429) * refactor: Detect corrects L1 and L2 when switching network * Restore unused component, fix undefined check * Properly override chainIdToDefaultL2ChainId in RegisterLocalNetwork * feat: add unstoppable domains support (#431) * feat: add unstoppable support * clean up code according to review comments * remove support for polygon UD names * rename methods * Dev : PR review pointers addressed * Dev : Revised the logic, PR review pointers addressed #2 Co-authored-by: Christophe Deveaux <[email protected]> Co-authored-by: Fionna Chan <[email protected]>
This PR only supports UD on Ethereum mainnet and not the ones on Polygon.
Local test
Development was done using Polygon UD
Polygon Mainnet address provided by Unstoppable:
To know if an address has reverse resolution set up, check that
reverseOf
returns the token idPolygon: https://polygonscan.com/address/0x3E67b8c702a1292d1CEb025494C84367fcb12b45#readContract
Mainnet: https://etherscan.io/address/0x049aba7510f45BA5b64ea9E658E342F904DB358D#readProxyContract