ArchonArchon
Public verified reportRun your own audit

Archon public report

VaultV2_Demo_Vault

Mantle Mainnet · scan depth deep · generated 6/15/2026, 10:18:47 AM

Risk Score

100

Archon completed a read-only Mantle Mainnet audit of VaultV2_Demo_Vault and found 17 deterministic findings. The highest-priority issue is Reentrancy Eth, with risk score 100/100 based on severity-weighted findings. The withdraw function is vulnerable to reentrancy attacks due to the external call occurring before the state change. Review the recommended fixes and run regression tests before deployment.

Findings

low: 3high: 2info: 10medium: 1critical: 1
SeverityFindingLocationConfidence
high

Reentrancy Eth

The withdraw function is vulnerable to reentrancy attacks due to the external call occurring before the state change.

VaultV2_Demo_Vault.sol:2790%
low

Reentrancy Events

The withdraw function emits an event after an external call, which can lead to misleading event logs in the case of reentrancy.

VaultV2_Demo_Vault.sol:2770%
info

Low Level Calls

The use of low-level calls can introduce risks if not handled properly.

VaultV2_Demo_Vault.sol:2760%
info

Redundant Statements

The minAmountOut variable is declared but never used, leading to redundant code.

VaultV2_Demo_Vault.sol:4850%
low

Cache Array Length

The totalDepositedSlow function uses an unbounded loop to calculate total deposits, which can be gas-wasteful.

VaultV2_Demo_Vault.sol:5540%
critical

External value transfer before balance update

The contract allows external value transfer before updating the user's balance, which can lead to reentrancy attacks.

VaultV2_Demo_Vault.sol:3090%
high

Missing slippage enforcement for swap output

The swapWithoutSlippageCheck function does not enforce slippage limits, potentially allowing users to receive less than expected.

VaultV2_Demo_Vault.sol:3780%
medium

Unbounded storage iteration can create runaway gas cost

The totalDepositedSlow function iterates over an unbounded storage array, which can lead to excessive gas costs.

VaultV2_Demo_Vault.sol:5570%
low

Review calldata parameter width

The withdraw function's calldata parameter width may be optimized for gas savings.

VaultV2_Demo_Vault.sol:2760%
info

Replace long revert string with custom error

Long revert strings can be replaced with custom errors for gas optimization.

VaultV2_Demo_Vault.sol:2850%
info

Replace long revert string with custom error

Replace long revert string with custom error for better gas efficiency.

VaultV2_Demo_Vault.sol:4180%
info

Cache repeated storage read

Cache repeated storage read to optimize gas usage.

VaultV2_Demo_Vault.sol:1875%
info

Use unchecked loop increment where bounded

Use unchecked loop increment where bounded to save gas.

VaultV2_Demo_Vault.sol:5570%
info

Cache array length before loop

Cache array length before loop to optimize gas usage.

VaultV2_Demo_Vault.sol:5575%
info

Use != 0 for unsigned non-zero checks

Use != 0 for unsigned non-zero checks to optimize gas usage.

VaultV2_Demo_Vault.sol:1670%
info

Use != 0 for unsigned non-zero checks

Use of '>' for unsigned non-zero checks can be optimized.

VaultV2_Demo_Vault.sol:4080%
info

Remove redundant zero initialization

Redundant zero initialization in a loop can be removed to optimize gas usage.

VaultV2_Demo_Vault.sol:5570%