Insurance

Pays out Vault in case of default

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

EMERGENCY_ADMIN

function EMERGENCY_ADMIN() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

GOVERNANCE

function GOVERNANCE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

clearingHouse

ClearingHouse contract

Returns

Name
Type
Description

_0

contract IClearingHouse

undefined

fundInsurance

Fund insurance. In case of bad debt, first recapitalize the Vault.

Parameters

Name
Type
Description

amount

uint256

Amount of UA tokens to be transfered

getRoleAdmin

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

Name
Type
Description

role

bytes32

undefined

Returns

Name
Type
Description

_0

bytes32

undefined

grantRole

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.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

hasRole

Returns true if account has been granted role.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

isEmergencyAdmin

Parameters

Name
Type
Description

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

isGovernor

Parameters

Name
Type
Description

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

removeInsurance

Withdraw some amount from the Insurance

Parameters

Name
Type
Description

amount

uint256

UA amount to withdraw from the Insurance

renounceRole

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.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

revokeRole

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.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

setClearingHouse

Update the ClearingHouse

Parameters

Name
Type
Description

newClearingHouse

contract IClearingHouse

Address of the new ClearingHouse

settleDebt

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).

Parameters

Name
Type
Description

amount

uint256

Amount of tokens withdrawn for settlement

supportsInterface

See {IERC165-supportsInterface}.

Parameters

Name
Type
Description

interfaceId

bytes4

undefined

Returns

Name
Type
Description

_0

bool

undefined

systemBadDebt

Debt which could not be settled by insurance

Returns

Name
Type
Description

_0

uint256

undefined

token

Insurance token

Returns

Name
Type
Description

_0

contract IERC20Metadata

undefined

vault

Vault contract

Returns

Name
Type
Description

_0

contract IVault

undefined

Events

ClearingHouseChanged

Emitted when a new ClearingHouse is connected to the issuer

Parameters

Name
Type
Description

newClearingHouse

contract IClearingHouse

undefined

InsuranceRemoved

Emitted when some insurance reserves are withdrawn by governance

Parameters

Name
Type
Description

amount

uint256

undefined

RoleAdminChanged

Parameters

Name
Type
Description

role indexed

bytes32

undefined

previousAdminRole indexed

bytes32

undefined

newAdminRole indexed

bytes32

undefined

RoleGranted

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

RoleRevoked

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

SystemDebtChanged

Emitted when the system debt is updated, upwards or downwards

Parameters

Name
Type
Description

newSystemDebt

uint256

undefined

Errors

Insurance_ClearingHouseAlreadySet

Emitted when the clearingHouse has already been set (one time call function)

Insurance_ClearingHouseZeroAddress

Emitted when the proposed clearingHouse address is equal to the zero address

Insurance_InsufficientInsurance

Emitted when locked insurance falls below insurance ratio

Insurance_SenderNotClearingHouse

Emitted when the sender is not the clearingHouse address

Insurance_SenderNotVault

Emitted when the sender is not the vault address

Insurance_ZeroAddressConstructor

Emitted when the zero address is provided as a parameter in the constructor

Parameters

Name
Type
Description

paramIndex

uint8

undefined

PRBMathSD59x18__MulInputTooSmall

Emitted when one of the inputs is MIN_SD59x18.

PRBMathSD59x18__MulOverflow

Emitted when the intermediary absolute result overflows SD59x18.

Parameters

Name
Type
Description

rAbs

uint256

undefined

PRBMath__MulDivFixedPointOverflow

Emitted when the result overflows uint256.

Parameters

Name
Type
Description

prod1

uint256

undefined

Last updated