@etherisc/gif-next 0.0.2-e5a2253-213 → 0.0.2-e69072e-892
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → Component.sol/Component.json} +340 -59
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +804 -211
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{IBaseComponent.sol/IBaseComponent.json → IComponent.sol/IComponent.json} +95 -56
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +699 -22
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +814 -60
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +519 -4
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +896 -298
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +442 -129
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +38 -62
- 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 +910 -289
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +110 -171
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +874 -557
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +52 -115
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +101 -168
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +346 -263
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +319 -86
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -32
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +119 -189
- 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 +13 -13
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.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 +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +968 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +258 -283
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -80
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +754 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +983 -221
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +441 -72
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +556 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +130 -217
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → instance/service/IClaimService.sol/IClaimService.json} +146 -179
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +552 -140
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +40 -292
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +22 -174
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -174
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +161 -407
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -114
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +139 -237
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +302 -77
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +139 -237
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +302 -77
- 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/IRegistry.sol/IRegistry.json +98 -5
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +112 -198
- 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 +112 -27
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +18 -18
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +216 -234
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -81
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +70 -53
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +151 -50
- 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/ERC165.sol/ERC165.json +41 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -34
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{experiment/inheritance/IB.sol/IB.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +18 -20
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +22 -174
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +120 -27
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -61
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +129 -51
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +114 -157
- 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/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +129 -51
- 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 +135 -214
- 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/TestVersionable.sol/TestVersionable.json +8 -190
- 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/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 +4 -0
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
- 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/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 +4 -0
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
- 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 +4 -0
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
- 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/Timestamp.sol/TimestampLib.json +25 -7
- 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 +221 -0
- package/contracts/components/Distribution.sol +206 -67
- package/contracts/components/IComponent.sol +68 -0
- package/contracts/components/IDistributionComponent.sol +44 -9
- package/contracts/components/IPoolComponent.sol +124 -39
- package/contracts/components/IProductComponent.sol +8 -3
- package/contracts/components/Pool.sol +284 -164
- package/contracts/components/Product.sol +110 -116
- package/contracts/instance/BundleManager.sol +8 -12
- package/contracts/instance/IInstance.sol +41 -9
- package/contracts/instance/IInstanceService.sol +20 -1
- package/contracts/instance/Instance.sol +90 -61
- package/contracts/instance/InstanceAccessManager.sol +18 -24
- package/contracts/instance/InstanceReader.sol +3 -25
- package/contracts/instance/InstanceService.sol +195 -50
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/ObjectManager.sol +7 -24
- package/contracts/instance/base/{ComponentServiceBase.sol → ComponentService.sol} +9 -13
- package/contracts/instance/module/IAccess.sol +3 -4
- package/contracts/instance/module/IBundle.sol +2 -1
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +30 -3
- package/contracts/instance/module/ISetup.sol +10 -10
- package/contracts/instance/service/ApplicationService.sol +350 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +17 -12
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +312 -33
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +14 -3
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +74 -0
- package/contracts/instance/service/IPolicyService.sol +26 -50
- package/contracts/instance/service/PolicyService.sol +127 -262
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +12 -45
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +50 -26
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/IRegistry.sol +16 -8
- package/contracts/registry/IRegistryService.sol +19 -10
- package/contracts/registry/Registry.sol +120 -52
- package/contracts/registry/RegistryAccessManager.sol +31 -25
- package/contracts/registry/RegistryService.sol +91 -128
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +86 -106
- package/contracts/registry/TokenRegistry.sol +19 -13
- package/contracts/shared/ERC165.sol +14 -12
- package/contracts/shared/INftOwnable.sol +11 -10
- package/contracts/shared/IPolicyHolder.sol +26 -0
- package/contracts/shared/IRegisterable.sol +4 -4
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IService.sol +2 -0
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -80
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +16 -32
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +19 -19
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/ObjectType.sol +9 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/RoleId.sol +12 -7
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/Timestamp.sol +12 -13
- package/package.json +3 -3
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +0 -66
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +0 -24
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +0 -42
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -100
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/contracts/components/BaseComponent.sol +0 -168
- package/contracts/components/IBaseComponent.sol +0 -35
- package/contracts/experiment/cloning/Cloner.sol +0 -47
- package/contracts/experiment/errors/Require.sol +0 -38
- package/contracts/experiment/errors/Revert.sol +0 -44
- package/contracts/experiment/inheritance/A.sol +0 -53
- package/contracts/experiment/inheritance/B.sol +0 -28
- package/contracts/experiment/inheritance/C.sol +0 -34
- package/contracts/experiment/inheritance/IA.sol +0 -13
- package/contracts/experiment/inheritance/IB.sol +0 -10
- package/contracts/experiment/inheritance/IC.sol +0 -12
- package/contracts/experiment/statemachine/Dummy.sol +0 -27
- package/contracts/experiment/statemachine/ISM.sol +0 -25
- package/contracts/experiment/statemachine/SM.sol +0 -57
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
- package/contracts/experiment/types/TypeA.sol +0 -47
- package/contracts/experiment/types/TypeB.sol +0 -29
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
- package/contracts/instance/IInstanceBase.sol +0 -25
- package/contracts/instance/InstanceBase.sol +0 -39
- package/contracts/instance/base/IInstanceBase.sol +0 -21
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -4,10 +4,11 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {DISTRIBUTION} from "../types/ObjectType.sol";
|
5
5
|
import {IDistributionService} from "../instance/service/IDistributionService.sol";
|
6
6
|
import {IProductService} from "../instance/service/IProductService.sol";
|
7
|
-
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
8
|
-
import {ReferralId} from "../types/Referral.sol";
|
7
|
+
import {NftId, zeroNftId, NftIdLib, toNftId} from "../types/NftId.sol";
|
8
|
+
import {ReferralId, ReferralStatus, ReferralLib} from "../types/Referral.sol";
|
9
9
|
import {Fee, FeeLib} from "../types/Fee.sol";
|
10
|
-
import {
|
10
|
+
import {Component} from "./Component.sol";
|
11
|
+
import {IDistribution} from "../instance/module/IDistribution.sol";
|
11
12
|
import {IDistributionComponent} from "./IDistributionComponent.sol";
|
12
13
|
import {IRegistry} from "../registry/IRegistry.sol";
|
13
14
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
@@ -15,65 +16,200 @@ import {ISetup} from "../instance/module/ISetup.sol";
|
|
15
16
|
import {Registerable} from "../shared/Registerable.sol";
|
16
17
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
17
18
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
19
|
+
import {UFixed} from "../types/UFixed.sol";
|
20
|
+
import {DistributorType} from "../types/DistributorType.sol";
|
21
|
+
import {Timestamp, TimestampLib} from "../types/Timestamp.sol";
|
22
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
23
|
+
|
18
24
|
|
19
25
|
abstract contract Distribution is
|
20
|
-
|
26
|
+
Component,
|
21
27
|
IDistributionComponent
|
22
28
|
{
|
23
|
-
|
24
|
-
|
25
|
-
Fee internal _initialDistributionFee;
|
26
|
-
bool internal _isVerifying;
|
29
|
+
// keccak256(abi.encode(uint256(keccak256("etherisc.storage.Distribution")) - 1)) & ~bytes32(uint256(0xff));
|
30
|
+
bytes32 public constant DISTRIBUTION_STORAGE_LOCATION_V1 = 0xaab7c5ea03d290056d6c060e0833d3ebcbe647f7694616a2ec52738a64b2f900;
|
27
31
|
|
28
|
-
|
29
|
-
|
30
|
-
|
32
|
+
struct DistributionStorage {
|
33
|
+
Fee _minDistributionOwnerFee;
|
34
|
+
Fee _distributionFee;
|
35
|
+
TokenHandler _tokenHandler;
|
36
|
+
IDistributionService _distributionService;
|
37
|
+
mapping(address distributor => NftId distributorNftId) _distributorNftId;
|
38
|
+
}
|
31
39
|
|
32
|
-
|
40
|
+
function initializeDistribution(
|
33
41
|
address registry,
|
34
42
|
NftId instanceNftId,
|
35
|
-
|
43
|
+
string memory name,
|
36
44
|
address token,
|
37
|
-
|
45
|
+
Fee memory minDistributionOwnerFee,
|
38
46
|
Fee memory distributionFee,
|
39
|
-
address initialOwner
|
47
|
+
address initialOwner,
|
48
|
+
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
40
49
|
)
|
41
|
-
|
50
|
+
public
|
51
|
+
virtual
|
52
|
+
onlyInitializing()
|
42
53
|
{
|
43
|
-
|
44
|
-
_initialDistributionFee = distributionFee;
|
54
|
+
initializeComponent(registry, instanceNftId, name, token, DISTRIBUTION(), true, initialOwner, registryData);
|
45
55
|
|
46
|
-
|
47
|
-
|
56
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
57
|
+
// TODO add validation
|
58
|
+
$._minDistributionOwnerFee = minDistributionOwnerFee;
|
59
|
+
$._distributionFee = distributionFee;
|
60
|
+
$._tokenHandler = new TokenHandler(token);
|
61
|
+
$._distributionService = getInstance().getDistributionService();
|
48
62
|
|
49
|
-
|
63
|
+
registerInterface(type(IDistributionComponent).interfaceId);
|
50
64
|
}
|
51
65
|
|
52
|
-
|
53
66
|
function setFees(
|
67
|
+
Fee memory minDistributionOwnerFee,
|
54
68
|
Fee memory distributionFee
|
55
69
|
)
|
56
70
|
external
|
57
71
|
override
|
72
|
+
onlyOwner
|
73
|
+
restricted()
|
58
74
|
{
|
59
|
-
_distributionService.setFees(distributionFee);
|
75
|
+
_getDistributionStorage()._distributionService.setFees(minDistributionOwnerFee, distributionFee);
|
60
76
|
}
|
61
77
|
|
62
|
-
function
|
63
|
-
|
64
|
-
|
78
|
+
function getDistributionFee() external view returns (Fee memory distributionFee) {
|
79
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
80
|
+
return $._distributionFee;
|
81
|
+
}
|
82
|
+
|
83
|
+
function createDistributorType(
|
84
|
+
string memory name,
|
85
|
+
UFixed minDiscountPercentage,
|
86
|
+
UFixed maxDiscountPercentage,
|
87
|
+
UFixed commissionPercentage,
|
88
|
+
uint32 maxReferralCount,
|
89
|
+
uint32 maxReferralLifetime,
|
90
|
+
bool allowSelfReferrals,
|
91
|
+
bool allowRenewals,
|
92
|
+
bytes memory data
|
65
93
|
)
|
94
|
+
public
|
95
|
+
returns (DistributorType distributorType)
|
96
|
+
{
|
97
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
98
|
+
distributorType = $._distributionService.createDistributorType(
|
99
|
+
name,
|
100
|
+
minDiscountPercentage,
|
101
|
+
maxDiscountPercentage,
|
102
|
+
commissionPercentage,
|
103
|
+
maxReferralCount,
|
104
|
+
maxReferralLifetime,
|
105
|
+
allowSelfReferrals,
|
106
|
+
allowRenewals,
|
107
|
+
data);
|
108
|
+
}
|
109
|
+
|
110
|
+
function createDistributor(
|
111
|
+
address distributor,
|
112
|
+
DistributorType distributorType,
|
113
|
+
bytes memory data
|
114
|
+
)
|
115
|
+
public
|
116
|
+
returns(NftId distributorNftId)
|
117
|
+
{
|
118
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
119
|
+
require($._distributorNftId[distributor].eqz(), "ERROR:DST-030:ALREADY_DISTRIBUTOR");
|
120
|
+
|
121
|
+
distributorNftId = $._distributionService.createDistributor(
|
122
|
+
distributor,
|
123
|
+
distributorType,
|
124
|
+
data);
|
125
|
+
|
126
|
+
$._distributorNftId[distributor] = distributorNftId;
|
127
|
+
}
|
128
|
+
|
129
|
+
function updateDistributorType(
|
130
|
+
NftId distributorNftId,
|
131
|
+
DistributorType distributorType,
|
132
|
+
bytes memory data
|
133
|
+
)
|
134
|
+
public
|
135
|
+
// TODO figure out what we need for authz
|
136
|
+
// and add it
|
137
|
+
{
|
138
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
139
|
+
$._distributionService.updateDistributorType(
|
140
|
+
distributorNftId,
|
141
|
+
distributorType,
|
142
|
+
data);
|
143
|
+
}
|
144
|
+
|
145
|
+
/**
|
146
|
+
* @dev lets distributors create referral codes.
|
147
|
+
* referral codes need to be unique
|
148
|
+
*/
|
149
|
+
function _createReferral(
|
150
|
+
NftId distributorNftId,
|
151
|
+
string memory code,
|
152
|
+
UFixed discountPercentage,
|
153
|
+
uint32 maxReferrals,
|
154
|
+
Timestamp expiryAt,
|
155
|
+
bytes memory data
|
156
|
+
)
|
157
|
+
internal
|
158
|
+
returns (ReferralId referralId)
|
159
|
+
{
|
160
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
161
|
+
referralId = $._distributionService.createReferral(
|
162
|
+
distributorNftId,
|
163
|
+
code,
|
164
|
+
discountPercentage,
|
165
|
+
maxReferrals,
|
166
|
+
expiryAt,
|
167
|
+
data);
|
168
|
+
}
|
169
|
+
|
170
|
+
function isDistributor(address candidate)
|
171
|
+
public
|
172
|
+
view
|
173
|
+
returns (bool)
|
174
|
+
{
|
175
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
176
|
+
return $._distributorNftId[candidate].gtz();
|
177
|
+
}
|
178
|
+
|
179
|
+
function getDistributorNftId(address distributor)
|
180
|
+
public
|
181
|
+
view
|
182
|
+
returns (NftId distributorNftId)
|
183
|
+
{
|
184
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
185
|
+
return $._distributorNftId[distributor];
|
186
|
+
}
|
187
|
+
|
188
|
+
function getDiscountPercentage(string memory referralCode)
|
66
189
|
external
|
67
190
|
view
|
68
|
-
|
69
|
-
|
191
|
+
returns (
|
192
|
+
UFixed discountPercentage,
|
193
|
+
ReferralStatus status
|
194
|
+
)
|
70
195
|
{
|
71
|
-
|
72
|
-
|
73
|
-
(feeAmount,) = FeeLib.calculateFee(fee, netPremiumAmount);
|
196
|
+
ReferralId referralId = getReferralId(referralCode);
|
197
|
+
return _getInstanceReader().getDiscountPercentage(referralId);
|
74
198
|
}
|
75
199
|
|
76
200
|
|
201
|
+
function getReferralId(
|
202
|
+
string memory referralCode
|
203
|
+
)
|
204
|
+
public
|
205
|
+
view
|
206
|
+
returns (ReferralId referralId)
|
207
|
+
{
|
208
|
+
return ReferralLib.toReferralId(
|
209
|
+
getNftId(),
|
210
|
+
referralCode);
|
211
|
+
}
|
212
|
+
|
77
213
|
function calculateRenewalFeeAmount(
|
78
214
|
ReferralId referralId,
|
79
215
|
uint256 netPremiumAmount
|
@@ -89,13 +225,15 @@ abstract contract Distribution is
|
|
89
225
|
|
90
226
|
function processSale(
|
91
227
|
ReferralId referralId,
|
92
|
-
uint256
|
228
|
+
uint256 premiumAmount
|
93
229
|
)
|
94
230
|
external
|
95
|
-
|
231
|
+
onlyOwner
|
232
|
+
restricted()
|
96
233
|
virtual override
|
97
234
|
{
|
98
|
-
|
235
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
236
|
+
$._distributionService.processSale(referralId, premiumAmount);
|
99
237
|
}
|
100
238
|
|
101
239
|
function processRenewal(
|
@@ -103,52 +241,53 @@ abstract contract Distribution is
|
|
103
241
|
uint256 feeAmount
|
104
242
|
)
|
105
243
|
external
|
106
|
-
|
244
|
+
onlyOwner
|
245
|
+
restricted()
|
107
246
|
virtual override
|
108
247
|
{
|
109
248
|
// default is no action
|
110
249
|
}
|
111
250
|
|
112
|
-
function
|
113
|
-
|
114
|
-
|
251
|
+
function getSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
252
|
+
InstanceReader reader = getInstance().getInstanceReader();
|
253
|
+
setupInfo = reader.getDistributionSetupInfo(getNftId());
|
254
|
+
|
255
|
+
// fallback to initial setup info (wallet is always != address(0))
|
256
|
+
if(setupInfo.wallet == address(0)) {
|
257
|
+
setupInfo = _getInitialSetupInfo();
|
258
|
+
}
|
115
259
|
}
|
116
260
|
|
117
|
-
function
|
118
|
-
|
119
|
-
return
|
261
|
+
function _getInitialSetupInfo() internal view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
262
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
263
|
+
return ISetup.DistributionSetupInfo(
|
264
|
+
zeroNftId(),
|
265
|
+
$._tokenHandler,
|
266
|
+
$._minDistributionOwnerFee,
|
267
|
+
$._distributionFee,
|
268
|
+
address(this),
|
269
|
+
0
|
270
|
+
);
|
271
|
+
}
|
272
|
+
|
273
|
+
|
274
|
+
function _nftTransferFrom(address from, address to, uint256 tokenId) internal virtual override {
|
275
|
+
// keep track of distributor nft owner
|
276
|
+
emit LogDistributorUpdated(to, msg.sender);
|
277
|
+
DistributionStorage storage $ = _getDistributionStorage();
|
278
|
+
$._distributorNftId[from] = zeroNftId();
|
279
|
+
$._distributorNftId[to] = toNftId(tokenId);
|
120
280
|
}
|
121
281
|
|
122
282
|
|
123
283
|
/// @dev returns true iff the component needs to be called when selling/renewing policis
|
124
284
|
function isVerifying() external view returns (bool verifying) {
|
125
|
-
return
|
285
|
+
return true;
|
126
286
|
}
|
127
287
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
view
|
133
|
-
override (IRegisterable, Registerable)
|
134
|
-
returns(IRegistry.ObjectInfo memory, bytes memory)
|
135
|
-
{
|
136
|
-
(
|
137
|
-
IRegistry.ObjectInfo memory info,
|
138
|
-
) = super.getInitialInfo();
|
139
|
-
|
140
|
-
return (
|
141
|
-
info,
|
142
|
-
abi.encode(
|
143
|
-
getName(),
|
144
|
-
ISetup.DistributionSetupInfo(
|
145
|
-
_productNftId,
|
146
|
-
_tokenHandler,
|
147
|
-
_initialDistributionFee,
|
148
|
-
_isVerifying,
|
149
|
-
address(this)
|
150
|
-
)
|
151
|
-
)
|
152
|
-
);
|
288
|
+
function _getDistributionStorage() private pure returns (DistributionStorage storage $) {
|
289
|
+
assembly {
|
290
|
+
$.slot := DISTRIBUTION_STORAGE_LOCATION_V1
|
291
|
+
}
|
153
292
|
}
|
154
293
|
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
6
|
+
import {IInstance} from "../instance/IInstance.sol";
|
7
|
+
import {IInstanceService} from "../instance/IInstanceService.sol";
|
8
|
+
import {IProductService} from "../instance/service/IProductService.sol";
|
9
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
10
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
11
|
+
import {NftId} from "../types/NftId.sol";
|
12
|
+
import {ObjectType} from "../types/ObjectType.sol";
|
13
|
+
|
14
|
+
/// @dev component base class
|
15
|
+
/// component examples are product, distribution, pool and oracle
|
16
|
+
interface IComponent is
|
17
|
+
IRegisterable,
|
18
|
+
ITransferInterceptor
|
19
|
+
{
|
20
|
+
error ErrorComponentNotChainNft(address caller);
|
21
|
+
error ErrorComponentNotProductService(address caller);
|
22
|
+
error ErrorComponentNotInstance(NftId instanceNftId);
|
23
|
+
error ErrorComponentProductNftAlreadySet();
|
24
|
+
|
25
|
+
error ErrorComponentWalletAddressZero();
|
26
|
+
error ErrorComponentWalletAddressIsSameAsCurrent();
|
27
|
+
error ErrorComponentWalletAllowanceTooSmall(address oldWallet, address newWallet, uint256 allowance, uint256 balance);
|
28
|
+
|
29
|
+
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
30
|
+
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
31
|
+
|
32
|
+
/// @dev locks component to disable functions that may change state related to this component, the only exception is function "unlock"
|
33
|
+
/// only component owner (nft holder) is authorizes to call this function
|
34
|
+
function lock() external;
|
35
|
+
|
36
|
+
/// @dev unlocks component to (re-)enable functions that may change state related to this component
|
37
|
+
/// only component owner (nft holder) is authorizes to call this function
|
38
|
+
function unlock() external;
|
39
|
+
|
40
|
+
/// @dev sets the wallet address for the component
|
41
|
+
/// if the current wallet has tokens, these will be transferred
|
42
|
+
/// if the new wallet address is externally owned, an approval from the
|
43
|
+
/// owner of the external wallet for the component to move all tokens must exist
|
44
|
+
function setWallet(address walletAddress) external;
|
45
|
+
|
46
|
+
/// @dev only product service may set product nft id during registration of product setup
|
47
|
+
function setProductNftId(NftId productNftId) external;
|
48
|
+
|
49
|
+
/// @dev returns the name of this component
|
50
|
+
/// to successfully register the component with an instance the name MUST be unique in the linked instance
|
51
|
+
function getName() external view returns (string memory name);
|
52
|
+
|
53
|
+
/// @dev defines which ERC20 token is used by this component
|
54
|
+
function getToken() external view returns (IERC20Metadata token);
|
55
|
+
|
56
|
+
/// @dev defines the instance to which this component is linked to
|
57
|
+
function getInstance() external view returns (IInstance instance);
|
58
|
+
|
59
|
+
/// @dev defines the wallet address used to hold the ERC20 tokens related to this component
|
60
|
+
/// the default address is the component token address
|
61
|
+
function getWallet() external view returns (address walletAddress);
|
62
|
+
|
63
|
+
/// @dev defines the product to which this component is linked to
|
64
|
+
/// this is only relevant for pool and distribution components
|
65
|
+
function getProductNftId() external view returns (NftId productNftId);
|
66
|
+
|
67
|
+
function isNftInterceptor() external view returns(bool isInterceptor);
|
68
|
+
}
|
@@ -2,20 +2,48 @@
|
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
4
|
import {Fee} from "../types/Fee.sol";
|
5
|
-
import {
|
6
|
-
import {NftId} from "../types/NftId.sol";
|
5
|
+
import {IComponent} from "./IComponent.sol";
|
7
6
|
import {ISetup} from "../instance/module/ISetup.sol";
|
7
|
+
import {ReferralId, ReferralStatus} from "../types/Referral.sol";
|
8
|
+
import {NftId} from "../types/NftId.sol";
|
9
|
+
import {DistributorType} from "../types/DistributorType.sol";
|
10
|
+
import {UFixed} from "../types/UFixed.sol";
|
11
|
+
import {Timestamp} from "../types/Timestamp.sol";
|
12
|
+
|
13
|
+
interface IDistributionComponent is IComponent {
|
8
14
|
|
9
|
-
|
15
|
+
event LogDistributorUpdated(address to, address caller);
|
16
|
+
|
17
|
+
function getSetupInfo() external view returns (ISetup.DistributionSetupInfo memory setupInfo);
|
10
18
|
|
11
19
|
function setFees(
|
20
|
+
Fee memory minDistributionOwnerFee,
|
12
21
|
Fee memory distributionFee
|
13
22
|
) external;
|
14
23
|
|
15
|
-
function
|
16
|
-
|
17
|
-
|
18
|
-
|
24
|
+
function createDistributorType(
|
25
|
+
string memory name,
|
26
|
+
UFixed minDiscountPercentage,
|
27
|
+
UFixed maxDiscountPercentage,
|
28
|
+
UFixed commissionPercentage,
|
29
|
+
uint32 maxReferralCount,
|
30
|
+
uint32 maxReferralLifetime,
|
31
|
+
bool allowSelfReferrals,
|
32
|
+
bool allowRenewals,
|
33
|
+
bytes memory data
|
34
|
+
) external returns (DistributorType distributorType);
|
35
|
+
|
36
|
+
function createDistributor(
|
37
|
+
address distributor,
|
38
|
+
DistributorType distributorType,
|
39
|
+
bytes memory data
|
40
|
+
) external returns(NftId distributorNftId);
|
41
|
+
|
42
|
+
function updateDistributorType(
|
43
|
+
NftId distributorNftId,
|
44
|
+
DistributorType distributorType,
|
45
|
+
bytes memory data
|
46
|
+
) external;
|
19
47
|
|
20
48
|
function calculateRenewalFeeAmount(
|
21
49
|
ReferralId referralId,
|
@@ -36,8 +64,15 @@ interface IDistributionComponent {
|
|
36
64
|
uint256 feeAmount
|
37
65
|
) external;
|
38
66
|
|
39
|
-
|
40
|
-
|
67
|
+
function getDiscountPercentage(
|
68
|
+
string memory referralCode
|
69
|
+
) external view returns (UFixed discountPercentage, ReferralStatus status);
|
70
|
+
|
71
|
+
function getDistributionFee() external view returns (Fee memory distibutionFee);
|
72
|
+
|
73
|
+
function getReferralId(
|
74
|
+
string memory referralCode
|
75
|
+
) external returns (ReferralId referralId);
|
41
76
|
|
42
77
|
/// @dev returns true iff the component needs to be called when selling/renewing policis
|
43
78
|
function isVerifying() external view returns (bool verifying);
|