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

Add Rootstock chain #516

Closed
wants to merge 1 commit into from

Conversation

ahsan-javaiid
Copy link

Description

This PR adds Rootstock chain support to smart-order-router. Previously Rootstock is added and released under https://github.com/Uniswap/sdk-core as Uniswap v3 contracts deployed to Rootstock.

Reference:

Uniswap/sdk-core#123

@ahsan-javaiid ahsan-javaiid requested a review from a team as a code owner March 18, 2024 07:24
@ahsan-javaiid
Copy link
Author

cc: @jsy1218 for review.

@jsy1218
Copy link
Member

jsy1218 commented Mar 18, 2024

@ahsan-javaiid there's some genuine error, sourced from Unit Tests:

0x6B1a73d547F4009A26B8485b63D7015D248AD406 is not a valid address.

  658 |
  659 | // Rootstock Tokens
> 660 | export const DAI_ROOTSTOCK = new Token(
      |                              ^
  661 |   ChainId.ROOTSTOCK,
  662 |   '0x6B1a73d547F4009A26B8485b63D7015D248AD406',
  663 |   18,

  at validateAndParseAddress (node_modules/@uniswap/sdk-core/src/utils/validateAndParseAddress.ts:11:11)
  at new Token (node_modules/@uniswap/sdk-core/src/entities/token.ts:51:[22](https://github.com/Uniswap/smart-order-router/actions/runs/8322756751/job/22797361015?pr=516#step:7:23))
  at Object.<anonymous> (src/providers/token-provider.ts:660:[30](https://github.com/Uniswap/smart-order-router/actions/runs/8322756751/job/22797361015?pr=516#step:7:31))
  at Object.<anonymous> (src/providers/caching-token-provider.ts:7:1)

Don't worry about Integration Tests failure, as you don't have the JSON RPC URLs in your forked repo. However Unit Tests are self-contained, and should be able to pass.

@jsy1218
Copy link
Member

jsy1218 commented Mar 18, 2024

Couple things needed:

  1. caching-token-provider need to add RootStock: https://github.com/Uniswap/smart-order-router/pull/511/files#diff-615bf7538df0e457fdd95bd9c65eacf3c0ff3bb1c410f7ba1162927a8e9e4e79
  2. v2 and v3 static-subgraph-provider need to add popular token for pool, as there's no subgraph for rootstock uniswap yet: https://github.com/Uniswap/smart-order-router/pull/511/files#diff-d6f60d0c4cf75c24903811d5018b7c23ab3d14d86008fbfa4adf2c1b787e76a9 & https://github.com/Uniswap/smart-order-router/pull/511/files#diff-f2269751335f6c3d2caa210ea406dff2fb2d0a22f6295296fa7d53124afbaf82
  3. v3 gas-costs need to include rootstock: https://github.com/Uniswap/smart-order-router/pull/511/files#diff-585c7f0b7e0175f0224fdc2d3cd6d5d2182bae26c80ca294b26bf97b4c8f818a
  4. Remove Rootstock from WETH9 exclusion https://github.com/Uniswap/smart-order-router/pull/511/files#diff-ae0915db441ef04255b5004a12525a8d227e8e6ef124e754d896142e179198e2.
  5. WRAPPED_NATIVE_CURRENCY needs to add RBTC

Also is it true that RBTC is the native currency on Rootstock, used for paying gas etc.? If that's true, then for 1-4, RBTC will need to be added into the token lists as well.

I'm slightly uncertain about routing for bitcoin side chain, since Rootstock will be the first non-ethereum side chain we support. Would be great if the integ-test can be added as well https://github.com/Uniswap/smart-order-router/pull/511/files#diff-b1a09e5a7156f19225eba6ca4e2e78d0942580ff1118bab472bf0ea3b1294904. I can help run the integration test on my local to ensure the routing on rootstock works.

@ahsan-javaiid
Copy link
Author

@jsy1218
Thinking a work around to update this pull request without graph/subgraph endpoint which is under development. Just asking if i can add subgraph later keeping it as todo for now. 🤔

Copy link
Member

jsy1218 commented May 14, 2024

@jsy1218
Thinking a work around to update this pull request without graph/subgraph endpoint which is under development. Just asking if i can add subgraph later keeping it as todo for now. 🤔

You can use the static subgraph provider class to work around. However I realized that our external providers don't support RootStock yet, which means token balances, staticcall RPC calls (e.g. multicall) won't be available in routing yet.

@ahsan-javaiid
Copy link
Author

@jsy1218
Thinking a work around to update this pull request without graph/subgraph endpoint which is under development. Just asking if i can add subgraph later keeping it as todo for now. 🤔

You can use the static subgraph provider class to work around. However I realized that our external providers don't support RootStock yet, which means token balances, staticcall RPC calls (e.g. multicall) won't be available in routing yet.

@jsy1218 Would be great to know which external providers are required for routing here. ? Thanks

Copy link

stale bot commented Jul 20, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix This will not be worked on label Jul 20, 2024
@stale stale bot closed this Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants