IBasicActions
Inherits: ICommonActions
Functions
openSAFE
Opens a brand new SAFE
function openSAFE(address _manager, bytes32 _cType, address _usr) external returns (uint256 _safeId);
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_cType | bytes32 | Bytes32 representing the collateral type |
_usr | address | Address of the SAFE owner |
Returns
Name | Type | Description |
---|---|---|
_safeId | uint256 | Id of the created SAFE |
generateDebt
Generates debt and sends COIN amount to msg.sender
function generateDebt(
address _manager,
address _taxCollector,
address _coinJoin,
uint256 _safeId,
uint256 _deltaWad
) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_coinJoin | address | Address of the CoinJoin contract |
_safeId | uint256 | Id of the SAFE |
_deltaWad | uint256 | Amount of COIN to generate [wad] |
repayDebt
Repays an amount of debt
function repayDebt(
address _manager,
address _taxCollector,
address _coinJoin,
uint256 _safeId,
uint256 _deltaWad
) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_coinJoin | address | Address of the CoinJoin contract |
_safeId | uint256 | Id of the SAFE |
_deltaWad | uint256 | Amount of COIN to repay [wad] |
lockTokenCollateral
Locks a collateral token amount in the SAFE
function lockTokenCollateral(address _manager, address _collateralJoin, uint256 _safeId, uint256 _deltaWad) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_safeId | uint256 | Id of the SAFE |
_deltaWad | uint256 | Amount of collateral to collateralize [wad] |
freeTokenCollateral
Unlocks a collateral token amount from the SAFE, and transfers the ERC20 collateral to the user's address
function freeTokenCollateral(address _manager, address _collateralJoin, uint256 _safeId, uint256 _deltaWad) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_safeId | uint256 | Id of the SAFE |
_deltaWad | uint256 | Amount of collateral to free [wad] |
repayAllDebt
Repays the total amount of debt of a SAFE
This method is used to close a SAFE's debt, when the amount of debt is increasing due to stability fees
function repayAllDebt(address _manager, address _taxCollector, address _coinJoin, uint256 _safeId) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_coinJoin | address | Address of the CoinJoin contract |
_safeId | uint256 | Id of the SAFE |
lockTokenCollateralAndGenerateDebt
Locks a collateral token amount in the SAFE and generates debt
function lockTokenCollateralAndGenerateDebt(
address _manager,
address _taxCollector,
address _collateralJoin,
address _coinJoin,
uint256 _safe,
uint256 _collateralAmount,
uint256 _deltaWad
) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_coinJoin | address | Address of the CoinJoin contract |
_safe | uint256 | Id of the SAFE |
_collateralAmount | uint256 | Amount of collateral to collateralize [wad] |
_deltaWad | uint256 | Amount of COIN to generate [wad] |
openLockTokenCollateralAndGenerateDebt
Creates a SAFE, locks a collateral token amount in it and generates debt
function openLockTokenCollateralAndGenerateDebt(
address _manager,
address _taxCollector,
address _collateralJoin,
address _coinJoin,
bytes32 _cType,
uint256 _collateralAmount,
uint256 _deltaWad
) external returns (uint256 _safe);
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_coinJoin | address | Address of the CoinJoin contract |
_cType | bytes32 | Bytes32 representing the collateral type |
_collateralAmount | uint256 | Amount of collateral to collateralize [wad] |
_deltaWad | uint256 | Amount of COIN to generate [wad] |
Returns
Name | Type | Description |
---|---|---|
_safe | uint256 | Id of the created SAFE |
repayDebtAndFreeTokenCollateral
Repays debt and unlocks a collateral token amount from the SAFE
function repayDebtAndFreeTokenCollateral(
address _manager,
address _taxCollector,
address _collateralJoin,
address _coinJoin,
uint256 _safeId,
uint256 _collateralWad,
uint256 _debtWad
) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_coinJoin | address | Address of the CoinJoin contract |
_safeId | uint256 | Id of the SAFE |
_collateralWad | uint256 | Amount of collateral to free [wad] |
_debtWad | uint256 | Amount of COIN to repay [wad] |
repayAllDebtAndFreeTokenCollateral
Repays all debt and unlocks collateral from the SAFE
function repayAllDebtAndFreeTokenCollateral(
address _manager,
address _taxCollector,
address _collateralJoin,
address _coinJoin,
uint256 _safeId,
uint256 _collateralWad
) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_taxCollector | address | Address of the TaxCollector contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_coinJoin | address | Address of the CoinJoin contract |
_safeId | uint256 | Id of the SAFE |
_collateralWad | uint256 | Amount of collateral to free [wad] |
collectTokenCollateral
Collects a collateral token amount from the SAFE handler, and transfers the ERC20 collateral to the user's address
function collectTokenCollateral(address _manager, address _collateralJoin, uint256 _safeId, uint256 _deltaWad) external;
Parameters
Name | Type | Description |
---|---|---|
_manager | address | Address of the HaiSafeManager contract |
_collateralJoin | address | Address of the CollateralJoin contract |
_safeId | uint256 | Id of the SAFE |
_deltaWad | uint256 | Amount of collateral to collect [wad] |