Inherits: IERC20, IAccessControl, IVersioned
TCAP v2 is an index token that is pegged to the entire crypto market cap
Mints new TCAP tokens
Only callable by registered vaults
function mint(address to, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
to |
address |
The address to mint the tokens to |
amount |
uint256 |
The amount of tokens to mint |
Burns TCAP tokens
Only callable by registered vaults
function burn(address from, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
from |
address |
The address to burn the tokens from |
amount |
uint256 |
The amount of tokens to burn |
Sets the new oracle for the crypto marketcap
Only callable by the oracle setter
function setOracle(address newOracle) external;
Parameters
Name | Type | Description |
---|---|---|
newOracle |
address |
The new oracle address |
Returns the amount of TCAP tokens minted by a vault
function mintedAmount(address vault) external view returns (uint256);
function oracle() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> |
address |
The oracle of the crypto marketcap |
Defined as the value of the total crypto marketcap divided by the divisor
function latestPrice() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> |
uint256 |
The target price of the TCAP token |
function latestPriceOf(uint256 amount) external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> |
uint256 |
The price of a given amount of TCAP tokens |
Emitted when a vault mints TCAP tokens
event Minted(address indexed vault, address indexed recipient, uint256 amount);
Emitted when a vault burns TCAP tokens
event Burned(address indexed vault, address indexed recipient, uint256 amount);
Emitted when the oracle is updated
event OracleUpdated(address indexed newOracle);
Parameters
Name | Type | Description |
---|---|---|
newOracle |
address |
The new oracle address |
Thrown when a vault tries to burn more TCAP tokens than it has minted
error BalanceExceeded(address vault);