-
Notifications
You must be signed in to change notification settings - Fork 177
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 cross-account trading for 1inch #5834
Conversation
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 sane to me pending runtime testing
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.
Runtime test - note, I had to bump QUOTE_TIMEOUT_MS
up to handle currrent Li.Fi timeouts
Account 0 -> 1 (ERC-20 -> native asset)
- Approve Tx from account 0
- Trade complete account 0 -> 1
Fundus successfully sent to account 1 🎉
Account 0 -> 1 (native asset -> ERC-20)
Note, no approval here as this is a native asset
- Trade complete account 0 -> 1
Note recipient / srcTo where srcTo
(the sender) is address zero, which is expected as this is an abstraction when dealing with native assets
Fundus successfully sent to account 1 🎉
Account 1 -> 0 (ERC-20 -> native asset)
- Approve Tx from account 1
Untestable as this is from account 1 which already has allowance granted, and I cannot add the account as account 1 in MM as they use a different account path component for derivation.
- Trade complete account 1 -> 0
Note, had to switch to Gnosisscan for this one as the funds were definitely received (got that sweet Zerion notification for funds received), but Blockscout couldn't pick the XDAI transfer internal Tx 🤦🏽
Fundus successfully sent to account 0 🎉
Account 1 -> 0 (native asset -> ERC-20)
Note, no approval here as this is a native asset
- Trade complete account 1 -> 0
Note recipient / srcTo where srcTo
(the sender) is address zero, which is expected as this is an abstraction when dealing with native assets
Fundus successfully sent to account 0 🎉
Account 1 -> 1 as a paranoia regression test
Fundus successfully sent to account 1 🎉
Account 0 -> 0 as a paranoia regression test
Fundus successfully sent to account 1 🎉
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.
Retest of Account 1 -> 0 (ERC-20 -> native asset), since I noticed this was sent from account 0 (i.e 0 -> 0) in the Tx above.
- Approval step is displayed
- Happy Tx
Two things to note here:
- While testing this PR, I've noticed these consistently failing:
- WRT the wrong account used above, I believe this has to do with backing off from preview step and going back to input step, though I haven't been able to repro - may have been a one-off shenanigan
Description
Enables cross-account trading for 1inch.
Cross-account 1inch transactions created from this branch:
Pull Request Type
Issue (if applicable)
Closes #4966
Risk
Medium. It's a small change, but as always, touching account selection is risky as mistakes can mean lost funds.
Testing
Confirm that 1inch quotes now show up when trading between accounts, and that they and sent and received from the correct accounts when executed.
Engineering
Sanity check logic.
Operations
☝️
Screenshots (if applicable)