# SiloVault.sol :: Markets with assets that revert on zero approvals cannot be removed.

SiloVault setCap approves 0 when removing a market; tokens like BNB revert on zero approvals, blocking market removal and queue updates.

- Payout: Contest reward
- Severity: medium
- Program: Silo Finance
- Credited: Fitro
- Disclosed: 2025-05-23
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2025-03-silo-finance#m-03
- Library page: https://bugbountylibrary.com/r/c4%3A2025-03-silo-finance%3AM-03
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic vuln:dos

**Target:** SiloVault.sol setCap / submitMarketRemoval
**Root cause:** setCap leaves approveValue at default 0 when supply cap is set to 0; forceApprove retries approve(0) which reverts on tokens that reject zero-value approvals.
**Steps:**
1. Curator calls `submitCap(market, 0)` on a market whose asset reverts on approve(0) (e.g. BNB).
2. Execution enters `_setCap` -> `SiloVaultActionsLib.setCap` with `_supplyCap=0`, so `approveValue` stays 0.
3. `IERC20(_asset).forceApprove(market, 0)` calls `approve(market,0)`, fails, retries `approve(market,0)` again, reverts.
4. Cap never reaches 0, so `submitMarketRemoval` reverts with `NonZeroCap`; market cannot be removed and withdraw queue cannot be updated.
**How found:** Code review of setCap's approveValue default and forceApprove fallback logic, noting forceApprove only handles nonzero-allowance-reset tokens, not zero-approval-reverting tokens.
**Escalation:** If vault depends on such markets, they cannot be removed, blocking addition of new markets due to MAX_QUEUE_LENGTH.
**Insight:** When clearing allowances, check whether the token reverts on approve(0); forceApprove's reset-to-zero fallback re-issues the same failing call, so approve 1 wei instead to keep removal paths functional.
