<!-- canonical: https://0xsimao.com/findings/yieldoor-i-divides-sing-shadow-rewards -->

# Swap amount can be 0 as it divides the balance by 2, DoSing ShadowStrategyGauge::collectGaugeRewards()

Low/Info · 0xSimao · Leveraged yield farming · 12th May 2025

Finding L-5 of the Yieldoor Gauges security review.

- Protocol: https://app.yieldoor.com/
- Report: /reports/yieldoor-i
- Source: https://github.com/0xSimao/audits/blob/main/0xSimao/2025-05-12-yieldoor-i.pdf

---

**Description:**

The `ShadowStrategyGauge::collectGaugeRewards()` will be DoSed when the `swapAmount` balance is 1, as it tries to swap in an [amount](https://github.com/spacegliderrrr/yieldoor/blob/master/src/instances/ShadowStrategyGauge.sol#L513) of `swapAmount / 2`, which reverts. This may make it easier for anybody to donate just 1 token of the reward tokens to intentionally make it revert. It can be fixed by donating more tokens, but it's still something to be avoided.

**Recommended Mitigation:**

Skip if the swap amount after dividing by 2 is null.

---

Related findings:

- [There may not be enough gem(Usdc) in the Psm contract, DoSing withdrawals in the Sky Strategy](https://0xsimao.com/findings/maple-finance-iv-gem-usdc-sing-withdrawals): Maple Cash Strategies
- [Aave RewardsController can add Usdc to the rewards list and the strategy has no way to collect the rewards](https://0xsimao.com/findings/maple-finance-iv-aave-rewards-usdc-way): Maple Cash Strategies
- [Interest generated by last bond will not go to anyone when liquidating as there is no bond amount to collect it](https://0xsimao.com/findings/autonomint-interest-generated-bond-liquidating): Autonomint
- [Uniswap collect fees should skip collecting fees of one of the tokens if the amount is 0](https://0xsimao.com/findings/singularity-uniswap-fees-skip-collecting): Singularity
