Product

Contains interfaces and contracts related to products.

Contracts

IProductComponent

import "@etherisc/gif-next/contracts/product/IProductComponent.sol";
Functions
  • [registerComponent(component)]

  • [processFundedClaim(policyNftId, claimId, availableAmount)]

  • [calculatePremium(sumInsuredAmount, riskId, lifetime, applicationData, bundleNftId, referralId)]

  • [calculateNetPremium(sumInsuredAmount, riskId, lifetime, applicationData)]

  • [getInitialProductInfo()]

  • [getInitialFeeInfo()]

IInstanceLinkedComponent
  • [withdrawFees(amount)]

  • [getInstance()]

IAuthorizedComponent
  • [getAuthorization()]

IComponent
  • [getName()]

  • [getToken()]

  • [getTokenHandler()]

  • [getWallet()]

  • [isNftInterceptor()]

  • [isRegistered()]

  • [getComponentInfo()]

  • [getInitialComponentInfo()]

ITransferInterceptor
  • [nftTransferFrom(from, to, tokenId, operator)]

IRegisterable
  • [isActive()]

  • [getInitialInfo()]

IRelease
  • [getRelease()]

INftOwnable
  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

IRegistryLinked
  • [getRegistry()]

IERC165
  • [supportsInterface(interfaceId)]

IAccessManaged
  • [authority()]

  • [setAuthority()]

  • [isConsumingScheduledOp()]

Events
IComponent
  • [LogComponentWalletAddressChanged(oldWallet, newWallet)]

  • [LogComponentWalletTokensTransferred(from, to, amount)]

  • [LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

registerComponent(address component) → NftId componentNftId external

processFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount) external

Callback function to inform product compnent about arrival of funding for a claim. The callback is called by the pool service after the corresponding pool triggers this function. The callback is only called when the product’s property isProcessingFundedClaims is set.

calculatePremium(Amount sumInsuredAmount, RiskId riskId, Seconds lifetime, bytes applicationData, NftId bundleNftId, ReferralId referralId) → Amount premiumAmount external

Calculates the premium amount for the provided application data. The returned premium amounts takes into account potential discounts and fees.

calculateNetPremium(Amount sumInsuredAmount, RiskId riskId, Seconds lifetime, bytes applicationData) → Amount netPremiumAmount external

Calculates the net premium amount for the provided application data. The returned net premium amounts only covers the cost of collateralizing the application. This amount purely depends on the use case specific risk and does not include any fees/commission.

getInitialProductInfo() → struct IComponents.ProductInfo info external

returns initial product specific infos

getInitialFeeInfo() → struct IComponents.FeeInfo info external

returns initial fee infos

IApplicationService

import "@etherisc/gif-next/contracts/product/IApplicationService.sol";

gif service responsible for creating applications only product components may call transaction functions

Functions
  • [create(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)]

  • [adjust(applicationNftId, riskId, bundleNftId, referralId, sumInsuredAmount, lifetime, applicationData)]

  • [renew(policyNftId, bundleNftId)]

  • [revoke(policyNftId)]

IService
  • [getDomain()]

  • [getRoleId()]

IVersionable
  • [initializeVersionable(activatedBy, activationData)]

  • [upgradeVersionable(upgradeData)]

  • [getVersion()]

IRegisterable
  • [isActive()]

  • [getInitialInfo()]

IRelease
  • [getRelease()]

INftOwnable
  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

IRegistryLinked
  • [getRegistry()]

IERC165
  • [supportsInterface(interfaceId)]

IAccessManaged
  • [authority()]

  • [setAuthority()]

  • [isConsumingScheduledOp()]

Events
  • [LogApplicationServiceApplicationCreated(applicationNftId, productNftId, bundleNftId, riskId, referralId, applicationOwner, sumInsuredAmount, premiumAmount, lifetime)]

  • [LogApplicationServiceApplicationRenewed(policyNftId, bundleNftId)]

  • [LogApplicationServiceApplicationAdjusted(applicationNftId, bundleNftId, riskId, referralId, sumInsuredAmount, lifetime)]

  • [LogApplicationServiceApplicationRevoked(applicationNftId)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

create(address applicationOwner, RiskId riskId, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime, NftId bundleNftId, ReferralId referralId, bytes applicationData) → NftId applicationNftId external

creates a new application based on the specified attributes may only be called by a product component

adjust(NftId applicationNftId, RiskId riskId, NftId bundleNftId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime, bytes applicationData) external

updates application attributes may only be called while the application is in applied state may only be called by the referenced product related to applicationNftId

renew(NftId policyNftId, NftId bundleNftId) → NftId applicationNftId external

creates a new application that extends the provided policy lifetime will seamlessly extend referenced policy, for closed policies lifetime will start at underwriting time product will need to limit the time window for renewal as underwriting will lock the collateral at underwriting time which might be earlier than activation time policyNftId needs to refer to an underwritten (or active or closed) policy may only be called by the referenced product related to policyNftId

revoke(NftId policyNftId) external

revokes the application represented by {policyNftId} an application can only be revoked in applied state only the application holder may revoke an application

LogApplicationServiceApplicationCreated(NftId applicationNftId, NftId productNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, address applicationOwner, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime) event

LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId) event

LogApplicationServiceApplicationAdjusted(NftId applicationNftId, NftId bundleNftId, RiskId riskId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime) event

LogApplicationServiceApplicationRevoked(NftId applicationNftId) event

IPricingService

import "@etherisc/gif-next/contracts/product/IPricingService.sol";
Functions
  • [calculatePremium(productNftId, riskId, sumInsuredAmount, lifetime, applicationData, bundleNftId, referralId)]

IService
  • [getDomain()]

  • [getRoleId()]

IVersionable
  • [initializeVersionable(activatedBy, activationData)]

  • [upgradeVersionable(upgradeData)]

  • [getVersion()]

IRegisterable
  • [isActive()]

  • [getInitialInfo()]

IRelease
  • [getRelease()]

INftOwnable
  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

IRegistryLinked
  • [getRegistry()]

IERC165
  • [supportsInterface(interfaceId)]

IAccessManaged
  • [authority()]

  • [setAuthority()]

  • [isConsumingScheduledOp()]

Events
INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

calculatePremium(NftId productNftId, RiskId riskId, Amount sumInsuredAmount, Seconds lifetime, bytes applicationData, NftId bundleNftId, ReferralId referralId) → struct IPolicy.PremiumInfo premium external

Product

import "@etherisc/gif-next/contracts/product/Product.sol";
Functions
  • [registerComponent(component)]

  • [processFundedClaim(policyNftId, claimId, availableAmount)]

  • [calculatePremium(sumInsuredAmount, riskId, lifetime, applicationData, bundleNftId, referralId)]

  • [calculateNetPremium(sumInsuredAmount, , , )]

  • [getInitialProductInfo()]

  • [getInitialFeeInfo()]

  • [__Product_init(registry, instanceNftId, name, productInfo, feeInfo, authorization, initialOwner)]

  • [_setFees(productFee, processingFee)]

  • [_createRisk(id, data)]

  • [_updateRisk(id, data)]

  • [_setRiskLocked(id, locked)]

  • [_closeRisk(id)]

  • [_createApplication(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)]

  • [_revoke(applicationNftId)]

  • [_createPolicy(applicationNftId, activateAt, maxPremiumAmount)]

  • [_decline(policyNftId)]

  • [_expire(policyNftId, expireAt)]

  • [_adjustActivation(policyNftId, activateAt)]

  • [_collectPremium(policyNftId, activateAt)]

  • [_activate(policyNftId, activateAt)]

  • [_close(policyNftId)]

  • [_submitClaim(policyNftId, claimAmount, claimData)]

  • [_revokeClaim(policyNftId, claimId)]

  • [_confirmClaim(policyNftId, claimId, confirmedAmount, data)]

  • [_declineClaim(policyNftId, claimId, data)]

  • [_cancelConfirmedClaim(policyNftId, claimId)]

  • [_createPayout(policyNftId, claimId, amount, data)]

  • [_createPayoutForBeneficiary(policyNftId, claimId, amount, beneficiary, data)]

  • [_processPayout(policyNftId, payoutId)]

  • [_cancelPayout(policyNftId, payoutId)]

  • [_getProductStorage()]

InstanceLinkedComponent
  • [getInstance()]

  • [getAuthorization()]

  • [withdrawFees(amount)]

  • [_sendRequest(oracleNftId, requestData, expiryAt, callbackMethod)]

  • [_cancelRequest(requestId)]

  • [_resendRequest(requestId)]

  • [__InstanceLinkedComponent_init(registry, parentNftId, name, componentType, authorization, isInterceptor, initialOwner)]

  • [_checkAndGetInstanceNftId(registryAddress, parentNftId, componentType)]

  • [_checkAndGetRegistry(registryAddress, objectNftId, requiredType)]

  • [_setWallet(newWallet)]

  • [_getComponentInfo()]

  • [_getInstanceReader()]

  • [_withdrawFees(amount)]

Component
  • [__Component_init(authority, registry, parentNftId, name, componentType, isInterceptor, initialOwner, registryData)]

  • [nftTransferFrom(from, to, tokenId, operator)]

  • [getWallet()]

  • [getTokenHandler()]

  • [getToken()]

  • [getName()]

  • [getVersion()]

  • [getComponentInfo()]

  • [getInitialComponentInfo()]

  • [isNftInterceptor()]

  • [isRegistered()]

  • [_approveTokenHandler(token, amount)]

  • [_nftTransferFrom(from, to, tokenId, operator)]

  • [_setLocked(locked)]

  • [_getServiceAddress(domain)]

Registerable
  • [__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)]

  • [isActive()]

  • [getRelease()]

  • [getInitialInfo()]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IComponent
  • [LogComponentWalletAddressChanged(oldWallet, newWallet)]

  • [LogComponentWalletTokensTransferred(from, to, amount)]

  • [LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

registerComponent(address component) → NftId componentNftId external

processFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount) external

Callback function to inform product compnent about arrival of funding for a claim. The callback is called by the pool service after the corresponding pool triggers this function. The callback is only called when the product’s property isProcessingFundedClaims is set.

calculatePremium(Amount sumInsuredAmount, RiskId riskId, Seconds lifetime, bytes applicationData, NftId bundleNftId, ReferralId referralId) → Amount premiumAmount public

Calculates the premium amount for the provided application data. The returned premium amounts takes into account potential discounts and fees.

calculateNetPremium(Amount sumInsuredAmount, RiskId, Seconds, bytes) → Amount netPremiumAmount external

getInitialProductInfo() → struct IComponents.ProductInfo poolInfo public

returns initial product specific infos

getInitialFeeInfo() → struct IComponents.FeeInfo feeInfo public

returns initial fee infos

__Product_init(address registry, NftId instanceNftId, string name, struct IComponents.ProductInfo productInfo, struct IComponents.FeeInfo feeInfo, contract IAuthorization authorization, address initialOwner) internal

_setFees(struct Fee productFee, struct Fee processingFee) internal

_createRisk(bytes32 id, bytes data) → RiskId riskId internal

_updateRisk(RiskId id, bytes data) internal

_setRiskLocked(RiskId id, bool locked) internal

_closeRisk(RiskId id) internal

_createApplication(address applicationOwner, RiskId riskId, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime, NftId bundleNftId, ReferralId referralId, bytes applicationData) → NftId applicationNftId internal

_revoke(NftId applicationNftId) internal

_createPolicy(NftId applicationNftId, Timestamp activateAt, Amount maxPremiumAmount) → Amount premiumAmount internal

_decline(NftId policyNftId) internal

_expire(NftId policyNftId, Timestamp expireAt) → Timestamp expiredAt internal

_adjustActivation(NftId policyNftId, Timestamp activateAt) internal

adjust the activation date of the policy. The policy must already have an activation date set. Allowed values are from the current blocktime to the expiration date of the policy.

_collectPremium(NftId policyNftId, Timestamp activateAt) internal

_activate(NftId policyNftId, Timestamp activateAt) internal

_close(NftId policyNftId) internal

_submitClaim(NftId policyNftId, Amount claimAmount, bytes claimData) → ClaimId internal

_revokeClaim(NftId policyNftId, ClaimId claimId) internal

_confirmClaim(NftId policyNftId, ClaimId claimId, Amount confirmedAmount, bytes data) internal

_declineClaim(NftId policyNftId, ClaimId claimId, bytes data) internal

_cancelConfirmedClaim(NftId policyNftId, ClaimId claimId) internal

_createPayout(NftId policyNftId, ClaimId claimId, Amount amount, bytes data) → PayoutId internal

_createPayoutForBeneficiary(NftId policyNftId, ClaimId claimId, Amount amount, address beneficiary, bytes data) → PayoutId internal

_processPayout(NftId policyNftId, PayoutId payoutId) → Amount netPayoutAmount, Amount processingFeeAmount internal

_cancelPayout(NftId policyNftId, PayoutId payoutId) internal

_getProductStorage() → struct Product.ProductStorage $ internal

BasicProduct

import "@etherisc/gif-next/contracts/product/BasicProduct.sol";
Functions
  • [setFees(productFee, processingFee)]

  • [_initializeBasicProduct(registry, instanceNftId, name, productInfo, feeInfo, authorization, initialOwner)]

Product
  • [registerComponent(component)]

  • [processFundedClaim(policyNftId, claimId, availableAmount)]

  • [calculatePremium(sumInsuredAmount, riskId, lifetime, applicationData, bundleNftId, referralId)]

  • [calculateNetPremium(sumInsuredAmount, , , )]

  • [getInitialProductInfo()]

  • [getInitialFeeInfo()]

  • [__Product_init(registry, instanceNftId, name, productInfo, feeInfo, authorization, initialOwner)]

  • [_setFees(productFee, processingFee)]

  • [_createRisk(id, data)]

  • [_updateRisk(id, data)]

  • [_setRiskLocked(id, locked)]

  • [_closeRisk(id)]

  • [_createApplication(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)]

  • [_revoke(applicationNftId)]

  • [_createPolicy(applicationNftId, activateAt, maxPremiumAmount)]

  • [_decline(policyNftId)]

  • [_expire(policyNftId, expireAt)]

  • [_adjustActivation(policyNftId, activateAt)]

  • [_collectPremium(policyNftId, activateAt)]

  • [_activate(policyNftId, activateAt)]

  • [_close(policyNftId)]

  • [_submitClaim(policyNftId, claimAmount, claimData)]

  • [_revokeClaim(policyNftId, claimId)]

  • [_confirmClaim(policyNftId, claimId, confirmedAmount, data)]

  • [_declineClaim(policyNftId, claimId, data)]

  • [_cancelConfirmedClaim(policyNftId, claimId)]

  • [_createPayout(policyNftId, claimId, amount, data)]

  • [_createPayoutForBeneficiary(policyNftId, claimId, amount, beneficiary, data)]

  • [_processPayout(policyNftId, payoutId)]

  • [_cancelPayout(policyNftId, payoutId)]

  • [_getProductStorage()]

InstanceLinkedComponent
  • [getInstance()]

  • [getAuthorization()]

  • [withdrawFees(amount)]

  • [_sendRequest(oracleNftId, requestData, expiryAt, callbackMethod)]

  • [_cancelRequest(requestId)]

  • [_resendRequest(requestId)]

  • [__InstanceLinkedComponent_init(registry, parentNftId, name, componentType, authorization, isInterceptor, initialOwner)]

  • [_checkAndGetInstanceNftId(registryAddress, parentNftId, componentType)]

  • [_checkAndGetRegistry(registryAddress, objectNftId, requiredType)]

  • [_setWallet(newWallet)]

  • [_getComponentInfo()]

  • [_getInstanceReader()]

  • [_withdrawFees(amount)]

Component
  • [__Component_init(authority, registry, parentNftId, name, componentType, isInterceptor, initialOwner, registryData)]

  • [nftTransferFrom(from, to, tokenId, operator)]

  • [getWallet()]

  • [getTokenHandler()]

  • [getToken()]

  • [getName()]

  • [getVersion()]

  • [getComponentInfo()]

  • [getInitialComponentInfo()]

  • [isNftInterceptor()]

  • [isRegistered()]

  • [_approveTokenHandler(token, amount)]

  • [_nftTransferFrom(from, to, tokenId, operator)]

  • [_setLocked(locked)]

  • [_getServiceAddress(domain)]

Registerable
  • [__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)]

  • [isActive()]

  • [getRelease()]

  • [getInitialInfo()]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IComponent
  • [LogComponentWalletAddressChanged(oldWallet, newWallet)]

  • [LogComponentWalletTokensTransferred(from, to, amount)]

  • [LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

setFees(struct Fee productFee, struct Fee processingFee) external

_initializeBasicProduct(address registry, NftId instanceNftId, string name, struct IComponents.ProductInfo productInfo, struct IComponents.FeeInfo feeInfo, contract IAuthorization authorization, address initialOwner) internal

BasicProductAuthorization

import "@etherisc/gif-next/contracts/product/BasicProductAuthorization.sol";
Functions
  • [constructor(componentName)]

  • [_setupServiceTargets()]

  • [_setupTokenHandlerAuthorizations()]

  • [_setupTargetAuthorizations()]

Authorization
  • [getTokenHandlerName()]

  • [getTokenHandlerTarget()]

  • [getTarget(targetName)]

  • [getTargets()]

  • [targetExists(target)]

  • [_setupTargets()]

  • [_setupRoles()]

  • [_addCustomRole(roleId, adminRoleId, maxMemberCount, name)]

  • [_addGifTarget(contractName)]

  • [_addInstanceTarget(contractName)]

  • [_addTarget(name)]

  • [_toTargetRoleId(targetDomain)]

  • [_toTargetRoleName(targetName)]

ServiceAuthorization
  • [getDomain()]

  • [getRelease()]

  • [getCommitHash()]

  • [getMainTargetName()]

  • [getMainTarget()]

  • [getServiceDomains()]

  • [getServiceDomain(idx)]

  • [getServiceTarget(serviceDomain)]

  • [getServiceRole(serviceDomain)]

  • [getServiceAddress(serviceDomain)]

  • [getTargetRole(target)]

  • [roleExists(roleId)]

  • [getRoles()]

  • [getRoleInfo(roleId)]

  • [getRoleName(roleId)]

  • [getAuthorizedRoles(target)]

  • [getAuthorizedFunctions(target, roleId)]

  • [_setupDomains()]

  • [_setupDomainAuthorizations()]

  • [_authorizeServiceDomain(serviceDomain, serviceAddress)]

  • [_addTargetWithRole(targetName, roleId, roleName)]

  • [_addRole(roleId, info)]

  • [_authorizeForService(serviceDomain, authorizedDomain)]

  • [_authorizeForTarget(target, authorizedRoleId)]

  • [_authorize(functions, selector, name)]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
Initializable
  • [Initialized(version)]

constructor(string componentName) public

_setupServiceTargets() internal

Sets up the relevant service targets for the component. Overwrite this function for use case specific authorizations.

_setupTokenHandlerAuthorizations() internal

Sets up the relevant component’s token handler authorizations. Overwrite this function for use case specific authorizations.

_setupTargetAuthorizations() internal

Sets up the relevant target authorizations for the component. Overwrite this function for use case specific authorizations.

ApplicationService

import "@etherisc/gif-next/contracts/product/ApplicationService.sol";
Functions
  • [_initialize(owner, data)]

  • [_checkLinkedApplicationParameters(instanceReader, productNftId, riskId, referralId, bundleNftId)]

  • [_registerApplication(productNftId, applicationOwner)]

  • [_calculatePremiumAmount(info)]

  • [create(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)]

  • [_emitApplicationCreatedEvent(applicationNftId, applicationOwner, applicationInfo)]

  • [_createApplicationInfo(productNftId, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)]

  • [renew(policyNftId, bundleNftId)]

  • [adjust(applicationNftId, riskId, bundleNftId, referralId, sumInsuredAmount, lifetime, applicationData)]

  • [revoke(applicationNftId)]

  • [_getAndVerifyActiveProduct()]

  • [_getDomain()]

Service
  • [__Service_init(authority, registry, initialOwner)]

  • [getDomain()]

  • [getVersion()]

  • [getRoleId()]

  • [_getServiceAddress(domain)]

ReentrancyGuardUpgradeable
  • [__ReentrancyGuard_init()]

  • [__ReentrancyGuard_init_unchained()]

  • [_reentrancyGuardEntered()]

Versionable
  • [initializeVersionable(activatedBy, data)]

  • [upgradeVersionable(data)]

  • [_upgrade(data)]

Registerable
  • [__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)]

  • [isActive()]

  • [getRelease()]

  • [getInitialInfo()]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IApplicationService
  • [LogApplicationServiceApplicationCreated(applicationNftId, productNftId, bundleNftId, riskId, referralId, applicationOwner, sumInsuredAmount, premiumAmount, lifetime)]

  • [LogApplicationServiceApplicationRenewed(policyNftId, bundleNftId)]

  • [LogApplicationServiceApplicationAdjusted(applicationNftId, bundleNftId, riskId, referralId, sumInsuredAmount, lifetime)]

  • [LogApplicationServiceApplicationRevoked(applicationNftId)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

_initialize(address owner, bytes data) internal

_checkLinkedApplicationParameters(contract InstanceReader instanceReader, NftId productNftId, RiskId riskId, ReferralId referralId, NftId bundleNftId) internal

_registerApplication(NftId productNftId, address applicationOwner) → NftId applicationNftId internal

_calculatePremiumAmount(struct IPolicy.PolicyInfo info) → Amount premiumAmount internal

create(address applicationOwner, RiskId riskId, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime, NftId bundleNftId, ReferralId referralId, bytes applicationData) → NftId applicationNftId external

creates a new application based on the specified attributes may only be called by a product component

_emitApplicationCreatedEvent(NftId applicationNftId, address applicationOwner, struct IPolicy.PolicyInfo applicationInfo) internal

_createApplicationInfo(NftId productNftId, RiskId riskId, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime, NftId bundleNftId, ReferralId referralId, bytes applicationData) → struct IPolicy.PolicyInfo applicationInfo internal

renew(NftId policyNftId, NftId bundleNftId) → NftId applicationNftId external

creates a new application that extends the provided policy lifetime will seamlessly extend referenced policy, for closed policies lifetime will start at underwriting time product will need to limit the time window for renewal as underwriting will lock the collateral at underwriting time which might be earlier than activation time policyNftId needs to refer to an underwritten (or active or closed) policy may only be called by the referenced product related to policyNftId

adjust(NftId applicationNftId, RiskId riskId, NftId bundleNftId, ReferralId referralId, Amount sumInsuredAmount, Seconds lifetime, bytes applicationData) external

updates application attributes may only be called while the application is in applied state may only be called by the referenced product related to applicationNftId

revoke(NftId applicationNftId) external

_getAndVerifyActiveProduct() → NftId productNftId, contract IInstance instance internal

_getDomain() → ObjectType internal

PricingService

import "@etherisc/gif-next/contracts/product/PricingService.sol";
Functions
  • [_initialize(owner, data)]

  • [calculatePremium(productNftId, riskId, sumInsuredAmount, lifetime, applicationData, bundleNftId, referralId)]

  • [_getFixedFeeAmounts(netPremiumAmount, feeInfo, bundleInfo)]

  • [_calculateVariableFeeAmounts(premium, feeInfo, bundleInfo)]

  • [_calculateDistributionOwnerFeeAmount(premium, feeInfo, distributionNftId, referralId, reader)]

  • [_calculateTargetWalletAmounts(premium)]

  • [_getDomain()]

Service
  • [__Service_init(authority, registry, initialOwner)]

  • [getDomain()]

  • [getVersion()]

  • [getRoleId()]

  • [_getServiceAddress(domain)]

ReentrancyGuardUpgradeable
  • [__ReentrancyGuard_init()]

  • [__ReentrancyGuard_init_unchained()]

  • [_reentrancyGuardEntered()]

Versionable
  • [initializeVersionable(activatedBy, data)]

  • [upgradeVersionable(data)]

  • [_upgrade(data)]

Registerable
  • [__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)]

  • [isActive()]

  • [getRelease()]

  • [getInitialInfo()]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

_initialize(address owner, bytes data) internal

calculatePremium(NftId productNftId, RiskId riskId, Amount sumInsuredAmount, Seconds lifetime, bytes applicationData, NftId bundleNftId, ReferralId referralId) → struct IPolicy.PremiumInfo premium external

calculates the premium amount for the specified attributes also returns the various fee components involved with creating a policy

_getFixedFeeAmounts(Amount netPremiumAmount, struct IComponents.FeeInfo feeInfo, struct IBundle.BundleInfo bundleInfo) → struct IPolicy.PremiumInfo premium internal

_calculateVariableFeeAmounts(struct IPolicy.PremiumInfo premium, struct IComponents.FeeInfo feeInfo, struct IBundle.BundleInfo bundleInfo) → struct IPolicy.PremiumInfo intermadiatePremium internal

_calculateDistributionOwnerFeeAmount(struct IPolicy.PremiumInfo premium, struct IComponents.FeeInfo feeInfo, NftId distributionNftId, ReferralId referralId, contract InstanceReader reader) → struct IPolicy.PremiumInfo finalPremium internal

_calculateTargetWalletAmounts(struct IPolicy.PremiumInfo premium) → struct IPolicy.PremiumInfo premiumWithTargetWalletAmounts internal

_getDomain() → ObjectType internal

ClaimService

import "@etherisc/gif-next/contracts/product/ClaimService.sol";
Functions
  • [_initialize(owner, data)]

  • [submit(policyNftId, claimAmount, claimData)]

  • [confirm(policyNftId, claimId, confirmedAmount, data)]

  • [decline(policyNftId, claimId, data)]

  • [revoke(policyNftId, claimId)]

  • [cancelConfirmedClaim(policyNftId, claimId)]

  • [createPayoutForBeneficiary(policyNftId, claimId, amount, beneficiary, data)]

  • [createPayout(policyNftId, claimId, amount, data)]

  • [processPayout(policyNftId, payoutId)]

  • [cancelPayout(policyNftId, payoutId)]

  • [_checkClaimAmount(policyNftId, policyInfo, claimAmount)]

  • [_createPayout(policyNftId, claimId, amount, beneficiary, data)]

  • [_verifyCallerWithPolicy(policyNftId)]

  • [_getAndVerifyActiveProduct()]

  • [_verifyClaim(instanceReader, policyNftId, claimId, expectedState)]

  • [_processConfirmedClaimByPool(instanceReader, productNftId, policyNftId, claimId, amount)]

  • [_policyHolderClaimConfirmed(policyNftId, claimId, confirmedAmount)]

  • [_getPolicyHolder(policyNftId)]

  • [_getDomain()]

Service
  • [__Service_init(authority, registry, initialOwner)]

  • [getDomain()]

  • [getVersion()]

  • [getRoleId()]

  • [_getServiceAddress(domain)]

ReentrancyGuardUpgradeable
  • [__ReentrancyGuard_init()]

  • [__ReentrancyGuard_init_unchained()]

  • [_reentrancyGuardEntered()]

Versionable
  • [initializeVersionable(activatedBy, data)]

  • [upgradeVersionable(data)]

  • [_upgrade(data)]

Registerable
  • [__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)]

  • [isActive()]

  • [getRelease()]

  • [getInitialInfo()]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

AccessManagedUpgradeable
  • [__AccessManaged_init(initialAuthority)]

  • [__AccessManaged_init_unchained(initialAuthority)]

  • [authority()]

  • [setAuthority(newAuthority)]

  • [isConsumingScheduledOp()]

  • [_setAuthority(newAuthority)]

  • [_checkCanCall(caller, data)]

ContextUpgradeable
  • [__Context_init()]

  • [__Context_init_unchained()]

  • [_msgSender()]

  • [_msgData()]

  • [_contextSuffixLength()]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
IClaimService
  • [LogClaimServiceClaimSubmitted(policyNftId, claimId, claimAmount)]

  • [LogClaimServiceClaimConfirmed(policyNftId, claimId, confirmedAmount)]

  • [LogClaimServiceClaimDeclined(policyNftId, claimId)]

  • [LogClaimServiceClaimRevoked(policyNftId, claimId)]

  • [LogClaimServiceClaimCancelled(policyNftId, claimId)]

  • [LogClaimServicePayoutCreated(policyNftId, payoutId, amount, beneficiary)]

  • [LogClaimServicePayoutProcessed(policyNftId, payoutId, amount)]

  • [LogClaimServicePayoutCancelled(policyNftId, payoutId)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

IAccessManaged
  • [AuthorityUpdated(authority)]

Initializable
  • [Initialized(version)]

_initialize(address owner, bytes data) internal

submit(NftId policyNftId, Amount claimAmount, bytes claimData) → ClaimId claimId external

create a new claim for the specified policy returns the id of the newly created claim function can only be called by product, policy needs to match with calling product

confirm(NftId policyNftId, ClaimId claimId, Amount confirmedAmount, bytes data) external

confirms the specified claim and specifies the payout amount function can only be called by product, policy needs to match with calling product

decline(NftId policyNftId, ClaimId claimId, bytes data) external

declines the specified claim function can only be called by product, policy needs to match with calling product

revoke(NftId policyNftId, ClaimId claimId) external

revokes the specified claim function can only be called by product, policy needs to match with calling product

cancelConfirmedClaim(NftId policyNftId, ClaimId claimId) external

cancels a confirmed claim before it has been fully paid out. Can only be called when there are not pending payouts function can only be called by product, policy needs to match with calling product

createPayoutForBeneficiary(NftId policyNftId, ClaimId claimId, Amount amount, address beneficiary, bytes data) → PayoutId payoutId external

Creates a new payout for the specified claim and beneficiary. returns the id of the newly created payout, this id is unique for the specified policy function can only be called by product, policy needs to match with calling product

createPayout(NftId policyNftId, ClaimId claimId, Amount amount, bytes data) → PayoutId payoutId external

Creates a new payout for the specified claim. The beneficiary is the holder of the policy NFT returns the id of the newly created payout, this id is unique for the specified policy function can only be called by product, policy needs to match with calling product

processPayout(NftId policyNftId, PayoutId payoutId) → Amount netPayoutAmount, Amount processingFeeAmount external

processes the specified payout this includes moving the payout token to the beneficiary (default: policy holder) function can only be called by product, policy needs to match with calling product

cancelPayout(NftId policyNftId, PayoutId payoutId) external

cancels the specified payout. no tokens are moved, payout is set to cancelled.

_checkClaimAmount(NftId policyNftId, struct IPolicy.PolicyInfo policyInfo, Amount claimAmount) internal

_createPayout(NftId policyNftId, ClaimId claimId, Amount amount, address beneficiary, bytes data) → PayoutId payoutId internal

_verifyCallerWithPolicy(NftId policyNftId) → NftId productNftId, contract IInstance instance, struct IInstance.InstanceContracts instanceContracts, struct IPolicy.PolicyInfo policyInfo internal

Verifies the caller is a product and the policy is active. Returns the product nft id, instance, instance contracts and policy info. in InstanceContracts only the contracts instanceReader, instanceStore and productStore are set.

_getAndVerifyActiveProduct() → NftId productNftId, contract IInstance instance internal

_verifyClaim(contract InstanceReader instanceReader, NftId policyNftId, ClaimId claimId, StateId expectedState) → struct IPolicy.ClaimInfo claimInfo internal

_processConfirmedClaimByPool(contract InstanceReader instanceReader, NftId productNftId, NftId policyNftId, ClaimId claimId, Amount amount) internal

_policyHolderClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount) internal

_getPolicyHolder(NftId policyNftId) → contract IPolicyHolder policyHolder internal

_getDomain() → ObjectType internal

ApplicationServiceManager

import "@etherisc/gif-next/contracts/product/ApplicationServiceManager.sol";
Functions
  • [constructor(authority, registry, salt)]

  • [getApplicationService()]

ProxyManager
  • [initialize(registry, implementation, data, salt)]

  • [deploy(registry, initialImplementation, initializationData)]

  • [deployDetermenistic(registry, initialImplementation, initializationData, salt)]

  • [upgrade(newImplementation)]

  • [upgrade(newImplementation, upgradeData)]

  • [linkToProxy()]

  • [getDeployData(proxyOwner, deployData)]

  • [getUpgradeData(upgradeData)]

  • [getProxy()]

  • [getVersion()]

  • [getVersionCount()]

  • [getVersion(idx)]

  • [getVersionInfo(_version)]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
ProxyManager
  • [LogProxyManagerVersionableDeployed(proxy, initialImplementation)]

  • [LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

Initializable
  • [Initialized(version)]

constructor(address authority, address registry, bytes32 salt) public

initializes proxy manager with service implementation

getApplicationService() → contract ApplicationService external

PricingServiceManager

import "@etherisc/gif-next/contracts/product/PricingServiceManager.sol";
Functions
  • [constructor(authority, registry, salt)]

  • [getPricingService()]

ProxyManager
  • [initialize(registry, implementation, data, salt)]

  • [deploy(registry, initialImplementation, initializationData)]

  • [deployDetermenistic(registry, initialImplementation, initializationData, salt)]

  • [upgrade(newImplementation)]

  • [upgrade(newImplementation, upgradeData)]

  • [linkToProxy()]

  • [getDeployData(proxyOwner, deployData)]

  • [getUpgradeData(upgradeData)]

  • [getProxy()]

  • [getVersion()]

  • [getVersionCount()]

  • [getVersion(idx)]

  • [getVersionInfo(_version)]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
ProxyManager
  • [LogProxyManagerVersionableDeployed(proxy, initialImplementation)]

  • [LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

Initializable
  • [Initialized(version)]

constructor(address authority, address registry, bytes32 salt) public

initializes proxy manager with pricing service implementation and deploys instance

getPricingService() → contract PricingService external

ClaimServiceManager

import "@etherisc/gif-next/contracts/product/ClaimServiceManager.sol";
Functions
  • [constructor(authority, registry, salt)]

  • [getClaimService()]

ProxyManager
  • [initialize(registry, implementation, data, salt)]

  • [deploy(registry, initialImplementation, initializationData)]

  • [deployDetermenistic(registry, initialImplementation, initializationData, salt)]

  • [upgrade(newImplementation)]

  • [upgrade(newImplementation, upgradeData)]

  • [linkToProxy()]

  • [getDeployData(proxyOwner, deployData)]

  • [getUpgradeData(upgradeData)]

  • [getProxy()]

  • [getVersion()]

  • [getVersionCount()]

  • [getVersion(idx)]

  • [getVersionInfo(_version)]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
ProxyManager
  • [LogProxyManagerVersionableDeployed(proxy, initialImplementation)]

  • [LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

Initializable
  • [Initialized(version)]

constructor(address authority, address registry, bytes32 salt) public

initializes proxy manager with service implementation

getClaimService() → contract ClaimService external