Last updated
Last updated
Inherits: IVirtualCollateralSupplyBase_v1, ERC165Upgradeable
Author: Inverter Network
Manages a virtual collateral supply to facilitate interactions with Inverter's Funding Manager
Implements {IVirtualCollateralSupplyBase_v1} for handling virtual collateral. Includes functions to set, get, add, and subtract virtual collateral amounts.
The internal state variable to keep track of the virtual collateral supply.
Maximum unsigned integer value for overflow checks.
Storage gap for future upgrades.
See {IERC165-supportsInterface}.
Returns the current virtual collateral supply.
This function returns the virtual supply by calling the internal _getVirtualCollateralSupply
function.
Returns
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.
Parameters
Adds a specified amount to the virtual collateral supply. Checks for overflow and reverts if an overflow occurs.
Parameters
Subtracts a specified amount from the virtual collateral supply. Checks for underflow and reverts if an underflow occurs.
Parameters
Internal function to directly set the virtual collateral supply to a new value.
Parameters
<none>
uint256
The current virtual collateral supply as a uint.
_virtualSupply
uint256
The new value to set for the virtual collateral supply.
_amount
uint256
The amount to add to the virtual collateral supply.
_amount
uint256
The amount to subtract from the virtual collateral supply.
_virtualSupply
uint256
The new value to set for the virtual collateral supply.