Unpermissioned example components
This directory contains a set of unpermissioned example compoents that are mainly used for testing purposes. The expose all the available functions of the component without requiring any permissions (and thereby setup) to use them.
Components that are built in such a way should never be used in production, as they expose functions that can move tokens or other assets without any authorization.
Contracts
SimpleDistribution
import "@etherisc/gif-next/contracts/examples/unpermissioned/SimpleDistribution.sol";
-
[
constructor(registry, productNftId, authorization, initialOwner)] -
[
initialize(registry, productNftId, authorization, initialOwner, name)] -
[
approveTokenHandler(token, amount)] -
[
setLocked(locked)] -
[
setWallet(newWallet)] -
[
createReferral2(distributorNftId, code, discountPercentage, maxReferrals, expiryAt, data)]
-
[
setFees(distributionFee, minDistributionOwnerFee)] -
[
createDistributorType(name, minDiscountPercentage, maxDiscountPercentage, commissionPercentage, maxReferralCount, maxReferralLifetime, allowSelfReferrals, allowRenewals, data)] -
[
createDistributor(distributor, distributorType, data)] -
[
changeDistributorType(distributorNftId, distributorType, data)] -
[
createReferral(distributorNftId, code, discountPercentage, maxReferrals, expiryAt, data)] -
[
_initializeBasicDistribution(registry, instanceNftId, authorization, initialOwner, name)]
-
[
processRenewal(referralId, feeAmount)] -
[
withdrawCommission(distributorNftId, amount)] -
[
getDiscountPercentage(referralCode)] -
[
getReferralId(referralCode)] -
[
calculateRenewalFeeAmount(, netPremiumAmount)] -
[
isVerifying()] -
[
__Distribution_init(registry, productNftId, authorization, isInterceptor, initialOwner, name)] -
[
_setFees(distributionFee, minDistributionOwnerFee)] -
[
_createDistributorType(name, minDiscountPercentage, maxDiscountPercentage, commissionPercentage, maxReferralCount, maxReferralLifetime, allowSelfReferrals, allowRenewals, data)] -
[
_createDistributor(distributor, distributorType, data)] -
[
_changeDistributorType(distributorNftId, distributorType, data)] -
[
_createReferral(distributorNftId, code, discountPercentage, maxReferrals, expiryAt, data)] -
[
_withdrawCommission(distributorNftId, amount)]
-
[
getInstance()] -
[
getAuthorization()] -
[
withdrawFees(amount)] -
[
_sendRequest(oracleNftId, requestData, expiryAt, callbackMethod)] -
[
_cancelRequest(requestId)] -
[
_resendResponse(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()]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)]
-
[
AuthorityUpdated(authority)]
-
[
Initialized(version)]
constructor(address registry, NftId productNftId, contract IAuthorization authorization, address initialOwner) public
SimpleOracle
import "@etherisc/gif-next/contracts/examples/unpermissioned/SimpleOracle.sol";
-
[
constructor(registry, productNftId, authorization, initialOwner)] -
[
initialize(registry, productNftId, authorization, initialOwner, name)] -
[
_request(requestId, requesterId, requestData, expiryAt)] -
[
_cancel(requestId)] -
[
respondAsync(requestId, responseText, revertInCall, revertUntil)] -
[
_respondSync(requestId)]
-
[
respond(requestId, responseData)] -
[
_initializeBasicOracle(registry, instanceNftId, authorization, initialOwner, name)]
-
[
request(requestId, requesterId, requestData, expiryAt)] -
[
cancel(requestId)] -
[
isVerifying()] -
[
withdrawFees()] -
[
activeRequests()] -
[
getActiveRequest(idx)] -
[
isActiveRequest(requestId)] -
[
__Oracle_init(registry, productNftId, authorization, initialOwner, name)] -
[
_respond(requestId, responseData)]
-
[
getInstance()] -
[
getAuthorization()] -
[
_sendRequest(oracleNftId, requestData, expiryAt, callbackMethod)] -
[
_cancelRequest(requestId)] -
[
_resendResponse(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()]
-
[
LogSimpleOracleRequestReceived(requestId, requesterId, synchronous, requestText)] -
[
LogSimpleOracleCancellingReceived(requestId)] -
[
LogSimpleOracleAsyncResponseSent(requestId, responseText)] -
[
LogSimpleOracleSyncResponseSent(requestId, responseText)]
-
[
LogOracleRequestReceived(requestId, requesterId)] -
[
LogOracleRequestCancelled(requestId)]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)]
-
[
AuthorityUpdated(authority)]
-
[
Initialized(version)]
constructor(address registry, NftId productNftId, contract IAuthorization authorization, address initialOwner) public
initialize(address registry, NftId productNftId, contract IAuthorization authorization, address initialOwner, string name) public
_request(RequestId requestId, NftId requesterId, bytes requestData, Timestamp expiryAt) internal
use case specific handling of oracle requests for now only log is emitted to verify that request has been received by oracle component
_cancel(RequestId requestId) internal
use case specific handling of oracle requests for now only log is emitted to verify that cancelling has been received by oracle component
respondAsync(RequestId requestId, string responseText, bool revertInCall, Timestamp revertUntil) external
SimplePool
import "@etherisc/gif-next/contracts/examples/unpermissioned/SimplePool.sol";
-
[
constructor(registry, productNftId, poolInfo, authorization, initialOwner)] -
[
initialize(registry, productNftId, poolInfo, authorization, initialOwner)] -
[
createBundle(fee, initialAmount, lifetime, filter)] -
[
fundPoolWallet(amount)] -
[
defundPoolWallet(amount)] -
[
approveTokenHandler(token, amount)] -
[
setLocked(locked)] -
[
setWallet(newWallet)]
-
[
_initializeBasicPool(registry, productNftId, name, poolInfo, authorization, initialOwner)] -
[
stake(bundleNftId, amount)] -
[
unstake(bundleNftId, amount)] -
[
extend(bundleNftId, lifetimeExtension)] -
[
setBundleLocked(bundleNftId, locked)] -
[
closeBundle(bundleNftId)] -
[
setBundleFee(bundleNftId, fee)] -
[
withdrawBundleFees(bundleNftId, amount)] -
[
setMaxBalanceAmount(maxBalanceAmount)] -
[
setFees(poolFee, stakingFee, performanceFee)]
-
[
getContractLocation(name)] -
[
verifyApplication(applicationNftId, bundleNftId, collateralizationAmount)] -
[
processConfirmedClaim(policyNftId, claimId, amount)] -
[
applicationMatchesBundle(applicationNftId, applicationData, bundleNftId, bundleFilter, collateralizationAmount)] -
[
getInitialPoolInfo()] -
[
__Pool_init(registry, productNftId, name, poolInfo, authorization, initialOwner)] -
[
_setPoolFees(poolFee, stakingFee, performanceFee)] -
[
_setMaxBalanceAmount(maxBalanceAmount)] -
[
_fundPoolWallet(amount)] -
[
_defundPoolWallet(amount)] -
[
_createBundle(bundleOwner, fee, lifetime, filter)] -
[
_setBundleFee(bundleNftId, fee)] -
[
_stake(bundleNftId, amount)] -
[
_unstake(bundleNftId, amount)] -
[
_extend(bundleNftId, lifetimeExtension)] -
[
_setBundleLocked(bundleNftId, locked)] -
[
_closeBundle(bundleNftId)] -
[
_withdrawBundleFees(bundleNftId, amount)] -
[
_processFundedClaim(policyNftId, claimId, availableAmount)]
-
[
getInstance()] -
[
getAuthorization()] -
[
withdrawFees(amount)] -
[
_sendRequest(oracleNftId, requestData, expiryAt, callbackMethod)] -
[
_cancelRequest(requestId)] -
[
_resendResponse(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()]
-
[
LogPoolVerifiedByPool(pool, applicationNftId, collateralizationAmount)]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)]
-
[
AuthorityUpdated(authority)]
-
[
Initialized(version)]
constructor(address registry, NftId productNftId, struct IComponents.PoolInfo poolInfo, contract IAuthorization authorization, address initialOwner) public
initialize(address registry, NftId productNftId, struct IComponents.PoolInfo poolInfo, contract IAuthorization authorization, address initialOwner) public
SimpleProduct
import "@etherisc/gif-next/contracts/examples/unpermissioned/SimpleProduct.sol";
-
[
constructor(registry, instanceNftId, name, productInfo, feeInfo, authorization, initialOwner)] -
[
initialize(registry, instanceNftid, name, productInfo, feeInfo, authorization, initialOwner)] -
[
createRisk(id, data)] -
[
updateRisk(id, data)] -
[
setRiskLocked(id, locked)] -
[
closeRisk(id)] -
[
createApplication(applicationOwner, riskId, sumInsured, lifetime, applicationData, bundleNftId, referralId)] -
[
createApplication2(applicationOwner, riskId, sumInsuredAmount, premiumAmount, lifetime, applicationData, bundleNftId, referralId)] -
[
revoke(applicationNftId)] -
[
createPolicy(applicationNftId, requirePremiumPayment, activateAt)] -
[
createPolicy2(applicationNftId, requirePremiumPayment, activateAt, maxPremiumAmount)] -
[
decline(policyNftId)] -
[
expire(policyNftId, expireAt)] -
[
collectPremium(policyNftId, activateAt)] -
[
activate(policyNftId, activateAt)] -
[
adjustActivation(policyNftId, activateAt)] -
[
close(policyNftId)] -
[
submitClaim(policyNftId, claimAmount, submissionData)] -
[
revokeClaim(policyNftId, claimId)] -
[
confirmClaim(policyNftId, claimId, confirmedAmount, processData)] -
[
declineClaim(policyNftId, claimId, processData)] -
[
cancelConfirmedClaim(policyNftId, claimId)] -
[
createPayout(policyNftId, claimId, amount, data)] -
[
cancelPayout(policyNftId, payoutId)] -
[
createPayoutForBeneficiary(policyNftId, claimId, amount, beneficiary, data)] -
[
processPayout(policyNftId, payoutId)] -
[
createOracleRequest(oracleNftId, requestText, expiryAt, synchronous)] -
[
createOracleRequest2(oracleNftId, requestText, expiryAt, synchronous, callbackMethod)] -
[
cancelOracleRequest(requestId)] -
[
fulfillOracleRequestSync(requestId, responseData)] -
[
fulfillOracleRequestAsync(requestId, responseData)] -
[
resend(requestId)] -
[
doSomethingOnlyWhenActive()] -
[
getOracleService()] -
[
approveTokenHandler(token, amount)] -
[
setLocked(locked)] -
[
setWallet(newWallet)]
-
[
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)] -
[
_resendResponse(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()]
-
[
LogSimpleProductRequestAsyncFulfilled(requestId, responseText, responseDataLength)] -
[
LogSimpleProductRequestSyncFulfilled(requestId, responseText, responseDataLength)]
-
[
LogNftOwnableNftLinkedToAddress(nftId, owner)]
-
[
AuthorityUpdated(authority)]
-
[
Initialized(version)]