-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove mandatory viaIR #872
Conversation
Forge code coverage:
|
@@ -265,13 +265,20 @@ library Pool { | |||
} | |||
|
|||
struct SwapParams { | |||
int256 amountSpecified; |
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 this ordering change matter?
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 removed the cached exactInput = params.amountSpecified < 0
, and are now using params.amountSpecified < 0
in place of the cached variable
making it the first element in the struct avoids the need of offset calculations
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.
i also do not like via-ir
src/libraries/Pool.sol
Outdated
// a swap fee totaling MAX_SWAP_FEE (100%) makes exact output swaps impossible since the input is entirely consumed by the fee | ||
if (swapFee >= SwapMath.MAX_SWAP_FEE) { | ||
if (!exactInput) { | ||
// if not exactInput | ||
if (!(params.amountSpecified < 0)) { |
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.
if (!(params.amountSpecified < 0)) { | |
if (params.amountSpecified >= 0) { |
might be better?
Related Issue
Mandatory viaIR sucks 💯
Description of changes