@etherisc/gif-next 0.0.2-e016345-525 → 0.0.2-e04dbfc-031
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +137 -58
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +37 -31
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +83 -3
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +449 -248
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +222 -21
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +348 -184
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +100 -13
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +83 -129
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +207 -33
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +46 -81
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +283 -181
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +74 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +33 -68
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +155 -68
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +92 -42
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +188 -46
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +248 -191
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +207 -33
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +149 -131
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +207 -33
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +95 -45
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +113 -47
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +188 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +305 -150
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +207 -33
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +139 -28
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +100 -7
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +163 -53
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +672 -320
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +188 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +374 -197
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +113 -83
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -38
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +422 -352
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +96 -53
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +68 -38
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +189 -35
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +38 -8
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +52 -22
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +91 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +42 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +51 -21
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +188 -46
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +118 -201
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +50 -64
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +38 -80
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +38 -8
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +120 -175
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +51 -21
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +472 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +265 -278
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +86 -56
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +139 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +45 -27
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +157 -112
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +207 -33
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +260 -187
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +72 -74
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +69 -3
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +105 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +48 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +144 -99
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +58 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +215 -187
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +727 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +68 -66
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +122 -78
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +48 -42
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +157 -112
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +131 -81
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -28
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +26 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- 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 +64 -40
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +548 -429
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +22 -24
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +324 -54
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +51 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +96 -138
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +44 -50
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +113 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +38 -8
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +28 -45
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +38 -8
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.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/IRegisterable.sol/IRegisterable.json +120 -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 +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +51 -21
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- 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/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- 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 +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +112 -17
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +130 -6
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +191 -74
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +56 -32
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +30 -57
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +185 -54
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +39 -29
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +143 -129
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +33 -23
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +3 -3
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +3 -3
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +30 -6
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +3 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +43 -26
- package/contracts/accounting/AccountingServiceManager.sol +1 -1
- package/contracts/accounting/IAccountingService.sol +3 -0
- package/contracts/authorization/AccessAdmin.sol +293 -205
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +307 -231
- package/contracts/authorization/IAccessAdmin.sol +69 -36
- package/contracts/authorization/IAuthorization.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +12 -8
- package/contracts/distribution/BasicDistributionAuthorization.sol +21 -8
- package/contracts/distribution/Distribution.sol +14 -55
- package/contracts/distribution/DistributionService.sol +62 -30
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +18 -15
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -1
- package/contracts/examples/fire/FireProduct.sol +4 -3
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -1
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +29 -4
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +1 -1
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +49 -15
- package/contracts/instance/IInstanceService.sol +15 -1
- package/contracts/instance/Instance.sol +80 -23
- package/contracts/instance/InstanceAdmin.sol +269 -104
- package/contracts/instance/InstanceAuthorizationV3.sol +49 -36
- package/contracts/instance/InstanceReader.sol +106 -35
- package/contracts/instance/InstanceService.sol +144 -73
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +11 -12
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IComponents.sol +3 -2
- package/contracts/instance/module/IDistribution.sol +5 -2
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/Oracle.sol +1 -1
- package/contracts/oracle/OracleService.sol +20 -19
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPoolAuthorization.sol +21 -13
- package/contracts/pool/BundleService.sol +28 -58
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +13 -20
- package/contracts/pool/IPoolService.sol +50 -38
- package/contracts/pool/Pool.sol +9 -9
- package/contracts/pool/PoolLib.sol +309 -0
- package/contracts/pool/PoolService.sol +334 -190
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +28 -9
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -0
- package/contracts/product/BasicProductAuthorization.sol +23 -8
- package/contracts/product/ClaimService.sol +165 -139
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +11 -6
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +112 -184
- package/contracts/product/PolicyServiceLib.sol +119 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +28 -19
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +55 -13
- package/contracts/product/RiskService.sol +76 -29
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +8 -15
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryAdmin.sol +143 -342
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +149 -117
- package/contracts/registry/ServiceAuthorizationV3.sol +159 -2
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +27 -19
- package/contracts/shared/ComponentService.sol +119 -116
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/ContractLib.sol +60 -3
- package/contracts/shared/IComponent.sol +3 -4
- package/contracts/shared/IComponentService.sol +4 -10
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +2 -2
- package/contracts/shared/NftOwnable.sol +6 -5
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +45 -92
- package/contracts/staking/IStaking.sol +12 -10
- package/contracts/staking/IStakingService.sol +19 -1
- package/contracts/staking/Staking.sol +57 -26
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +6 -16
- package/contracts/staking/StakingService.sol +71 -44
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/ObjectType.sol +47 -39
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +9 -119
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +2 -2
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -2,27 +2,28 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
5
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
6
|
-
import {IInstance} from "../instance/IInstance.sol";
|
7
5
|
import {IComponentService} from "../shared/IComponentService.sol";
|
6
|
+
import {IDistribution} from "../instance/module/IDistribution.sol";
|
7
|
+
import {IDistributionService} from "./IDistributionService.sol";
|
8
|
+
import {IInstance} from "../instance/IInstance.sol";
|
8
9
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
11
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
10
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
11
12
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
13
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
13
14
|
|
14
15
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
16
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
17
|
+
import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
|
15
18
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
16
19
|
import {KEEP_STATE} from "../type/StateId.sol";
|
17
20
|
import {ObjectType, ACCOUNTING, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {UFixed} from "../type/UFixed.sol";
|
21
|
-
import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
|
21
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
22
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
22
23
|
import {ReferralId, ReferralLib} from "../type/Referral.sol";
|
24
|
+
import {Seconds} from "../type/Seconds.sol";
|
23
25
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
24
|
-
import {
|
25
|
-
import {InstanceStore} from "../instance/InstanceStore.sol";
|
26
|
+
import {UFixed} from "../type/UFixed.sol";
|
26
27
|
|
27
28
|
|
28
29
|
contract DistributionService is
|
@@ -43,11 +44,11 @@ contract DistributionService is
|
|
43
44
|
initializer()
|
44
45
|
{
|
45
46
|
(
|
46
|
-
address
|
47
|
-
address
|
47
|
+
address authority,
|
48
|
+
address registry
|
48
49
|
) = abi.decode(data, (address, address));
|
49
50
|
|
50
|
-
|
51
|
+
__Service_init(authority, registry, owner);
|
51
52
|
|
52
53
|
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
53
54
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
@@ -64,23 +65,23 @@ contract DistributionService is
|
|
64
65
|
UFixed maxDiscountPercentage,
|
65
66
|
UFixed commissionPercentage,
|
66
67
|
uint32 maxReferralCount,
|
67
|
-
|
68
|
+
Seconds maxReferralLifetime,
|
68
69
|
bool allowSelfReferrals,
|
69
70
|
bool allowRenewals,
|
70
71
|
bytes memory data
|
71
72
|
)
|
72
73
|
external
|
74
|
+
restricted()
|
73
75
|
returns (DistributorType distributorType)
|
74
76
|
{
|
75
77
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
76
|
-
// InstanceReader instanceReader = instance.getInstanceReader();
|
77
78
|
|
78
79
|
{
|
79
80
|
NftId productNftId = _getProductNftId(distributionNftId);
|
80
|
-
IComponents.
|
81
|
+
IComponents.FeeInfo memory feeInfo = instance.getInstanceReader().getFeeInfo(productNftId);
|
81
82
|
|
82
|
-
UFixed variableDistributionFees =
|
83
|
-
UFixed variableFeesPartsTotal =
|
83
|
+
UFixed variableDistributionFees = feeInfo.distributionFee.fractionalFee;
|
84
|
+
UFixed variableFeesPartsTotal = feeInfo.minDistributionOwnerFee.fractionalFee + commissionPercentage;
|
84
85
|
|
85
86
|
if (variableFeesPartsTotal > variableDistributionFees) {
|
86
87
|
revert ErrorDistributionServiceVariableFeesTooHight(variableDistributionFees.toInt1000(), variableFeesPartsTotal.toInt1000());
|
@@ -95,6 +96,7 @@ contract DistributionService is
|
|
95
96
|
distributorType = DistributorTypeLib.toDistributorType(distributionNftId, name);
|
96
97
|
IDistribution.DistributorTypeInfo memory info = IDistribution.DistributorTypeInfo(
|
97
98
|
name,
|
99
|
+
distributionNftId,
|
98
100
|
minDiscountPercentage,
|
99
101
|
maxDiscountPercentage,
|
100
102
|
commissionPercentage,
|
@@ -115,9 +117,11 @@ contract DistributionService is
|
|
115
117
|
)
|
116
118
|
external
|
117
119
|
virtual
|
120
|
+
restricted()
|
118
121
|
returns (NftId distributorNftId)
|
119
122
|
{
|
120
123
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
124
|
+
_checkDistributionType(instance.getInstanceReader(), distributorType, distributionNftId);
|
121
125
|
|
122
126
|
distributorNftId = _registryService.registerDistributor(
|
123
127
|
IRegistry.ObjectInfo(
|
@@ -141,15 +145,19 @@ contract DistributionService is
|
|
141
145
|
|
142
146
|
function changeDistributorType(
|
143
147
|
NftId distributorNftId,
|
144
|
-
DistributorType
|
148
|
+
DistributorType newDistributorType,
|
145
149
|
bytes memory data
|
146
150
|
)
|
147
151
|
external
|
148
152
|
virtual
|
153
|
+
restricted()
|
149
154
|
{
|
150
|
-
(
|
155
|
+
_checkNftType(distributorNftId, DISTRIBUTOR());
|
156
|
+
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
157
|
+
_checkDistributionType(instance.getInstanceReader(), newDistributorType, distributionNftId);
|
158
|
+
|
151
159
|
IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
|
152
|
-
distributorInfo.distributorType =
|
160
|
+
distributorInfo.distributorType = newDistributorType;
|
153
161
|
distributorInfo.data = data;
|
154
162
|
instance.getInstanceStore().updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
|
155
163
|
}
|
@@ -165,16 +173,22 @@ contract DistributionService is
|
|
165
173
|
)
|
166
174
|
external
|
167
175
|
virtual
|
176
|
+
restricted()
|
168
177
|
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
169
178
|
returns (ReferralId referralId)
|
170
179
|
{
|
171
180
|
(NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
172
181
|
|
173
182
|
if (bytes(code).length == 0) {
|
174
|
-
revert
|
183
|
+
revert ErrorDistributionServiceInvalidReferral(code);
|
175
184
|
}
|
176
185
|
if (expiryAt.eqz() || expiryAt.lte(TimestampLib.blockTimestamp())) {
|
177
|
-
revert
|
186
|
+
revert ErrorDistributionServiceExpirationInvalid(expiryAt);
|
187
|
+
}
|
188
|
+
|
189
|
+
NftId distributorDistributionNftId = getRegistry().getParentNftId(distributorNftId);
|
190
|
+
if (distributorDistributionNftId != distributionNftId) {
|
191
|
+
revert ErrorDistributionServiceDistributorDistributionMismatch(distributorNftId, distributorDistributionNftId, distributionNftId);
|
178
192
|
}
|
179
193
|
|
180
194
|
{
|
@@ -183,22 +197,23 @@ contract DistributionService is
|
|
183
197
|
IDistribution.DistributorTypeInfo memory distributorTypeData = instanceReader.getDistributorTypeInfo(distributorType);
|
184
198
|
|
185
199
|
if (distributorTypeData.maxReferralCount < maxReferrals) {
|
186
|
-
revert
|
200
|
+
revert ErrorDistributionServiceMaxReferralsExceeded(distributorTypeData.maxReferralCount);
|
187
201
|
}
|
188
202
|
if (distributorTypeData.minDiscountPercentage > discountPercentage) {
|
189
|
-
revert
|
203
|
+
revert ErrorDistributionServiceDiscountTooLow(distributorTypeData.minDiscountPercentage.toInt(), discountPercentage.toInt());
|
190
204
|
}
|
191
205
|
if (distributorTypeData.maxDiscountPercentage < discountPercentage) {
|
192
|
-
revert
|
206
|
+
revert ErrorDistributionServiceDiscountTooHigh(distributorTypeData.maxDiscountPercentage.toInt(), discountPercentage.toInt());
|
193
207
|
}
|
194
|
-
if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime) {
|
195
|
-
revert
|
208
|
+
if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime.toInt()) {
|
209
|
+
revert ErrorDistributionServiceExpiryTooLong(distributorTypeData.maxReferralLifetime, expiryAt);
|
196
210
|
}
|
197
211
|
}
|
198
212
|
|
199
213
|
{
|
200
214
|
referralId = ReferralLib.toReferralId(distributionNftId, code);
|
201
215
|
IDistribution.ReferralInfo memory info = IDistribution.ReferralInfo(
|
216
|
+
distributionNftId,
|
202
217
|
distributorNftId,
|
203
218
|
code,
|
204
219
|
discountPercentage,
|
@@ -279,7 +294,7 @@ contract DistributionService is
|
|
279
294
|
function withdrawCommission(NftId distributorNftId, Amount amount)
|
280
295
|
public
|
281
296
|
virtual
|
282
|
-
|
297
|
+
restricted()
|
283
298
|
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
284
299
|
returns (Amount withdrawnAmount)
|
285
300
|
{
|
@@ -314,7 +329,7 @@ contract DistributionService is
|
|
314
329
|
{
|
315
330
|
address distributor = getRegistry().ownerOf(distributorNftId);
|
316
331
|
emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(distributionInfo.token), withdrawnAmount);
|
317
|
-
distributionInfo.tokenHandler.
|
332
|
+
distributionInfo.tokenHandler.pushToken(distributor, withdrawnAmount);
|
318
333
|
}
|
319
334
|
}
|
320
335
|
|
@@ -337,16 +352,33 @@ contract DistributionService is
|
|
337
352
|
return false;
|
338
353
|
}
|
339
354
|
|
355
|
+
// ensure the referral was created on the same distribution
|
356
|
+
if(info.distributionNftId != distributionNftId) {
|
357
|
+
revert ErrorDistributionServiceReferralDistributionMismatch(referralId, info.distributionNftId, distributionNftId);
|
358
|
+
}
|
359
|
+
|
340
360
|
isValid = info.expiryAt.eqz() || (info.expiryAt.gtz() && TimestampLib.blockTimestamp() <= info.expiryAt);
|
341
361
|
isValid = isValid && info.usedReferrals < info.maxReferrals;
|
342
362
|
}
|
343
363
|
|
364
|
+
function _checkDistributionType(InstanceReader instanceReader, DistributorType distributorType, NftId expectedDistributionNftId)
|
365
|
+
internal
|
366
|
+
view
|
367
|
+
{
|
368
|
+
// enfore distributor type belongs to the calling distribution
|
369
|
+
NftId distributorTypeDistributionNftId = instanceReader.getDistributorTypeInfo(distributorType).distributionNftId;
|
370
|
+
|
371
|
+
if (distributorTypeDistributionNftId != expectedDistributionNftId) {
|
372
|
+
revert ErrorDistributionServiceDistributorTypeDistributionMismatch(distributorType, distributorTypeDistributionNftId, expectedDistributionNftId);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
|
344
376
|
function _getInstanceForDistribution(NftId distributionNftId)
|
345
377
|
internal
|
346
378
|
view
|
347
379
|
returns(IInstance instance)
|
348
380
|
{
|
349
|
-
NftId instanceNftId = getRegistry().
|
381
|
+
NftId instanceNftId = getRegistry().getParentNftId(distributionNftId);
|
350
382
|
address instanceAddress = getRegistry().getObjectAddress(instanceNftId);
|
351
383
|
return IInstance(instanceAddress);
|
352
384
|
}
|
@@ -17,7 +17,7 @@ contract DistributionServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
DistributionService svc = new DistributionService{salt: salt}();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|
@@ -9,17 +9,8 @@ import {UFixed} from "../type/UFixed.sol";
|
|
9
9
|
|
10
10
|
interface IDistributionComponent is IInstanceLinkedComponent {
|
11
11
|
|
12
|
-
error ErrorDistributionNotDistributor(address distributor);
|
13
|
-
error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
|
14
|
-
|
15
12
|
event LogDistributorUpdated(address to, address operator);
|
16
13
|
|
17
|
-
/// @dev Returns true iff the provided address is registered as a distributor with this distribution component.
|
18
|
-
function isDistributor(address candidate) external view returns (bool);
|
19
|
-
|
20
|
-
/// @dev Returns the distributor Nft Id for the provided address
|
21
|
-
function getDistributorNftId(address distributor) external view returns (NftId distributorNftId);
|
22
|
-
|
23
14
|
function getDiscountPercentage(
|
24
15
|
string memory referralCode
|
25
16
|
) external view returns (UFixed discountPercentage, ReferralStatus status);
|
@@ -8,31 +8,34 @@ import {IService} from "../shared/IService.sol";
|
|
8
8
|
import {UFixed} from "../type/UFixed.sol";
|
9
9
|
import {DistributorType} from "../type/DistributorType.sol";
|
10
10
|
import {ReferralId} from "../type/Referral.sol";
|
11
|
+
import {Seconds} from "../type/Seconds.sol";
|
11
12
|
import {Timestamp} from "../type/Timestamp.sol";
|
12
13
|
|
13
14
|
|
14
15
|
interface IDistributionService is IService {
|
15
|
-
|
16
16
|
error ErrorDistributionServiceCallerNotRegistered(address caller);
|
17
|
-
error
|
18
|
-
error
|
19
|
-
error
|
20
|
-
error
|
21
|
-
error
|
22
|
-
error
|
23
|
-
error
|
24
|
-
error
|
25
|
-
error
|
26
|
-
error
|
27
|
-
error
|
17
|
+
error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
18
|
+
error ErrorDistributionServiceCallerNotDistributor(address caller);
|
19
|
+
error ErrorDistributionServiceInvalidReferralId(ReferralId referralId);
|
20
|
+
error ErrorDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
|
21
|
+
error ErrorDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
|
22
|
+
error ErrorDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
|
23
|
+
error ErrorDistributionServiceExpiryTooLong(Seconds maxReferralLifetime, Timestamp expiryAt);
|
24
|
+
error ErrorDistributionServiceInvalidReferral(string code);
|
25
|
+
error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
|
26
|
+
error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
27
|
+
error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
28
|
+
error ErrorDistributionServiceDistributorTypeDistributionMismatch(DistributorType distributorType, NftId distributorTypeDistributionNftId, NftId distributionNftId);
|
29
|
+
error ErrorDistributionServiceDistributorDistributionMismatch(NftId distributorNftId, NftId distributorDistributionNftId, NftId distributionNftId);
|
28
30
|
|
29
31
|
error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
|
30
32
|
|
31
33
|
error ErrorDistributionServiceVariableFeesTooHight(uint256 maxDiscountPercentage, uint256 limit);
|
32
34
|
error ErrorDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
33
35
|
|
34
|
-
error
|
36
|
+
error ErrorDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
35
37
|
error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
|
38
|
+
error ErrorDistributionServiceReferralDistributionMismatch(ReferralId referralId, NftId referralDistributionNft, NftId distributionNftId);
|
36
39
|
|
37
40
|
event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount);
|
38
41
|
|
@@ -42,7 +45,7 @@ interface IDistributionService is IService {
|
|
42
45
|
UFixed maxDiscountPercentage,
|
43
46
|
UFixed commissionPercentage,
|
44
47
|
uint32 maxReferralCount,
|
45
|
-
|
48
|
+
Seconds maxReferralLifetime,
|
46
49
|
bool allowSelfReferrals,
|
47
50
|
bool allowRenewals,
|
48
51
|
bytes memory data
|
@@ -58,7 +61,7 @@ interface IDistributionService is IService {
|
|
58
61
|
|
59
62
|
function changeDistributorType(
|
60
63
|
NftId distributorNftId,
|
61
|
-
DistributorType
|
64
|
+
DistributorType newDistributorType,
|
62
65
|
bytes memory data
|
63
66
|
) external;
|
64
67
|
|
@@ -25,7 +25,7 @@ contract FirePoolAuthorization
|
|
25
25
|
IAccess.FunctionInfo[] storage functions;
|
26
26
|
|
27
27
|
// authorize public role (open access to any account, only allows to lock target)
|
28
|
-
functions = _authorizeForTarget(
|
28
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
29
29
|
// TODO: FirePool.createBundle must require a custom role (e.g. INVESTOR) instead of PUBLIC_ROLE
|
30
30
|
_authorize(functions, FirePool.approveTokenHandler.selector, "approveTokenHandler");
|
31
31
|
_authorize(functions, FirePool.createBundle.selector, "createBundle");
|
@@ -107,7 +107,9 @@ contract FireProduct is
|
|
107
107
|
numberOfOracles: 0,
|
108
108
|
poolNftId: NftIdLib.zero(),
|
109
109
|
distributionNftId: NftIdLib.zero(),
|
110
|
-
oracleNftId: new NftId[](0)
|
110
|
+
oracleNftId: new NftId[](0)
|
111
|
+
}),
|
112
|
+
IComponents.FeeInfo({
|
111
113
|
productFee: FeeLib.zero(),
|
112
114
|
processingFee: FeeLib.zero(),
|
113
115
|
distributionFee: FeeLib.zero(),
|
@@ -250,8 +252,7 @@ contract FireProduct is
|
|
250
252
|
return _riskMapping[cityName];
|
251
253
|
}
|
252
254
|
_cities.push(cityName);
|
253
|
-
risk =
|
254
|
-
_createRisk(risk, "");
|
255
|
+
risk = _createRisk(bytes32(abi.encodePacked(cityName)), "");
|
255
256
|
_riskMapping[cityName] = risk;
|
256
257
|
}
|
257
258
|
|
@@ -23,7 +23,7 @@ contract FireProductAuthorization
|
|
23
23
|
IAccess.FunctionInfo[] storage functions;
|
24
24
|
|
25
25
|
// authorize public role (open access to any account, only allows to lock target)
|
26
|
-
functions = _authorizeForTarget(
|
26
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
27
27
|
// fully public functions
|
28
28
|
_authorize(functions, FireProduct.approveTokenHandler.selector, "approveTokenHandler");
|
29
29
|
_authorize(functions, FireProduct.createApplication.selector, "createApplication");
|
@@ -7,6 +7,9 @@ import {Amount} from "../../type/Amount.sol";
|
|
7
7
|
import {BasicDistribution} from "../../distribution/BasicDistribution.sol";
|
8
8
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
9
9
|
import {NftId} from "../../type/NftId.sol";
|
10
|
+
import {ReferralId} from "../../type/Referral.sol";
|
11
|
+
import {Timestamp, TimestampLib} from "../../type/Timestamp.sol";
|
12
|
+
import {UFixed, UFixedLib} from "../../type/UFixed.sol";
|
10
13
|
|
11
14
|
|
12
15
|
contract SimpleDistribution is
|
@@ -54,4 +57,29 @@ contract SimpleDistribution is
|
|
54
57
|
function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
|
55
58
|
function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
|
56
59
|
function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
|
60
|
+
|
61
|
+
/**
|
62
|
+
* @dev create referral codes. This is required for testing only to provide a distributor that is not the message sender.
|
63
|
+
*/
|
64
|
+
function createReferral2(
|
65
|
+
NftId distributorNftId,
|
66
|
+
string memory code,
|
67
|
+
UFixed discountPercentage,
|
68
|
+
uint32 maxReferrals,
|
69
|
+
Timestamp expiryAt,
|
70
|
+
bytes memory data
|
71
|
+
)
|
72
|
+
external
|
73
|
+
virtual
|
74
|
+
returns (ReferralId referralId)
|
75
|
+
{
|
76
|
+
return _createReferral(
|
77
|
+
distributorNftId,
|
78
|
+
code,
|
79
|
+
discountPercentage,
|
80
|
+
maxReferrals,
|
81
|
+
expiryAt,
|
82
|
+
data); // data
|
83
|
+
}
|
84
|
+
|
57
85
|
}
|
@@ -21,7 +21,7 @@ contract SimpleDistributionAuthorization
|
|
21
21
|
|
22
22
|
// authorize public role (open access to any account, only allows to lock target)
|
23
23
|
IAccess.FunctionInfo[] storage functions;
|
24
|
-
functions = _authorizeForTarget(
|
24
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
25
25
|
_authorize(functions, SimpleDistribution.approveTokenHandler.selector, "approveTokenHandler");
|
26
26
|
_authorize(functions, SimpleDistribution.setWallet.selector, "setWallet");
|
27
27
|
}
|
@@ -5,7 +5,6 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
5
5
|
|
6
6
|
import {Amount, AmountLib} from "../../type/Amount.sol";
|
7
7
|
import {BasicPool} from "../../pool/BasicPool.sol";
|
8
|
-
import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
|
9
8
|
import {Fee} from "../../type/Fee.sol";
|
10
9
|
import {IAuthorization} from "../../authorization/IAuthorization.sol";
|
11
10
|
import {IComponents} from "../../instance/module/IComponents.sol";
|
@@ -21,7 +21,7 @@ contract SimplePoolAuthorization
|
|
21
21
|
|
22
22
|
// authorize public role (open access to any account, only allows to lock target)
|
23
23
|
IAccess.FunctionInfo[] storage functions;
|
24
|
-
functions = _authorizeForTarget(
|
24
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
25
25
|
_authorize(functions, SimplePool.approveTokenHandler.selector, "approveTokenHandler");
|
26
26
|
_authorize(functions, SimplePool.setWallet.selector, "setWallet");
|
27
27
|
}
|
@@ -39,6 +39,7 @@ contract SimpleProduct is
|
|
39
39
|
string memory name,
|
40
40
|
address token,
|
41
41
|
IComponents.ProductInfo memory productInfo,
|
42
|
+
IComponents.FeeInfo memory feeInfo,
|
42
43
|
IAuthorization authorization,
|
43
44
|
address initialOwner
|
44
45
|
)
|
@@ -49,6 +50,7 @@ contract SimpleProduct is
|
|
49
50
|
name,
|
50
51
|
token,
|
51
52
|
productInfo,
|
53
|
+
feeInfo,
|
52
54
|
authorization,
|
53
55
|
initialOwner);
|
54
56
|
}
|
@@ -60,6 +62,7 @@ contract SimpleProduct is
|
|
60
62
|
string memory name,
|
61
63
|
address token,
|
62
64
|
IComponents.ProductInfo memory productInfo,
|
65
|
+
IComponents.FeeInfo memory feeInfo,
|
63
66
|
IAuthorization authorization,
|
64
67
|
address initialOwner
|
65
68
|
)
|
@@ -73,6 +76,7 @@ contract SimpleProduct is
|
|
73
76
|
name,
|
74
77
|
token,
|
75
78
|
productInfo,
|
79
|
+
feeInfo,
|
76
80
|
authorization,
|
77
81
|
initialOwner);
|
78
82
|
|
@@ -81,11 +85,11 @@ contract SimpleProduct is
|
|
81
85
|
|
82
86
|
|
83
87
|
function createRisk(
|
84
|
-
|
88
|
+
string memory id,
|
85
89
|
bytes memory data
|
86
|
-
) public {
|
87
|
-
_createRisk(
|
88
|
-
id,
|
90
|
+
) public returns (RiskId) {
|
91
|
+
return _createRisk(
|
92
|
+
bytes32(abi.encodePacked(id)),
|
89
93
|
data
|
90
94
|
);
|
91
95
|
}
|
@@ -184,6 +188,13 @@ contract SimpleProduct is
|
|
184
188
|
_activate(policyNftId, activateAt);
|
185
189
|
}
|
186
190
|
|
191
|
+
function adjustActivation(
|
192
|
+
NftId policyNftId,
|
193
|
+
Timestamp activateAt
|
194
|
+
) public {
|
195
|
+
_adjustActivation(policyNftId, activateAt);
|
196
|
+
}
|
197
|
+
|
187
198
|
function close(
|
188
199
|
NftId policyNftId
|
189
200
|
) public {
|
@@ -198,6 +209,13 @@ contract SimpleProduct is
|
|
198
209
|
return _submitClaim(policyNftId, claimAmount, submissionData);
|
199
210
|
}
|
200
211
|
|
212
|
+
function revokeClaim(
|
213
|
+
NftId policyNftId,
|
214
|
+
ClaimId claimId
|
215
|
+
) public {
|
216
|
+
_revokeClaim(policyNftId, claimId);
|
217
|
+
}
|
218
|
+
|
201
219
|
function confirmClaim(
|
202
220
|
NftId policyNftId,
|
203
221
|
ClaimId claimId,
|
@@ -231,6 +249,13 @@ contract SimpleProduct is
|
|
231
249
|
return _createPayout(policyNftId, claimId, amount, data);
|
232
250
|
}
|
233
251
|
|
252
|
+
function cancelPayout(
|
253
|
+
NftId policyNftId,
|
254
|
+
PayoutId payoutId
|
255
|
+
) public {
|
256
|
+
_cancelPayout(policyNftId, payoutId);
|
257
|
+
}
|
258
|
+
|
234
259
|
// TODO add test
|
235
260
|
function createPayoutForBeneficiary(
|
236
261
|
NftId policyNftId,
|
@@ -21,7 +21,7 @@ contract SimpleProductAuthorization
|
|
21
21
|
|
22
22
|
// authorize public role (open access to any account, only allows to lock target)
|
23
23
|
IAccess.FunctionInfo[] storage functions;
|
24
|
-
functions = _authorizeForTarget(
|
24
|
+
functions = _authorizeForTarget(getMainTargetName(), PUBLIC_ROLE());
|
25
25
|
_authorize(functions, SimpleProduct.approveTokenHandler.selector, "approveTokenHandler");
|
26
26
|
_authorize(functions, SimpleProduct.setWallet.selector, "setWallet");
|
27
27
|
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IPolicy} from "../instance/module/IPolicy.sol";
|
5
4
|
import {LibNftIdSet} from "../type/NftIdSet.sol";
|
6
5
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
7
6
|
import {Key32} from "../type/Key32.sol";
|
8
7
|
import {BUNDLE} from "../type/ObjectType.sol";
|
9
8
|
|
10
9
|
import {ObjectSet} from "./base/ObjectSet.sol";
|
10
|
+
import {ObjectSetHelperLib} from "./base/ObjectSetHelperLib.sol";
|
11
11
|
|
12
12
|
contract BundleSet is
|
13
13
|
ObjectSet
|
@@ -60,7 +60,7 @@ contract BundleSet is
|
|
60
60
|
/// @dev add a new bundle to a pool registerd with this instance
|
61
61
|
// the corresponding pool is fetched via instance reader
|
62
62
|
function add(NftId bundleNftId) external restricted() {
|
63
|
-
NftId poolNftId =
|
63
|
+
NftId poolNftId = ObjectSetHelperLib.getPoolNftId(_instanceAddress, bundleNftId);
|
64
64
|
|
65
65
|
// ensure pool is registered with instance
|
66
66
|
if(poolNftId.eqz()) {
|
@@ -74,14 +74,14 @@ contract BundleSet is
|
|
74
74
|
|
75
75
|
/// @dev unlocked (active) bundles are available to collateralize new policies
|
76
76
|
function unlock(NftId bundleNftId) external restricted() {
|
77
|
-
NftId poolNftId =
|
77
|
+
NftId poolNftId = ObjectSetHelperLib.getPoolNftId(_instanceAddress, bundleNftId);
|
78
78
|
_activate(poolNftId, _toBundleKey32(bundleNftId));
|
79
79
|
emit LogBundleSetBundleUnlocked(poolNftId, bundleNftId);
|
80
80
|
}
|
81
81
|
|
82
82
|
/// @dev locked (deactivated) bundles may not collateralize any new policies
|
83
83
|
function lock(NftId bundleNftId) external restricted() {
|
84
|
-
NftId poolNftId =
|
84
|
+
NftId poolNftId = ObjectSetHelperLib.getPoolNftId(_instanceAddress, bundleNftId);
|
85
85
|
_deactivate(poolNftId, _toBundleKey32(bundleNftId));
|
86
86
|
emit LogBundleSetBundleLocked(poolNftId, bundleNftId);
|
87
87
|
}
|