-
Notifications
You must be signed in to change notification settings - Fork 404
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
Bump uniswap sdk core to 4.09 and add correct base swap router address #481
Conversation
would be great to get this merged, currently using the smart-order-router on base results in a loss of funds since they're sent to an EOA the function call "succeeds" |
hey all, We are currently not supporting actively the |
it looks like the address in the docs doesn't match the address being used in the universal-router-sdk either. I think the docs are wrong and the sdk is right, but would you confirm for me? Obviously a little extra nervous here given we've already lost funds with the last wrong address |
@wminshew thank you for the flag. Before I give you a final confirmation, let me circle back to confirm the right addresses and will get back to you asap |
Sure! The address for |
I've made this PR for sdk-core, I think we should merge that as a catch-all to make sure this never happens again. Then we can publish that and you can integrate it here. What do you think? |
Personally I prefer to separate support |
Hey @hensha256 just added Avalanche address as well. I'm assuming it's in the SDK-core like the Base one is as well. If not can hardcode it in, but probably better to add it into core directly and reference |
Hey! The PR I talked about in this message has now been merged and published into sdk-core version 4.1.2. If you want to update to that version, you should be able to update the PR to just use that function without special casing :) |
Would also be great if you could separate the sepolia stuff into another PR as @jsy1218 said! |
@jsy1218 sounds good will do that today |
@jsy1218 I can't update to sdk-core version 4.1.2 without adding arbitrum-sepolia support, and I need 4.1.2 to get the new swap router addresses exported from sdk-core. Do you want me to do that in a separate PR or do it here as well. |
Sorry for the trouble, but would love to support arb-sepolia in a separate PR. |
Let me know when the arb PR is merged and I can rebase off of main and finalize the changes. Sure, I'm available pretty much any time today |
@sismanis just merged :) |
737df46
to
f8dd7b3
Compare
Will reopen in a sec, just found it easier to reset to main and reimplement cause I had a lot of similar/conflicting changes with the sepolia stuff |
Should be good to go now @jsy1218. I noticed some conlficting keys in a test case with the new sepolia chains. Can fix that real quick in this PR if you want too |
Integration Tests will fail, if the branch is forked from SOR. This is because a bunch of secrets used in https://github.com/Uniswap/smart-order-router/blob/main/.github/workflows/tests.yml require creating new repository secrets:
The changes seems ok to me, and I'm ok merging it first, and see the main branch can have all the tests pass. |
I noticed that Tests / Unit Tests (pull_request) failed, which is set to be required for the branch protection rule, and block this PR from merging. For it to pass, it requires setting JSON_RPC_PROVIDER to your forked repo https://github.com/L1-Advisors/smart-order-router/tree/fix-base-swap-router. Do you have a JSON PRC ready? A free API key from Infura should do, i.e. https://mainnet.infura.io/v3/{API_KEY} |
Yeah no problem I have one ready. Will set that now |
Alright @jsy1218 just added |
@jsy1218 just updated it again and double checked it was there idk if I messed something up the first time |
Manully retryed again. It fails again, and I can't quite tell why. I think I will create a PR within Uniswap SOR, so as to ship this fix asap. |
That's a shame I was hoping to get some contribution credit to the repo. Would it work if I created the PR within this repo and not from a fork? I can handle it if that's the case |
Well.. Only Uniswap Labs employees can be added to the Uniswap org, in order to create the PR within https://github.com/Uniswap repos. Can you disable all tests in token-properties-provider.test.ts and token-fee-fetcher.test.ts? That's probably gonna make unit test pass as well. I think I will follow up by putting token-properties-provider.test.ts and token-fee-fetcher.test.ts out of the unit test suite. I tested locally, disable all tests in token-properties-provider.test.ts and token-fee-fetcher.test.ts can make unit test pass. This way you can still get contribution credit, meanwhile the repo can be better structured to serve future community contributions as well. |
Yep, I will do that right now. Thanks so much. |
@jsy1218 just FYI I skipped the tests in those files. Not 100% sure if I did it correctly. |
@sismanis FYI, Update - the regression might be explained here Uniswap/sdk-core#120 |
The swap router address for base is different for other chains so the function needs to account for that. Also, @uniswap/sdk-core needs to be bumped to 4.0.9 where the WETH9 contract for Base was added otherwise any pools with WETH on base will not work in this SDK with the swap router.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This will fix bugs with using base with the smart order router. Currently does not work with the current version of the sdk and is fixed with these changes
What is the current behavior? (You can also link to an open issue here)
The current behavior will throw an error when requesting a swap router quote on base
What is the new behavior (if this is a feature change)?
The swap router will work correctly and quotes are able to be fetched using the SDK
Other information: