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

withdrawFromQueue emits the wrong number of tokens withdrawn #7

Open
andreiashu opened this issue Jul 29, 2021 · 0 comments
Open

withdrawFromQueue emits the wrong number of tokens withdrawn #7

andreiashu opened this issue Jul 29, 2021 · 0 comments

Comments

@andreiashu
Copy link
Member

andreiashu commented Jul 29, 2021

Description

withdrawFromQueue can be called by anyone in order to withdraw deposited tokens from a round:

https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L305-L306

The emitted event is incorrectly using the withdrawQueueAmount variable which holds the tokens leftover in the queue to be withdrawn:

https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L464-L471

Recommendation

Fix the code to reference withdrawAmount instead which represents the number of tokens the user deposited in the round.

@andreiashu andreiashu changed the title withdrawFromQueue emits the wrong amount of tokens withdrawn withdrawFromQueue emits the wrong number of tokens withdrawn Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant