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

feat: add unstoppable domains support #431

Merged
merged 4 commits into from
Sep 15, 2022
Merged

feat: add unstoppable domains support #431

merged 4 commits into from
Sep 15, 2022

Conversation

fionnachan
Copy link
Member

@fionnachan fionnachan commented Sep 15, 2022

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:

Here's a test address for mainnet 0x499dD6D875787869670900a2130223D85d4F6Aa7 with reverse resolution configured

To know if an address has reverse resolution set up, check that reverseOf returns the token id
Polygon: https://polygonscan.com/address/0x3E67b8c702a1292d1CEb025494C84367fcb12b45#readContract
Mainnet: https://etherscan.io/address/0x049aba7510f45BA5b64ea9E658E342F904DB358D#readProxyContract

image

@vercel
Copy link

vercel bot commented Sep 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
arb-token-bridge ✅ Ready (Inspect) Visit Preview Sep 15, 2022 at 1:15PM (UTC)

Copy link
Member

@spsjvc spsjvc left a 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.

Comment on lines 63 to 64
async function tryLookupUD(address: string) {
const UDresolution = Resolution.fromEthersProvider({});
Copy link
Member

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:

Suggested change
async function tryLookupUD(address: string) {
const UDresolution = Resolution.fromEthersProvider({});
async function tryLookupUD(provider: JsonRpcProvider, address: string) {
const UDresolution = Resolution.fromEthersProvider(provider);

Copy link
Member Author

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
      }
    }
  }});

https://github.com/unstoppabledomains/resolution/blob/62dd1ccfc58fc192a6432269c046042b295d622d/src/Resolution.ts#L387-L400

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?

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@spsjvc spsjvc left a comment

Choose a reason for hiding this comment

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

LGTM

@spsjvc spsjvc changed the title feat: add unstoppable support feat: add unstoppable domains support Sep 15, 2022
@spsjvc spsjvc merged commit 1264f6a into master Sep 15, 2022
@spsjvc spsjvc deleted the unstoppable branch September 15, 2022 13:48
dewanshparashar pushed a commit that referenced this pull request Sep 16, 2022
* feat: add unstoppable support

* clean up code according to review comments

* remove support for polygon UD names

* rename methods
spsjvc pushed a commit that referenced this pull request Sep 20, 2022
* 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]>
dewanshparashar added a commit that referenced this pull request Sep 20, 2022
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants