Insurance
Pays out Vault in case of default
Methods
DEFAULT_ADMIN_ROLE
Returns
_0
bytes32
undefined
EMERGENCY_ADMIN
Returns
_0
bytes32
undefined
GOVERNANCE
Returns
_0
bytes32
undefined
clearingHouse
ClearingHouse contract
Returns
_0
contract IClearingHouse
undefined
fundInsurance
Fund insurance. In case of bad debt, first recapitalize the Vault.
Parameters
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
role
bytes32
undefined
Returns
_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
role
bytes32
undefined
account
address
undefined
hasRole
Returns true
if account
has been granted role
.
Parameters
role
bytes32
undefined
account
address
undefined
Returns
_0
bool
undefined
isEmergencyAdmin
Parameters
account
address
undefined
Returns
_0
bool
undefined
isGovernor
Parameters
account
address
undefined
Returns
_0
bool
undefined
removeInsurance
Withdraw some amount from the Insurance
Parameters
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
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
role
bytes32
undefined
account
address
undefined
setClearingHouse
Update the ClearingHouse
Parameters
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
amount
uint256
Amount of tokens withdrawn for settlement
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
systemBadDebt
Debt which could not be settled by insurance
Returns
_0
uint256
undefined
token
Insurance token
Returns
_0
contract IERC20Metadata
undefined
vault
Vault contract
Returns
_0
contract IVault
undefined
Events
ClearingHouseChanged
Emitted when a new ClearingHouse is connected to the issuer
Parameters
newClearingHouse
contract IClearingHouse
undefined
InsuranceRemoved
Emitted when some insurance reserves are withdrawn by governance
Parameters
amount
uint256
undefined
RoleAdminChanged
Parameters
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
RoleGranted
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
RoleRevoked
Parameters
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
SystemDebtChanged
Emitted when the system debt is updated, upwards or downwards
Parameters
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
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
rAbs
uint256
undefined
PRBMath__MulDivFixedPointOverflow
Emitted when the result overflows uint256.
Parameters
prod1
uint256
undefined
Last updated