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

👷 fix: odos unwind swap return #57

Merged
merged 3 commits into from
Nov 4, 2024
Merged

Conversation

Flocqst
Copy link
Collaborator

@Flocqst Flocqst commented Nov 2, 2024

Fix for odosSwap return value design when called during unwind process.

@Flocqst Flocqst mentioned this pull request Nov 2, 2024
src/Zap.sol Outdated
Comment on lines 506 to 508
unwound -= _collateral == USDC
? _flashloan
: odosSwap(_collateral, _swapAmountIn, _path);
: odosSwapForUnwind(_collateral, _swapAmountIn, _path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can change this to an if else block, and just subtract _swapAmountIn directly without using the return value from odosSwap.

src/Zap.sol Outdated
Comment on lines 675 to 680
/// @dev wrapper around odosSwap that returns input amount instead of output
/// amount
/// @param _tokenFrom address of token being swapped
/// @param _amountIn amount of token being swapped
/// @param _swapPath bytes from odos assemble api containing the swap
function odosSwapForUnwind(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can delete this function, see the above comment

@moss-eth moss-eth merged commit eb5be27 into odos-integration Nov 4, 2024
2 checks passed
moss-eth added a commit that referenced this pull request Dec 5, 2024
* 👷 wip odos swap

* forge install: surl

* ⚙️ add ffi to foundry.toml

* 👷 added odos router to zap constructor

* ✅ successful odos quote using SURL

* ✅ arb quote test and fmt

* ✅ successfully calling odosAssemble

* ✅ wip odos testing

* ✨ Lint

* ✅ blocked on testing

* ✅ test failing in the odos swap

* ✅ latest block on base fixed odos test

* ✅ swap for tests + docs

* ✅ asserts on swap for tests

* ✅  fork tests take current block

* ✨ removed all uniswap logic / mentions, renamed odos vars, updated docs

* 👷 replaced ternary logic in unwind

* ✨ removed unused constants

* ✨ fmt

* 📚 docs + fmt

* ✨ renamed swapFrom test

* fmt

* ✅ added new bootstrap with current block forking

* ✨ fmt

* burn test

* ✨fmt

* 👷 fix: odos unwind swap return (#57)

* 👷 fix: odos unwind swap return

* fix

* ✨ fmt

---------

Co-authored-by: Moss <moss@cc.snxdao.io>

* 👷🏻‍♂️ Odos refund + Unwind Test (#58)

* 👷 refund logic

* ✅ unwind test

* 👷 Odos audit fix (#59)

* 📚 first round of fixes

* 👷 fix 2

* some test fixes

* 👷 fix leftovers (#60)

* 👷 fix leftovers

* fmt

---------

Co-authored-by: Moss <moss@cc.snxdao.io>

* audit remidiations 23/11

* 👷 zapOut when unwinding USDC (#64)

* 👷 zapOut when unwinding USDC

* fix make deploy_base

* 👷 adjust minAmountOut to match usdc 6 decimal precision when unwinding udsc

* 👷 test fix

* ✨ fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants