@etherisc/gif-next 0.0.2-d086e6d-456 → 0.0.2-d1f0662-893
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -88
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +37 -6
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +60 -13
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +37 -6
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +44 -13
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +55 -24
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +52 -21
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +55 -24
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +52 -21
- 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 +309 -2023
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +21 -62
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +424 -2776
- 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 +331 -51
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +71 -215
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +38 -83
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -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 +25 -36
- 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 +8 -8
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +6 -6
- 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 +106 -246
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +38 -55
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +166 -136
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +38 -59
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +623 -91
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +143 -32
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +185 -451
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +82 -107
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +38 -191
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +97 -45
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +306 -62
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +34 -297
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +124 -103
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +269 -60
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +510 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +5 -37
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +332 -162
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +104 -53
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +442 -84
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +90 -39
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +1004 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +688 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +56 -59
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +28 -37
- 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 +5 -37
- 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 +22 -49
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +21 -34
- 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 +10 -23
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
- 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/INftOwnable.sol/INftOwnable.json +0 -13
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +5 -37
- 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 +6 -19
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -27
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +6 -19
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +11 -38
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
- 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 +6 -19
- 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 +26 -49
- 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 +1 -1
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +124 -4
- 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/ClaimId.sol/ClaimIdLib.json +83 -4
- 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 +42 -18
- 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/PayoutId.sol/PayoutIdLib.json +116 -7
- 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/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +17 -4
- 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 +21 -2
- package/contracts/components/Distribution.sol +11 -6
- package/contracts/components/IComponent.sol +16 -2
- package/contracts/components/IPoolComponent.sol +8 -7
- package/contracts/components/IProductComponent.sol +5 -4
- package/contracts/components/Pool.sol +11 -12
- package/contracts/components/Product.sol +144 -62
- package/contracts/instance/BundleManager.sol +3 -4
- package/contracts/instance/IInstance.sol +32 -53
- package/contracts/instance/IInstanceService.sol +15 -14
- package/contracts/instance/Instance.sol +107 -205
- package/contracts/instance/InstanceAccessManager.sol +44 -25
- package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
- package/contracts/instance/InstanceReader.sol +84 -7
- package/contracts/instance/InstanceService.sol +102 -289
- package/contracts/instance/InstanceStore.sol +212 -0
- package/contracts/instance/ObjectManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +53 -41
- package/contracts/instance/base/KeyValueStore.sol +0 -31
- package/contracts/instance/base/Lifecycle.sol +15 -4
- package/contracts/instance/module/IAccess.sol +2 -2
- package/contracts/instance/module/IComponents.sol +3 -3
- package/contracts/instance/module/IDistribution.sol +3 -2
- package/contracts/instance/module/IPolicy.sol +13 -8
- package/contracts/instance/service/ApplicationService.sol +60 -224
- package/contracts/instance/service/BundleService.sol +73 -122
- package/contracts/instance/service/ClaimService.sol +318 -32
- package/contracts/instance/service/DistributionService.sol +64 -151
- package/contracts/instance/service/IApplicationService.sol +8 -28
- package/contracts/instance/service/IBundleService.sol +34 -9
- package/contracts/instance/service/IClaimService.sol +52 -23
- package/contracts/instance/service/IDistributionService.sol +11 -22
- package/contracts/instance/service/IPolicyService.sol +24 -16
- package/contracts/instance/service/IPoolService.sol +18 -3
- package/contracts/instance/service/IPricingService.sol +37 -0
- package/contracts/instance/service/PolicyService.sol +134 -118
- package/contracts/instance/service/PoolService.sol +124 -64
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +14 -14
- package/contracts/registry/IRegistryService.sol +0 -2
- package/contracts/registry/RegistryService.sol +16 -15
- package/contracts/registry/ReleaseManager.sol +20 -18
- package/contracts/shared/IPolicyHolder.sol +23 -9
- package/contracts/shared/IRegistryLinked.sol +0 -1
- package/contracts/shared/IService.sol +3 -6
- package/contracts/shared/NftOwnable.sol +0 -2
- package/contracts/shared/PolicyHolder.sol +30 -17
- package/contracts/shared/Registerable.sol +10 -9
- package/contracts/shared/RegistryLinked.sol +0 -5
- package/contracts/shared/Service.sol +16 -7
- package/contracts/shared/TokenHandler.sol +4 -2
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +49 -0
- package/contracts/types/ClaimId.sol +25 -2
- package/contracts/types/Fee.sol +7 -6
- package/contracts/types/ObjectType.sol +9 -5
- package/contracts/types/PayoutId.sol +33 -5
- package/contracts/types/StateId.sol +6 -2
- package/contracts/types/Timestamp.sol +5 -0
- package/package.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
@@ -240,16 +240,29 @@
|
|
240
240
|
],
|
241
241
|
"stateMutability": "pure",
|
242
242
|
"type": "function"
|
243
|
+
},
|
244
|
+
{
|
245
|
+
"inputs": [],
|
246
|
+
"name": "zero",
|
247
|
+
"outputs": [
|
248
|
+
{
|
249
|
+
"internalType": "Timestamp",
|
250
|
+
"name": "",
|
251
|
+
"type": "uint40"
|
252
|
+
}
|
253
|
+
],
|
254
|
+
"stateMutability": "pure",
|
255
|
+
"type": "function"
|
243
256
|
}
|
244
257
|
],
|
245
|
-
"bytecode": "
|
246
|
-
"deployedBytecode": "
|
258
|
+
"bytecode": "0x6103d161003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100be5760003560e01c8063adb618321161007b578063adb618321461016d578063add9ce9914610173578063bc1b392d14610186578063c24922ce1461018d578063da09d484146101a0578063ddf3d631146101c657600080fd5b8063790a38ad146100c357806383ffcdef146100f15780638d38cd4b1461010457806394335b1a1461011e5780639df8763914610131578063a5798b4e14610144575b600080fd5b6100dc6100d1366004610304565b64ffffffffff161590565b60405190151581526020015b60405180910390f35b6100dc6100ff366004610328565b6101d9565b6100dc610112366004610304565b64ffffffffff16151590565b6100dc61012c366004610328565b6101f2565b6100dc61013f366004610328565b610207565b610157610152366004610328565b61021b565b60405164ffffffffff90911681526020016100e8565b42610157565b6100dc610181366004610328565b6102b0565b6000610157565b6100dc61019b366004610328565b6102c4565b6101b86101ae366004610304565b64ffffffffff1690565b6040519081526020016100e8565b6100dc6101d4366004610328565b6102d9565b600064ffffffffff808316908416115b90505b92915050565b600064ffffffffff80831690841611156101e9565b600064ffffffffff808416908316146101e9565b604051633682752160e21b815264ffffffffff821660048201526000906101e99073__$a3c3b8d16d3b00e17e1b34e034b17e7fd4$__9063da09d48490602401602060405180830381865af4158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029c9190610361565b6102ad9064ffffffffff861661037a565b90565b600064ffffffffff808316908416106101e9565b600064ffffffffff80831690841610156101e9565b600064ffffffffff80841690831614156101e9565b64ffffffffff8116811461030157600080fd5b50565b60006020828403121561031657600080fd5b8135610321816102ee565b9392505050565b6000806040838503121561033b57600080fd5b8235610346816102ee565b91506020830135610356816102ee565b809150509250929050565b60006020828403121561037357600080fd5b5051919050565b808201808211156101ec57634e487b7160e01b600052601160045260246000fdfea26469706673582212209a859a9d2e862bf8df4a8ca5002e1814474f9c343aa91fa3f113da71f0d1f3dc64736f6c63430008140033",
|
259
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100be5760003560e01c8063adb618321161007b578063adb618321461016d578063add9ce9914610173578063bc1b392d14610186578063c24922ce1461018d578063da09d484146101a0578063ddf3d631146101c657600080fd5b8063790a38ad146100c357806383ffcdef146100f15780638d38cd4b1461010457806394335b1a1461011e5780639df8763914610131578063a5798b4e14610144575b600080fd5b6100dc6100d1366004610304565b64ffffffffff161590565b60405190151581526020015b60405180910390f35b6100dc6100ff366004610328565b6101d9565b6100dc610112366004610304565b64ffffffffff16151590565b6100dc61012c366004610328565b6101f2565b6100dc61013f366004610328565b610207565b610157610152366004610328565b61021b565b60405164ffffffffff90911681526020016100e8565b42610157565b6100dc610181366004610328565b6102b0565b6000610157565b6100dc61019b366004610328565b6102c4565b6101b86101ae366004610304565b64ffffffffff1690565b6040519081526020016100e8565b6100dc6101d4366004610328565b6102d9565b600064ffffffffff808316908416115b90505b92915050565b600064ffffffffff80831690841611156101e9565b600064ffffffffff808416908316146101e9565b604051633682752160e21b815264ffffffffff821660048201526000906101e99073__$a3c3b8d16d3b00e17e1b34e034b17e7fd4$__9063da09d48490602401602060405180830381865af4158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029c9190610361565b6102ad9064ffffffffff861661037a565b90565b600064ffffffffff808316908416106101e9565b600064ffffffffff80831690841610156101e9565b600064ffffffffff80841690831614156101e9565b64ffffffffff8116811461030157600080fd5b50565b60006020828403121561031657600080fd5b8135610321816102ee565b9392505050565b6000806040838503121561033b57600080fd5b8235610346816102ee565b91506020830135610356816102ee565b809150509250929050565b60006020828403121561037357600080fd5b5051919050565b808201808211156101ec57634e487b7160e01b600052601160045260246000fdfea26469706673582212209a859a9d2e862bf8df4a8ca5002e1814474f9c343aa91fa3f113da71f0d1f3dc64736f6c63430008140033",
|
247
260
|
"linkReferences": {
|
248
261
|
"contracts/types/Seconds.sol": {
|
249
262
|
"SecondsLib": [
|
250
263
|
{
|
251
264
|
"length": 20,
|
252
|
-
"start":
|
265
|
+
"start": 632
|
253
266
|
}
|
254
267
|
]
|
255
268
|
}
|
@@ -259,7 +272,7 @@
|
|
259
272
|
"SecondsLib": [
|
260
273
|
{
|
261
274
|
"length": 20,
|
262
|
-
"start":
|
275
|
+
"start": 574
|
263
276
|
}
|
264
277
|
]
|
265
278
|
}
|
@@ -20,6 +20,7 @@ import {VersionPart} from "../types/Version.sol";
|
|
20
20
|
import {Registerable} from "../shared/Registerable.sol";
|
21
21
|
import {RoleId, RoleIdLib} from "../types/RoleId.sol";
|
22
22
|
import {IAccess} from "../instance/module/IAccess.sol";
|
23
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
23
24
|
import {VersionPart} from "../types/Version.sol";
|
24
25
|
|
25
26
|
// TODO discuss to inherit from oz accessmanaged
|
@@ -95,14 +96,28 @@ abstract contract Component is
|
|
95
96
|
registerInterface(type(IComponent).interfaceId);
|
96
97
|
}
|
97
98
|
|
98
|
-
function lock() external onlyOwner
|
99
|
+
function lock() external onlyOwner {
|
99
100
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
100
101
|
}
|
101
102
|
|
102
|
-
function unlock() external onlyOwner
|
103
|
+
function unlock() external onlyOwner {
|
103
104
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
104
105
|
}
|
105
106
|
|
107
|
+
function approveTokenHandler(uint256 spendingLimitAmount) external onlyOwner {
|
108
|
+
IComponents.ComponentInfo memory info = getComponentInfo();
|
109
|
+
|
110
|
+
if(info.wallet != address(this)) {
|
111
|
+
revert ErrorComponentWalletNotComponent();
|
112
|
+
}
|
113
|
+
|
114
|
+
info.token.approve(
|
115
|
+
address(info.tokenHandler),
|
116
|
+
spendingLimitAmount);
|
117
|
+
|
118
|
+
emit LogComponentTokenHandlerApproved(spendingLimitAmount);
|
119
|
+
}
|
120
|
+
|
106
121
|
function setWallet(address newWallet)
|
107
122
|
external
|
108
123
|
override
|
@@ -197,6 +212,10 @@ abstract contract Component is
|
|
197
212
|
return _getComponentStorage()._token;
|
198
213
|
}
|
199
214
|
|
215
|
+
function getTokenHandler() public view returns (TokenHandler tokenHandler) {
|
216
|
+
return getComponentInfo().tokenHandler;
|
217
|
+
}
|
218
|
+
|
200
219
|
function isNftInterceptor() public view override returns(bool isInterceptor) {
|
201
220
|
return _getComponentStorage()._isNftInterceptor;
|
202
221
|
}
|
@@ -37,6 +37,8 @@ abstract contract Distribution is
|
|
37
37
|
mapping(address distributor => NftId distributorNftId) _distributorNftId;
|
38
38
|
}
|
39
39
|
|
40
|
+
error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
|
41
|
+
|
40
42
|
function initializeDistribution(
|
41
43
|
address registry,
|
42
44
|
NftId instanceNftId,
|
@@ -58,7 +60,7 @@ abstract contract Distribution is
|
|
58
60
|
$._minDistributionOwnerFee = minDistributionOwnerFee;
|
59
61
|
$._distributionFee = distributionFee;
|
60
62
|
$._tokenHandler = new TokenHandler(token);
|
61
|
-
$._distributionService =
|
63
|
+
$._distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
62
64
|
|
63
65
|
registerInterface(type(IDistributionComponent).interfaceId);
|
64
66
|
}
|
@@ -116,7 +118,9 @@ abstract contract Distribution is
|
|
116
118
|
returns(NftId distributorNftId)
|
117
119
|
{
|
118
120
|
DistributionStorage storage $ = _getDistributionStorage();
|
119
|
-
|
121
|
+
if($._distributorNftId[distributor].gtz()) {
|
122
|
+
revert ErrorDistributionAlreadyDistributor(distributor, $._distributorNftId[distributor]);
|
123
|
+
}
|
120
124
|
|
121
125
|
distributorNftId = $._distributionService.createDistributor(
|
122
126
|
distributor,
|
@@ -136,10 +140,11 @@ abstract contract Distribution is
|
|
136
140
|
// and add it
|
137
141
|
{
|
138
142
|
DistributionStorage storage $ = _getDistributionStorage();
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
+
// TODO re-enable once implemented
|
144
|
+
// $._distributionService.updateDistributorType(
|
145
|
+
// distributorNftId,
|
146
|
+
// distributorType,
|
147
|
+
// data);
|
143
148
|
}
|
144
149
|
|
145
150
|
/**
|
@@ -12,6 +12,7 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
12
12
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
13
|
import {NftId} from "../types/NftId.sol";
|
14
14
|
import {ObjectType} from "../types/ObjectType.sol";
|
15
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
15
16
|
|
16
17
|
/// @dev component base class
|
17
18
|
/// component examples are product, distribution, pool and oracle
|
@@ -29,9 +30,13 @@ interface IComponent is
|
|
29
30
|
error ErrorComponentWalletAddressIsSameAsCurrent();
|
30
31
|
error ErrorComponentWalletAllowanceTooSmall(address oldWallet, address newWallet, uint256 allowance, uint256 balance);
|
31
32
|
|
33
|
+
error ErrorComponentWalletNotComponent();
|
34
|
+
|
32
35
|
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
33
36
|
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
34
37
|
|
38
|
+
event LogComponentTokenHandlerApproved(uint256 limit);
|
39
|
+
|
35
40
|
/// @dev locks component to disable functions that may change state related to this component, the only exception is function "unlock"
|
36
41
|
/// only component owner (nft holder) is authorizes to call this function
|
37
42
|
function lock() external;
|
@@ -40,6 +45,11 @@ interface IComponent is
|
|
40
45
|
/// only component owner (nft holder) is authorizes to call this function
|
41
46
|
function unlock() external;
|
42
47
|
|
48
|
+
/// @dev approves token hanlder to spend up to the specified amount of tokens
|
49
|
+
/// reverts if component wallet is not component itself
|
50
|
+
/// only component owner (nft holder) is authorizes to call this function
|
51
|
+
function approveTokenHandler(uint256 spendingLimitAmount) external;
|
52
|
+
|
43
53
|
/// @dev sets the wallet address for the component
|
44
54
|
/// if the current wallet has tokens, these will be transferred
|
45
55
|
/// if the new wallet address is externally owned, an approval from the
|
@@ -49,6 +59,9 @@ interface IComponent is
|
|
49
59
|
/// @dev only product service may set product nft id during registration of product setup
|
50
60
|
function setProductNftId(NftId productNftId) external;
|
51
61
|
|
62
|
+
/// @dev defines the instance to which this component is linked to
|
63
|
+
function getInstance() external view returns (IInstance instance);
|
64
|
+
|
52
65
|
/// @dev returns the name of this component
|
53
66
|
/// to successfully register the component with an instance the name MUST be unique in the linked instance
|
54
67
|
function getName() external view returns (string memory name);
|
@@ -56,8 +69,9 @@ interface IComponent is
|
|
56
69
|
/// @dev defines which ERC20 token is used by this component
|
57
70
|
function getToken() external view returns (IERC20Metadata token);
|
58
71
|
|
59
|
-
/// @dev
|
60
|
-
|
72
|
+
/// @dev returns token handler for this component
|
73
|
+
/// only registered components return a non zero token handler
|
74
|
+
function getTokenHandler() external view returns (TokenHandler tokenHandler);
|
61
75
|
|
62
76
|
/// @dev defines the wallet address used to hold the ERC20 tokens related to this component
|
63
77
|
/// the default address is the component token address
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../types/Amount.sol";
|
4
5
|
import {Fee} from "../types/Fee.sol";
|
5
6
|
import {IComponent} from "./IComponent.sol";
|
6
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
@@ -18,17 +19,17 @@ interface IPoolComponent is IComponent {
|
|
18
19
|
|
19
20
|
error ErrorPoolApplicationBundleMismatch(NftId applicationNftId);
|
20
21
|
|
21
|
-
event LogPoolVerifiedByPool(address pool, NftId applicationNftId,
|
22
|
+
event LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount);
|
22
23
|
|
23
24
|
/// @dev increases the staked tokens by the specified amount
|
24
25
|
/// only the bundle owner may stake tokens
|
25
26
|
/// bundle MUST be in active or locked state
|
26
|
-
function stake(NftId bundleNftId,
|
27
|
+
function stake(NftId bundleNftId, Amount amount) external;
|
27
28
|
|
28
29
|
/// @dev decreases the staked tokens by the specified amount
|
29
30
|
/// only the bundle owner may unstake tokens from the bundle
|
30
31
|
/// bundle MUST be in active, locked or closed state
|
31
|
-
function unstake(NftId bundleNftId,
|
32
|
+
function unstake(NftId bundleNftId, Amount amount) external;
|
32
33
|
|
33
34
|
/// @dev extends the bundle lifetime of the bundle by the specified time
|
34
35
|
/// only the bundle owner may extend the bundle's lifetime
|
@@ -37,7 +38,7 @@ interface IPoolComponent is IComponent {
|
|
37
38
|
|
38
39
|
/// @dev locks the specified bundle
|
39
40
|
/// a bundle to be locked MUST be in active state
|
40
|
-
/// locked bundles may not be used to
|
41
|
+
/// locked bundles may not be used to collateralize any new policy
|
41
42
|
function lockBundle(NftId bundleNftId) external;
|
42
43
|
|
43
44
|
/// @dev unlocks the specified bundle
|
@@ -61,7 +62,7 @@ interface IPoolComponent is IComponent {
|
|
61
62
|
|
62
63
|
/// @dev sets the maximum overall capital amound held by this pool
|
63
64
|
/// function may only be called by pool owner
|
64
|
-
function setMaxCapitalAmount(
|
65
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount) external;
|
65
66
|
|
66
67
|
/// @dev sets the required role to create/own bundles
|
67
68
|
/// may only be called once after setting up a pool
|
@@ -88,7 +89,7 @@ interface IPoolComponent is IComponent {
|
|
88
89
|
bytes memory applicationData,
|
89
90
|
NftId bundleNftId,
|
90
91
|
bytes memory bundleFilter,
|
91
|
-
|
92
|
+
Amount collateralizationAmount
|
92
93
|
) external;
|
93
94
|
|
94
95
|
/// @dev returns true iff the application matches with the bundle
|
@@ -99,7 +100,7 @@ interface IPoolComponent is IComponent {
|
|
99
100
|
bytes memory applicationData,
|
100
101
|
NftId bundleNftId,
|
101
102
|
bytes memory bundleFilter,
|
102
|
-
|
103
|
+
Amount collateralizationAmount
|
103
104
|
)
|
104
105
|
external
|
105
106
|
view
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../types/Amount.sol";
|
4
5
|
import {Fee} from "../types/Fee.sol";
|
5
6
|
import {IComponent} from "./IComponent.sol";
|
6
7
|
import {ISetup} from "../instance/module/ISetup.sol";
|
@@ -19,20 +20,20 @@ interface IProductComponent is IComponent {
|
|
19
20
|
) external;
|
20
21
|
|
21
22
|
function calculatePremium(
|
22
|
-
|
23
|
+
Amount sumInsuredAmount,
|
23
24
|
RiskId riskId,
|
24
25
|
Seconds lifetime,
|
25
26
|
bytes memory applicationData,
|
26
27
|
NftId bundleNftId,
|
27
28
|
ReferralId referralId
|
28
|
-
) external view returns (
|
29
|
+
) external view returns (Amount premiumAmount);
|
29
30
|
|
30
31
|
function calculateNetPremium(
|
31
|
-
|
32
|
+
Amount sumInsuredAmount,
|
32
33
|
RiskId riskId,
|
33
34
|
Seconds lifetime,
|
34
35
|
bytes memory applicationData
|
35
|
-
) external view returns (
|
36
|
+
) external view returns (Amount netPremiumAmount);
|
36
37
|
|
37
38
|
|
38
39
|
function getPoolNftId() external view returns (NftId poolNftId);
|
@@ -5,12 +5,11 @@ import {Amount, AmountLib} from "../types/Amount.sol";
|
|
5
5
|
import {Component} from "./Component.sol";
|
6
6
|
import {Fee, FeeLib} from "../types/Fee.sol";
|
7
7
|
import {IBundleService} from "../instance/service/IBundleService.sol";
|
8
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
9
8
|
import {IPoolComponent} from "./IPoolComponent.sol";
|
10
9
|
import {IPoolService} from "../instance/service/IPoolService.sol";
|
11
10
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
11
|
import {NftId, NftIdLib} from "../types/NftId.sol";
|
13
|
-
import {POOL} from "../types/ObjectType.sol";
|
12
|
+
import {BUNDLE, POOL} from "../types/ObjectType.sol";
|
14
13
|
import {RoleId, PUBLIC_ROLE} from "../types/RoleId.sol";
|
15
14
|
import {Seconds} from "../types/Seconds.sol";
|
16
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
@@ -61,8 +60,8 @@ abstract contract Pool is
|
|
61
60
|
initializeComponent(registry, instanceNftId, name, token, POOL(), isInterceptingNftTransfers, initialOwner, registryData);
|
62
61
|
|
63
62
|
PoolStorage storage $ = _getPoolStorage();
|
64
|
-
$._poolService =
|
65
|
-
$._bundleService =
|
63
|
+
$._poolService = IPoolService(_getServiceAddress(POOL()));
|
64
|
+
$._bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
66
65
|
|
67
66
|
registerInterface(type(IPoolComponent).interfaceId);
|
68
67
|
}
|
@@ -70,7 +69,7 @@ abstract contract Pool is
|
|
70
69
|
|
71
70
|
function stake(
|
72
71
|
NftId bundleNftId,
|
73
|
-
|
72
|
+
Amount amount
|
74
73
|
)
|
75
74
|
public
|
76
75
|
virtual
|
@@ -83,7 +82,7 @@ abstract contract Pool is
|
|
83
82
|
|
84
83
|
function unstake(
|
85
84
|
NftId bundleNftId,
|
86
|
-
|
85
|
+
Amount amount
|
87
86
|
)
|
88
87
|
public
|
89
88
|
virtual
|
@@ -150,7 +149,7 @@ abstract contract Pool is
|
|
150
149
|
}
|
151
150
|
|
152
151
|
|
153
|
-
function setMaxCapitalAmount(
|
152
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount)
|
154
153
|
public
|
155
154
|
virtual
|
156
155
|
restricted()
|
@@ -190,7 +189,7 @@ abstract contract Pool is
|
|
190
189
|
bytes memory applicationData,
|
191
190
|
NftId bundleNftId,
|
192
191
|
bytes memory bundleFilter,
|
193
|
-
|
192
|
+
Amount collateralizationAmount
|
194
193
|
)
|
195
194
|
public
|
196
195
|
virtual
|
@@ -219,7 +218,7 @@ abstract contract Pool is
|
|
219
218
|
bytes memory applicationData,
|
220
219
|
NftId bundleNftId,
|
221
220
|
bytes memory bundleFilter,
|
222
|
-
|
221
|
+
Amount collateralizationAmount
|
223
222
|
)
|
224
223
|
public
|
225
224
|
view
|
@@ -280,9 +279,9 @@ abstract contract Pool is
|
|
280
279
|
IComponents.PoolInfo(
|
281
280
|
NftIdLib.zero(), // will be set when GIF registers the related product
|
282
281
|
PUBLIC_ROLE(), // bundleOwnerRole
|
283
|
-
|
284
|
-
|
285
|
-
|
282
|
+
AmountLib.max(), // maxCapitalAmount,
|
283
|
+
AmountLib.zero(), // initial balance amount
|
284
|
+
AmountLib.zero(), // initial fee amount
|
286
285
|
isNftInterceptor(), // isInterceptingBundleTransfers
|
287
286
|
false, // isExternallyManaged,
|
288
287
|
false, // isVerifyingApplications,
|