40/100
Audit Report·mantle-sepolia

SampleVault.sol

CriticalHighMedium
09 Jun 2026, 16:06 UTC0x6f1f65ae…784a3a

Findings(5)

CriticalF-001Line 15
Confidence100%

Reentrancy

The withdraw function allows for reentrancy attacks because it makes an external call to msg.sender before updating the state variable balances.

Recommendation

Use the Checks-Effects-Interactions pattern by updating the state variable balances before making the external call.

HighF-002Line 10
Confidence50%

Unprotected Function

The deposit function is not protected against potential front-running attacks, allowing an attacker to manipulate the contract's state.

Recommendation

Add access control (or a commit-reveal / per-block guard) to deposit() so its share accounting cannot be front-run, and never derive shares from a value an attacker can move within the same transaction.

MediumF-003Line 15
Confidence50%

Unsecured Use of Transfer

The use of the transfer function (via msg.sender.call{value: bal}()) in the withdraw function can lead to issues if the recipient contract does not handle the transfer correctly.

Recommendation

Follow checks-effects-interactions: update the caller's balance before the external call, wrap withdraw() in OpenZeppelin's nonReentrant guard, and prefer a pull-payment pattern over forwarding all gas via call().

HighF-004Line 14
Confidence65%

reentrancy-eth

Reentrancy in SampleVault.withdraw() (contracts/audit-targets/SampleVault.sol#14-20): External calls: - (ok,None) = msg.sender.call{value: bal}() (contracts/audit-targets/SampleVault.sol#17) State variables written after the call(s): - balances[msg.sender] = 0 (contracts/audit-targets/SampleVault.sol#19) SampleVault.balances (contracts/audit-targets/SampleVault.sol#7) can be used in cross function reentrancies: - SampleVault.balances (contracts/audit-targets/SampleVault.sol#7) - SampleVault.deposit() (contracts/audit-targets/SampleVault.sol#9-11) - SampleVault.withdraw() (contracts/audit-targets/SampleVault.sol#14-20)

Recommendation

Zero the caller's balance before sending ETH (checks-effects-interactions) and add OpenZeppelin's ReentrancyGuard (nonReentrant) to withdraw() so the external call cannot re-enter.

InfoF-005Line 14
Confidence85%

low-level-calls

Low level call in SampleVault.withdraw() (contracts/audit-targets/SampleVault.sol#14-20): - (ok,None) = msg.sender.call{value: bal}() (contracts/audit-targets/SampleVault.sol#17)

Recommendation

Check the boolean returned by the low-level call and revert on failure (require(ok, "transfer failed")); consider Address.sendValue or a pull-payment pattern instead of a raw call().

Gas Breakdown — SampleVault.sol on mantle-sepolia

Total Deployment Cost0.00002482 MNT≈ $0.000015
Deployment Gas1,200,000
L2 Execution97%
L1 Data Fee3%
Operator Fee0%

On-Chain Proof

ERC-8004 AttestationMantle · Identity Registry
Code Hash0xb8847a37ce8437d01189686090f93af466e4eaa5e5fe3de7ba2579338e85e7b0

Encrypted Report

Full findings encryptedAES-256-GCM · Lit Protocol access control · Arweave stored
Report unavailable