@etherisc/gif-next 0.0.2-ce2fc91-485 → 0.0.2-ce8407f-016
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +71 -25
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +115 -48
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.json +101 -0
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +1119 -0
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +1082 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1 -1907
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2428 -1138
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +917 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +878 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +117 -0
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +50 -55
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IService.sol/IService.json +174 -53
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +156 -112
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +4 -4
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.json +220 -52
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +211 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{bundle/IBundle.sol → IBundle.sol}/IBundle.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{access/IAccess.sol/IAccess.json → IDistribution.sol/IDistribution.json} +2 -2
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{policy/IPolicy.sol → IPolicy.sol}/IPolicy.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{risk/IRisk.sol → IRisk.sol}/IRisk.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +4 -0
- package/artifacts/contracts/instance/{base/ModuleBase.sol/ModuleBase.json → module/ISetup.sol/ISetup.json} +2 -2
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{treasury/ITreasury.sol → ITreasury.sol}/ITreasury.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +141 -12
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +5 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +298 -39
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +745 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +34 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +489 -120
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1013 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +476 -0
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +107 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +127 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +117 -37
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +55 -14
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +158 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +349 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +190 -37
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +96 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +78 -14
- 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 +204 -36
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +5 -111
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +283 -62
- 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 +103 -23
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +104 -0
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +50 -11
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +31 -17
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +100 -0
- 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/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +123 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +134 -8
- 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 +15 -2
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +40 -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/IBaseComponent.sol +4 -4
- package/contracts/instance/AccessManagedSimple.sol +114 -0
- package/contracts/instance/AccessManagerSimple.sol +682 -0
- package/contracts/instance/IAccessManagerSimple.sol +391 -0
- package/contracts/instance/IInstance.sol +3 -49
- package/contracts/instance/Instance.sol +378 -54
- package/contracts/instance/InstanceAccessManager.sol +288 -0
- package/contracts/instance/InstanceReader.sol +235 -0
- package/contracts/instance/InstanceService.sol +45 -0
- package/contracts/instance/base/IKeyValueStore.sol +10 -11
- package/contracts/instance/base/ILifecycle.sol +3 -3
- package/contracts/instance/base/KeyValueStore.sol +50 -18
- package/contracts/instance/base/Lifecycle.sol +16 -11
- package/contracts/instance/base/ServiceBase.sol +20 -13
- package/contracts/instance/module/IAccess.sol +38 -0
- package/contracts/instance/module/IBundle.sol +19 -0
- package/contracts/instance/module/IDistribution.sol +39 -0
- package/contracts/instance/module/IPolicy.sol +45 -0
- package/contracts/instance/module/IRisk.sol +11 -0
- package/contracts/instance/module/ISetup.sol +41 -0
- package/contracts/instance/module/ITreasury.sol +23 -0
- package/contracts/registry/ChainNft.sol +43 -15
- package/contracts/registry/IChainNft.sol +3 -2
- package/contracts/registry/IRegistry.sol +42 -26
- package/contracts/registry/IRegistryService.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +6 -0
- package/contracts/registry/Registry.sol +384 -274
- package/contracts/registry/RegistryService.sol +369 -0
- package/contracts/registry/RegistryServiceManager.sol +43 -0
- package/contracts/shared/ContractDeployerLib.sol +72 -0
- package/contracts/shared/ERC165.sol +1 -1
- package/contracts/shared/INftOwnable.sol +22 -0
- package/contracts/shared/IRegisterable.sol +9 -16
- package/contracts/shared/IVersionable.sol +55 -11
- package/contracts/shared/NftOwnable.sol +136 -0
- package/contracts/shared/ProxyManager.sol +94 -0
- package/contracts/shared/Registerable.sol +62 -59
- package/contracts/shared/TokenHandler.sol +27 -0
- package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
- package/contracts/shared/Versionable.sol +113 -55
- package/contracts/test/TestRegisterable.sol +5 -6
- package/contracts/test/TestRoleId.sol +6 -6
- package/contracts/test/TestService.sol +5 -11
- package/contracts/types/DistributorType.sol +55 -0
- package/contracts/types/Fee.sol +8 -3
- package/contracts/types/Key32.sol +8 -3
- package/contracts/types/NumberId.sol +52 -0
- package/contracts/types/ObjectType.sol +44 -11
- package/contracts/types/Referral.sol +85 -0
- package/contracts/types/RiskId.sol +43 -0
- package/contracts/types/RoleId.sol +47 -10
- package/contracts/types/StateId.sol +1 -1
- package/contracts/types/Timestamp.sol +7 -3
- package/contracts/types/Version.sol +9 -0
- package/package.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -174
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +0 -356
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +0 -279
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.json +0 -387
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.json +0 -305
- package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.json +0 -24
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +0 -300
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -63
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.json +0 -326
- package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.json +0 -333
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.json +0 -333
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +0 -296
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +0 -296
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +0 -10
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.json +0 -10
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.json +0 -10
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +0 -241
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.json +0 -10
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +0 -241
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +0 -271
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +0 -271
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.json +0 -10
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -149
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -149
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +0 -10
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +0 -10
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +0 -533
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +0 -76
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +0 -533
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -507
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -364
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +0 -376
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +0 -477
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -471
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -673
- package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.json +0 -24
- package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +0 -4
- package/artifacts/contracts/shared/IOwnable.sol/IOwnable.json +0 -24
- package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +0 -4
- package/artifacts/contracts/test/TestPool.sol/TestPool.json +0 -387
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +0 -4
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +0 -393
- package/contracts/components/BaseComponent.sol +0 -88
- package/contracts/components/IPoolComponent.sol +0 -57
- package/contracts/components/IProductComponent.sol +0 -19
- package/contracts/components/Pool.sol +0 -174
- package/contracts/components/Product.sol +0 -117
- package/contracts/experiment/statemachine/README.md +0 -112
- package/contracts/instance/IInstanceLinked.sol +0 -8
- package/contracts/instance/base/ComponentServiceBase.sol +0 -42
- package/contracts/instance/base/IInstanceBase.sol +0 -14
- package/contracts/instance/base/InstanceBase.sol +0 -80
- package/contracts/instance/base/ModuleBase.sol +0 -52
- package/contracts/instance/module/access/Access.sol +0 -149
- package/contracts/instance/module/access/IAccess.sol +0 -53
- package/contracts/instance/module/bundle/BundleModule.sol +0 -136
- package/contracts/instance/module/bundle/IBundle.sol +0 -58
- package/contracts/instance/module/compensation/CompensationModule.sol +0 -8
- package/contracts/instance/module/compensation/ICompensation.sol +0 -10
- package/contracts/instance/module/component/ComponentModule.sol +0 -104
- package/contracts/instance/module/component/IComponent.sol +0 -63
- package/contracts/instance/module/policy/IPolicy.sol +0 -61
- package/contracts/instance/module/policy/PolicyModule.sol +0 -77
- package/contracts/instance/module/pool/IPoolModule.sol +0 -41
- package/contracts/instance/module/pool/PoolModule.sol +0 -87
- package/contracts/instance/module/risk/IRisk.sol +0 -10
- package/contracts/instance/module/risk/RiskModule.sol +0 -8
- package/contracts/instance/module/treasury/ITreasury.sol +0 -103
- package/contracts/instance/module/treasury/TokenHandler.sol +0 -48
- package/contracts/instance/module/treasury/TreasuryModule.sol +0 -152
- package/contracts/instance/service/ComponentOwnerService.sol +0 -176
- package/contracts/instance/service/IComponentOwnerService.sol +0 -22
- package/contracts/instance/service/IPoolService.sol +0 -30
- package/contracts/instance/service/IProductService.sol +0 -58
- package/contracts/instance/service/PoolService.sol +0 -123
- package/contracts/instance/service/ProductService.sol +0 -354
- package/contracts/registry/IRegistryLinked.sol +0 -8
- package/contracts/shared/IOwnable.sol +0 -6
- package/contracts/test/TestPool.sol +0 -22
- package/contracts/test/TestProduct.sol +0 -44
@@ -1,176 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.19;
|
3
|
-
|
4
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
-
|
6
|
-
import {IRegistry} from "../../registry/IRegistry.sol";
|
7
|
-
import {IInstance} from "../IInstance.sol";
|
8
|
-
|
9
|
-
import {ITreasuryModule} from "../module/treasury/ITreasury.sol";
|
10
|
-
import {TreasuryModule} from "../module/treasury/TreasuryModule.sol";
|
11
|
-
import {IComponent, IComponentModule} from "../module/component/IComponent.sol";
|
12
|
-
import {IBaseComponent} from "../../components/IBaseComponent.sol";
|
13
|
-
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
14
|
-
|
15
|
-
import {IVersionable} from "../../shared/IVersionable.sol";
|
16
|
-
import {Versionable} from "../../shared/Versionable.sol";
|
17
|
-
|
18
|
-
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../types/RoleId.sol";
|
19
|
-
import {ObjectType, PRODUCT, ORACLE, POOL} from "../../types/ObjectType.sol";
|
20
|
-
import {StateId, ACTIVE, PAUSED} from "../../types/StateId.sol";
|
21
|
-
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
22
|
-
import {Fee} from "../../types/Fee.sol";
|
23
|
-
import {Version, VersionLib} from "../../types/Version.sol";
|
24
|
-
|
25
|
-
import {IProductComponent} from "../../components/IProductComponent.sol";
|
26
|
-
import {ServiceBase} from "../base/ServiceBase.sol";
|
27
|
-
import {IComponentOwnerService} from "./IComponentOwnerService.sol";
|
28
|
-
|
29
|
-
contract ComponentOwnerService is
|
30
|
-
ServiceBase,
|
31
|
-
IComponentOwnerService
|
32
|
-
{
|
33
|
-
using NftIdLib for NftId;
|
34
|
-
|
35
|
-
string public constant NAME = "ComponentOwnerService";
|
36
|
-
|
37
|
-
modifier onlyRegisteredComponent(IBaseComponent component) {
|
38
|
-
NftId nftId = _registry.getNftId(address(component));
|
39
|
-
require(nftId.gtz(), "ERROR:COS-001:COMPONENT_UNKNOWN");
|
40
|
-
_;
|
41
|
-
}
|
42
|
-
|
43
|
-
constructor(
|
44
|
-
address registry,
|
45
|
-
NftId registryNftId
|
46
|
-
) ServiceBase(registry, registryNftId) // solhint-disable-next-line no-empty-blocks
|
47
|
-
{
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
function getVersion()
|
52
|
-
public
|
53
|
-
pure
|
54
|
-
virtual override (IVersionable, Versionable)
|
55
|
-
returns(Version)
|
56
|
-
{
|
57
|
-
return VersionLib.toVersion(3,0,0);
|
58
|
-
}
|
59
|
-
|
60
|
-
function getName() external pure override returns(string memory name) {
|
61
|
-
return NAME;
|
62
|
-
}
|
63
|
-
|
64
|
-
function getRoleForType(
|
65
|
-
ObjectType cType
|
66
|
-
) public pure override returns (RoleId role) {
|
67
|
-
if (cType == PRODUCT()) {
|
68
|
-
return PRODUCT_OWNER_ROLE();
|
69
|
-
}
|
70
|
-
if (cType == POOL()) {
|
71
|
-
return POOL_OWNER_ROLE();
|
72
|
-
}
|
73
|
-
if (cType == ORACLE()) {
|
74
|
-
return ORACLE_OWNER_ROLE();
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
function register(
|
79
|
-
IBaseComponent component
|
80
|
-
) external override returns (NftId nftId) {
|
81
|
-
address initialOwner = component.getOwner();
|
82
|
-
require(
|
83
|
-
msg.sender == address(component),
|
84
|
-
"ERROR:COS-003:NOT_COMPONENT"
|
85
|
-
);
|
86
|
-
|
87
|
-
IInstance instance = component.getInstance();
|
88
|
-
ObjectType objectType = component.getType();
|
89
|
-
RoleId typeRole = getRoleForType(objectType);
|
90
|
-
require(
|
91
|
-
instance.hasRole(typeRole, initialOwner),
|
92
|
-
"ERROR:CMP-004:TYPE_ROLE_MISSING"
|
93
|
-
);
|
94
|
-
|
95
|
-
nftId = _registry.register(address(component));
|
96
|
-
IERC20Metadata token = component.getToken();
|
97
|
-
|
98
|
-
instance.registerComponent(
|
99
|
-
nftId,
|
100
|
-
objectType,
|
101
|
-
token);
|
102
|
-
|
103
|
-
address wallet = component.getWallet();
|
104
|
-
|
105
|
-
// component type specific registration actions
|
106
|
-
if (component.getType() == PRODUCT()) {
|
107
|
-
IProductComponent product = IProductComponent(address(component));
|
108
|
-
NftId poolNftId = product.getPoolNftId();
|
109
|
-
require(poolNftId.gtz(), "ERROR:CMP-005:POOL_UNKNOWN");
|
110
|
-
// validate pool token and product token are same
|
111
|
-
|
112
|
-
// register with tresury
|
113
|
-
// implement and add validation
|
114
|
-
NftId distributorNftId = zeroNftId();
|
115
|
-
instance.registerProduct(
|
116
|
-
nftId,
|
117
|
-
distributorNftId,
|
118
|
-
poolNftId,
|
119
|
-
token,
|
120
|
-
wallet,
|
121
|
-
product.getPolicyFee(),
|
122
|
-
product.getProcessingFee()
|
123
|
-
);
|
124
|
-
} else if (component.getType() == POOL()) {
|
125
|
-
IPoolComponent pool = IPoolComponent(address(component));
|
126
|
-
|
127
|
-
// register with pool
|
128
|
-
instance.registerPool(
|
129
|
-
nftId,
|
130
|
-
pool.isVerifying(),
|
131
|
-
pool.getCollateralizationLevel());
|
132
|
-
|
133
|
-
// register with tresury
|
134
|
-
instance.registerPool(
|
135
|
-
nftId,
|
136
|
-
wallet,
|
137
|
-
pool.getStakingFee(),
|
138
|
-
pool.getPerformanceFee());
|
139
|
-
}
|
140
|
-
// TODO add distribution
|
141
|
-
}
|
142
|
-
|
143
|
-
function lock(
|
144
|
-
IBaseComponent component
|
145
|
-
) external override onlyRegisteredComponent(component) {
|
146
|
-
// TODO use msg.sender to get component and get instance via registered parent nft id
|
147
|
-
IInstance instance = component.getInstance();
|
148
|
-
instance.updateComponentState(component.getNftId(), PAUSED());
|
149
|
-
// IInstance instance = component.getInstance();
|
150
|
-
// IComponent.ComponentInfo memory info = instance.getComponentInfo(
|
151
|
-
// component.getNftId()
|
152
|
-
// );
|
153
|
-
// require(info.nftId.gtz(), "ERROR_COMPONENT_UNKNOWN");
|
154
|
-
|
155
|
-
// info.state = PAUSED();
|
156
|
-
// // setComponentInfo checks for valid state changes
|
157
|
-
// instance.setComponentInfo(info);
|
158
|
-
}
|
159
|
-
|
160
|
-
function unlock(
|
161
|
-
IBaseComponent component
|
162
|
-
) external override onlyRegisteredComponent(component) {
|
163
|
-
// TODO use msg.sender to get component and get instance via registered parent nft id
|
164
|
-
IInstance instance = component.getInstance();
|
165
|
-
instance.updateComponentState(component.getNftId(), ACTIVE());
|
166
|
-
// IInstance instance = component.getInstance();
|
167
|
-
// IComponent.ComponentInfo memory info = instance.getComponentInfo(
|
168
|
-
// component.getNftId()
|
169
|
-
// );
|
170
|
-
// require(info.nftId.gtz(), "ERROR_COMPONENT_UNKNOWN");
|
171
|
-
|
172
|
-
// info.state = ACTIVE();
|
173
|
-
// // setComponentInfo checks for valid state changes
|
174
|
-
// instance.setComponentInfo(info);
|
175
|
-
}
|
176
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.19;
|
3
|
-
|
4
|
-
import {NftId} from "../../types/NftId.sol";
|
5
|
-
import {ObjectType} from "../../types/ObjectType.sol";
|
6
|
-
import {RoleId} from "../../types/RoleId.sol";
|
7
|
-
import {IBaseComponent} from "../../components/IBaseComponent.sol";
|
8
|
-
import {IService} from "../base/IService.sol";
|
9
|
-
|
10
|
-
// TODO rename to registry service
|
11
|
-
interface IComponentOwnerService is IService {
|
12
|
-
|
13
|
-
function register(IBaseComponent component) external returns(NftId componentNftId);
|
14
|
-
|
15
|
-
// TODO move to product/pool services
|
16
|
-
function lock(IBaseComponent component) external;
|
17
|
-
|
18
|
-
// TODO move to product/pool services
|
19
|
-
function unlock(IBaseComponent component) external;
|
20
|
-
|
21
|
-
function getRoleForType(ObjectType cType) external pure returns (RoleId role);
|
22
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.19;
|
3
|
-
|
4
|
-
import {NftId} from "../../types/NftId.sol";
|
5
|
-
import {Fee} from "../../types/Fee.sol";
|
6
|
-
import {IService} from "../base/IService.sol";
|
7
|
-
|
8
|
-
interface IPoolService is IService {
|
9
|
-
function setFees(
|
10
|
-
Fee memory stakingFee,
|
11
|
-
Fee memory performanceFee
|
12
|
-
) external;
|
13
|
-
|
14
|
-
function createBundle(
|
15
|
-
address owner,
|
16
|
-
uint256 amount,
|
17
|
-
uint256 lifetime,
|
18
|
-
bytes calldata filter
|
19
|
-
) external returns(NftId bundleNftId);
|
20
|
-
|
21
|
-
// function fundBundle(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
22
|
-
|
23
|
-
// function defundBundle(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
24
|
-
|
25
|
-
// function lockBundle(NftId bundleNftId) external;
|
26
|
-
|
27
|
-
// function unlockBundle(NftId bundleNftId) external;
|
28
|
-
|
29
|
-
// function closeBundle(NftId bundleNftId) external;
|
30
|
-
}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.19;
|
3
|
-
|
4
|
-
import {NftId} from "../../types/NftId.sol";
|
5
|
-
import {Timestamp} from "../../types/Timestamp.sol";
|
6
|
-
import {UFixed} from "../../types/UFixed.sol";
|
7
|
-
import {Fee} from "../../types/Fee.sol";
|
8
|
-
import {IService} from "../base/IService.sol";
|
9
|
-
|
10
|
-
interface IProductService is IService {
|
11
|
-
function setFees(
|
12
|
-
Fee memory policyFee,
|
13
|
-
Fee memory processingFee
|
14
|
-
) external;
|
15
|
-
|
16
|
-
function createApplication(
|
17
|
-
address applicationOwner,
|
18
|
-
uint256 sumInsuredAmount,
|
19
|
-
uint256 premiumAmount,
|
20
|
-
uint256 lifetime,
|
21
|
-
NftId bundleNftId
|
22
|
-
) external returns (NftId nftId);
|
23
|
-
|
24
|
-
// function revoke(unit256 nftId) external;
|
25
|
-
|
26
|
-
/**
|
27
|
-
* @dev underwrites the policy represented by {policyNftId}.
|
28
|
-
* optionally collects premiums and activates the policy.
|
29
|
-
* - premium payment is only attempted if requirePremiumPayment is set to true
|
30
|
-
* - activation is only done if activateAt is a non-zero timestamp
|
31
|
-
*/
|
32
|
-
function underwrite(
|
33
|
-
NftId policyNftId,
|
34
|
-
bool requirePremiumPayment,
|
35
|
-
Timestamp activateAt
|
36
|
-
) external;
|
37
|
-
|
38
|
-
// function decline(uint256 nftId) external;
|
39
|
-
// function expire(uint256 nftId) external;
|
40
|
-
|
41
|
-
function collectPremium(NftId nftId, Timestamp activateAt) external;
|
42
|
-
|
43
|
-
function activate(NftId nftId, Timestamp activateAt) external;
|
44
|
-
|
45
|
-
|
46
|
-
function close(NftId nftId) external;
|
47
|
-
|
48
|
-
// function createClaim(uint256 nftId, uint256 claimAmount) external;
|
49
|
-
// function confirmClaim(uint256 nftId, uint256 claimId, uint256 claimAmount) external;
|
50
|
-
// function declineClaim(uint256 nftId, uint256 claimId) external;
|
51
|
-
// function closeClaim(uint256 nftId, uint256 claimId) external;
|
52
|
-
|
53
|
-
function calculateRequiredCollateral(
|
54
|
-
UFixed collateralizationLevel,
|
55
|
-
uint256 sumInsuredAmount
|
56
|
-
) external pure returns(uint256 collateralAmount);
|
57
|
-
|
58
|
-
}
|
@@ -1,123 +0,0 @@
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.19;
|
3
|
-
|
4
|
-
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
|
-
import {IInstance} from "../../instance/IInstance.sol";
|
6
|
-
import {ITreasury, ITreasuryModule, TokenHandler} from "../../instance/module/treasury/ITreasury.sol";
|
7
|
-
|
8
|
-
import {IVersionable} from "../../shared/IVersionable.sol";
|
9
|
-
import {Versionable} from "../../shared/Versionable.sol";
|
10
|
-
|
11
|
-
import {NftId, NftIdLib} from "../../types/NftId.sol";
|
12
|
-
import {POOL, BUNDLE} from "../../types/ObjectType.sol";
|
13
|
-
import {Fee} from "../../types/Fee.sol";
|
14
|
-
import {Version, VersionLib} from "../../types/Version.sol";
|
15
|
-
|
16
|
-
import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
|
17
|
-
import {IPoolService} from "./IPoolService.sol";
|
18
|
-
|
19
|
-
|
20
|
-
contract PoolService is ComponentServiceBase, IPoolService {
|
21
|
-
using NftIdLib for NftId;
|
22
|
-
|
23
|
-
string public constant NAME = "PoolService";
|
24
|
-
|
25
|
-
constructor(
|
26
|
-
address registry,
|
27
|
-
NftId registryNftId
|
28
|
-
) ComponentServiceBase(registry, registryNftId) // solhint-disable-next-line no-empty-blocks
|
29
|
-
{
|
30
|
-
_registerInterface(type(IPoolService).interfaceId);
|
31
|
-
}
|
32
|
-
|
33
|
-
function getVersion()
|
34
|
-
public
|
35
|
-
pure
|
36
|
-
virtual override (IVersionable, Versionable)
|
37
|
-
returns(Version)
|
38
|
-
{
|
39
|
-
return VersionLib.toVersion(3,0,0);
|
40
|
-
}
|
41
|
-
|
42
|
-
function getName() external pure override returns(string memory name) {
|
43
|
-
return NAME;
|
44
|
-
}
|
45
|
-
|
46
|
-
function setFees(
|
47
|
-
Fee memory stakingFee,
|
48
|
-
Fee memory performanceFee
|
49
|
-
)
|
50
|
-
external
|
51
|
-
override
|
52
|
-
{
|
53
|
-
(IRegistry.ObjectInfo memory info, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
54
|
-
instance.setPoolFees(info.nftId, stakingFee, performanceFee);
|
55
|
-
}
|
56
|
-
|
57
|
-
function createBundle(
|
58
|
-
address owner,
|
59
|
-
uint256 stakingAmount,
|
60
|
-
uint256 lifetime,
|
61
|
-
bytes calldata filter
|
62
|
-
)
|
63
|
-
external
|
64
|
-
override
|
65
|
-
returns(NftId bundleNftId)
|
66
|
-
{
|
67
|
-
(IRegistry.ObjectInfo memory info, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
68
|
-
|
69
|
-
// register bundle with registry
|
70
|
-
NftId poolNftId = info.nftId;
|
71
|
-
bundleNftId = _registry.registerObjectForInstance(
|
72
|
-
poolNftId,
|
73
|
-
BUNDLE(),
|
74
|
-
owner,
|
75
|
-
"");
|
76
|
-
|
77
|
-
// create bundle info in instance
|
78
|
-
instance.createBundleInfo(
|
79
|
-
bundleNftId,
|
80
|
-
poolNftId,
|
81
|
-
stakingAmount,
|
82
|
-
lifetime,
|
83
|
-
filter);
|
84
|
-
|
85
|
-
// add bundle to pool in instance
|
86
|
-
instance.addBundleToPool(
|
87
|
-
bundleNftId,
|
88
|
-
poolNftId,
|
89
|
-
stakingAmount);
|
90
|
-
|
91
|
-
// collect capital
|
92
|
-
_processStakingByTreasury(
|
93
|
-
instance,
|
94
|
-
poolNftId,
|
95
|
-
bundleNftId,
|
96
|
-
stakingAmount);
|
97
|
-
|
98
|
-
// TODO add logging
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
function _processStakingByTreasury(
|
103
|
-
IInstance instance,
|
104
|
-
NftId poolNftId,
|
105
|
-
NftId bundleNftId,
|
106
|
-
uint256 stakingAmount
|
107
|
-
)
|
108
|
-
internal
|
109
|
-
{
|
110
|
-
// process token transfer(s)
|
111
|
-
if(stakingAmount > 0) {
|
112
|
-
TokenHandler tokenHandler = instance.getTokenHandler(poolNftId);
|
113
|
-
address bundleOwner = _registry.getOwner(bundleNftId);
|
114
|
-
address poolWallet = instance.getPoolSetup(poolNftId).wallet;
|
115
|
-
|
116
|
-
tokenHandler.transfer(
|
117
|
-
bundleOwner,
|
118
|
-
poolWallet,
|
119
|
-
stakingAmount
|
120
|
-
);
|
121
|
-
}
|
122
|
-
}
|
123
|
-
}
|