-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
src/Zap.sol
Outdated
unwound -= _collateral == USDC | ||
? _flashloan | ||
: odosSwap(_collateral, _swapAmountIn, _path); | ||
: odosSwapForUnwind(_collateral, _swapAmountIn, _path); |
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.
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
/// @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( |
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.
we can delete this function, see the above comment
* 👷 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
Fix for
odosSwap
return value design when called during unwind process.