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

Depositing should allow up to or equal to the cap #4

Open
cleanunicorn opened this issue Jul 27, 2021 · 0 comments
Open

Depositing should allow up to or equal to the cap #4

cleanunicorn opened this issue Jul 27, 2021 · 0 comments

Comments

@cleanunicorn
Copy link
Member

cleanunicorn commented Jul 27, 2021

Description

A user can deposit funds in the vault by calling deposit() or registerDeposit().

When they are called, the total amount of locked funds are checked to be up to the specified limit, called the cap.

https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L406

https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L248

The check makes sure the amount of funds is strictly less than the limit. This will force the last user joining the vault to send an awkward amount of funds (similar to 99999999). Allowing the total amount of funds to equal will make the user experience better, and also, the total reported amount of funds displayed will be easier to the eye.

Recommendation

Change the require to accept the sum of deposited amounts to be equal to the cap.

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