@etherisc/gif-next 0.0.2-f034782-101 → 0.0.2-f080b71-868
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -83
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +10 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +10 -0
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +100 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +100 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +110 -0
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +100 -0
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +20 -0
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +10 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +214 -1988
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +101 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +379 -2729
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +95 -58
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +45 -25
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +157 -126
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +30 -58
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2677 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +108 -21
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +6 -6
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +119 -227
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +11 -35
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +330 -147
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +70 -14
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +127 -32
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +11 -7
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +193 -386
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +38 -74
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +68 -149
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +163 -113
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +80 -14
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +89 -231
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +132 -24
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +430 -14
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +518 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +80 -14
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +210 -65
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +27 -19
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +493 -48
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +18 -14
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +988 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +689 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +139 -44
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +16 -12
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -24
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +17 -36
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +7 -7
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +23 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +80 -14
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +86 -15
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +2 -2
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +101 -26
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +161 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +40 -9
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/components/Component.sol +4 -2
- package/contracts/components/IComponent.sol +3 -1
- package/contracts/components/Pool.sol +8 -4
- package/contracts/components/Product.sol +8 -5
- package/contracts/instance/IInstance.sol +16 -54
- package/contracts/instance/IInstanceService.sol +14 -2
- package/contracts/instance/Instance.sol +88 -188
- package/contracts/instance/InstanceAccessManager.sol +41 -23
- package/contracts/instance/InstanceAuthorizationsLib.sol +299 -0
- package/contracts/instance/InstanceReader.sol +15 -6
- package/contracts/instance/InstanceService.sol +59 -234
- package/contracts/instance/InstanceStore.sol +219 -0
- package/contracts/instance/base/ComponentService.sol +51 -38
- package/contracts/instance/base/KeyValueStore.sol +8 -3
- package/contracts/instance/module/IAccess.sol +2 -2
- package/contracts/instance/module/IBundle.sol +6 -4
- package/contracts/instance/module/IComponents.sol +6 -0
- package/contracts/instance/service/ApplicationService.sol +35 -202
- package/contracts/instance/service/BundleService.sol +165 -70
- package/contracts/instance/service/ClaimService.sol +2 -8
- package/contracts/instance/service/DistributionService.sol +30 -151
- package/contracts/instance/service/IApplicationService.sol +0 -18
- package/contracts/instance/service/IBundleService.sol +54 -22
- package/contracts/instance/service/IDistributionService.sol +1 -14
- package/contracts/instance/service/IPolicyService.sol +2 -0
- package/contracts/instance/service/IPoolService.sol +65 -1
- package/contracts/instance/service/IPricingService.sol +36 -0
- package/contracts/instance/service/PolicyService.sol +88 -115
- package/contracts/instance/service/PoolService.sol +136 -53
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +25 -56
- package/contracts/registry/IRegistryService.sol +4 -3
- package/contracts/registry/RegistryService.sol +25 -22
- package/contracts/registry/ReleaseManager.sol +20 -18
- package/contracts/shared/IService.sol +4 -6
- package/contracts/shared/Service.sol +21 -7
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +60 -0
- package/contracts/types/Fee.sol +12 -5
- package/contracts/types/ObjectType.sol +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,18 +1,6 @@
|
|
1
1
|
# GIF-Next (Generic Insurance Framework, next version)
|
2
2
|
|
3
3
|
|
4
|
-
```mermaid
|
5
|
-
graph TD
|
6
|
-
IPoolComponent --> IComponent
|
7
|
-
IComponent --> IRegisterable
|
8
|
-
IComponent --> ITransferInterceptor
|
9
|
-
IRegistryService --> IService
|
10
|
-
IService-->IRegisterable
|
11
|
-
IService-->IVersionable
|
12
|
-
IRegisterable-->INftOwnable
|
13
|
-
INftOwnable-->IERC165
|
14
|
-
```
|
15
|
-
|
16
4
|
## Add OpenZeppelin V5 Dependencies
|
17
5
|
|
18
6
|
```shell
|
@@ -40,6 +28,10 @@ This repository uses submodules. To checkout or update to the latest submodules,
|
|
40
28
|
git submodule update --recursive
|
41
29
|
```
|
42
30
|
|
31
|
+
## Example components
|
32
|
+
|
33
|
+
A (very early) example of a product and a pool can be found in the [gif-next-sandbox repository](https://github.com/etherisc/gif-next-sandbox).
|
34
|
+
|
43
35
|
## Hardhat
|
44
36
|
|
45
37
|
### NPM Commands
|
@@ -232,17 +224,7 @@ https://book.getfoundry.sh/reference/
|
|
232
224
|
|
233
225
|
## Style Guide
|
234
226
|
|
235
|
-
|
236
|
-
|
237
|
-
Documentation of the code should be written inline using [NatSpec](https://docs.soliditylang.org/en/latest/natspec-format.html).
|
238
|
-
|
239
|
-
### Naming conventions
|
240
|
-
|
241
|
-
Additionally, we use the following naming conventions:
|
242
|
-
|
243
|
-
- Function arguments and return types: If using custom data types, make the name include the type by appending the Type to the argument name, e.g. `function getInfo(NftId bundleNftId)` instead of `function getInfo(NftId bundleId)`. Background: Custom data types are lost when using the ABI or Typescript binding classes (e.g. instead of `NftID` a `uint96` is used), so the type needs to be included in the name to make it clear what the argument is without having to look at the documentation or checking the solidity source code.
|
244
|
-
- When naming a field or an attribute `id` and the context is not clear, call it `nftId` instead so its clear what type if id it is as there will be multiple ids for different kind of objects. Example: if you the function has a bundle nft id and a policy nft id as arguments, call them `bundleNftId` and `policyNftId` instead of `id` and `policyId`. In case of doubt, be a bit more verbose for the sake of clarity.
|
245
|
-
- When naming things, remember that the code will likely be used in Javascript/Typescript as well, so avoid names that are reserved in Javascript/Typescript. A list of reserved words in Javascript can be found [here](https://www.w3schools.com/js/js_reserved.asp) and a list of reserved words in Typescript can be found [here](https://www.tektutorialshub.com/typescript/identifiers-keywords-in-typescript/).
|
227
|
+
Please see https://docs.etherisc.com/gif-next/3.x/ for style guide and general coding rules.
|
246
228
|
|
247
229
|
### Automatic code formatting
|
248
230
|
|
@@ -257,7 +239,7 @@ We use solhint to lint the code.
|
|
257
239
|
To execute linting run `npm run lint`.
|
258
240
|
|
259
241
|
|
260
|
-
### Adding Brownie (Legacy)
|
242
|
+
### Adding Brownie (Legacy - don't do that :wink: )
|
261
243
|
|
262
244
|
python3 is already installed
|
263
245
|
|
@@ -405,65 +387,6 @@ Intercepting property
|
|
405
387
|
|
406
388
|
### Product
|
407
389
|
|
408
|
-
### Payout Handling
|
409
|
-
|
410
|
-
Pool specifies **retention level**.
|
411
|
-
Retention level defines up to which percentage of the sum insured the pool is payout out using its own/current funds.
|
412
|
-
Depending on the amount of a new payout the poolService decides to either execute the payout directly or to add the payout as a pending payout with a notification of the pool.
|
413
|
-
|
414
|
-
The sequence below sketches the small payout flow (payout < retention amount)
|
415
|
-
- retention level: 30%
|
416
|
-
- sum insured: 1000
|
417
|
-
- payout: 200
|
418
|
-
|
419
|
-
```mermaid
|
420
|
-
sequenceDiagram
|
421
|
-
participant customer
|
422
|
-
participant product
|
423
|
-
participant claimService
|
424
|
-
participant poolService
|
425
|
-
participant pool
|
426
|
-
product->>claimService: createPayout()
|
427
|
-
claimService ->> poolService: requestPayout()
|
428
|
-
poolService -->> pool: verifyPayout() *
|
429
|
-
poolService ->> poolService: processPayout()
|
430
|
-
poolService ->> customer: transfer token for payout
|
431
|
-
poolService ->> claimService: payoutExecuted()
|
432
|
-
poolService -->> customer: payoutExecutedCallback() **
|
433
|
-
```
|
434
|
-
|
435
|
-
*: if pool is configured to verify payouts before execution
|
436
|
-
|
437
|
-
**: callback only if customer is contract (IPolicyHolder)
|
438
|
-
|
439
|
-
The sequence below sketches the call flow for payouts larger than the retention amount
|
440
|
-
- retention level: 30%
|
441
|
-
- sum insured: 1000
|
442
|
-
- payout: 500
|
443
|
-
* locally available: 300
|
444
|
-
* via policy (re-insurance): 200
|
445
|
-
|
446
|
-
```mermaid
|
447
|
-
sequenceDiagram
|
448
|
-
participant customer
|
449
|
-
participant product
|
450
|
-
participant claimService
|
451
|
-
participant poolService
|
452
|
-
participant pool
|
453
|
-
pool ->> reinsuranceProduct: applyForPolicy()
|
454
|
-
product->>claimService: createPayout()
|
455
|
-
claimService ->> poolService: requestPayout()
|
456
|
-
poolService ->> pool: pendingPayoutAdded()
|
457
|
-
pool ->> pool: getReinsurancePolicy()
|
458
|
-
pool ->> reinsuranceProduct: claim()
|
459
|
-
reinsuranceProduct -->> reinsurancePool: createPayout
|
460
|
-
reinsurancePool ->> pool: transfer token for payout
|
461
|
-
reinsurancePool ->> pool: payoutExecutedCallback()
|
462
|
-
pool ->> poolService: processPendingPayout()
|
463
|
-
poolService ->> customer: transfer token for payout
|
464
|
-
poolService ->> claimService: payoutExecuted()
|
465
|
-
```
|
466
|
-
|
467
390
|
### Pool
|
468
391
|
|
469
392
|
### Distribution
|
@@ -360,6 +360,16 @@
|
|
360
360
|
"name": "wallet",
|
361
361
|
"type": "address"
|
362
362
|
},
|
363
|
+
{
|
364
|
+
"internalType": "Amount",
|
365
|
+
"name": "balanceAmount",
|
366
|
+
"type": "uint96"
|
367
|
+
},
|
368
|
+
{
|
369
|
+
"internalType": "Amount",
|
370
|
+
"name": "feeAmount",
|
371
|
+
"type": "uint96"
|
372
|
+
},
|
363
373
|
{
|
364
374
|
"internalType": "bytes",
|
365
375
|
"name": "data",
|
@@ -504,6 +504,16 @@
|
|
504
504
|
"name": "wallet",
|
505
505
|
"type": "address"
|
506
506
|
},
|
507
|
+
{
|
508
|
+
"internalType": "Amount",
|
509
|
+
"name": "balanceAmount",
|
510
|
+
"type": "uint96"
|
511
|
+
},
|
512
|
+
{
|
513
|
+
"internalType": "Amount",
|
514
|
+
"name": "feeAmount",
|
515
|
+
"type": "uint96"
|
516
|
+
},
|
507
517
|
{
|
508
518
|
"internalType": "bytes",
|
509
519
|
"name": "data",
|
@@ -3,6 +3,44 @@
|
|
3
3
|
"contractName": "IComponent",
|
4
4
|
"sourceName": "contracts/components/IComponent.sol",
|
5
5
|
"abi": [
|
6
|
+
{
|
7
|
+
"inputs": [
|
8
|
+
{
|
9
|
+
"internalType": "address",
|
10
|
+
"name": "authority",
|
11
|
+
"type": "address"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"name": "AccessManagedInvalidAuthority",
|
15
|
+
"type": "error"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"inputs": [
|
19
|
+
{
|
20
|
+
"internalType": "address",
|
21
|
+
"name": "caller",
|
22
|
+
"type": "address"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"internalType": "uint32",
|
26
|
+
"name": "delay",
|
27
|
+
"type": "uint32"
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"name": "AccessManagedRequiredDelay",
|
31
|
+
"type": "error"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"inputs": [
|
35
|
+
{
|
36
|
+
"internalType": "address",
|
37
|
+
"name": "caller",
|
38
|
+
"type": "address"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"name": "AccessManagedUnauthorized",
|
42
|
+
"type": "error"
|
43
|
+
},
|
6
44
|
{
|
7
45
|
"inputs": [
|
8
46
|
{
|
@@ -126,6 +164,19 @@
|
|
126
164
|
"name": "ErrorNotRegistry",
|
127
165
|
"type": "error"
|
128
166
|
},
|
167
|
+
{
|
168
|
+
"anonymous": false,
|
169
|
+
"inputs": [
|
170
|
+
{
|
171
|
+
"indexed": false,
|
172
|
+
"internalType": "address",
|
173
|
+
"name": "authority",
|
174
|
+
"type": "address"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"name": "AuthorityUpdated",
|
178
|
+
"type": "event"
|
179
|
+
},
|
129
180
|
{
|
130
181
|
"anonymous": false,
|
131
182
|
"inputs": [
|
@@ -170,6 +221,19 @@
|
|
170
221
|
"name": "LogComponentWalletTokensTransferred",
|
171
222
|
"type": "event"
|
172
223
|
},
|
224
|
+
{
|
225
|
+
"inputs": [],
|
226
|
+
"name": "authority",
|
227
|
+
"outputs": [
|
228
|
+
{
|
229
|
+
"internalType": "address",
|
230
|
+
"name": "",
|
231
|
+
"type": "address"
|
232
|
+
}
|
233
|
+
],
|
234
|
+
"stateMutability": "view",
|
235
|
+
"type": "function"
|
236
|
+
},
|
173
237
|
{
|
174
238
|
"inputs": [],
|
175
239
|
"name": "getComponentInfo",
|
@@ -196,6 +260,16 @@
|
|
196
260
|
"name": "wallet",
|
197
261
|
"type": "address"
|
198
262
|
},
|
263
|
+
{
|
264
|
+
"internalType": "Amount",
|
265
|
+
"name": "balanceAmount",
|
266
|
+
"type": "uint96"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"internalType": "Amount",
|
270
|
+
"name": "feeAmount",
|
271
|
+
"type": "uint96"
|
272
|
+
},
|
199
273
|
{
|
200
274
|
"internalType": "bytes",
|
201
275
|
"name": "data",
|
@@ -377,6 +451,19 @@
|
|
377
451
|
"stateMutability": "view",
|
378
452
|
"type": "function"
|
379
453
|
},
|
454
|
+
{
|
455
|
+
"inputs": [],
|
456
|
+
"name": "isConsumingScheduledOp",
|
457
|
+
"outputs": [
|
458
|
+
{
|
459
|
+
"internalType": "bytes4",
|
460
|
+
"name": "",
|
461
|
+
"type": "bytes4"
|
462
|
+
}
|
463
|
+
],
|
464
|
+
"stateMutability": "view",
|
465
|
+
"type": "function"
|
466
|
+
},
|
380
467
|
{
|
381
468
|
"inputs": [],
|
382
469
|
"name": "isNftInterceptor",
|
@@ -445,6 +532,19 @@
|
|
445
532
|
"stateMutability": "nonpayable",
|
446
533
|
"type": "function"
|
447
534
|
},
|
535
|
+
{
|
536
|
+
"inputs": [
|
537
|
+
{
|
538
|
+
"internalType": "address",
|
539
|
+
"name": "",
|
540
|
+
"type": "address"
|
541
|
+
}
|
542
|
+
],
|
543
|
+
"name": "setAuthority",
|
544
|
+
"outputs": [],
|
545
|
+
"stateMutability": "nonpayable",
|
546
|
+
"type": "function"
|
547
|
+
},
|
448
548
|
{
|
449
549
|
"inputs": [
|
450
550
|
{
|
package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json
CHANGED
@@ -3,6 +3,44 @@
|
|
3
3
|
"contractName": "IDistributionComponent",
|
4
4
|
"sourceName": "contracts/components/IDistributionComponent.sol",
|
5
5
|
"abi": [
|
6
|
+
{
|
7
|
+
"inputs": [
|
8
|
+
{
|
9
|
+
"internalType": "address",
|
10
|
+
"name": "authority",
|
11
|
+
"type": "address"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"name": "AccessManagedInvalidAuthority",
|
15
|
+
"type": "error"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"inputs": [
|
19
|
+
{
|
20
|
+
"internalType": "address",
|
21
|
+
"name": "caller",
|
22
|
+
"type": "address"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"internalType": "uint32",
|
26
|
+
"name": "delay",
|
27
|
+
"type": "uint32"
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"name": "AccessManagedRequiredDelay",
|
31
|
+
"type": "error"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"inputs": [
|
35
|
+
{
|
36
|
+
"internalType": "address",
|
37
|
+
"name": "caller",
|
38
|
+
"type": "address"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"name": "AccessManagedUnauthorized",
|
42
|
+
"type": "error"
|
43
|
+
},
|
6
44
|
{
|
7
45
|
"inputs": [
|
8
46
|
{
|
@@ -126,6 +164,19 @@
|
|
126
164
|
"name": "ErrorNotRegistry",
|
127
165
|
"type": "error"
|
128
166
|
},
|
167
|
+
{
|
168
|
+
"anonymous": false,
|
169
|
+
"inputs": [
|
170
|
+
{
|
171
|
+
"indexed": false,
|
172
|
+
"internalType": "address",
|
173
|
+
"name": "authority",
|
174
|
+
"type": "address"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"name": "AuthorityUpdated",
|
178
|
+
"type": "event"
|
179
|
+
},
|
129
180
|
{
|
130
181
|
"anonymous": false,
|
131
182
|
"inputs": [
|
@@ -189,6 +240,19 @@
|
|
189
240
|
"name": "LogDistributorUpdated",
|
190
241
|
"type": "event"
|
191
242
|
},
|
243
|
+
{
|
244
|
+
"inputs": [],
|
245
|
+
"name": "authority",
|
246
|
+
"outputs": [
|
247
|
+
{
|
248
|
+
"internalType": "address",
|
249
|
+
"name": "",
|
250
|
+
"type": "address"
|
251
|
+
}
|
252
|
+
],
|
253
|
+
"stateMutability": "view",
|
254
|
+
"type": "function"
|
255
|
+
},
|
192
256
|
{
|
193
257
|
"inputs": [
|
194
258
|
{
|
@@ -327,6 +391,16 @@
|
|
327
391
|
"name": "wallet",
|
328
392
|
"type": "address"
|
329
393
|
},
|
394
|
+
{
|
395
|
+
"internalType": "Amount",
|
396
|
+
"name": "balanceAmount",
|
397
|
+
"type": "uint96"
|
398
|
+
},
|
399
|
+
{
|
400
|
+
"internalType": "Amount",
|
401
|
+
"name": "feeAmount",
|
402
|
+
"type": "uint96"
|
403
|
+
},
|
330
404
|
{
|
331
405
|
"internalType": "bytes",
|
332
406
|
"name": "data",
|
@@ -645,6 +719,19 @@
|
|
645
719
|
"stateMutability": "view",
|
646
720
|
"type": "function"
|
647
721
|
},
|
722
|
+
{
|
723
|
+
"inputs": [],
|
724
|
+
"name": "isConsumingScheduledOp",
|
725
|
+
"outputs": [
|
726
|
+
{
|
727
|
+
"internalType": "bytes4",
|
728
|
+
"name": "",
|
729
|
+
"type": "bytes4"
|
730
|
+
}
|
731
|
+
],
|
732
|
+
"stateMutability": "view",
|
733
|
+
"type": "function"
|
734
|
+
},
|
648
735
|
{
|
649
736
|
"inputs": [],
|
650
737
|
"name": "isNftInterceptor",
|
@@ -744,6 +831,19 @@
|
|
744
831
|
"stateMutability": "nonpayable",
|
745
832
|
"type": "function"
|
746
833
|
},
|
834
|
+
{
|
835
|
+
"inputs": [
|
836
|
+
{
|
837
|
+
"internalType": "address",
|
838
|
+
"name": "",
|
839
|
+
"type": "address"
|
840
|
+
}
|
841
|
+
],
|
842
|
+
"name": "setAuthority",
|
843
|
+
"outputs": [],
|
844
|
+
"stateMutability": "nonpayable",
|
845
|
+
"type": "function"
|
846
|
+
},
|
747
847
|
{
|
748
848
|
"inputs": [
|
749
849
|
{
|
@@ -3,6 +3,44 @@
|
|
3
3
|
"contractName": "IPoolComponent",
|
4
4
|
"sourceName": "contracts/components/IPoolComponent.sol",
|
5
5
|
"abi": [
|
6
|
+
{
|
7
|
+
"inputs": [
|
8
|
+
{
|
9
|
+
"internalType": "address",
|
10
|
+
"name": "authority",
|
11
|
+
"type": "address"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"name": "AccessManagedInvalidAuthority",
|
15
|
+
"type": "error"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"inputs": [
|
19
|
+
{
|
20
|
+
"internalType": "address",
|
21
|
+
"name": "caller",
|
22
|
+
"type": "address"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"internalType": "uint32",
|
26
|
+
"name": "delay",
|
27
|
+
"type": "uint32"
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"name": "AccessManagedRequiredDelay",
|
31
|
+
"type": "error"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"inputs": [
|
35
|
+
{
|
36
|
+
"internalType": "address",
|
37
|
+
"name": "caller",
|
38
|
+
"type": "address"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"name": "AccessManagedUnauthorized",
|
42
|
+
"type": "error"
|
43
|
+
},
|
6
44
|
{
|
7
45
|
"inputs": [
|
8
46
|
{
|
@@ -164,6 +202,19 @@
|
|
164
202
|
"name": "ErrorPoolNotPoolService",
|
165
203
|
"type": "error"
|
166
204
|
},
|
205
|
+
{
|
206
|
+
"anonymous": false,
|
207
|
+
"inputs": [
|
208
|
+
{
|
209
|
+
"indexed": false,
|
210
|
+
"internalType": "address",
|
211
|
+
"name": "authority",
|
212
|
+
"type": "address"
|
213
|
+
}
|
214
|
+
],
|
215
|
+
"name": "AuthorityUpdated",
|
216
|
+
"type": "event"
|
217
|
+
},
|
167
218
|
{
|
168
219
|
"anonymous": false,
|
169
220
|
"inputs": [
|
@@ -272,6 +323,19 @@
|
|
272
323
|
"stateMutability": "view",
|
273
324
|
"type": "function"
|
274
325
|
},
|
326
|
+
{
|
327
|
+
"inputs": [],
|
328
|
+
"name": "authority",
|
329
|
+
"outputs": [
|
330
|
+
{
|
331
|
+
"internalType": "address",
|
332
|
+
"name": "",
|
333
|
+
"type": "address"
|
334
|
+
}
|
335
|
+
],
|
336
|
+
"stateMutability": "view",
|
337
|
+
"type": "function"
|
338
|
+
},
|
275
339
|
{
|
276
340
|
"inputs": [
|
277
341
|
{
|
@@ -329,6 +393,16 @@
|
|
329
393
|
"name": "wallet",
|
330
394
|
"type": "address"
|
331
395
|
},
|
396
|
+
{
|
397
|
+
"internalType": "Amount",
|
398
|
+
"name": "balanceAmount",
|
399
|
+
"type": "uint96"
|
400
|
+
},
|
401
|
+
{
|
402
|
+
"internalType": "Amount",
|
403
|
+
"name": "feeAmount",
|
404
|
+
"type": "uint96"
|
405
|
+
},
|
332
406
|
{
|
333
407
|
"internalType": "bytes",
|
334
408
|
"name": "data",
|
@@ -466,6 +540,16 @@
|
|
466
540
|
"name": "maxCapitalAmount",
|
467
541
|
"type": "uint256"
|
468
542
|
},
|
543
|
+
{
|
544
|
+
"internalType": "uint256",
|
545
|
+
"name": "balanceAmount",
|
546
|
+
"type": "uint256"
|
547
|
+
},
|
548
|
+
{
|
549
|
+
"internalType": "uint256",
|
550
|
+
"name": "feeAmount",
|
551
|
+
"type": "uint256"
|
552
|
+
},
|
469
553
|
{
|
470
554
|
"internalType": "bool",
|
471
555
|
"name": "isInterceptingBundleTransfers",
|
@@ -616,6 +700,19 @@
|
|
616
700
|
"stateMutability": "view",
|
617
701
|
"type": "function"
|
618
702
|
},
|
703
|
+
{
|
704
|
+
"inputs": [],
|
705
|
+
"name": "isConsumingScheduledOp",
|
706
|
+
"outputs": [
|
707
|
+
{
|
708
|
+
"internalType": "bytes4",
|
709
|
+
"name": "",
|
710
|
+
"type": "bytes4"
|
711
|
+
}
|
712
|
+
],
|
713
|
+
"stateMutability": "view",
|
714
|
+
"type": "function"
|
715
|
+
},
|
619
716
|
{
|
620
717
|
"inputs": [],
|
621
718
|
"name": "isNftInterceptor",
|
@@ -697,6 +794,19 @@
|
|
697
794
|
"stateMutability": "nonpayable",
|
698
795
|
"type": "function"
|
699
796
|
},
|
797
|
+
{
|
798
|
+
"inputs": [
|
799
|
+
{
|
800
|
+
"internalType": "address",
|
801
|
+
"name": "",
|
802
|
+
"type": "address"
|
803
|
+
}
|
804
|
+
],
|
805
|
+
"name": "setAuthority",
|
806
|
+
"outputs": [],
|
807
|
+
"stateMutability": "nonpayable",
|
808
|
+
"type": "function"
|
809
|
+
},
|
700
810
|
{
|
701
811
|
"inputs": [
|
702
812
|
{
|