Part 2

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

Missing Event Emission for State Update in `ZlpVault::maxDeposit` Function

Vulnerability Details

The function ZlpVault::maxDeposit calculates the maximum depositable assets based on the vault's deposit cap and total assets, but it does not emit an event to notify any changes or significant state updates. This is a potential vulnerability because key actions within the contract should typically trigger events for transparency and tracking, particularly when state variables are being modified.

Impact

  1. Lack of Transparency: Without emitting an event, there is no record on the blockchain of the internal state change.

  2. Increased Debugging Difficulty

Recommendations

Emit Event for State Update: Introduce an event that is emitted whenever the maxDeposit function is called and the state of the vault is queried or updated. The event should include the vault ID, deposit cap, and available assets for deposit.

event MaxDepositUpdated(uint128 vaultId, uint256 maxAssets);
function maxDeposit(address) public view override returns (uint256 maxAssets) {
// existing code
emit MaxDepositUpdated(zlpVaultStorage.vaultId, maxAssets);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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