# 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();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inverter.network/contracts/technical-reference/modules/funding-manager/bonding-curve/interfaces/ivirtualcollateralsupplybase_v1.sol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
