# `Fontaine` never stops the flows to the tax and recipient, so the buffer component of the flows will be lost

Fontaine never stops Superfluid flows after vesting, so the 4-hour liquidation buffer deposit is permanently locked, shorting recipient and tax pool.

- Payout: Audit contest
- Severity: high
- Program: Superfluid
- Found by: 0x73696d616f
- Disclosed: 2024-11-13
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-11-superfluid-locking-contract-judging/issues/36
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-11-superfluid-locking-contract%3AH-3
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error

**Target:** Fontaine vesting contract on Superfluid CFA/GDA
**Root cause:** Fontaine::initialize creates flows to recipient and tax pool but never calls stopFlow/deleteFlow, so the Superfluid deposit buffer reserved for liquidation is never released back to the contract.
**Steps:**
1. Deploy Fontaine and call `initialize(unlockRecipient, unlockFlowRate, taxFlowRate)` which calls `FLUID.distributeFlow` and `FLUID.createFlow`.
2. Observe `FLUID.balanceOf(address(this))` drops by the 4-hour buffer amount reserved per flow.
3. Run `forge test --mt testVestUnlock -vvvv`: Alice sends 10_000e18 but only 9996.8e18 remains usable.
4. No stopFlow is ever invoked, so buffer is never reclaimed.
**How found:** Code reading of Fontaine::initialize against Superfluid's documented buffer/liquidation semantics: noticed flows are created but never stopped, so the reserved deposit cannot be reclaimed.
**Exploitation:** Not an active attack; any user unlocking Fluid with a non-null unlocking period triggers the loss of the buffer component, which is never returned to recipient or tax pool.
**Insight:** When integrating Superfluid CFA/GDA, audit flow lifecycle symmetry: every createFlow/distributeFlow must have a matching stopFlow/deleteFlow path, otherwise the 4-hour deposit buffer is permanently stranded.

## Proof of concept (copied exactly from the original report)

**Instrumented initialize() logging Fontaine balance around flows**

```
function initialize(address unlockRecipient, int96 unlockFlowRate, int96 taxFlowRate) external initializer {
    // Ensure recipient is not a SuperApp
    if (ISuperfluid(FLUID.getHost()).isApp(ISuperApp(unlockRecipient))) revert CANNOT_UNLOCK_TO_SUPERAPP();

    console2.log("fontaine balance pre distributeFlow", FLUID.balanceOf(address(this)));

    // Distribute Tax flow to Staker GDA Pool
    FLUID.distributeFlow(address(this), TAX_DISTRIBUTION_POOL, taxFlowRate);

    console2.log("fontaine balance pre createFlow", FLUID.balanceOf(address(this)));

    // Create the unlocking flow from the Fontaine to the locker owner
    FLUID.createFlow(unlockRecipient, unlockFlowRate);

    console2.log("fontaine balance after createFlow", FLUID.balanceOf(address(this)));
}
```

