Skip to content

Latest commit

 

History

History
153 lines (94 loc) · 2.74 KB

interface.ITCAPV2.md

File metadata and controls

153 lines (94 loc) · 2.74 KB

ITCAPV2

Git Source

Inherits: IERC20, IAccessControl, IVersioned

TCAP v2 is an index token that is pegged to the entire crypto market cap

Functions

mint

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

burn

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

setOracle

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

mintedAmount

Returns the amount of TCAP tokens minted by a vault

function mintedAmount(address vault) external view returns (uint256);

oracle

function oracle() external view returns (address);

Returns

Name Type Description
<none> address The oracle of the crypto marketcap

latestPrice

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

latestPriceOf

function latestPriceOf(uint256 amount) external view returns (uint256);

Returns

Name Type Description
<none> uint256 The price of a given amount of TCAP tokens

Events

Minted

Emitted when a vault mints TCAP tokens

event Minted(address indexed vault, address indexed recipient, uint256 amount);

Burned

Emitted when a vault burns TCAP tokens

event Burned(address indexed vault, address indexed recipient, uint256 amount);

OracleUpdated

Emitted when the oracle is updated

event OracleUpdated(address indexed newOracle);

Parameters

Name Type Description
newOracle address The new oracle address

Errors

BalanceExceeded

Thrown when a vault tries to burn more TCAP tokens than it has minted

error BalanceExceeded(address vault);