Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Use of totalAssets Function - ZipVault.sol

Summary

The maxDeposit function calls the totalAssets function without considering pending deposits or withdrawals.

Vulnerability Details

The maxDeposit function calls the totalAssets function to get the total assets in the vault, but it does not take into account any pending deposits or withdrawals that may have been made but not yet processed. This could potentially lead to incorrect calculations of the maximum deposit amount.

Impact

Low. Incorrect calculations of the maximum deposit amount could lead to unexpected behavior or vulnerabilities, potentially causing financial loss or incorrect state.

Tools Used

Manual code review and analysis.

Recommendations

Modify the maxDeposit function to take into account any pending deposits or withdrawals, or use a more accurate method to calculate the total assets in the vault.

function maxDeposit(address) public view override returns (uint256 maxAssets) {
ZlpVaultStorage storage zlpVaultStorage = _getZlpVaultStorage();
IMarket
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.