Vault.sol
Functions
balanceOf
Returns reserve balance of subject token.
function balanceOf(
address _subjectToken,
address _token
) external view returns (uint256 balance_)
Parameters
Name | Type | Description |
---|---|---|
_subjectToken | address | Subject token for which reserve is tracked. |
_token | address | Token in which reserve kept. |
Return Values
Name | Type | Description |
---|---|---|
balance_ | uint256 | Reserve balance. |
deposit
Deposit funds to reserve for a subject in a given token. Vault should be approved to spend. This function is only accessible to the deposit role.
function deposit(
address _subjectToken,
address _token,
uint256 _value
) external override onlyRole(DEPOSIT_ROLE)
Parameters
Name | Type | Description |
---|---|---|
_subjectToken | address | Subject token for which reserve is tracked. |
_token | address | Token in which reserve kept. |
_value | uint256 | Amount to deposit. |
transfer
Transfer funds from the vault. This function is only accessible to the transfer role.
function transfer(
address _subjectToken,
address _token,
address _to,
uint256 _value
) external override whenNotPaused onlyRole(TRANSFER_ROLE)
Parameters
Name | Type | Description |
---|---|---|
_subjectToken | address | Subject token for which reserve is tracked. |
_token | address | Address of deposit token of reserve. |
_to | address | To address of beneficiary. |
_value | uint256 | Amount to transfer. |