@etherisc/gif-next 0.0.2-7c3106f-930 → 0.0.2-7c515fb-081
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 +4 -0
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +13 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +75 -15
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +13 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +52 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +112 -13
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +39 -18
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- 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 +1 -1
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +15 -2
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +403 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +59 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +164 -84
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +34 -34
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +168 -37
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +229 -41
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +77 -9
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +29 -0
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +18 -18
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +681 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +436 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +820 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +448 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +309 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -19
- 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 +258 -24
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +20 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +49 -28
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +410 -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 +2 -2
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IService.sol/IService.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +4 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +4 -0
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +442 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/{instance/base/ServiceBase.sol/ServiceBase.json → shared/Service.sol/Service.json} +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +4 -4
- 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 +11 -11
- 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 +2 -2
- 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 +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- 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/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- 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/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/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +22 -3
- package/contracts/components/BaseComponent.sol +8 -3
- package/contracts/components/Distribution.sol +13 -13
- package/contracts/components/IBaseComponent.sol +1 -0
- package/contracts/components/IDistributionComponent.sol +3 -0
- package/contracts/components/Pool.sol +15 -27
- package/contracts/components/Product.sol +1 -1
- package/contracts/instance/AccessManagedSimple.sol +5 -4
- package/contracts/instance/AccessManagerSimple.sol +10 -0
- package/contracts/instance/IInstance.sol +15 -4
- package/contracts/instance/IInstanceService.sol +21 -8
- package/contracts/instance/Instance.sol +28 -21
- package/contracts/instance/InstanceAccessManager.sol +1 -1
- package/contracts/instance/InstanceReader.sol +27 -1
- package/contracts/instance/InstanceService.sol +107 -27
- package/contracts/instance/base/ComponentServiceBase.sol +21 -10
- package/contracts/instance/module/IBundle.sol +1 -0
- package/contracts/instance/module/ISetup.sol +1 -0
- package/contracts/instance/service/ComponentOwnerService.sol +5 -5
- package/contracts/instance/service/DistributionService.sol +99 -0
- package/contracts/instance/service/DistributionServiceManager.sol +53 -0
- package/contracts/instance/service/IComponentOwnerService.sol +1 -1
- package/contracts/instance/service/IDistributionService.sol +1 -1
- package/contracts/instance/service/IPoolService.sol +1 -1
- package/contracts/instance/service/IProductService.sol +1 -1
- package/contracts/instance/service/PoolService.sol +205 -0
- package/contracts/instance/service/PoolServiceManager.sol +53 -0
- package/contracts/registry/IRegistry.sol +39 -2
- package/contracts/registry/IRegistryService.sol +7 -9
- package/contracts/registry/Registry.sol +95 -29
- package/contracts/registry/RegistryService.sol +14 -54
- package/contracts/registry/RegistryServiceManager.sol +21 -5
- package/contracts/registry/TokenRegistry.sol +111 -0
- package/contracts/shared/ERC165.sol +6 -2
- package/contracts/{instance/base → shared}/IService.sol +3 -3
- package/contracts/shared/Registerable.sol +1 -0
- package/contracts/shared/RegisterableUpgradable.sol +16 -0
- package/contracts/shared/Service.sol +54 -0
- package/contracts/test/TestService.sol +3 -5
- package/contracts/types/RoleId.sol +7 -0
- package/contracts/types/StateId.sol +4 -0
- package/contracts/types/Version.sol +4 -1
- package/package.json +1 -1
- package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +0 -4
- package/contracts/instance/base/ServiceBase.sol +0 -44
@@ -131,8 +131,8 @@
|
|
131
131
|
"type": "function"
|
132
132
|
}
|
133
133
|
],
|
134
|
-
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
135
|
-
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
134
|
+
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220fc6a35bb293dd84eb5ac7cbc5613951d9b8b18b87ff3cf51dcc60822256afeaa64736f6c63430008140033",
|
135
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220fc6a35bb293dd84eb5ac7cbc5613951d9b8b18b87ff3cf51dcc60822256afeaa64736f6c63430008140033",
|
136
136
|
"linkReferences": {
|
137
137
|
"contracts/types/Key32.sol": {
|
138
138
|
"Key32Lib": [
|
@@ -85,8 +85,8 @@
|
|
85
85
|
"type": "function"
|
86
86
|
}
|
87
87
|
],
|
88
|
-
"bytecode": "
|
89
|
-
"deployedBytecode": "
|
88
|
+
"bytecode": "0x61018c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632c2f8a671461005b5780636f91962014610083578063ac43d83414610098578063b2466acf146100c9575b600080fd5b61006e610069366004610108565b6100df565b60405190151581526020015b60405180910390f35b61006e61009136600461013b565b60ff161590565b6100ac6100a636600461013b565b60ff1690565b6040516bffffffffffffffffffffffff909116815260200161007a565b61006e6100d736600461013b565b60ff16151590565b600060ff808416908316145b9392505050565b803560ff8116811461010357600080fd5b919050565b6000806040838503121561011b57600080fd5b610124836100f2565b9150610132602084016100f2565b90509250929050565b60006020828403121561014d57600080fd5b6100eb826100f256fea26469706673582212204cd4e6f2bb672e5640aaa5a4af92ef3714ca5bf00495f7a3790a03dec2aaa3fc64736f6c63430008140033",
|
89
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632c2f8a671461005b5780636f91962014610083578063ac43d83414610098578063b2466acf146100c9575b600080fd5b61006e610069366004610108565b6100df565b60405190151581526020015b60405180910390f35b61006e61009136600461013b565b60ff161590565b6100ac6100a636600461013b565b60ff1690565b6040516bffffffffffffffffffffffff909116815260200161007a565b61006e6100d736600461013b565b60ff16151590565b600060ff808416908316145b9392505050565b803560ff8116811461010357600080fd5b919050565b6000806040838503121561011b57600080fd5b610124836100f2565b9150610132602084016100f2565b90509250929050565b60006020828403121561014d57600080fd5b6100eb826100f256fea26469706673582212204cd4e6f2bb672e5640aaa5a4af92ef3714ca5bf00495f7a3790a03dec2aaa3fc64736f6c63430008140033",
|
90
90
|
"linkReferences": {},
|
91
91
|
"deployedLinkReferences": {}
|
92
92
|
}
|
@@ -170,8 +170,8 @@
|
|
170
170
|
"type": "function"
|
171
171
|
}
|
172
172
|
],
|
173
|
-
"bytecode": "
|
174
|
-
"deployedBytecode": "
|
173
|
+
"bytecode": "0x61039161003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c80638e4ad86c116100655780638e4ad86c1461012157806394aa449c14610144578063a123b37c14610152578063c9e66e291461017957600080fd5b806304b8f6c5146100975780632efe0113146100b357806349a7111a146100c657806355601007146100fd575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61009a6100c136600461026e565b610190565b6100d96100d436600461029a565b610231565b6040805160ff948516815292841660208401529216918101919091526060016100aa565b61011361010b36600461029a565b62ffffff1690565b6040519081526020016100aa565b61013261012f3660046102c6565b90565b60405160ff90911681526020016100aa565b61009a61012f3660046102df565b61016061010b36600461029a565b60405167ffffffffffffffff90911681526020016100aa565b61013261018736600461029a565b60101c60ff1690565b6000610100841080156101a4575061010083105b80156101b1575061010082105b61020c5760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b8161021f600885901b601087901b61031f565b610229919061031f565b949350505050565b600080808360ff601082901c166102488383610338565b915061ffff600883901c16600061025f8185610338565b92989197509195509350505050565b60008060006060848603121561028357600080fd5b505081359360208301359350604090920135919050565b6000602082840312156102ac57600080fd5b813562ffffff811681146102bf57600080fd5b9392505050565b6000602082840312156102d857600080fd5b5035919050565b6000602082840312156102f157600080fd5b813567ffffffffffffffff811681146102bf57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561033257610332610309565b92915050565b62ffffff82811682821603908082111561035457610354610309565b509291505056fea264697066735822122096e4b37266f82e0aaf6f30afa90c545c35f82576ca3b67d630233921e58f525b64736f6c63430008140033",
|
174
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c80638e4ad86c116100655780638e4ad86c1461012157806394aa449c14610144578063a123b37c14610152578063c9e66e291461017957600080fd5b806304b8f6c5146100975780632efe0113146100b357806349a7111a146100c657806355601007146100fd575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61009a6100c136600461026e565b610190565b6100d96100d436600461029a565b610231565b6040805160ff948516815292841660208401529216918101919091526060016100aa565b61011361010b36600461029a565b62ffffff1690565b6040519081526020016100aa565b61013261012f3660046102c6565b90565b60405160ff90911681526020016100aa565b61009a61012f3660046102df565b61016061010b36600461029a565b60405167ffffffffffffffff90911681526020016100aa565b61013261018736600461029a565b60101c60ff1690565b6000610100841080156101a4575061010083105b80156101b1575061010082105b61020c5760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b8161021f600885901b601087901b61031f565b610229919061031f565b949350505050565b600080808360ff601082901c166102488383610338565b915061ffff600883901c16600061025f8185610338565b92989197509195509350505050565b60008060006060848603121561028357600080fd5b505081359360208301359350604090920135919050565b6000602082840312156102ac57600080fd5b813562ffffff811681146102bf57600080fd5b9392505050565b6000602082840312156102d857600080fd5b5035919050565b6000602082840312156102f157600080fd5b813567ffffffffffffffff811681146102bf57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561033257610332610309565b92915050565b62ffffff82811682821603908082111561035457610354610309565b509291505056fea264697066735822122096e4b37266f82e0aaf6f30afa90c545c35f82576ca3b67d630233921e58f525b64736f6c63430008140033",
|
175
175
|
"linkReferences": {},
|
176
176
|
"deployedLinkReferences": {}
|
177
177
|
}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
"inputs": [
|
8
8
|
{
|
9
9
|
"internalType": "VersionPart",
|
10
|
-
"name": "
|
10
|
+
"name": "a",
|
11
11
|
"type": "uint8"
|
12
12
|
}
|
13
13
|
],
|
@@ -21,10 +21,29 @@
|
|
21
21
|
],
|
22
22
|
"stateMutability": "pure",
|
23
23
|
"type": "function"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"inputs": [
|
27
|
+
{
|
28
|
+
"internalType": "uint256",
|
29
|
+
"name": "a",
|
30
|
+
"type": "uint256"
|
31
|
+
}
|
32
|
+
],
|
33
|
+
"name": "toVersionPart",
|
34
|
+
"outputs": [
|
35
|
+
{
|
36
|
+
"internalType": "VersionPart",
|
37
|
+
"name": "",
|
38
|
+
"type": "uint8"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"stateMutability": "pure",
|
42
|
+
"type": "function"
|
24
43
|
}
|
25
44
|
],
|
26
|
-
"bytecode": "
|
27
|
-
"deployedBytecode": "
|
45
|
+
"bytecode": "0x60fb610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe7300000000000000000000000000000000000000003014608060405260043610603d5760003560e01c80638e4ad86c146042578063ac43d834146067575b600080fd5b6050604d3660046085565b90565b60405160ff90911681526020015b60405180910390f35b60786072366004609d565b60ff1690565b604051908152602001605e565b600060208284031215609657600080fd5b5035919050565b60006020828403121560ae57600080fd5b813560ff8116811460be57600080fd5b939250505056fea264697066735822122074bb6f75f2cab9692d05e41844bf40283045a9440c662c37a97b2502d38207ed64736f6c63430008140033",
|
46
|
+
"deployedBytecode": "0x7300000000000000000000000000000000000000003014608060405260043610603d5760003560e01c80638e4ad86c146042578063ac43d834146067575b600080fd5b6050604d3660046085565b90565b60405160ff90911681526020015b60405180910390f35b60786072366004609d565b60ff1690565b604051908152602001605e565b600060208284031215609657600080fd5b5035919050565b60006020828403121560ae57600080fd5b813560ff8116811460be57600080fd5b939250505056fea264697066735822122074bb6f75f2cab9692d05e41844bf40283045a9440c662c37a97b2502d38207ed64736f6c63430008140033",
|
28
47
|
"linkReferences": {},
|
29
48
|
"deployedLinkReferences": {}
|
30
49
|
}
|
@@ -11,13 +11,15 @@ import {IInstance} from "../instance/IInstance.sol";
|
|
11
11
|
import {IInstance} from "../instance/IInstance.sol";
|
12
12
|
import {IComponentOwnerService} from "../instance/service/IComponentOwnerService.sol";
|
13
13
|
import {IBaseComponent} from "./IBaseComponent.sol";
|
14
|
-
import {NftId} from "../types/NftId.sol";
|
14
|
+
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
15
15
|
import {ObjectType} from "../types/ObjectType.sol";
|
16
16
|
|
17
17
|
abstract contract BaseComponent is
|
18
18
|
Registerable,
|
19
19
|
IBaseComponent
|
20
20
|
{
|
21
|
+
using NftIdLib for NftId;
|
22
|
+
|
21
23
|
IComponentOwnerService internal _componentOwnerService;
|
22
24
|
|
23
25
|
address internal _deployer;
|
@@ -29,7 +31,6 @@ abstract contract BaseComponent is
|
|
29
31
|
constructor(
|
30
32
|
address registry,
|
31
33
|
NftId instanceNftId,
|
32
|
-
NftId productNftId,
|
33
34
|
address token,
|
34
35
|
ObjectType componentType,
|
35
36
|
bool isInterceptor,
|
@@ -49,7 +50,6 @@ abstract contract BaseComponent is
|
|
49
50
|
_componentOwnerService = _instance.getComponentOwnerService();
|
50
51
|
_wallet = address(this);
|
51
52
|
_token = IERC20Metadata(token);
|
52
|
-
_productNftId = productNftId;
|
53
53
|
|
54
54
|
_registerInterface(type(IBaseComponent).interfaceId);
|
55
55
|
}
|
@@ -80,6 +80,11 @@ abstract contract BaseComponent is
|
|
80
80
|
return _instance;
|
81
81
|
}
|
82
82
|
|
83
|
+
function setProductNftId(NftId productNftId) public override onlyOwner {
|
84
|
+
require(_productNftId.eq(zeroNftId()), "product nft id already set");
|
85
|
+
_productNftId = productNftId;
|
86
|
+
}
|
87
|
+
|
83
88
|
function getProductNftId() public view override returns (NftId productNftId) {
|
84
89
|
return _productNftId;
|
85
90
|
}
|
@@ -38,20 +38,19 @@ contract Distribution is
|
|
38
38
|
constructor(
|
39
39
|
address registry,
|
40
40
|
NftId instanceNftId,
|
41
|
-
NftId productNftId,
|
42
41
|
// TODO refactor into tokenNftId
|
43
42
|
address token,
|
44
43
|
bool verifying,
|
45
44
|
Fee memory distributionFee,
|
46
45
|
address initialOwner
|
47
46
|
)
|
48
|
-
BaseComponent(registry, instanceNftId,
|
47
|
+
BaseComponent(registry, instanceNftId, token, DISTRIBUTION(), true, initialOwner)
|
49
48
|
{
|
50
49
|
_isVerifying = verifying;
|
51
50
|
_initialDistributionFee = distributionFee;
|
52
51
|
|
52
|
+
_distributionService = _instance.getDistributionService();
|
53
53
|
// TODO: reactivate when services are available again
|
54
|
-
// _distributionService = _instance.getDistributionService();
|
55
54
|
// _productService = _instance.getProductService();
|
56
55
|
|
57
56
|
_registerInterface(type(IDistributionComponent).interfaceId);
|
@@ -122,20 +121,21 @@ contract Distribution is
|
|
122
121
|
return false;
|
123
122
|
}
|
124
123
|
|
125
|
-
function
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
}
|
124
|
+
function getInitialSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
125
|
+
return ISetup.DistributionSetupInfo(
|
126
|
+
_productNftId,
|
127
|
+
TokenHandler(address(_token)),
|
128
|
+
_initialDistributionFee,
|
129
|
+
_isVerifying,
|
130
|
+
address(this)
|
131
|
+
);
|
132
|
+
}
|
135
133
|
|
134
|
+
function getSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
136
135
|
InstanceReader reader = _instance.getInstanceReader();
|
137
136
|
return reader.getDistributionSetupInfo(getNftId());
|
138
137
|
}
|
138
|
+
|
139
139
|
|
140
140
|
/// @dev returns true iff the component needs to be called when selling/renewing policis
|
141
141
|
function isVerifying() external view returns (bool verifying) {
|
@@ -4,9 +4,12 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {Fee} from "../types/Fee.sol";
|
5
5
|
import {ReferralId} from "../types/Referral.sol";
|
6
6
|
import {NftId} from "../types/NftId.sol";
|
7
|
+
import {ISetup} from "../instance/module/ISetup.sol";
|
7
8
|
|
8
9
|
interface IDistributionComponent {
|
9
10
|
|
11
|
+
function getInitialSetupInfo() external view returns (ISetup.DistributionSetupInfo memory setupInfo);
|
12
|
+
|
10
13
|
function setFees(
|
11
14
|
Fee memory distributionFee
|
12
15
|
) external;
|
@@ -55,7 +55,6 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
55
55
|
constructor(
|
56
56
|
address registry,
|
57
57
|
NftId instanceNftId,
|
58
|
-
NftId productNftId,
|
59
58
|
// TODO refactor into tokenNftId
|
60
59
|
address token,
|
61
60
|
bool isInterceptor,
|
@@ -66,7 +65,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
66
65
|
Fee memory performanceFee,
|
67
66
|
address initialOwner
|
68
67
|
)
|
69
|
-
BaseComponent(registry, instanceNftId,
|
68
|
+
BaseComponent(registry, instanceNftId, token, POOL(), isInterceptor, initialOwner)
|
70
69
|
{
|
71
70
|
_isVerifying = verifying;
|
72
71
|
// TODO add validation
|
@@ -75,8 +74,8 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
75
74
|
_initialStakingFee = stakingFee;
|
76
75
|
_initialPerformanceFee = performanceFee;
|
77
76
|
|
77
|
+
_poolService = _instance.getPoolService();
|
78
78
|
// TODO: reactivate when services are available again
|
79
|
-
// _poolService = _instance.getPoolService();
|
80
79
|
// _productService = _instance.getProductService();
|
81
80
|
|
82
81
|
_registerInterface(type(IPoolComponent).interfaceId);
|
@@ -169,21 +168,19 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
169
168
|
_poolService.setBundleFee(bundleNftId, fee);
|
170
169
|
}
|
171
170
|
|
171
|
+
function getInitialSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
172
|
+
return ISetup.PoolSetupInfo(
|
173
|
+
_productNftId,
|
174
|
+
TokenHandler(address(_token)),
|
175
|
+
_collateralizationLevel,
|
176
|
+
_initialPoolFee,
|
177
|
+
_initialStakingFee,
|
178
|
+
_initialPerformanceFee,
|
179
|
+
_isVerifying,
|
180
|
+
_wallet
|
181
|
+
);
|
182
|
+
}
|
172
183
|
function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
173
|
-
// TODO fix this
|
174
|
-
if (getNftId().eq(zeroNftId())) {
|
175
|
-
return ISetup.PoolSetupInfo(
|
176
|
-
_productNftId,
|
177
|
-
TokenHandler(address(0)),
|
178
|
-
_collateralizationLevel,
|
179
|
-
_initialPoolFee,
|
180
|
-
_initialStakingFee,
|
181
|
-
_initialPerformanceFee,
|
182
|
-
_isVerifying,
|
183
|
-
_wallet
|
184
|
-
);
|
185
|
-
}
|
186
|
-
|
187
184
|
InstanceReader reader = _instance.getInstanceReader();
|
188
185
|
return reader.getPoolSetupInfo(getNftId());
|
189
186
|
}
|
@@ -206,16 +203,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
206
203
|
return (
|
207
204
|
info,
|
208
205
|
abi.encode(
|
209
|
-
|
210
|
-
getProductNftId(),
|
211
|
-
TokenHandler(address(0)),
|
212
|
-
_collateralizationLevel,
|
213
|
-
_initialPoolFee,
|
214
|
-
_initialStakingFee,
|
215
|
-
_initialPerformanceFee,
|
216
|
-
_isVerifying,
|
217
|
-
_wallet
|
218
|
-
)
|
206
|
+
getInitialSetupInfo()
|
219
207
|
)
|
220
208
|
);
|
221
209
|
}
|
@@ -49,7 +49,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
49
49
|
Fee memory productFee,
|
50
50
|
Fee memory processingFee,
|
51
51
|
address initialOwner
|
52
|
-
) BaseComponent(registry, instanceNftid,
|
52
|
+
) BaseComponent(registry, instanceNftid, token, PRODUCT(), isInterceptor, initialOwner) {
|
53
53
|
// TODO add validation
|
54
54
|
// TODO: reactivate when services are available again
|
55
55
|
// _productService = _instance.getProductService();
|
@@ -19,17 +19,18 @@ import {IAccessManagerSimple} from "./IAccessManagerSimple.sol";
|
|
19
19
|
* functions, and ideally only used in `external` functions. See {restricted}.
|
20
20
|
*/
|
21
21
|
abstract contract AccessManagedSimple is Context, IAccessManaged {
|
22
|
+
bool private _initialized;
|
22
23
|
address private _authority;
|
23
24
|
|
24
25
|
bool private _consumingSchedule;
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
*/
|
29
|
-
constructor(address initialAuthority) {
|
27
|
+
function initializeAccessManagedSimple(address initialAuthority) internal {
|
28
|
+
require(!_initialized, "AccessManaged: already initialized");
|
30
29
|
_setAuthority(initialAuthority);
|
30
|
+
_initialized = true;
|
31
31
|
}
|
32
32
|
|
33
|
+
|
33
34
|
/**
|
34
35
|
* @dev Restricts access to a function as defined by the connected Authority for this contract and the
|
35
36
|
* caller and selector of the function that entered the contract.
|
@@ -46,6 +46,8 @@ contract AccessManagerSimple is Context, IAccessManagerSimple {
|
|
46
46
|
uint32 nonce;
|
47
47
|
}
|
48
48
|
|
49
|
+
bool private _initialized;
|
50
|
+
|
49
51
|
uint64 public constant ADMIN_ROLE = type(uint64).min; // 0
|
50
52
|
uint64 public constant PUBLIC_ROLE = type(uint64).max; // 2**64-1
|
51
53
|
|
@@ -67,14 +69,22 @@ contract AccessManagerSimple is Context, IAccessManagerSimple {
|
|
67
69
|
}
|
68
70
|
|
69
71
|
constructor(address initialAdmin) {
|
72
|
+
initialize(initialAdmin);
|
73
|
+
}
|
74
|
+
|
75
|
+
function initialize(address initialAdmin) public {
|
76
|
+
require(!_initialized, "AccessManager: already initialized");
|
77
|
+
|
70
78
|
if (initialAdmin == address(0)) {
|
71
79
|
revert AccessManagerInvalidInitialAdmin(address(0));
|
72
80
|
}
|
73
81
|
|
74
82
|
// admin is active immediately and without any execution delay.
|
75
83
|
_grantRole(ADMIN_ROLE, initialAdmin, 0, 0);
|
84
|
+
_initialized = true;
|
76
85
|
}
|
77
86
|
|
87
|
+
|
78
88
|
// =================================================== GETTERS ====================================================
|
79
89
|
/// @inheritdoc IAccessManagerSimple
|
80
90
|
function canCall(
|
@@ -9,20 +9,31 @@ import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
|
9
9
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
10
10
|
import {IPoolService} from "./service/IPoolService.sol";
|
11
11
|
import {IProductService} from "./service/IProductService.sol";
|
12
|
+
import {IBundle} from "./module/IBundle.sol";
|
12
13
|
import {ISetup} from "./module/ISetup.sol";
|
13
14
|
import {NftId} from "../types/NftId.sol";
|
15
|
+
import {StateId} from "../types/StateId.sol";
|
14
16
|
|
15
17
|
interface IInstance is IERC165 {
|
16
18
|
|
17
19
|
function getComponentOwnerService() external view returns (IComponentOwnerService);
|
18
|
-
|
19
|
-
// function getDistributionService() external view returns (IDistributionService);
|
20
|
+
function getDistributionService() external view returns (IDistributionService);
|
20
21
|
// function getProductService() external view returns (IProductService);
|
21
|
-
|
22
|
+
function getPoolService() external view returns (IPoolService);
|
22
23
|
|
23
24
|
function createProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup) external;
|
25
|
+
|
24
26
|
function createDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup) external;
|
25
|
-
function
|
27
|
+
function updateDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup, StateId newState) external;
|
28
|
+
function updateDistributionSetupState(NftId distributionNftId, StateId newState) external;
|
29
|
+
|
30
|
+
function createPoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup) external;
|
31
|
+
function updatePoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup, StateId newState) external;
|
32
|
+
function updatePoolSetupState(NftId poolNftId, StateId newState) external;
|
33
|
+
|
34
|
+
function createBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle) external;
|
35
|
+
function updateBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle, StateId newState) external;
|
36
|
+
function updateBundleState(NftId bundleNftId, StateId newState) external;
|
26
37
|
|
27
38
|
function getInstanceReader() external view returns (InstanceReader);
|
28
39
|
}
|
@@ -1,17 +1,30 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {NftId} from "
|
5
|
-
import {ObjectType} from "
|
6
|
-
import {RoleId} from "
|
7
|
-
import {IService} from "
|
8
|
-
import {IRegistry} from "
|
4
|
+
import {NftId} from "../types/NftId.sol";
|
5
|
+
import {ObjectType} from "../types/ObjectType.sol";
|
6
|
+
import {RoleId} from "../types/RoleId.sol";
|
7
|
+
import {IService} from "../shared/IService.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
9
|
|
10
|
-
import {IRegisterable} from "
|
11
|
-
import {IBaseComponent} from "
|
10
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
+
import {IBaseComponent} from "../components/IBaseComponent.sol";
|
12
|
+
|
13
|
+
import {AccessManagerSimple} from "./AccessManagerSimple.sol";
|
14
|
+
import {Instance} from "./Instance.sol";
|
15
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
12
16
|
|
13
17
|
interface IInstanceService is IService {
|
14
18
|
|
15
|
-
|
19
|
+
event LogInstanceCloned(address clonedAccessManagerAddress, address clonedInstanceAddress, address clonedInstanceReaderAddress, NftId clonedInstanceNftId);
|
20
|
+
|
21
|
+
function createInstanceClone()
|
22
|
+
external
|
23
|
+
returns (
|
24
|
+
AccessManagerSimple clonedAccessManager,
|
25
|
+
Instance clonedInstance,
|
26
|
+
NftId instanceNftId,
|
27
|
+
InstanceReader clonedInstanceReader
|
28
|
+
);
|
16
29
|
}
|
17
30
|
|
@@ -25,6 +25,8 @@ import {ERC165} from "../shared/ERC165.sol";
|
|
25
25
|
import {Registerable} from "../shared/Registerable.sol";
|
26
26
|
import {ComponentOwnerService} from "./service/ComponentOwnerService.sol";
|
27
27
|
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
28
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
29
|
+
import {IPoolService} from "./service/IPoolService.sol";
|
28
30
|
import {VersionPart} from "../types/Version.sol";
|
29
31
|
|
30
32
|
contract Instance is
|
@@ -41,6 +43,8 @@ contract Instance is
|
|
41
43
|
|
42
44
|
uint32 public constant EXECUTION_DELAY = 0;
|
43
45
|
|
46
|
+
bool private _initialized;
|
47
|
+
|
44
48
|
mapping(ShortString name => RoleId roleId) internal _role;
|
45
49
|
mapping(RoleId roleId => EnumerableSet.AddressSet roleMembers) internal _roleMembers;
|
46
50
|
RoleId [] internal _roles;
|
@@ -51,16 +55,23 @@ contract Instance is
|
|
51
55
|
InstanceReader internal _instanceReader;
|
52
56
|
|
53
57
|
constructor(address accessManagerAddress, address registryAddress, NftId registryNftId)
|
54
|
-
AccessManagedSimple(accessManagerAddress)
|
55
58
|
{
|
56
|
-
|
59
|
+
initialize(accessManagerAddress, registryAddress, registryNftId, msg.sender);
|
60
|
+
}
|
61
|
+
|
62
|
+
function initialize(address accessManagerAddress, address registryAddress, NftId registryNftId, address initialOwner) public {
|
63
|
+
require(!_initialized, "Contract instance has already been initialized");
|
64
|
+
|
65
|
+
initializeAccessManagedSimple(accessManagerAddress);
|
66
|
+
|
57
67
|
_accessManager = AccessManagerSimple(accessManagerAddress);
|
58
68
|
_createRole(RoleIdLib.toRoleId(ADMIN_ROLE), "AdminRole", false, false);
|
59
69
|
_createRole(RoleIdLib.toRoleId(PUBLIC_ROLE), "PublicRole", false, false);
|
60
70
|
|
61
|
-
_initializeRegisterable(registryAddress, registryNftId, INSTANCE(), false,
|
71
|
+
_initializeRegisterable(registryAddress, registryNftId, INSTANCE(), false, initialOwner, "");
|
62
72
|
|
63
|
-
_registerInterface(type(IInstance).interfaceId);
|
73
|
+
_registerInterface(type(IInstance).interfaceId);
|
74
|
+
_initialized = true;
|
64
75
|
}
|
65
76
|
|
66
77
|
//--- Role ------------------------------------------------------//
|
@@ -210,16 +221,16 @@ contract Instance is
|
|
210
221
|
}
|
211
222
|
|
212
223
|
//--- PoolSetup ------------------------------------------------------//
|
213
|
-
function createPoolSetup(NftId
|
214
|
-
create(_toNftKey32(
|
224
|
+
function createPoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup) external restricted() {
|
225
|
+
create(_toNftKey32(poolNftId, POOL()), abi.encode(setup));
|
215
226
|
}
|
216
227
|
|
217
|
-
function updatePoolSetup(NftId
|
218
|
-
update(_toNftKey32(
|
228
|
+
function updatePoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup, StateId newState) external restricted() {
|
229
|
+
update(_toNftKey32(poolNftId, POOL()), abi.encode(setup), newState);
|
219
230
|
}
|
220
231
|
|
221
|
-
function updatePoolSetupState(NftId
|
222
|
-
updateState(_toNftKey32(
|
232
|
+
function updatePoolSetupState(NftId poolNftId, StateId newState) external restricted() {
|
233
|
+
updateState(_toNftKey32(poolNftId, POOL()), newState);
|
223
234
|
}
|
224
235
|
|
225
236
|
//--- DistributorType ---------------------------------------------------//
|
@@ -408,25 +419,21 @@ contract Instance is
|
|
408
419
|
return ComponentOwnerService(_registry.getServiceAddress("ComponentOwnerService", VersionPart.wrap(3)));
|
409
420
|
}
|
410
421
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
// }
|
422
|
+
function getDistributionService() external view returns (IDistributionService) {
|
423
|
+
return IDistributionService(_registry.getServiceAddress("DistributionService", VersionPart.wrap(3)));
|
424
|
+
}
|
415
425
|
|
416
426
|
// TODO reactivate when services are available
|
417
427
|
// function getProductService() external view returns (IProductService) {
|
418
428
|
// return ProductService(_registry.getServiceAddress("ProductService", VersionPart.wrap(3)));
|
419
429
|
// }
|
420
430
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
// }
|
431
|
+
function getPoolService() external view returns (IPoolService) {
|
432
|
+
return IPoolService(_registry.getServiceAddress("PoolService", VersionPart.wrap(3)));
|
433
|
+
}
|
425
434
|
|
426
435
|
function setInstanceReader(InstanceReader instanceReader) external restricted() {
|
427
|
-
|
428
|
-
revert("InstanceReader is set");
|
429
|
-
}
|
436
|
+
require(address(_instanceReader) == address(0), "InstanceReader is set");
|
430
437
|
_instanceReader = instanceReader;
|
431
438
|
}
|
432
439
|
|
@@ -79,9 +79,9 @@ contract InstanceAccessManager is
|
|
79
79
|
AccessManagerSimple internal _accessManager;
|
80
80
|
|
81
81
|
constructor(address accessManager)
|
82
|
-
AccessManagedSimple(accessManager)
|
83
82
|
{
|
84
83
|
_accessManager = AccessManagerSimple(accessManager);
|
84
|
+
initializeAccessManagedSimple(accessManager);
|
85
85
|
|
86
86
|
_createRole(RoleIdLib.toRoleId(_accessManager.ADMIN_ROLE()), ADMIN_ROLE_NAME, false, false);
|
87
87
|
_createRole(RoleIdLib.toRoleId(_accessManager.PUBLIC_ROLE()), PUBLIC_ROLE_NAME, false, false);
|