dos-vectorslisted
Install: claude install-skill iktok90-design/ai-smart-contract-auditor
# DoS vector detection
## When this applies
- Loops iterating over user-supplied or unbounded arrays
- Push-style payment patterns (contract pushes value to N recipients)
- Auctions that refund the previous highest bidder via direct transfer
- Mass `claim()` / `distribute()` functions
- Queues / stacks of withdrawals
- Functions whose gas cost scales with `n` users / `n` tokens
- L2 forced inclusion mechanics
## Detection patterns
### Unbounded loop over user-controlled array (CRITICAL-HIGH)
```solidity
function distribute() external {
for (uint i; i < holders.length; ++i) {
payable(holders[i]).transfer(rewards[i]); // ← gas grows; eventually un-callable
}
}
```
Worse if attacker can grow `holders` (e.g. anyone can register).
### Push-payment with revert-on-receive (HIGH)
```solidity
function refundPreviousBidder() internal {
payable(highBidder).transfer(highBid); // ← attacker bids from contract that reverts on receive → freezes auction
}
```
Use pull-payments: store credits, let users withdraw.
### `.transfer` (2300 gas) blocks smart-wallet receivers (MEDIUM-HIGH)
Smart wallets (Gnosis Safe, Argent) have fallback functions that need >2300 gas. Their users can't receive — effectively DoS for them.
### Gas griefing via large calldata (HIGH on relayers)
Relayer pays gas; user provides bloated calldata to grief. Cap calldata length or charge per-byte.
### `external` reentrant fee-loop DoS (HIGH)
Withdrawals from each strategy in a vault — if any