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: add minShares to vault withdraw #517

Closed
wants to merge 2 commits into from
Closed

feat: add minShares to vault withdraw #517

wants to merge 2 commits into from

Conversation

0xbok
Copy link

@0xbok 0xbok commented Jan 21, 2022

Description

Pass minShares argument to Vault.withdraw() function, so that it reverts if lower than minShares shares are being redeemed.

Fixes #477

Checklist

  • I have run vyper and solidity linting
  • I have run the tests on my machine
  • I have followed commitlint guidelines
  • I have rebased my changes to the latest version of the main branch

# Calling it a second time with strategy_balance should revert as we cannot withdraw more shares
with brownie.reverts():
vault.withdraw(
strategy_balance * vault.pricePerShare() // 10 ** vault.decimals(),
Copy link
Author

Choose a reason for hiding this comment

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

this actually should be strategy_balance * (10 ** vault.decimals()) // vault.pricePerShare(). I have this PR #516 out to fix this.

@0xbok
Copy link
Author

0xbok commented Jan 22, 2022

This code is outdated, and as per an issue comment this functionality will be added to new code.

@0xbok 0xbok closed this Jan 22, 2022
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.

add minShares to vault withdrawals
1 participant