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

test: swapExactAmountOut happyPath #19

Merged
merged 3 commits into from
May 15, 2024

Conversation

0xAustrian
Copy link

Closes BAL-33

@0xAustrian 0xAustrian self-assigned this May 14, 2024
Copy link

linear bot commented May 14, 2024

BAL-33

@0xAustrian 0xAustrian marked this pull request as ready for review May 14, 2024 22:17
Comment on lines 742 to 747
// internal calculation for calcInGivenOut
uint256 _weightRatio = bdiv(_fuzz.tokenOutDenorm, _fuzz.tokenInDenorm);
uint256 _diff = bsub(_fuzz.tokenOutBalance, _fuzz.tokenAmountOut);
uint256 _y = bdiv(_fuzz.tokenOutBalance, _diff);
uint256 _foo = bpow(_y, _weightRatio);
vm.assume(bsub(_foo, BONE) < type(uint256).max / _fuzz.tokenInBalance);
Copy link
Member

Choose a reason for hiding this comment

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

why create _assumeCalcSpotPrice but not a method for this?

Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

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

wow, looks like quite a long happy path 🥇

Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

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

gaining momentum 👏

@wei3erHase wei3erHase merged commit 8c76c6c into dev May 15, 2024
4 checks passed
@wei3erHase wei3erHase deleted the test/swap-exact-amount-out-happy-path branch May 15, 2024 12:57
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