First line of deposit:
require(amount > 0, "amount must be positive");
Three calls run: 40, then 0, then 60. The middle one is now rejected.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Vault {
uint256 public total;
function deposit(uint256 amount) external {
total += amount;
}
}