-
Notifications
You must be signed in to change notification settings - Fork 1
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
Lido offchain plugin p3, Uniswap plugin #439
Conversation
🦋 Changeset detectedLatest commit: 0c75bac The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
"resolutions": { | ||
"@uniswap/sdk-core": "^4.0.3" | ||
}, |
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.
For the life of me could not resolve some versioning issues btwn uniswap router-sdk -> sdk-core and sdk-core. This was the only thing that worked to fix it
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.
ok - do you know if it still works if you install the plugin package separately? If not, nw, we can publish an alpha for it and try installing it into interface later when we "acceptance test" it anyways.
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.
Yeah installing directly into plugins package didn't work
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.
looks ok aside from unit tests failing and previously-discussed lack of tests - just had a few small questions and one nit change that may or may not apply
"resolutions": { | ||
"@uniswap/sdk-core": "^4.0.3" | ||
}, |
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.
ok - do you know if it still works if you install the plugin package separately? If not, nw, we can publish an alpha for it and try installing it into interface later when we "acceptance test" it anyways.
| { | ||
type: "Action"; | ||
actionType: "UniswapV3 Swap"; | ||
tokenIn: Address; | ||
inAmount: bigint; | ||
tokenOut: Address; |
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.
This is ok for now, but we're going to need to come back and generalize this. I think the sanest way to deal with probably going to end up requiring plugins to format metadata.
@@ -109,14 +114,14 @@ export type JoinSplitsAndPaymentsForAsset = [ | |||
export function newOpRequestBuilder( | |||
provider: ethers.providers.Provider, | |||
chainId: bigint, | |||
tellerContract?: Address // for testing purposes in case there is no config for test network |
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.
mashallah
resolve({ | ||
unwraps: [unwrap], | ||
confidentialPayments: [], | ||
actions: [approveAction, swapAction], // enqueue approve + swap |
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.
Do we need to revoke approval and/or limit the approval? Is the thinking here that it's kind of pointless because handler is shared?
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.
Need to check on this, I don't think I understand permit2 very well rn
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.
Yeah so you have one-time approve max uint256 for permit2 approvals. See uniswap article here for little bit more of explanation. What's above basically just does max approval if needed, can serve for any user later on to
https://blog.uniswap.org/permit2-integration-guide
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.
Nvm I changed to swap router which does traditional token approval to protocol, just doing max uint256 because anyone can call handler.approve
} | ||
); | ||
|
||
this.pluginFn(prom); |
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.
does pluginFn
chain? If so we can just do return this.pluginFn(prom)
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.
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.
yeah this is what I was referring to re: this
getting bound to the wrong thing.
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.
b884d12
to
bb2cb5f
Compare
e833d12
to
c486f04
Compare
c486f04
to
64f15ce
Compare
…SA for reentrancy
cb943b0
to
0c75bac
Compare
Motivation
Add uniswap plugin.
Solution
Proof
N/A (will test once UI is ready)
PR so interface still builds is here: https://github.com/nocturne-xyz/interface/pull/128
PR Checklist