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

Informational - Missing _minAmount check in redeem #30

Open
kitty-the-kat opened this issue Jan 11, 2023 · 1 comment
Open

Informational - Missing _minAmount check in redeem #30

kitty-the-kat opened this issue Jan 11, 2023 · 1 comment

Comments

@kitty-the-kat
Copy link
Contributor

redeem does not check if the _minAmount asset requirement is met. The other three similar functions check if the assets amount is at least _minAmount.

Technical Details

deposit() and mint() verify the deposit amount is greater than minDeposit while withdraw() checks that the asset amount is greater than the user-specified _minAmount before transferring tokens. redeem() does have a comparable minimum value check before assets are transferred.

Impact

Informational.

Recommendation

Consider adding the line if (_assets < _minAmount) revert Errors.InsufficientAssets(); into redeem() to keep the GVault consistent with how it uses _minAmount.

@kitty-the-kat
Copy link
Contributor Author

challenged: Not and issue
reasoning: the EIP-4626 compatible withdraw functions do not use the user specified minAmount, only the added withdraw function does. We dont really see any need to implement a secondary redeem function that uses minAmount to protect against potential slippage

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

When branches are created from issues, their pull requests are automatically linked.

1 participant