Product
Contains interfaces and contracts related to products.
Contracts
IProductComponent
import "@etherisc/gif-next/contracts/product/IProductComponent.sol";
-
[
registerComponent(component)
] -
[
processFundedClaim(policyNftId, claimId, availableAmount)
] -
[
calculatePremium(sumInsuredAmount, riskId, lifetime, applicationData, bundleNftId, referralId)
] -
[
calculateNetPremium(sumInsuredAmount, riskId, lifetime, applicationData)
] -
[
getInitialProductInfo()
] -
[
getInitialFeeInfo()
]
-
[
withdrawFees(amount)
] -
[
getInstance()
]
-
[
getAuthorization()
]
-
[
getName()
] -
[
getToken()
] -
[
getTokenHandler()
] -
[
getWallet()
] -
[
isNftInterceptor()
] -
[
isRegistered()
] -
[
getComponentInfo()
] -
[
getInitialComponentInfo()
]
-
[
nftTransferFrom(from, to, tokenId, operator)
]
-
[
isActive()
] -
[
getInitialInfo()
]
-
[
getRelease()
]
-
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
]
-
[
getRegistry()
]
-
[
supportsInterface(interfaceId)
]
-
[
authority()
] -
[
setAuthority()
] -
[
isConsumingScheduledOp()
]
-
[
LogComponentWalletAddressChanged(oldWallet, newWallet)
] -
[
LogComponentWalletTokensTransferred(from, to, amount)
] -
[
LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
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.
IApplicationService
import "@etherisc/gif-next/contracts/product/IApplicationService.sol";
gif service responsible for creating applications only product components may call transaction functions
-
[
create(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, bundleNftId, referralId, applicationData)
] -
[
adjust(applicationNftId, riskId, bundleNftId, referralId, sumInsuredAmount, lifetime, applicationData)
] -
[
renew(policyNftId, bundleNftId)
] -
[
revoke(policyNftId)
]
-
[
getDomain()
] -
[
getRoleId()
]
-
[
initializeVersionable(activatedBy, activationData)
] -
[
upgradeVersionable(upgradeData)
] -
[
getVersion()
]
-
[
isActive()
] -
[
getInitialInfo()
]
-
[
getRelease()
]
-
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
]
-
[
getRegistry()
]
-
[
supportsInterface(interfaceId)
]
-
[
authority()
] -
[
setAuthority()
] -
[
isConsumingScheduledOp()
]
-
[
LogApplicationServiceApplicationCreated(applicationNftId, productNftId, bundleNftId, riskId, referralId, applicationOwner, sumInsuredAmount, premiumAmount, lifetime)
] -
[
LogApplicationServiceApplicationRenewed(policyNftId, bundleNftId)
] -
[
LogApplicationServiceApplicationAdjusted(applicationNftId, bundleNftId, riskId, referralId, sumInsuredAmount, lifetime)
] -
[
LogApplicationServiceApplicationRevoked(applicationNftId)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
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
IPricingService
import "@etherisc/gif-next/contracts/product/IPricingService.sol";
-
[
calculatePremium(productNftId, riskId, sumInsuredAmount, lifetime, applicationData, bundleNftId, referralId)
]
-
[
getDomain()
] -
[
getRoleId()
]
-
[
initializeVersionable(activatedBy, activationData)
] -
[
upgradeVersionable(upgradeData)
] -
[
getVersion()
]
-
[
isActive()
] -
[
getInitialInfo()
]
-
[
getRelease()
]
-
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
]
-
[
getRegistry()
]
-
[
supportsInterface(interfaceId)
]
-
[
authority()
] -
[
setAuthority()
] -
[
isConsumingScheduledOp()
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
Product
import "@etherisc/gif-next/contracts/product/Product.sol";
-
[
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()
]
-
[
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_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_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)
] -
[
isActive()
] -
[
getRelease()
] -
[
getInitialInfo()
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
__AccessManaged_init(initialAuthority)
] -
[
__AccessManaged_init_unchained(initialAuthority)
] -
[
authority()
] -
[
setAuthority(newAuthority)
] -
[
isConsumingScheduledOp()
] -
[
_setAuthority(newAuthority)
] -
[
_checkCanCall(caller, data)
]
-
[
__Context_init()
] -
[
__Context_init_unchained()
] -
[
_msgSender()
] -
[
_msgData()
] -
[
_contextSuffixLength()
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogComponentWalletAddressChanged(oldWallet, newWallet)
] -
[
LogComponentWalletTokensTransferred(from, to, amount)
] -
[
LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
-
[
Initialized(version)
]
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
__Product_init(address registry, NftId instanceNftId, string name, struct IComponents.ProductInfo productInfo, struct IComponents.FeeInfo feeInfo, contract IAuthorization authorization, address initialOwner)
internal
_createApplication(address applicationOwner, RiskId riskId, Amount sumInsuredAmount, Amount premiumAmount, Seconds lifetime, NftId bundleNftId, ReferralId referralId, bytes applicationData) → NftId applicationNftId
internal
_createPolicy(NftId applicationNftId, Timestamp activateAt, Amount maxPremiumAmount) → Amount premiumAmount
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.
_createPayoutForBeneficiary(NftId policyNftId, ClaimId claimId, Amount amount, address beneficiary, bytes data) → PayoutId
internal
BasicProduct
import "@etherisc/gif-next/contracts/product/BasicProduct.sol";
-
[
setFees(productFee, processingFee)
] -
[
_initializeBasicProduct(registry, instanceNftId, name, productInfo, feeInfo, authorization, initialOwner)
]
-
[
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()
]
-
[
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_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_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)
] -
[
isActive()
] -
[
getRelease()
] -
[
getInitialInfo()
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
__AccessManaged_init(initialAuthority)
] -
[
__AccessManaged_init_unchained(initialAuthority)
] -
[
authority()
] -
[
setAuthority(newAuthority)
] -
[
isConsumingScheduledOp()
] -
[
_setAuthority(newAuthority)
] -
[
_checkCanCall(caller, data)
]
-
[
__Context_init()
] -
[
__Context_init_unchained()
] -
[
_msgSender()
] -
[
_msgData()
] -
[
_contextSuffixLength()
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogComponentWalletAddressChanged(oldWallet, newWallet)
] -
[
LogComponentWalletTokensTransferred(from, to, amount)
] -
[
LogComponentTokenHandlerApproved(tokenHandler, token, limit, isMaxAmount)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
-
[
Initialized(version)
]
BasicProductAuthorization
import "@etherisc/gif-next/contracts/product/BasicProductAuthorization.sol";
-
[
constructor(componentName)
] -
[
_setupServiceTargets()
] -
[
_setupTokenHandlerAuthorizations()
] -
[
_setupTargetAuthorizations()
]
-
[
getTokenHandlerName()
] -
[
getTokenHandlerTarget()
] -
[
getTarget(targetName)
] -
[
getTargets()
] -
[
targetExists(target)
] -
[
_setupTargets()
] -
[
_setupRoles()
] -
[
_addCustomRole(roleId, adminRoleId, maxMemberCount, name)
] -
[
_addGifTarget(contractName)
] -
[
_addInstanceTarget(contractName)
] -
[
_addTarget(name)
] -
[
_toTargetRoleId(targetDomain)
] -
[
_toTargetRoleName(targetName)
]
-
[
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)
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
Initialized(version)
]
_setupServiceTargets()
internal
Sets up the relevant service targets for the component. Overwrite this function for use case specific authorizations.
ApplicationService
import "@etherisc/gif-next/contracts/product/ApplicationService.sol";
-
[
_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_init(authority, registry, initialOwner)
] -
[
getDomain()
] -
[
getVersion()
] -
[
getRoleId()
] -
[
_getServiceAddress(domain)
]
-
[
__ReentrancyGuard_init()
] -
[
__ReentrancyGuard_init_unchained()
] -
[
_reentrancyGuardEntered()
]
-
[
initializeVersionable(activatedBy, data)
] -
[
upgradeVersionable(data)
] -
[
_upgrade(data)
]
-
[
__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)
] -
[
isActive()
] -
[
getRelease()
] -
[
getInitialInfo()
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
__AccessManaged_init(initialAuthority)
] -
[
__AccessManaged_init_unchained(initialAuthority)
] -
[
authority()
] -
[
setAuthority(newAuthority)
] -
[
isConsumingScheduledOp()
] -
[
_setAuthority(newAuthority)
] -
[
_checkCanCall(caller, data)
]
-
[
__Context_init()
] -
[
__Context_init_unchained()
] -
[
_msgSender()
] -
[
_msgData()
] -
[
_contextSuffixLength()
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogApplicationServiceApplicationCreated(applicationNftId, productNftId, bundleNftId, riskId, referralId, applicationOwner, sumInsuredAmount, premiumAmount, lifetime)
] -
[
LogApplicationServiceApplicationRenewed(policyNftId, bundleNftId)
] -
[
LogApplicationServiceApplicationAdjusted(applicationNftId, bundleNftId, riskId, referralId, sumInsuredAmount, lifetime)
] -
[
LogApplicationServiceApplicationRevoked(applicationNftId)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
-
[
Initialized(version)
]
_checkLinkedApplicationParameters(contract InstanceReader instanceReader, NftId productNftId, RiskId riskId, ReferralId referralId, NftId bundleNftId)
internal
_registerApplication(NftId productNftId, address applicationOwner) → NftId applicationNftId
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
PricingService
import "@etherisc/gif-next/contracts/product/PricingService.sol";
-
[
_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_init(authority, registry, initialOwner)
] -
[
getDomain()
] -
[
getVersion()
] -
[
getRoleId()
] -
[
_getServiceAddress(domain)
]
-
[
__ReentrancyGuard_init()
] -
[
__ReentrancyGuard_init_unchained()
] -
[
_reentrancyGuardEntered()
]
-
[
initializeVersionable(activatedBy, data)
] -
[
upgradeVersionable(data)
] -
[
_upgrade(data)
]
-
[
__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)
] -
[
isActive()
] -
[
getRelease()
] -
[
getInitialInfo()
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
__AccessManaged_init(initialAuthority)
] -
[
__AccessManaged_init_unchained(initialAuthority)
] -
[
authority()
] -
[
setAuthority(newAuthority)
] -
[
isConsumingScheduledOp()
] -
[
_setAuthority(newAuthority)
] -
[
_checkCanCall(caller, data)
]
-
[
__Context_init()
] -
[
__Context_init_unchained()
] -
[
_msgSender()
] -
[
_msgData()
] -
[
_contextSuffixLength()
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
-
[
Initialized(version)
]
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
ClaimService
import "@etherisc/gif-next/contracts/product/ClaimService.sol";
-
[
_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_init(authority, registry, initialOwner)
] -
[
getDomain()
] -
[
getVersion()
] -
[
getRoleId()
] -
[
_getServiceAddress(domain)
]
-
[
__ReentrancyGuard_init()
] -
[
__ReentrancyGuard_init_unchained()
] -
[
_reentrancyGuardEntered()
]
-
[
initializeVersionable(activatedBy, data)
] -
[
upgradeVersionable(data)
] -
[
_upgrade(data)
]
-
[
__Registerable_init(authority, registry, parentNftId, objectType, isInterceptor, initialOwner, data)
] -
[
isActive()
] -
[
getRelease()
] -
[
getInitialInfo()
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
__AccessManaged_init(initialAuthority)
] -
[
__AccessManaged_init_unchained(initialAuthority)
] -
[
authority()
] -
[
setAuthority(newAuthority)
] -
[
isConsumingScheduledOp()
] -
[
_setAuthority(newAuthority)
] -
[
_checkCanCall(caller, data)
]
-
[
__Context_init()
] -
[
__Context_init_unchained()
] -
[
_msgSender()
] -
[
_msgData()
] -
[
_contextSuffixLength()
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
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)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
AuthorityUpdated(authority)
]
-
[
Initialized(version)
]
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.
_verifyClaim(contract InstanceReader instanceReader, NftId policyNftId, ClaimId claimId, StateId expectedState) → struct IPolicy.ClaimInfo claimInfo
internal
ApplicationServiceManager
import "@etherisc/gif-next/contracts/product/ApplicationServiceManager.sol";
-
[
constructor(authority, registry, salt)
] -
[
getApplicationService()
]
-
[
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)
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogProxyManagerVersionableDeployed(proxy, initialImplementation)
] -
[
LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
Initialized(version)
]
PricingServiceManager
import "@etherisc/gif-next/contracts/product/PricingServiceManager.sol";
-
[
constructor(authority, registry, salt)
] -
[
getPricingService()
]
-
[
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)
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogProxyManagerVersionableDeployed(proxy, initialImplementation)
] -
[
LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
Initialized(version)
]
ClaimServiceManager
import "@etherisc/gif-next/contracts/product/ClaimServiceManager.sol";
-
[
constructor(authority, registry, salt)
] -
[
getClaimService()
]
-
[
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)
]
-
[
_checkNftType(nftId, expectedObjectType)
] -
[
__NftOwnable_init(registry, initialOwner)
] -
[
linkToRegisteredNftId()
] -
[
getNftId()
] -
[
getOwner()
] -
[
_linkToNftOwnable(nftOwnableAddress)
]
-
[
__RegistryLinked_init(registry)
] -
[
getRegistry()
]
-
[
__ERC165_init()
] -
[
_initializeERC165()
] -
[
_registerInterface(interfaceId)
] -
[
_registerInterfaceNotInitializing(interfaceId)
] -
[
supportsInterface(interfaceId)
]
-
[
_checkInitializing()
] -
[
_disableInitializers()
] -
[
_getInitializedVersion()
] -
[
_isInitializing()
]
-
[
LogProxyManagerVersionableDeployed(proxy, initialImplementation)
] -
[
LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)
]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)
]
-
[
Initialized(version)
]