> For the complete documentation index, see [llms.txt](https://docs.inverter.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inverter.network/contracts/technical-reference/modules/funding-manager/bonding-curve/interfaces/ivirtualcollateralsupplybase_v1.sol.md).

# IVirtualCollateralSupplyBase\_v1.sol

[Git Source](https://github.com/InverterNetwork/inverter-contracts/blob/649b450f02fc8b735c128ff0821467e71966c666/src/modules/fundingManager/bondingCurve/interfaces/IVirtualCollateralSupplyBase_v1.sol)

### Functions

#### setVirtualCollateralSupply

Sets the virtual collateral supply to a new value.

*This function should call the internal function `_setVirtualCollateralSupply`. The function must be implemented by the downstream contract. The downstream contract should manage access control for setting the supply.*

```solidity
function setVirtualCollateralSupply(uint _virtualSupply) external;
```

**Parameters**

| Name             | Type      | Description                                             |
| ---------------- | --------- | ------------------------------------------------------- |
| `_virtualSupply` | `uint256` | The new value to set for the virtual collateral supply. |

#### getVirtualCollateralSupply

Returns the current virtual collateral supply.

*This function returns the virtual supply by calling the internal `_getVirtualCollateralSupply` function.*

```solidity
function getVirtualCollateralSupply() external view returns (uint);
```

**Returns**

| Name     | Type      | Description                                      |
| -------- | --------- | ------------------------------------------------ |
| `<none>` | `uint256` | The current virtual collateral supply as a uint. |

### Events

#### VirtualCollateralSupplySet

Event emitted when virtual collateral supply has been set.

```solidity
event VirtualCollateralSupplySet(uint newSupply, uint oldSupply);
```

#### VirtualCollateralAmountAdded

Event emitted when virtual collateral amount has been added.

```solidity
event VirtualCollateralAmountAdded(uint amountAdded, uint newSupply);
```

#### VirtualCollateralAmountSubtracted

Event emitted when virtual collateral amount has been subtracted.

```solidity
event VirtualCollateralAmountSubtracted(uint amountSubtracted, uint newSupply);
```

### Errors

#### Module\_\_VirtualCollateralSupplyBase\_\_VirtualSupplyCannotBeZero

The virtual supply cannot be zero.

```solidity
error Module__VirtualCollateralSupplyBase__VirtualSupplyCannotBeZero();
```

#### Module\_\_VirtualCollateralSupplyBase\_\_SubtractResultsInUnderflow

```solidity
error Module__VirtualCollateralSupplyBase__SubtractResultsInUnderflow();
```

#### Module\_\_VirtualCollateralSupplyBase\_\_AddResultsInOverflow

Adding would result in and overflow.

```solidity
error Module__VirtualCollateralSupplyBase__AddResultsInOverflow();
```
