VaultTracker
Annotated source code of the VaultTracker.sol smart contract
VaultTracker
Contents
Globals
Note this list contains both internal and external attributes
Var | Type |
---|---|
vaults | mapping(address => struct VaultTracker.Vault) |
cTokenAddr | address |
marketPlace | address |
swivel | address |
maturity | uint256 |
maturityRate | uint256 |
protocol | uint8 |
Modifiers
authorized
Restricts msg.sender as the only viable caller of a method
Declaration
Functions
constructor
Declaration
Modifiers:
No modifiers
Args:
Arg | Type | Description |
---|---|---|
| uint8 | Maturity timestamp associated with this vault |
| uint256 | Compounding Token address associated with this vault |
| address | Address of the deployed swivel contract |
| address | Address of the designated admin, which is the Marketplace addess stored by the Creator contract |
addNotional
Adds notional to a given address
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| address | Address that owns a vault |
| uint256 | Amount of notional added |
removeNotional
Removes notional from a given address
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| address | Address that owns a vault |
| uint256 | Amount of notional to remove |
redeemInterest
Redeem's interest accrued by a given address
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| address | Address that owns a vault |
matureVault
Matures the vault
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| uint256 | The current cToken exchange rate |
transferNotionalFrom
Transfers notional from one address to another
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| address | Owner of the amount |
| address | Recipient of the amount |
| uint256 | Amount to transfer |
transferNotionalFee
Transfers, in notional, a fee payment to the Swivel contract without recalculating marginal interest for the owner
Declaration
Modifiers:
Modifier |
---|
authorized |
Args:
Arg | Type | Description |
---|---|---|
| address | Owner of the amount |
| uint256 | Amount to transfer |
rates
Return both the current maturityRate if it's > 0 (or exchangeRate in its place) and the Compounding exchange rate
While it may seem unnecessarily redundant to return the exchangeRate twice, it prevents many kludges that would otherwise be necessary to guard it
Declaration
Modifiers:
No modifiers
Returns:
Type | Description |
---|---|
| if maturityRate > 0, exchangeRate, exchangeRate if not. |
balancesOf
Returns both relevant balances for a given user's vault
Declaration
Modifiers:
No modifiers
Args:
Arg | Type | Description |
---|---|---|
| address | Address that owns a vault |