IPremiumsAccount
Interface for Premiums Account contracts.
Public Functions
policyCreated
function policyCreated(struct Policy.PolicyData policy) external
Adds a policy to the PremiumsAccount. Stores the pure premiums and locks the aditional funds from junior and senior eTokens.
Parameters
| Name | Type | Description |
|---|---|---|
| policy | struct Policy.PolicyData | The policy to add (created in this transaction) |
Pre-conditions
- Must be called by
policyPool()
Emits
- {EToken-SCRLocked}
policyReplaced
function policyReplaced(struct Policy.PolicyData oldPolicy, struct Policy.PolicyData newPolicy) external
Replaces a policy with another in PremiumsAccount. Stores the pure premiums difference and re-locks the aditional funds from junior and senior eTokens.
Parameters
| Name | Type | Description |
|---|---|---|
| oldPolicy | struct Policy.PolicyData | The policy to replace (created in a previous transaction) |
| newPolicy | struct Policy.PolicyData | The policy that will replace the old one (created in this transaction) |
Pre-conditions
- Must be called by
policyPool()
Emits
- {EToken-SCRUnlocked}
- {EToken-SCRLocked}
policyCancelled
function policyCancelled(struct Policy.PolicyData policyToCancel, uint256 purePremiumRefund, uint256 jrCocRefund, uint256 srCocRefund, address policyHolder) external
Reflects the cancellation of a policy, doing the required refunds.
Parameters
| Name | Type | Description |
|---|---|---|
| policyToCancel | struct Policy.PolicyData | The policy that is being cancelled |
| purePremiumRefund | uint256 | The pure premium amount that will be reimbursed to the policy holder |
| jrCocRefund | uint256 | The jrCoc that will be reimbursed to the policy holder |
| srCocRefund | uint256 | The srCoc that will be reimbursed to the policy holder |
| policyHolder | address | Owner of the policy that will receive the reimbursement |
Pre-conditions
- Must be called by
policyPool()
Emits
- {EToken-SCRUnlocked}
policyResolvedWithPayout
function policyResolvedWithPayout(address policyHolder, struct Policy.PolicyData policy, uint256 payout) external
The PremiumsAccount is notified that the policy was resolved and issues the payout to the policyHolder.
Parameters
| Name | Type | Description |
|---|---|---|
| policyHolder | address | The one that will receive the payout |
| policy | struct Policy.PolicyData | The policy that was resolved |
| payout | uint256 | The amount that has to be transferred to policyHolder |
Pre-conditions
- Must be called by
policyPool()
Emits
- {ERC20-Transfer}:
- `to == policyHolder`, `amount == payout`
- {EToken-InternalLoan}:
- optional, if a loan needs to be taken
- {EToken-SCRUnlocked}
policyExpired
function policyExpired(struct Policy.PolicyData policy) external
The PremiumsAccount is notified that the policy has expired, unlocks the SCR and earns the pure premium.
Parameters
| Name | Type | Description |
|---|---|---|
| policy | struct Policy.PolicyData | The policy that has expired |
Pre-conditions
- Must be called by
policyPool()
Emits
- {ERC20-Transfer}:
- `to == policyHolder`, `amount == payout`
- {EToken-InternalLoanRepaid}:
- optional, if a loan was taken before
seniorEtk
function seniorEtk() external view returns (contract IEToken)
The senior eToken, the secondary source of solvency, used if the premiums account is exhausted and junior too
juniorEtk
function juniorEtk() external view returns (contract IEToken)
The junior eToken, the primary source of solvency, used if the premiums account is exhausted.
etks
function etks() external view returns (contract IEToken juniorEtk, contract IEToken seniorEtk)
Returns the juniorEtk and seniorEtk. See {juniorEtk()} and {seniorEtk()}
purePremiums
function purePremiums() external view returns (uint256)
The total amount of premiums hold by this PremiumsAccount