Insurance
Pays out Vault in case of default
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function EMERGENCY_ADMIN() external view returns (bytes32)
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function GOVERNANCE() external view returns (bytes32)
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function clearingHouse() external view returns (contract IClearingHouse)
ClearingHouse contract
Name | Type | Description |
---|---|---|
_0 | contract IClearingHouse | undefined |
function fundInsurance(uint256 amount) external nonpayable
Fund insurance. In case of bad debt, first recapitalize the Vault.
Name | Type | Description |
---|---|---|
amount | uint256 | Amount of UA tokens to be transfered |
function getRoleAdmin(bytes32 role) external view returns (bytes32)
Returns the admin role that controls
role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
Name | Type | Description |
---|---|---|
_0 | bytes32 | undefined |
function grantRole(bytes32 role, address account) external nonpayable
Grants
role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role. May emit a {RoleGranted} event.Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
function hasRole(bytes32 role, address account) external view returns (bool)
Returns
true
if account
has been granted role
.Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function isEmergencyAdmin(address account) external view returns (bool)
Name | Type | Description |
---|---|---|
account | address | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function isGovernor(address account) external view returns (bool)
Name | Type | Description |
---|---|---|
account | address | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function removeInsurance(uint256 amount) external nonpayable
Withdraw some amount from the Insurance
Name | Type | Description |
---|---|---|
amount | uint256 | UA amount to withdraw from the Insurance |
function renounceRole(bytes32 role, address account) external nonpayable
Revokes
role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
. May emit a {RoleRevoked} event.Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
function revokeRole(bytes32 role, address account) external nonpayable
Revokes
role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role. May emit a {RoleRevoked} event.Name | Type | Description |
---|---|---|
role | bytes32 | undefined |
account | address | undefined |
function setClearingHouse(contract IClearingHouse newClearingHouse) external nonpayable
Update the ClearingHouse
Name | Type | Description |
---|---|---|
newClearingHouse | contract IClearingHouse | Address of the new ClearingHouse |
function settleDebt(uint256 amount) external nonpayable
Settle bad debt in the Vault (in UA)
settleDebt
won't revert if the Insurance balance isn't large enough to cover the debt amount
, so from the point of view of the Vault it'll seem like the Insurance paid back the debt (while it's not). Yet Insurance will keep track of this accounting imbalance with the systemBadDebt
variable. The first action of the Insurance will be to spur this debt before adding new funds to the Insurance balance (see fundInsurance
).The UA amount transferred to the Vault is not assigned to any user's balance because the Vault cancels the debt of the individual user when calling
settleDebt
(see settleLiquidationOnCollaterals
).Name | Type | Description |
---|---|---|
amount | uint256 | Amount of tokens withdrawn for settlement |
function supportsInterface(bytes4 interfaceId) external view returns (bool)
See {IERC165-supportsInterface}.
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | undefined |
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
function systemBadDebt() external view returns (uint256)
Debt which could not be settled by insurance
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
function token() external view returns (contract IERC20Metadata)
Insurance token
Name | Type | Description |
---|---|---|
_0 | contract IERC20Metadata | undefined |
function vault() external view returns (contract IVault)
Vault contract
Name | Type | Description |
---|---|---|
_0 | contract IVault | undefined |
event ClearingHouseChanged(contract IClearingHouse newClearingHouse)
Emitted when a new ClearingHouse is connected to the issuer
Name | Type | Description |
---|---|---|
newClearingHouse | contract IClearingHouse | undefined |
event InsuranceRemoved(uint256 amount)
Emitted when some insurance reserves are withdrawn by governance
Name | Type | Description |
---|---|---|
amount | uint256 | undefined |
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
previousAdminRole indexed | bytes32 | undefined |
newAdminRole indexed | bytes32 | undefined |
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
Name | Type | Description |
---|---|---|
role indexed | bytes32 | undefined |
account indexed | address | undefined |
sender indexed | address | undefined |
event SystemDebtChanged(uint256 newSystemDebt)
Emitted when the system debt is updated, upwards or downwards
Name | Type | Description |
---|---|---|
newSystemDebt | uint256 | undefined |
error Insurance_ClearingHouseAlreadySet()
Emitted when the clearingHouse has already been set (one time call function)
error Insurance_ClearingHouseZeroAddress()
Emitted when the proposed clearingHouse address is equal to the zero address
error Insurance_InsufficientInsurance()
Emitted when locked insurance falls below insurance ratio
error Insurance_SenderNotClearingHouse()
Emitted when the sender is not the clearingHouse address
error Insurance_SenderNotVault()
Emitted when the sender is not the vault address
error Insurance_ZeroAddressConstructor(uint8 paramIndex)
Emitted when the zero address is provided as a parameter in the constructor
Name | Type | Description |
---|---|---|
paramIndex | uint8 | undefined |
error PRBMathSD59x18__MulInputTooSmall()
Emitted when one of the inputs is MIN_SD59x18.
error PRBMathSD59x18__MulOverflow(uint256 rAbs)
Emitted when the intermediary absolute result overflows SD59x18.
Name | Type | Description |
---|---|---|
rAbs | uint256 | undefined |
error PRBMath__MulDivFixedPointOverflow(uint256 prod1)
Emitted when the result overflows uint256.
Name | Type | Description |
---|---|---|
prod1 | uint256 | undefined |
Last modified 11mo ago