InceptionVaultsDataProvider
This contract handles individual vaults state, base debt and vault related read functions.
Each user inception vault state is store in a InceptionVault
struct :
Param Name | Type | Description |
---|---|---|
| address | Vault owner |
| uint256 | Vault collateral balance |
| uint256 | Vault base debt (not including interests) |
| uint256 | Vault creation timestamp |
Write Methods
initialize(IInceptionVaultsCore inceptionVaultsCore, IAddressProvider addressProvider)
initialize(IInceptionVaultsCore inceptionVaultsCore, IAddressProvider addressProvider)
Initializer function to set state variables upon cloning.
Requirements :
Can only be called once
Param Name | Type | Description |
---|---|---|
|
|
|
|
|
|
createVault(address _owner)
createVault(address _owner)
Opens a new vault.
Requirements :
Can only be called by
InceptionVaultsCore
Param Name | Type | Description |
---|---|---|
| address | Owner of the new vault. |
setCollateralBalance(uint256 _vaultId, uint256 _balance)
setCollateralBalance(uint256 _vaultId, uint256 _balance)
Sets the collateral balance of a vault.
Requirements :
Can only be called by
InceptionVaultsCore
Param Name | Type | Description |
---|---|---|
| uint256 | Vault id of which the collateral balance will be updated |
| uint256 | New vault balance |
setBaseDebt(uint256 _vaultId, uint256 _newBaseDebt)
setBaseDebt(uint256 _vaultId, uint256 _newBaseDebt)
Sets the base debt of a vault.
Requirements :
Can only be called by
InceptionVaultsCore
Param Name | Type | Description |
---|---|---|
| uint256 | Vault ID of which the base debt will be updated |
| uint256 | New vault base debt |
View Methods
getA()
getA()
Returns the AddressProvider
address.
getInceptionVaultsCore()
getInceptionVaultsCore()
Returns the InceptionVaultsCore
address.
getInceptionVaultCount()
getInceptionVaultCount()
Returns the number of opened inception vaults.
getBaseDebt()
getBaseDebt()
Returns the total base debt.
vaultOwner(uint256 _id)
vaultOwner(uint256 _id)
Returns the owner of a specific vault.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | address | Vault owner |
vaultCollateralBalance(uint256 _id)
vaultCollateralBalance(uint256 _id)
Returns the collateral balance of a specific vault.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | uint256 | Vault collateral balance |
vaultBaseDebt(uint256 _id)
vaultBaseDebt(uint256 _id)
Returns the base debt of a specific vault.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | uint256 | Vault base debt |
vaultId(address _owner)
vaultId(address _owner)
Retrieves the vault id for a specified owner.
Call Params
Name | Type | Description |
---|---|---|
| address | Address of the owner of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | uint256 | Vault id |
vaultDebt(uint256 _id)
vaultDebt(uint256 _id)
Returns the debt of a specific vault.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | uint256 | Vault debt |
vaultExists(uint256 _id)
vaultExists(uint256 _id)
Checks if a specified vault exists.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | bool |
|
getVault(uint256 _id)
getVault(uint256 _id)
Returns a specific vault state.
Call Params
Name | Type | Description |
---|---|---|
| uint256 | The ID of the vault |
Return Value
Name | Type | Description |
---|---|---|
NA | struct |
|
Last updated