@etherisc/gif-next 0.0.2-da06f3b-803 → 0.0.2-da09ec0-359
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -13
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +315 -98
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +668 -141
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +241 -60
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +438 -86
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +526 -144
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +257 -144
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +676 -183
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +435 -186
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +64 -50
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +267 -1594
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +232 -208
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +393 -2515
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +359 -92
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +424 -236
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +338 -409
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +291 -108
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -13
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +197 -169
- 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 +40 -10
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +36 -11
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +51 -42
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
- 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 +918 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +648 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +526 -340
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +340 -93
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +1376 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +748 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +982 -198
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +430 -87
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +493 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +290 -270
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +743 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +527 -128
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +181 -296
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +705 -122
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +510 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +71 -160
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +449 -395
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +349 -114
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +1018 -202
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +360 -89
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +1004 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +688 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +231 -223
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +298 -95
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +15 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +70 -193
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +18 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +182 -232
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +287 -94
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +23 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +128 -37
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
- 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 +27 -29
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +189 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +8 -29
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{experiment/inheritance/IA.sol/ISharedA.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +15 -17
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +71 -160
- 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 +100 -33
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +302 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +283 -76
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +115 -58
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +71 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +172 -160
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/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/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +115 -58
- 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 +190 -210
- 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/TestVersion.sol/TestVersion.json +2 -2
- 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/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +281 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
- 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 +179 -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/Fee.sol/FeeLib.json +74 -19
- 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 +17 -4
- 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 +209 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
- 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/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +38 -7
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
- package/contracts/components/Component.sol +134 -78
- package/contracts/components/Distribution.sol +189 -57
- package/contracts/components/IComponent.sol +62 -15
- package/contracts/components/IDistributionComponent.sol +39 -15
- package/contracts/components/IPoolComponent.sol +86 -23
- package/contracts/components/IProductComponent.sol +8 -6
- package/contracts/components/Pool.sol +230 -136
- package/contracts/components/Product.sol +227 -118
- package/contracts/instance/BundleManager.sol +10 -9
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +40 -35
- package/contracts/instance/IInstanceService.sol +44 -13
- package/contracts/instance/Instance.sol +131 -171
- package/contracts/instance/InstanceAccessManager.sol +281 -154
- package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
- package/contracts/instance/InstanceReader.sol +90 -15
- package/contracts/instance/InstanceService.sol +173 -338
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +212 -0
- package/contracts/instance/ObjectManager.sol +6 -8
- package/contracts/instance/base/ComponentService.sol +53 -39
- package/contracts/instance/base/KeyValueStore.sol +13 -36
- package/contracts/instance/base/Lifecycle.sol +26 -6
- package/contracts/instance/module/IAccess.sol +18 -12
- package/contracts/instance/module/IBundle.sol +8 -5
- package/contracts/instance/module/IComponents.sol +41 -0
- package/contracts/instance/module/IDistribution.sol +3 -0
- package/contracts/instance/module/IPolicy.sol +43 -11
- package/contracts/instance/module/ISetup.sol +7 -20
- package/contracts/instance/service/ApplicationService.sol +186 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +225 -136
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +437 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +264 -22
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +62 -0
- package/contracts/instance/service/IBundleService.sol +96 -22
- package/contracts/instance/service/IClaimService.sol +90 -0
- package/contracts/instance/service/IDistributionService.sol +76 -1
- package/contracts/instance/service/IPolicyService.sol +40 -54
- package/contracts/instance/service/IPoolService.sol +97 -3
- package/contracts/instance/service/IPricingService.sol +37 -0
- package/contracts/instance/service/PolicyService.sol +200 -362
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +313 -20
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +41 -64
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +3 -2
- package/contracts/registry/IRegistryService.sol +12 -11
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +30 -20
- package/contracts/registry/RegistryService.sol +75 -51
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +32 -40
- package/contracts/registry/TokenRegistry.sol +16 -12
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/shared/ERC165.sol +14 -12
- package/contracts/shared/INftOwnable.sol +11 -10
- package/contracts/shared/IPolicyHolder.sol +40 -0
- package/contracts/shared/IRegisterable.sol +3 -3
- package/contracts/shared/IRegistryLinked.sol +11 -0
- package/contracts/shared/IService.sol +6 -4
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +64 -85
- package/contracts/shared/PolicyHolder.sol +94 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +16 -27
- package/contracts/shared/RegistryLinked.sol +43 -0
- package/contracts/shared/Service.sol +32 -20
- package/contracts/shared/TokenHandler.sol +14 -6
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +109 -0
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +75 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/Fee.sol +17 -8
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +16 -7
- package/contracts/types/PayoutId.sol +82 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +12 -8
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +7 -2
- package/contracts/types/Timestamp.sol +18 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +1 -1
- 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/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
- 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/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
@@ -5,38 +5,69 @@ import {NftId} from "../types/NftId.sol";
|
|
5
5
|
import {ObjectType} from "../types/ObjectType.sol";
|
6
6
|
import {RoleId} from "../types/RoleId.sol";
|
7
7
|
import {IService} from "../shared/IService.sol";
|
8
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
-
|
10
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
-
import {IComponent} from "../components/IComponent.sol";
|
12
8
|
|
9
|
+
import {AccessManagerUpgradeableInitializeable} from "../shared/AccessManagerUpgradeableInitializeable.sol";
|
13
10
|
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
14
11
|
import {Instance} from "./Instance.sol";
|
15
12
|
import {InstanceReader} from "./InstanceReader.sol";
|
16
13
|
import {BundleManager} from "./BundleManager.sol";
|
14
|
+
import {InstanceStore} from "./InstanceStore.sol";
|
17
15
|
|
18
16
|
interface IInstanceService is IService {
|
19
17
|
|
18
|
+
error ErrorInstanceServiceMasterInstanceAlreadySet();
|
19
|
+
error ErrorInstanceServiceMasterOzAccessManagerAlreadySet();
|
20
|
+
error ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet();
|
21
|
+
error ErrorInstanceServiceMasterBundleManagerAlreadySet();
|
22
|
+
error ErrorInstanceServiceInstanceAddressZero();
|
23
|
+
|
24
|
+
error ErrorInstanceServiceMasterInstanceReaderNotSet();
|
25
|
+
error ErrorInstanceServiceInstanceReaderAddressZero();
|
26
|
+
error ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader();
|
27
|
+
error ErrorInstanceServiceInstanceReaderInstanceMismatch();
|
28
|
+
|
29
|
+
error ErrorInstanceServiceInstanceAccessManagerZero();
|
30
|
+
error ErrorInstanceServiceInstanceReaderZero();
|
31
|
+
error ErrorInstanceServiceBundleManagerZero();
|
32
|
+
error ErrorInstanceServiceInstanceStoreZero();
|
33
|
+
|
34
|
+
error ErrorInstanceServiceInstanceAuthorityMismatch();
|
35
|
+
error ErrorInstanceServiceBundleManagerAuthorityMismatch();
|
36
|
+
error ErrorInstanceServiceInstanceReaderInstanceMismatch2();
|
37
|
+
error ErrorInstanceServiceBundleMangerInstanceMismatch();
|
38
|
+
error ErrorInstanceServiceInstanceStoreAuthorityMismatch();
|
39
|
+
|
20
40
|
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
21
41
|
error ErrorInstanceServiceNotInstanceOwner(address caller, NftId instanceNftId);
|
22
42
|
error ErrorInstanceServiceNotInstance(NftId nftId);
|
23
43
|
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
44
|
+
error ErrorInstanceServiceInstanceComponentMismatch(NftId instanceNftId, NftId componentNftId);
|
24
45
|
error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType);
|
25
46
|
|
26
|
-
event LogInstanceCloned(
|
47
|
+
event LogInstanceCloned(
|
48
|
+
address clonedOzAccessManager,
|
49
|
+
address clonedInstanceAccessManager,
|
50
|
+
address clonedInstance,
|
51
|
+
address clonedInstanceStore,
|
52
|
+
address clonedBundleManager,
|
53
|
+
address clonedInstanceReader,
|
54
|
+
NftId clonedInstanceNftId
|
55
|
+
);
|
27
56
|
|
28
57
|
function createInstanceClone()
|
29
58
|
external
|
30
59
|
returns (
|
31
|
-
InstanceAccessManager clonedAccessManager,
|
32
60
|
Instance clonedInstance,
|
33
|
-
NftId instanceNftId
|
34
|
-
InstanceReader clonedInstanceReader,
|
35
|
-
BundleManager clonedBundleManager
|
61
|
+
NftId instanceNftId
|
36
62
|
);
|
37
63
|
|
38
|
-
function
|
39
|
-
|
40
|
-
|
41
|
-
|
64
|
+
function createGifTarget(
|
65
|
+
NftId instanceNftId,
|
66
|
+
address targetAddress,
|
67
|
+
string memory targetName,
|
68
|
+
bytes4[][] memory selectors,
|
69
|
+
RoleId[] memory roles
|
70
|
+
) external;
|
42
71
|
|
72
|
+
function setComponentLocked(bool locked) external;
|
73
|
+
}
|
@@ -3,28 +3,33 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
|
6
|
-
import {Key32
|
6
|
+
import {Key32} from "../types/Key32.sol";
|
7
7
|
import {NftId} from "../types/NftId.sol";
|
8
|
-
import {
|
9
|
-
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT} from "../types/ObjectType.sol";
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
|
16
|
-
|
8
|
+
import {RiskId} from "../types/RiskId.sol";
|
9
|
+
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../types/ObjectType.sol";
|
10
|
+
import {RoleId, RoleIdLib, eqRoleId, ADMIN_ROLE, INSTANCE_ROLE, INSTANCE_OWNER_ROLE} from "../types/RoleId.sol";
|
11
|
+
import {VersionPart, VersionPartLib} from "../types/Version.sol";
|
12
|
+
import {ClaimId} from "../types/ClaimId.sol";
|
13
|
+
import {ReferralId} from "../types/Referral.sol";
|
14
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
15
|
+
import {DistributorType} from "../types/DistributorType.sol";
|
16
|
+
|
17
17
|
import {Registerable} from "../shared/Registerable.sol";
|
18
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
|
+
|
20
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
18
21
|
|
19
22
|
import {IInstance} from "./IInstance.sol";
|
20
23
|
import {InstanceReader} from "./InstanceReader.sol";
|
21
24
|
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
22
25
|
import {BundleManager} from "./BundleManager.sol";
|
26
|
+
import {InstanceStore} from "./InstanceStore.sol";
|
23
27
|
|
24
28
|
import {KeyValueStore} from "./base/KeyValueStore.sol";
|
25
29
|
|
26
|
-
import {IAccess} from "./module/IAccess.sol";
|
27
30
|
import {IBundle} from "./module/IBundle.sol";
|
31
|
+
import {IComponents} from "./module/IComponents.sol";
|
32
|
+
import {IDistribution} from "./module/IDistribution.sol";
|
28
33
|
import {IPolicy} from "./module/IPolicy.sol";
|
29
34
|
import {IRisk} from "./module/IRisk.sol";
|
30
35
|
import {ISetup} from "./module/ISetup.sol";
|
@@ -34,236 +39,191 @@ import {IPoolService} from "./service/IPoolService.sol";
|
|
34
39
|
import {IProductService} from "./service/IProductService.sol";
|
35
40
|
import {IPolicyService} from "./service/IPolicyService.sol";
|
36
41
|
import {IBundleService} from "./service/IBundleService.sol";
|
37
|
-
import {VersionPart, VersionPartLib} from "../types/Version.sol";
|
38
42
|
|
39
43
|
contract Instance is
|
40
44
|
IInstance,
|
41
45
|
AccessManagedUpgradeable,
|
42
|
-
Registerable
|
43
|
-
KeyValueStore
|
46
|
+
Registerable
|
44
47
|
{
|
45
|
-
|
46
48
|
uint256 public constant GIF_MAJOR_VERSION = 3;
|
47
49
|
|
48
|
-
uint64 public constant ADMIN_ROLE = type(uint64).min;
|
49
|
-
uint64 public constant PUBLIC_ROLE = type(uint64).max;
|
50
|
-
uint64 public constant CUSTOM_ROLE_ID_MIN = 10000;
|
51
|
-
|
52
|
-
uint32 public constant EXECUTION_DELAY = 0;
|
53
|
-
|
54
50
|
bool private _initialized;
|
55
51
|
|
56
52
|
InstanceAccessManager internal _accessManager;
|
57
53
|
InstanceReader internal _instanceReader;
|
58
54
|
BundleManager internal _bundleManager;
|
55
|
+
InstanceStore internal _instanceStore;
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
_initializeRegisterable(registryAddress, registryNftId, INSTANCE(), false, initialOwner, "");
|
67
|
-
|
68
|
-
_registerInterface(type(IInstance).interfaceId);
|
69
|
-
}
|
70
|
-
|
71
|
-
//--- ProductSetup ------------------------------------------------------//
|
72
|
-
function createProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup) external restricted() {
|
73
|
-
create(_toNftKey32(productNftId, PRODUCT()), abi.encode(setup));
|
74
|
-
}
|
75
|
-
|
76
|
-
function updateProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup, StateId newState) external restricted() {
|
77
|
-
update(_toNftKey32(productNftId, PRODUCT()), abi.encode(setup), newState);
|
78
|
-
}
|
79
|
-
|
80
|
-
function updateProductSetupState(NftId productNftId, StateId newState) external restricted() {
|
81
|
-
updateState(_toNftKey32(productNftId, PRODUCT()), newState);
|
82
|
-
}
|
83
|
-
|
84
|
-
//--- DistributionSetup ------------------------------------------------------//
|
85
|
-
function createDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup) external restricted() {
|
86
|
-
create(_toNftKey32(distributionNftId, DISTRIBUTION()), abi.encode(setup));
|
87
|
-
}
|
88
|
-
|
89
|
-
function updateDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup, StateId newState) external restricted() {
|
90
|
-
update(_toNftKey32(distributionNftId, DISTRIBUTION()), abi.encode(setup), newState);
|
57
|
+
modifier onlyChainNft() {
|
58
|
+
if(msg.sender != getRegistry().getChainNftAddress()) {
|
59
|
+
revert();
|
60
|
+
}
|
61
|
+
_;
|
91
62
|
}
|
92
63
|
|
93
|
-
function
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
}
|
101
|
-
|
102
|
-
function updatePoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup, StateId newState) external restricted() {
|
103
|
-
update(_toNftKey32(poolNftId, POOL()), abi.encode(setup), newState);
|
104
|
-
}
|
105
|
-
|
106
|
-
function updatePoolSetupState(NftId poolNftId, StateId newState) external restricted() {
|
107
|
-
updateState(_toNftKey32(poolNftId, POOL()), newState);
|
108
|
-
}
|
109
|
-
|
110
|
-
//--- DistributorType ---------------------------------------------------//
|
111
|
-
function createDistributorType(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout) external restricted() {
|
112
|
-
create(toPolicyKey32(policyNftId), abi.encode(payout));
|
113
|
-
}
|
114
|
-
|
115
|
-
function updateDistributorType(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout, StateId newState) external restricted() {
|
116
|
-
update(toPolicyKey32(policyNftId), abi.encode(payout), newState);
|
117
|
-
}
|
64
|
+
function initialize(address authority, address registryAddress, address initialOwner)
|
65
|
+
external
|
66
|
+
initializer()
|
67
|
+
{
|
68
|
+
if(authority == address(0)) {
|
69
|
+
revert ErrorInstanceInstanceAccessManagerZero();
|
70
|
+
}
|
118
71
|
|
119
|
-
|
120
|
-
|
121
|
-
|
72
|
+
__AccessManaged_init(authority);
|
73
|
+
|
74
|
+
IRegistry registry = IRegistry(registryAddress);
|
75
|
+
initializeRegisterable(registryAddress, registry.getNftId(), INSTANCE(), true, initialOwner, "");
|
122
76
|
|
123
|
-
|
124
|
-
function createDistributor(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout) external restricted() {
|
125
|
-
create(toPolicyKey32(policyNftId), abi.encode(payout));
|
77
|
+
registerInterface(type(IInstance).interfaceId);
|
126
78
|
}
|
127
79
|
|
128
|
-
|
129
|
-
update(toPolicyKey32(policyNftId), abi.encode(payout), newState);
|
130
|
-
}
|
80
|
+
//--- Roles ------------------------------------------------------------//
|
131
81
|
|
132
|
-
function
|
133
|
-
|
82
|
+
function createRole(string memory roleName, string memory adminName)
|
83
|
+
external
|
84
|
+
restricted // INSTANCE_OWNER_ROLE
|
85
|
+
returns (RoleId roleId, RoleId admin)
|
86
|
+
{
|
87
|
+
(roleId, admin) = _accessManager.createRole(roleName, adminName);
|
134
88
|
}
|
135
89
|
|
136
|
-
|
137
|
-
|
138
|
-
|
90
|
+
function grantRole(RoleId roleId, address account)
|
91
|
+
external
|
92
|
+
restricted // INSTANCE_OWNER_ROLE
|
93
|
+
{
|
94
|
+
_accessManager.grantRole(roleId, account);
|
139
95
|
}
|
140
96
|
|
141
|
-
function
|
142
|
-
|
97
|
+
function revokeRole(RoleId roleId, address account)
|
98
|
+
external
|
99
|
+
restricted // INSTANCE_OWNER_ROLE
|
100
|
+
{
|
101
|
+
_accessManager.revokeRole(roleId, account);
|
143
102
|
}
|
144
103
|
|
145
|
-
|
146
|
-
updateState(toPolicyKey32(policyNftId), newState);
|
147
|
-
}
|
104
|
+
//--- Targets ------------------------------------------------------------//
|
148
105
|
|
149
|
-
|
150
|
-
|
151
|
-
|
106
|
+
function createTarget(address target, string memory name)
|
107
|
+
external
|
108
|
+
restricted // INSTANCE_OWNER_ROLE
|
109
|
+
{
|
110
|
+
_accessManager.createTarget(target, name);
|
152
111
|
}
|
153
112
|
|
154
|
-
function
|
155
|
-
|
113
|
+
function setTargetFunctionRole(
|
114
|
+
string memory targetName,
|
115
|
+
bytes4[] calldata selectors,
|
116
|
+
RoleId roleId
|
117
|
+
)
|
118
|
+
external
|
119
|
+
restricted // INSTANCE_OWNER_ROLE
|
120
|
+
{
|
121
|
+
_accessManager.setTargetFunctionRole(targetName, selectors, roleId);
|
156
122
|
}
|
157
123
|
|
158
|
-
function
|
159
|
-
|
124
|
+
function setTargetLocked(address target, bool locked)
|
125
|
+
external
|
126
|
+
restricted // INSTANCE_OWNER_ROLE
|
127
|
+
{
|
128
|
+
_accessManager.setTargetLockedByInstance(target, locked);
|
160
129
|
}
|
161
130
|
|
162
|
-
//---
|
163
|
-
function createRisk(RiskId riskId, IRisk.RiskInfo memory risk) external restricted() {
|
164
|
-
create(riskId.toKey32(), abi.encode(risk));
|
165
|
-
}
|
131
|
+
//--- ITransferInterceptor ------------------------------------------------------------//
|
166
132
|
|
167
|
-
function
|
168
|
-
|
133
|
+
function nftMint(address to, uint256 tokenId) external onlyChainNft {
|
134
|
+
assert(_accessManager.roleMembers(INSTANCE_OWNER_ROLE()) == 0);// temp
|
135
|
+
assert(_accessManager.grantRole(INSTANCE_OWNER_ROLE(), to) == true);
|
169
136
|
}
|
170
137
|
|
171
|
-
function
|
172
|
-
|
138
|
+
function nftTransferFrom(address from, address to, uint256 tokenId) external onlyChainNft {
|
139
|
+
assert(_accessManager.revokeRole(INSTANCE_OWNER_ROLE(), from) == true);
|
140
|
+
assert(_accessManager.grantRole(INSTANCE_OWNER_ROLE(), to) == true);
|
173
141
|
}
|
174
142
|
|
175
|
-
//---
|
176
|
-
function createPolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy) external restricted() {
|
177
|
-
create(toPolicyKey32(policyNftId), abi.encode(policy));
|
178
|
-
}
|
143
|
+
//--- initial setup functions -------------------------------------------//
|
179
144
|
|
180
|
-
function
|
181
|
-
|
145
|
+
function setInstanceAccessManager(InstanceAccessManager accessManager) external restricted {
|
146
|
+
if(address(_accessManager) != address(0)) {
|
147
|
+
revert ErrorInstanceInstanceAccessManagerAlreadySet(address(_accessManager));
|
148
|
+
}
|
149
|
+
if(accessManager.authority() != authority()) {
|
150
|
+
revert ErrorInstanceInstanceAccessManagerAuthorityMismatch(authority());
|
151
|
+
}
|
152
|
+
_accessManager = accessManager;
|
182
153
|
}
|
183
|
-
|
184
|
-
function
|
185
|
-
|
154
|
+
|
155
|
+
function setBundleManager(BundleManager bundleManager) external restricted() {
|
156
|
+
if(address(_bundleManager) != address(0)) {
|
157
|
+
revert ErrorInstanceBundleManagerAlreadySet(address(_bundleManager));
|
158
|
+
}
|
159
|
+
if(bundleManager.getInstance() != Instance(this)) {
|
160
|
+
revert ErrorInstanceBundleManagerInstanceMismatch(address(this));
|
161
|
+
}
|
162
|
+
if(bundleManager.authority() != authority()) {
|
163
|
+
revert ErrorInstanceBundleManagerAuthorityMismatch(authority());
|
164
|
+
}
|
165
|
+
_bundleManager = bundleManager;
|
186
166
|
}
|
187
167
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
168
|
+
function setInstanceReader(InstanceReader instanceReader) external restricted() {
|
169
|
+
if(instanceReader.getInstance() != Instance(this)) {
|
170
|
+
revert ErrorInstanceInstanceReaderInstanceMismatch(address(this));
|
171
|
+
}
|
192
172
|
|
193
|
-
|
194
|
-
update(toPolicyKey32(policyNftId), abi.encode(claim), newState);
|
173
|
+
_instanceReader = instanceReader;
|
195
174
|
}
|
196
175
|
|
197
|
-
|
198
|
-
updateState(toPolicyKey32(policyNftId), newState);
|
199
|
-
}
|
176
|
+
//--- external view functions -------------------------------------------//
|
200
177
|
|
201
|
-
|
202
|
-
|
203
|
-
create(toPolicyKey32(policyNftId), abi.encode(payout));
|
178
|
+
function getInstanceReader() external view returns (InstanceReader) {
|
179
|
+
return _instanceReader;
|
204
180
|
}
|
205
181
|
|
206
|
-
function
|
207
|
-
|
182
|
+
function getBundleManager() external view returns (BundleManager) {
|
183
|
+
return _bundleManager;
|
208
184
|
}
|
209
185
|
|
210
|
-
function
|
211
|
-
|
186
|
+
function getInstanceAccessManager() external view returns (InstanceAccessManager) {
|
187
|
+
return _accessManager;
|
212
188
|
}
|
213
189
|
|
214
|
-
|
215
|
-
|
216
|
-
|
190
|
+
function setInstanceStore(InstanceStore instanceStore) external restricted {
|
191
|
+
if(address(_instanceStore) != address(0)) {
|
192
|
+
revert ErrorInstanceInstanceStoreAlreadySet(address(_instanceStore));
|
193
|
+
}
|
194
|
+
if(instanceStore.authority() != authority()) {
|
195
|
+
revert ErrorInstanceInstanceStoreAuthorityMismatch(authority());
|
196
|
+
}
|
197
|
+
_instanceStore = instanceStore;
|
217
198
|
}
|
218
199
|
|
219
|
-
function
|
220
|
-
return
|
200
|
+
function getInstanceStore() external view returns (InstanceStore) {
|
201
|
+
return _instanceStore;
|
221
202
|
}
|
222
203
|
|
223
|
-
function
|
224
|
-
return
|
204
|
+
function getMajorVersion() external pure returns (VersionPart majorVersion) {
|
205
|
+
return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
|
225
206
|
}
|
226
207
|
|
227
208
|
function getDistributionService() external view returns (IDistributionService) {
|
228
|
-
return IDistributionService(
|
209
|
+
return IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), VersionPart.wrap(3)));
|
229
210
|
}
|
230
211
|
|
231
212
|
function getProductService() external view returns (IProductService) {
|
232
|
-
return IProductService(
|
213
|
+
return IProductService(getRegistry().getServiceAddress(PRODUCT(), VersionPart.wrap(3)));
|
233
214
|
}
|
234
215
|
|
235
216
|
function getPoolService() external view returns (IPoolService) {
|
236
|
-
return IPoolService(
|
217
|
+
return IPoolService(getRegistry().getServiceAddress(POOL(), VersionPart.wrap(3)));
|
237
218
|
}
|
238
219
|
|
239
220
|
function getPolicyService() external view returns (IPolicyService) {
|
240
|
-
return IPolicyService(
|
221
|
+
return IPolicyService(getRegistry().getServiceAddress(POLICY(), VersionPart.wrap(3)));
|
241
222
|
}
|
242
223
|
|
243
224
|
function getBundleService() external view returns (IBundleService) {
|
244
|
-
return IBundleService(
|
225
|
+
return IBundleService(getRegistry().getServiceAddress(BUNDLE(), VersionPart.wrap(3)));
|
245
226
|
}
|
246
227
|
|
247
|
-
|
248
|
-
|
249
|
-
_instanceReader = instanceReader;
|
250
|
-
}
|
251
|
-
|
252
|
-
function getMajorVersion() external pure returns (VersionPart majorVersion) {
|
253
|
-
return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
|
254
|
-
}
|
255
|
-
|
256
|
-
function getInstanceReader() external view returns (InstanceReader) {
|
257
|
-
return _instanceReader;
|
258
|
-
}
|
259
|
-
|
260
|
-
function setBundleManager(BundleManager bundleManager) external restricted() {
|
261
|
-
require(address(_bundleManager) == address(0), "BundleManager is set");
|
262
|
-
require(bundleManager.getInstance() == Instance(this), "BundleManager instance mismatch");
|
263
|
-
_bundleManager = bundleManager;
|
264
|
-
}
|
265
|
-
|
266
|
-
function getBundleManager() external view returns (BundleManager) {
|
267
|
-
return _bundleManager;
|
268
|
-
}
|
269
|
-
}
|
228
|
+
//--- internal view/pure functions --------------------------------------//
|
229
|
+
}
|