<!-- canonical: https://0xsimao.com/findings/autonomint-interest-generated-bond-liquidating -->

# Interest generated by last bond will not go to anyone when liquidating as there is no bond amount to collect it

Medium · Sherlock · Hedged stablecoin · 4th December 2024

Finding M-21 of the Autonomint competition.

- Protocol: https://audits.sherlock.xyz/contests/569
- Report: /reports/autonomint
- Codebase: https://github.com/0xsimao/2024-11-autonomint/tree/0d324e04d4c0ca306e1ae4d4c65f0cb9d681751b
- Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/790

---

### Summary

`borrowingLiquidation::liquidationType1()` [withdraws](https://github.com/sherlock-audit/2024-11-autonomint/blob/main/Blockchain/Blockchian/contracts/Core_logic/borrowLiquidation.sol#L295) the bond from the external protocol and updates the interest, but does not check if there is bond supply to distribute the interest to. Thus, if there are no bonds (if it was the only depositor being liquidated), it will be stuck. 

### Root Cause

In `borrowingLiquidation:295`, the bond is withdrawn from the external protocol without consideration for the supply of the bond or the number of borrowers.

### Internal pre-conditions

None.

### External pre-conditions

None.

### Attack Path

1. A single borrower exists that is liquidated, so the bond interest goes to nobody.

### Impact

Stuck bond interest.

### PoC

See links and explanation.

### Mitigation

Check if the bond supply is non null and the number of borrowers.

---

Related findings:

- [`PreDepositVault` does not collect interest for `WBTC`](https://0xsimao.com/findings/gaib-pre-deposit-interest-wbtc): GAIB Pre-Vaults
- [Liquidator will leave a pool with unassigned earnings on `Market::clearBadDebt()` free to claim for anyone when the repaid maturity is not the last](https://0xsimao.com/findings/exactly-protocol-update-staking-contract-ii-liquidator-clear-debt-repaid): Exactly Protocol Update - Staking Contract
- [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
- [Swap amount can be 0 as it divides the balance by 2, DoSing ShadowStrategyGauge::collectGaugeRewards()](https://0xsimao.com/findings/yieldoor-i-divides-sing-shadow-rewards): Yieldoor Gauges
