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

Feat: update wrap #49

Closed
wants to merge 2 commits into from
Closed

Feat: update wrap #49

wants to merge 2 commits into from

Conversation

devtooligan
Copy link
Contributor

@devtooligan devtooligan commented Aug 17, 2022

see #48

@devtooligan devtooligan changed the title Feat 48 update wrap Feat: update wrap Aug 17, 2022
@devtooligan
Copy link
Contributor Author

Bruno had requested this change but in the end we decided it was too much to try and squeeze in before deploying. Closing this for now

@devtooligan devtooligan closed this Sep 1, 2022
@@ -454,7 +454,7 @@ contract Pool is PoolEvents, IPool, ERC20Permit, AccessControl {
_mint(to, lpTokensMinted);

// Return any unused base tokens
if (sharesBalance > cache.sharesCached + sharesIn) _unwrap(remainder);
if (sharesBalance > cache.sharesCached + sharesIn) _unwrap(baseToken.balanceOf(address(this)), remainder);
Copy link
Contributor Author

@devtooligan devtooligan Sep 13, 2022

Choose a reason for hiding this comment

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

this looks like a mistake - prob should be:

uint surplus = sharesBalance - cache.sharesCached + sharesIn;
if (surplus > 0) {
  _unwrap(surplus, remainder); // unwrap surplus
}

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.

1 participant