@etherisc/gif-next 0.0.2-e922e07-736 → 0.0.2-e9a637d-547
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -71
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +68 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +68 -0
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +158 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +158 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +184 -149
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +158 -0
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +114 -189
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +68 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
- 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 +214 -2063
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +196 -51
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +363 -2832
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +491 -127
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +101 -167
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +333 -171
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +75 -23
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2677 -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 +85 -30
- 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 +56 -73
- 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 +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +124 -53
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +21 -13
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +384 -249
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +74 -14
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +104 -41
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +11 -7
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +195 -121
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +51 -47
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +80 -14
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +212 -186
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +80 -14
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +101 -24
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +90 -24
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +511 -14
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +80 -14
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +136 -65
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +27 -19
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +561 -51
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +24 -12
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +114 -51
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +16 -12
- 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 +19 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -24
- 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 +31 -12
- 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 +17 -36
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +7 -7
- 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 +2 -2
- 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/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +80 -14
- 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/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.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 +2 -2
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +86 -15
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- 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/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 +2 -2
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +6 -6
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +101 -26
- 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/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +161 -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 +1 -1
- 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 +40 -9
- 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 +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +1 -1
- 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 +2 -2
- 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 +42 -10
- package/contracts/components/IComponent.sol +9 -1
- package/contracts/components/IPoolComponent.sol +5 -43
- package/contracts/components/Pool.sol +47 -122
- package/contracts/components/Product.sol +4 -0
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +6 -4
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +23 -55
- package/contracts/instance/IInstanceService.sol +31 -6
- package/contracts/instance/Instance.sol +90 -182
- package/contracts/instance/InstanceAccessManager.sol +402 -159
- package/contracts/instance/InstanceReader.sol +12 -12
- package/contracts/instance/InstanceService.sol +287 -246
- package/contracts/instance/InstanceStore.sol +219 -0
- package/contracts/instance/ObjectManager.sol +6 -8
- package/contracts/instance/base/ComponentService.sol +17 -30
- package/contracts/instance/base/KeyValueStore.sol +13 -5
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +21 -14
- package/contracts/instance/module/IBundle.sol +6 -4
- package/contracts/instance/module/IComponents.sol +41 -0
- package/contracts/instance/module/ISetup.sol +3 -16
- package/contracts/instance/service/ApplicationService.sol +18 -16
- package/contracts/instance/service/BundleService.sol +213 -81
- package/contracts/instance/service/ClaimService.sol +3 -3
- package/contracts/instance/service/DistributionService.sol +57 -70
- package/contracts/instance/service/IBundleService.sol +63 -25
- package/contracts/instance/service/IDistributionService.sol +1 -0
- package/contracts/instance/service/IPoolService.sol +82 -3
- package/contracts/instance/service/PolicyService.sol +68 -100
- package/contracts/instance/service/PoolService.sol +214 -20
- package/contracts/instance/service/ProductService.sol +34 -58
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/IRegistryService.sol +4 -3
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +23 -20
- package/contracts/registry/RegistryService.sol +10 -11
- package/contracts/registry/ReleaseManager.sol +20 -18
- package/contracts/shared/IService.sol +4 -6
- package/contracts/shared/Service.sol +21 -7
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +60 -0
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/Fee.sol +13 -5
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +1 -0
- package/contracts/types/RoleId.sol +6 -4
- package/contracts/types/StateId.sol +1 -0
- package/contracts/types/Timestamp.sol +1 -0
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +1 -1
@@ -472,8 +472,8 @@
|
|
472
472
|
"type": "function"
|
473
473
|
}
|
474
474
|
],
|
475
|
-
"bytecode": "
|
476
|
-
"deployedBytecode": "
|
475
|
+
"bytecode": "0x610a2a61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c80637a858b97116100cd578063bc1b392d11610086578063bc1b392d146102c7578063bdbb4630146102ce578063c8a4ac9c146102d5578063cc8b7b73146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b80637a858b971461025f57806389fa8ed71461027257806393aa872514610287578063a391c15b1461028e578063b4773329146102a1578063b67d77c5146102b457600080fd5b8063313ce5671161011f578063313ce567146101f957806332148d731461020057806344aa68361461021357806345ebb61e14610226578063753b14a514610239578063771602f71461024c57600080fd5b8063059f8b161461016757806308c76ec414610182578063118fc88c146101955780631488c845146101b85780631a12cd47146101cb57806321e5749b146101e6575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61016f610190366004610797565b610325565b6101a86101a33660046107cd565b6103ad565b6040519015158152602001610179565b61016f6101c63660046107ef565b6103ba565b6101d3601281565b60405160009190910b8152602001610179565b6101a86101f43660046107cd565b61049c565b601261016f565b6101a861020e3660046107cd565b6104a6565b61016f61022136600461081a565b6104b0565b61016f61023436600461081a565b6104bd565b6101a861024736600461081a565b6104d5565b61016f61025a3660046107cd565b6104de565b6101a861026d36600461081a565b6104ea565b60025b60405160ff9091168152602001610179565b6000610275565b61016f61029c3660046107cd565b6104f4565b6101a86102af3660046107cd565b610500565b61016f6102c23660046107cd565b61050b565b600061016f565b6001610275565b61016f6102e33660046107cd565b610517565b61016f6102f63660046107cd565b610523565b6101a86103093660046107cd565b61052f565b61016f61053a565b6103226012600a61092d565b81565b600060011960ff8316016103745761036d60026103446012600a61092d565b61034e919061094f565b6103589085610971565b60016103666012600a61092d565b6000610552565b90506103a7565b60ff821661038e5761036d8360016103666012600a61092d565b61036d8360016103a06012600a61092d565b6001610552565b92915050565b60008282115b9392505050565b6000806103c8836012610984565b60000b121561041e5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b604061042b836012610984565b60000b131561047c5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c41524745006044820152606401610415565b610487826012610984565b61049290600a6109a5565b6103b390846109b4565b60008282106103b3565b60008183146103b3565b60006103a7826002610325565b60006104cb6012600a61092d565b6103a790836109b4565b600081156103a7565b60006103b383836105af565b60008115156103a7565b60006103b383836105bb565b6000828211156103b3565b60006103b3838361061f565b60006103b3838361067b565b60006103b38383610690565b6000828210156103b3565b60026105486012600a61092d565b610322919061094f565b6000806105608686866106ae565b90506001836002811115610576576105766109cb565b14801561059357506000848061058e5761058e610939565b868809115b156105a6576105a3600182610971565b90505b95945050505050565b60006103b38284610971565b600080821161060c5760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f0000000000006044820152606401610415565b6103b383670de0b6b3a7640000846106ae565b6000828211156106715760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c540000006044820152606401610415565b6103b382846109e1565b60006103b38383670de0b6b3a76400006106ae565b6000828210156106a45761036d838361061f565b6103b3828461061f565b60008080600019858709858702925082811083820303915050806000036106e8578382816106de576106de610939565b04925050506103b3565b80841161072f5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610415565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080604083850312156107aa57600080fd5b82359150602083013560ff811681146107c257600080fd5b809150509250929050565b600080604083850312156107e057600080fd5b50508035926020909101359150565b6000806040838503121561080257600080fd5b8235915060208301358060000b81146107c257600080fd5b60006020828403121561082c57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088457816000190482111561086a5761086a610833565b8085161561087757918102915b93841c939080029061084e565b509250929050565b60008261089b575060016103a7565b816108a8575060006103a7565b81600181146108be57600281146108c8576108e4565b60019150506103a7565b60ff8411156108d9576108d9610833565b50506001821b6103a7565b5060208310610133831016604e8410600b8410161715610907575081810a6103a7565b6109118383610849565b806000190482111561092557610925610833565b029392505050565b60006103b3838361088c565b634e487b7160e01b600052601260045260246000fd5b60008261096c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156103a7576103a7610833565b600081810b9083900b01607f8113607f19821217156103a7576103a7610833565b60006103b360ff84168361088c565b80820281158282048414176103a7576103a7610833565b634e487b7160e01b600052602160045260246000fd5b818103818111156103a7576103a761083356fea2646970667358221220bf133d0c138c18bc61ded1b407424a979556fd8b0354b7c8f51b313c2d08fa2264736f6c63430008140033",
|
476
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c80637a858b97116100cd578063bc1b392d11610086578063bc1b392d146102c7578063bdbb4630146102ce578063c8a4ac9c146102d5578063cc8b7b73146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b80637a858b971461025f57806389fa8ed71461027257806393aa872514610287578063a391c15b1461028e578063b4773329146102a1578063b67d77c5146102b457600080fd5b8063313ce5671161011f578063313ce567146101f957806332148d731461020057806344aa68361461021357806345ebb61e14610226578063753b14a514610239578063771602f71461024c57600080fd5b8063059f8b161461016757806308c76ec414610182578063118fc88c146101955780631488c845146101b85780631a12cd47146101cb57806321e5749b146101e6575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61016f610190366004610797565b610325565b6101a86101a33660046107cd565b6103ad565b6040519015158152602001610179565b61016f6101c63660046107ef565b6103ba565b6101d3601281565b60405160009190910b8152602001610179565b6101a86101f43660046107cd565b61049c565b601261016f565b6101a861020e3660046107cd565b6104a6565b61016f61022136600461081a565b6104b0565b61016f61023436600461081a565b6104bd565b6101a861024736600461081a565b6104d5565b61016f61025a3660046107cd565b6104de565b6101a861026d36600461081a565b6104ea565b60025b60405160ff9091168152602001610179565b6000610275565b61016f61029c3660046107cd565b6104f4565b6101a86102af3660046107cd565b610500565b61016f6102c23660046107cd565b61050b565b600061016f565b6001610275565b61016f6102e33660046107cd565b610517565b61016f6102f63660046107cd565b610523565b6101a86103093660046107cd565b61052f565b61016f61053a565b6103226012600a61092d565b81565b600060011960ff8316016103745761036d60026103446012600a61092d565b61034e919061094f565b6103589085610971565b60016103666012600a61092d565b6000610552565b90506103a7565b60ff821661038e5761036d8360016103666012600a61092d565b61036d8360016103a06012600a61092d565b6001610552565b92915050565b60008282115b9392505050565b6000806103c8836012610984565b60000b121561041e5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b604061042b836012610984565b60000b131561047c5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c41524745006044820152606401610415565b610487826012610984565b61049290600a6109a5565b6103b390846109b4565b60008282106103b3565b60008183146103b3565b60006103a7826002610325565b60006104cb6012600a61092d565b6103a790836109b4565b600081156103a7565b60006103b383836105af565b60008115156103a7565b60006103b383836105bb565b6000828211156103b3565b60006103b3838361061f565b60006103b3838361067b565b60006103b38383610690565b6000828210156103b3565b60026105486012600a61092d565b610322919061094f565b6000806105608686866106ae565b90506001836002811115610576576105766109cb565b14801561059357506000848061058e5761058e610939565b868809115b156105a6576105a3600182610971565b90505b95945050505050565b60006103b38284610971565b600080821161060c5760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f0000000000006044820152606401610415565b6103b383670de0b6b3a7640000846106ae565b6000828211156106715760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c540000006044820152606401610415565b6103b382846109e1565b60006103b38383670de0b6b3a76400006106ae565b6000828210156106a45761036d838361061f565b6103b3828461061f565b60008080600019858709858702925082811083820303915050806000036106e8578382816106de576106de610939565b04925050506103b3565b80841161072f5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610415565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b600080604083850312156107aa57600080fd5b82359150602083013560ff811681146107c257600080fd5b809150509250929050565b600080604083850312156107e057600080fd5b50508035926020909101359150565b6000806040838503121561080257600080fd5b8235915060208301358060000b81146107c257600080fd5b60006020828403121561082c57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088457816000190482111561086a5761086a610833565b8085161561087757918102915b93841c939080029061084e565b509250929050565b60008261089b575060016103a7565b816108a8575060006103a7565b81600181146108be57600281146108c8576108e4565b60019150506103a7565b60ff8411156108d9576108d9610833565b50506001821b6103a7565b5060208310610133831016604e8410600b8410161715610907575081810a6103a7565b6109118383610849565b806000190482111561092557610925610833565b029392505050565b60006103b3838361088c565b634e487b7160e01b600052601260045260246000fd5b60008261096c57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156103a7576103a7610833565b600081810b9083900b01607f8113607f19821217156103a7576103a7610833565b60006103b360ff84168361088c565b80820281158282048414176103a7576103a7610833565b634e487b7160e01b600052602160045260246000fd5b818103818111156103a7576103a761083356fea2646970667358221220bf133d0c138c18bc61ded1b407424a979556fd8b0354b7c8f51b313c2d08fa2264736f6c63430008140033",
|
477
477
|
"linkReferences": {},
|
478
478
|
"deployedLinkReferences": {}
|
479
479
|
}
|
@@ -170,8 +170,8 @@
|
|
170
170
|
"type": "function"
|
171
171
|
}
|
172
172
|
],
|
173
|
-
"bytecode": "
|
174
|
-
"deployedBytecode": "
|
173
|
+
"bytecode": "0x61039161003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c80638e4ad86c116100655780638e4ad86c1461012157806394aa449c14610144578063a123b37c14610152578063c9e66e291461017957600080fd5b806304b8f6c5146100975780632efe0113146100b357806349a7111a146100c657806355601007146100fd575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61009a6100c136600461026e565b610190565b6100d96100d436600461029a565b610231565b6040805160ff948516815292841660208401529216918101919091526060016100aa565b61011361010b36600461029a565b62ffffff1690565b6040519081526020016100aa565b61013261012f3660046102c6565b90565b60405160ff90911681526020016100aa565b61009a61012f3660046102df565b61016061010b36600461029a565b60405167ffffffffffffffff90911681526020016100aa565b61013261018736600461029a565b60101c60ff1690565b6000610100841080156101a4575061010083105b80156101b1575061010082105b61020c5760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b8161021f600885901b601087901b61031f565b610229919061031f565b949350505050565b600080808360ff601082901c166102488383610338565b915061ffff600883901c16600061025f8185610338565b92989197509195509350505050565b60008060006060848603121561028357600080fd5b505081359360208301359350604090920135919050565b6000602082840312156102ac57600080fd5b813562ffffff811681146102bf57600080fd5b9392505050565b6000602082840312156102d857600080fd5b5035919050565b6000602082840312156102f157600080fd5b813567ffffffffffffffff811681146102bf57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561033257610332610309565b92915050565b62ffffff82811682821603908082111561035457610354610309565b509291505056fea2646970667358221220801f2c14b03a7330f0c0f9dce2a4a4bea8603a2ffbea5bb26b7564e07c0d257564736f6c63430008140033",
|
174
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100925760003560e01c80638e4ad86c116100655780638e4ad86c1461012157806394aa449c14610144578063a123b37c14610152578063c9e66e291461017957600080fd5b806304b8f6c5146100975780632efe0113146100b357806349a7111a146100c657806355601007146100fd575b600080fd5b60005b60405162ffffff90911681526020015b60405180910390f35b61009a6100c136600461026e565b610190565b6100d96100d436600461029a565b610231565b6040805160ff948516815292841660208401529216918101919091526060016100aa565b61011361010b36600461029a565b62ffffff1690565b6040519081526020016100aa565b61013261012f3660046102c6565b90565b60405160ff90911681526020016100aa565b61009a61012f3660046102df565b61016061010b36600461029a565b60405167ffffffffffffffff90911681526020016100aa565b61013261018736600461029a565b60101c60ff1690565b6000610100841080156101a4575061010083105b80156101b1575061010082105b61020c5760405162461bcd60e51b815260206004820152602260248201527f4552524f523a5652532d3031303a56455253494f4e5f504152545f544f4f5f42604482015261494760f01b606482015260840160405180910390fd5b8161021f600885901b601087901b61031f565b610229919061031f565b949350505050565b600080808360ff601082901c166102488383610338565b915061ffff600883901c16600061025f8185610338565b92989197509195509350505050565b60008060006060848603121561028357600080fd5b505081359360208301359350604090920135919050565b6000602082840312156102ac57600080fd5b813562ffffff811681146102bf57600080fd5b9392505050565b6000602082840312156102d857600080fd5b5035919050565b6000602082840312156102f157600080fd5b813567ffffffffffffffff811681146102bf57600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561033257610332610309565b92915050565b62ffffff82811682821603908082111561035457610354610309565b509291505056fea2646970667358221220801f2c14b03a7330f0c0f9dce2a4a4bea8603a2ffbea5bb26b7564e07c0d257564736f6c63430008140033",
|
175
175
|
"linkReferences": {},
|
176
176
|
"deployedLinkReferences": {}
|
177
177
|
}
|
@@ -42,8 +42,8 @@
|
|
42
42
|
"type": "function"
|
43
43
|
}
|
44
44
|
],
|
45
|
-
"bytecode": "
|
46
|
-
"deployedBytecode": "
|
45
|
+
"bytecode": "0x60fb610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe7300000000000000000000000000000000000000003014608060405260043610603d5760003560e01c80638e4ad86c146042578063ac43d834146067575b600080fd5b6050604d3660046085565b90565b60405160ff90911681526020015b60405180910390f35b60786072366004609d565b60ff1690565b604051908152602001605e565b600060208284031215609657600080fd5b5035919050565b60006020828403121560ae57600080fd5b813560ff8116811460be57600080fd5b939250505056fea2646970667358221220cdee50fe6c9714f8463d3a3d707ceac1b02f5c17b070c998ecfbac805f95cace64736f6c63430008140033",
|
46
|
+
"deployedBytecode": "0x7300000000000000000000000000000000000000003014608060405260043610603d5760003560e01c80638e4ad86c146042578063ac43d834146067575b600080fd5b6050604d3660046085565b90565b60405160ff90911681526020015b60405180910390f35b60786072366004609d565b60ff1690565b604051908152602001605e565b600060208284031215609657600080fd5b5035919050565b60006020828403121560ae57600080fd5b813560ff8116811460be57600080fd5b939250505056fea2646970667358221220cdee50fe6c9714f8463d3a3d707ceac1b02f5c17b070c998ecfbac805f95cace64736f6c63430008140033",
|
47
47
|
"linkReferences": {},
|
48
48
|
"deployedLinkReferences": {}
|
49
49
|
}
|
@@ -1,11 +1,13 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
5
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
7
8
|
|
8
9
|
import {IComponent} from "./IComponent.sol";
|
10
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
9
11
|
import {IProductService} from "../instance/service/IProductService.sol";
|
10
12
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
11
13
|
import {IInstance} from "../instance/IInstance.sol";
|
@@ -47,6 +49,13 @@ abstract contract Component is
|
|
47
49
|
}
|
48
50
|
}
|
49
51
|
|
52
|
+
modifier onlyChainNft() {
|
53
|
+
if(msg.sender != getRegistry().getChainNftAddress()) {
|
54
|
+
revert ErrorComponentNotChainNft(msg.sender);
|
55
|
+
}
|
56
|
+
_;
|
57
|
+
}
|
58
|
+
|
50
59
|
function initializeComponent(
|
51
60
|
address registry,
|
52
61
|
NftId instanceNftId,
|
@@ -82,15 +91,16 @@ abstract contract Component is
|
|
82
91
|
$._wallet = address(this);
|
83
92
|
$._token = IERC20Metadata(token);
|
84
93
|
|
94
|
+
registerInterface(type(IAccessManaged).interfaceId);
|
85
95
|
registerInterface(type(IComponent).interfaceId);
|
86
96
|
}
|
87
97
|
|
88
98
|
function lock() external onlyOwner override {
|
89
|
-
IInstanceService(_getServiceAddress(INSTANCE())).
|
99
|
+
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
90
100
|
}
|
91
101
|
|
92
102
|
function unlock() external onlyOwner override {
|
93
|
-
IInstanceService(_getServiceAddress(INSTANCE())).
|
103
|
+
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
94
104
|
}
|
95
105
|
|
96
106
|
function setWallet(address newWallet)
|
@@ -160,18 +170,21 @@ abstract contract Component is
|
|
160
170
|
$._productNftId = productNftId;
|
161
171
|
}
|
162
172
|
|
173
|
+
function nftMint(address to, uint256 tokenId)
|
174
|
+
external
|
175
|
+
virtual
|
176
|
+
onlyChainNft
|
177
|
+
{}
|
178
|
+
|
163
179
|
/// @dev callback function for nft transfers
|
164
180
|
/// may only be called by chain nft contract.
|
165
181
|
/// do not override this function to implement business logic for handling transfers
|
166
182
|
/// override internal function _nftTransferFrom instead
|
167
183
|
function nftTransferFrom(address from, address to, uint256 tokenId)
|
168
184
|
external
|
169
|
-
virtual
|
185
|
+
virtual
|
186
|
+
onlyChainNft
|
170
187
|
{
|
171
|
-
if(msg.sender != getRegistry().getChainNftAddress()) {
|
172
|
-
revert ErrorComponentNotChainNft(msg.sender);
|
173
|
-
}
|
174
|
-
|
175
188
|
_nftTransferFrom(from, to, tokenId);
|
176
189
|
}
|
177
190
|
|
@@ -200,6 +213,25 @@ abstract contract Component is
|
|
200
213
|
return _getComponentStorage()._productNftId;
|
201
214
|
}
|
202
215
|
|
216
|
+
function getComponentInfo() public view returns (IComponents.ComponentInfo memory info) {
|
217
|
+
info = _getInstanceReader().getComponentInfo(getNftId());
|
218
|
+
|
219
|
+
// fallback to initial info (wallet is always != address(0))
|
220
|
+
if(info.wallet == address(0)) {
|
221
|
+
info = _getInitialInfo();
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
/// @dev defines initial component specification
|
226
|
+
/// overwrite this function according to your use case
|
227
|
+
function _getInitialInfo()
|
228
|
+
internal
|
229
|
+
view
|
230
|
+
virtual
|
231
|
+
returns (IComponents.ComponentInfo memory info)
|
232
|
+
{ }
|
233
|
+
|
234
|
+
|
203
235
|
/// @dev internal function for nft transfers.
|
204
236
|
/// handling logic that deals with nft transfers need to overwrite this function
|
205
237
|
function _nftTransferFrom(address from, address to, uint256 tokenId)
|
@@ -218,4 +250,4 @@ abstract contract Component is
|
|
218
250
|
VersionPart majorVersion = _getComponentStorage()._instance.getMajorVersion();
|
219
251
|
return getRegistry().getServiceAddress(domain, majorVersion);
|
220
252
|
}
|
221
|
-
}
|
253
|
+
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
4
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
6
|
|
7
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
6
8
|
import {IInstance} from "../instance/IInstance.sol";
|
7
9
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
8
10
|
import {IProductService} from "../instance/service/IProductService.sol";
|
@@ -15,7 +17,8 @@ import {ObjectType} from "../types/ObjectType.sol";
|
|
15
17
|
/// component examples are product, distribution, pool and oracle
|
16
18
|
interface IComponent is
|
17
19
|
IRegisterable,
|
18
|
-
ITransferInterceptor
|
20
|
+
ITransferInterceptor,
|
21
|
+
IAccessManaged
|
19
22
|
{
|
20
23
|
error ErrorComponentNotChainNft(address caller);
|
21
24
|
error ErrorComponentNotProductService(address caller);
|
@@ -65,4 +68,9 @@ interface IComponent is
|
|
65
68
|
function getProductNftId() external view returns (NftId productNftId);
|
66
69
|
|
67
70
|
function isNftInterceptor() external view returns(bool isInterceptor);
|
71
|
+
|
72
|
+
/// @dev returns component infos for this pool
|
73
|
+
/// when registered with an instance the info is obtained from the data stored in the instance
|
74
|
+
/// when not registered the function returns the info from the component contract
|
75
|
+
function getComponentInfo() external view returns (IComponents.ComponentInfo memory info);
|
68
76
|
}
|
@@ -3,7 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Fee} from "../types/Fee.sol";
|
5
5
|
import {IComponent} from "./IComponent.sol";
|
6
|
-
import {
|
6
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
7
7
|
import {NftId} from "../types/NftId.sol";
|
8
8
|
import {RoleId} from "../types/RoleId.sol";
|
9
9
|
import {Seconds} from "../types/Seconds.sol";
|
@@ -17,11 +17,8 @@ interface IPoolComponent is IComponent {
|
|
17
17
|
error ErrorPoolNotPoolService(address caller);
|
18
18
|
|
19
19
|
error ErrorPoolApplicationBundleMismatch(NftId applicationNftId);
|
20
|
-
error ErrorPoolBundleOwnerRoleAlreadySet();
|
21
20
|
|
22
21
|
event LogPoolVerifiedByPool(address pool, NftId applicationNftId, uint256 collateralizationAmount);
|
23
|
-
event LogPoolBundleMaxCapitalAmountUpdated(uint256 previousMaxCapitalAmount, uint256 currentMaxCapitalAmount);
|
24
|
-
event LogPoolBundleOwnerRoleSet(RoleId bundleOwnerRole);
|
25
22
|
|
26
23
|
/// @dev increases the staked tokens by the specified amount
|
27
24
|
/// only the bundle owner may stake tokens
|
@@ -94,41 +91,6 @@ interface IPoolComponent is IComponent {
|
|
94
91
|
uint256 collateralizationAmount
|
95
92
|
) external;
|
96
93
|
|
97
|
-
/// @dev defines the multiplier to calculate the required collateral to cover a given sum insured amount
|
98
|
-
/// default implementation returns 100%
|
99
|
-
function getCollateralizationLevel() external view returns (UFixed collateralizationLevel);
|
100
|
-
|
101
|
-
/// @dev defines the amount of collateral held in the pool.
|
102
|
-
/// if the value is < 100% the pool is required to hold a policy that covers the locally missing collateral
|
103
|
-
/// default implementation returns 100%
|
104
|
-
function getRetentionLevel() external view returns (UFixed retentionLevel);
|
105
|
-
|
106
|
-
/// @dev declares if pool relies on external management of collateral (yes/no):
|
107
|
-
/// - yes: underwriting of new policies does not require an actual token balance, instead it is assumed that the pool owner will manage funds externally and inject enough tokens to allow process confirmed payouts
|
108
|
-
/// - no: the pool smart contract ensures that the necessary capacity of the pool prior to underwriting.
|
109
|
-
/// default implementation returns false (no)
|
110
|
-
function isExternallyManaged() external view returns (bool);
|
111
|
-
|
112
|
-
/// @dev declares if pool component is actively involved in underwriting (yes/no):
|
113
|
-
/// - yes: verifying pools components actively confirm underwriting applications, ie the pool component logic explicitly needs to confirm the locking of collateral to cover the sum insured of the policy
|
114
|
-
/// - no: underwriting a policy does not require any interaction with the pool component if the covering bundle can provide the necessary captial
|
115
|
-
/// default implementation returnsfalse (no)
|
116
|
-
function isVerifyingApplications() external view returns (bool);
|
117
|
-
|
118
|
-
/// @dev returns the maximum overall capital amound held by this pool
|
119
|
-
function getMaxCapitalAmount() external view returns (uint256 maxCapitalAmount);
|
120
|
-
|
121
|
-
/// @dev declares if pool intercept transfers of bundle nft ids
|
122
|
-
/// - yes: pool may block transfer of bundle ownership or simply updates some bookkeeping related to bundle ownership. callback function is nftTransferFrom
|
123
|
-
/// - no: pool is not involved in transfer of bundle ownership
|
124
|
-
/// default implementation returns false (no)
|
125
|
-
function isInterceptingBundleTransfers() external view returns (bool);
|
126
|
-
|
127
|
-
/// @dev returns the required role for bundle owners
|
128
|
-
/// default emplementation returns PUBLIC_ROLE
|
129
|
-
/// the PUBLIC_ROLE role implies that no specific roole is required for bundle owners
|
130
|
-
function getBundleOwnerRole() external view returns (RoleId bundleOwnerRole);
|
131
|
-
|
132
94
|
/// @dev returns true iff the application matches with the bundle
|
133
95
|
/// this is a callback function that is only called if a pool declares itself as a verifying pool
|
134
96
|
/// default implementation returns true
|
@@ -143,9 +105,9 @@ interface IPoolComponent is IComponent {
|
|
143
105
|
view
|
144
106
|
returns (bool isMatching);
|
145
107
|
|
146
|
-
/// @dev returns
|
147
|
-
/// when registered with an instance the
|
148
|
-
/// when not registered the function returns the
|
149
|
-
function
|
108
|
+
/// @dev returns pool specific infos for this pool
|
109
|
+
/// when registered with an instance the info is obtained from the data stored in the instance
|
110
|
+
/// when not registered the function returns the info from the component contract
|
111
|
+
function getPoolInfo() external view returns (IComponents.PoolInfo memory info);
|
150
112
|
|
151
113
|
}
|
@@ -1,20 +1,20 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount, AmountLib} from "../types/Amount.sol";
|
4
5
|
import {Component} from "./Component.sol";
|
5
6
|
import {Fee, FeeLib} from "../types/Fee.sol";
|
6
7
|
import {IBundleService} from "../instance/service/IBundleService.sol";
|
7
8
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
8
9
|
import {IPoolComponent} from "./IPoolComponent.sol";
|
9
10
|
import {IPoolService} from "../instance/service/IPoolService.sol";
|
10
|
-
import {
|
11
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
11
12
|
import {NftId, NftIdLib} from "../types/NftId.sol";
|
12
13
|
import {POOL} from "../types/ObjectType.sol";
|
13
14
|
import {RoleId, PUBLIC_ROLE} from "../types/RoleId.sol";
|
14
15
|
import {Seconds} from "../types/Seconds.sol";
|
15
16
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
-
import {UFixed} from "../types/UFixed.sol";
|
17
|
-
|
17
|
+
import {UFixed, UFixedLib} from "../types/UFixed.sol";
|
18
18
|
|
19
19
|
abstract contract Pool is
|
20
20
|
Component,
|
@@ -24,23 +24,6 @@ abstract contract Pool is
|
|
24
24
|
bytes32 public constant POOL_STORAGE_LOCATION_V1 = 0x25e3e51823fbfffb988e0a2744bb93722d9f3e906c07cc0a9e77884c46c58300;
|
25
25
|
|
26
26
|
struct PoolStorage {
|
27
|
-
UFixed _collateralizationLevel;
|
28
|
-
UFixed _retentionLevel;
|
29
|
-
uint256 _maxCapitalAmount;
|
30
|
-
|
31
|
-
bool _isExternallyManaged;
|
32
|
-
bool _isVerifyingApplications;
|
33
|
-
|
34
|
-
RoleId _bundleOwnerRole;
|
35
|
-
bool _isInterceptingBundleTransfers;
|
36
|
-
|
37
|
-
Fee _initialPoolFee;
|
38
|
-
Fee _initialStakingFee;
|
39
|
-
Fee _initialPerformanceFee;
|
40
|
-
|
41
|
-
TokenHandler _tokenHandler;
|
42
|
-
|
43
|
-
// may be used to interact with instance by derived contracts
|
44
27
|
IPoolService _poolService;
|
45
28
|
IBundleService _bundleService;
|
46
29
|
}
|
@@ -68,10 +51,6 @@ abstract contract Pool is
|
|
68
51
|
string memory name,
|
69
52
|
address token,
|
70
53
|
bool isInterceptingNftTransfers,
|
71
|
-
bool isExternallyManaging,
|
72
|
-
bool isVerifying,
|
73
|
-
UFixed collateralizationLevel,
|
74
|
-
UFixed retentionLevel,
|
75
54
|
address initialOwner,
|
76
55
|
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
77
56
|
)
|
@@ -82,17 +61,6 @@ abstract contract Pool is
|
|
82
61
|
initializeComponent(registry, instanceNftId, name, token, POOL(), isInterceptingNftTransfers, initialOwner, registryData);
|
83
62
|
|
84
63
|
PoolStorage storage $ = _getPoolStorage();
|
85
|
-
// TODO add validation
|
86
|
-
$._tokenHandler = new TokenHandler(token);
|
87
|
-
$._maxCapitalAmount = type(uint256).max;
|
88
|
-
$._isExternallyManaged = isExternallyManaging;
|
89
|
-
$._isVerifyingApplications = isVerifying;
|
90
|
-
$._bundleOwnerRole = PUBLIC_ROLE();
|
91
|
-
$._collateralizationLevel = collateralizationLevel;
|
92
|
-
$._retentionLevel = retentionLevel;
|
93
|
-
$._initialPoolFee = FeeLib.zeroFee();
|
94
|
-
$._initialStakingFee = FeeLib.zeroFee();
|
95
|
-
$._initialPerformanceFee = FeeLib.zeroFee();
|
96
64
|
$._poolService = getInstance().getPoolService();
|
97
65
|
$._bundleService = getInstance().getBundleService();
|
98
66
|
|
@@ -142,30 +110,30 @@ abstract contract Pool is
|
|
142
110
|
function lockBundle(NftId bundleNftId)
|
143
111
|
public
|
144
112
|
virtual
|
145
|
-
restricted()
|
113
|
+
//restricted() // TODO consider adding this back
|
146
114
|
onlyBundleOwner(bundleNftId)
|
147
115
|
{
|
148
|
-
_getPoolStorage()._bundleService.
|
116
|
+
_getPoolStorage()._bundleService.lock(bundleNftId);
|
149
117
|
}
|
150
118
|
|
151
119
|
|
152
120
|
function unlockBundle(NftId bundleNftId)
|
153
121
|
public
|
154
122
|
virtual
|
155
|
-
restricted()
|
123
|
+
//restricted()
|
156
124
|
onlyBundleOwner(bundleNftId)
|
157
125
|
{
|
158
|
-
_getPoolStorage()._bundleService.
|
126
|
+
_getPoolStorage()._bundleService.unlock(bundleNftId);
|
159
127
|
}
|
160
128
|
|
161
129
|
|
162
130
|
function close(NftId bundleNftId)
|
163
131
|
public
|
164
132
|
virtual
|
165
|
-
restricted()
|
133
|
+
//restricted()
|
166
134
|
onlyBundleOwner(bundleNftId)
|
167
135
|
{
|
168
|
-
|
136
|
+
_getPoolStorage()._poolService.closeBundle(bundleNftId);
|
169
137
|
}
|
170
138
|
|
171
139
|
|
@@ -178,7 +146,7 @@ abstract contract Pool is
|
|
178
146
|
restricted()
|
179
147
|
onlyBundleOwner(bundleNftId)
|
180
148
|
{
|
181
|
-
_getPoolStorage()._bundleService.
|
149
|
+
_getPoolStorage()._bundleService.setFee(bundleNftId, fee);
|
182
150
|
}
|
183
151
|
|
184
152
|
|
@@ -188,13 +156,7 @@ abstract contract Pool is
|
|
188
156
|
restricted()
|
189
157
|
onlyOwner()
|
190
158
|
{
|
191
|
-
|
192
|
-
// _getPoolStorage()._poolService.setMaxCapitalAmount(...);
|
193
|
-
|
194
|
-
uint256 previousMaxCapitalAmount = _getPoolStorage()._maxCapitalAmount;
|
195
|
-
_getPoolStorage()._maxCapitalAmount = maxCapitalAmount;
|
196
|
-
|
197
|
-
emit LogPoolBundleMaxCapitalAmountUpdated(previousMaxCapitalAmount, maxCapitalAmount);
|
159
|
+
_getPoolStorage()._poolService.setMaxCapitalAmount(maxCapitalAmount);
|
198
160
|
}
|
199
161
|
|
200
162
|
|
@@ -204,16 +166,7 @@ abstract contract Pool is
|
|
204
166
|
restricted()
|
205
167
|
onlyOwner()
|
206
168
|
{
|
207
|
-
|
208
|
-
// _getPoolStorage()._poolService.setBundleOwnerRole(...);
|
209
|
-
|
210
|
-
if(_getPoolStorage()._bundleOwnerRole != PUBLIC_ROLE()) {
|
211
|
-
revert ErrorPoolBundleOwnerRoleAlreadySet();
|
212
|
-
}
|
213
|
-
|
214
|
-
_getPoolStorage()._bundleOwnerRole = bundleOwnerRole;
|
215
|
-
|
216
|
-
emit LogPoolBundleOwnerRoleSet(bundleOwnerRole);
|
169
|
+
_getPoolStorage()._poolService.setBundleOwnerRole(bundleOwnerRole);
|
217
170
|
}
|
218
171
|
|
219
172
|
|
@@ -243,7 +196,6 @@ abstract contract Pool is
|
|
243
196
|
virtual
|
244
197
|
restricted()
|
245
198
|
{
|
246
|
-
// validate application data against bundle filter
|
247
199
|
if(!applicationMatchesBundle(
|
248
200
|
applicationNftId,
|
249
201
|
applicationData,
|
@@ -259,41 +211,6 @@ abstract contract Pool is
|
|
259
211
|
}
|
260
212
|
|
261
213
|
|
262
|
-
function getCollateralizationLevel() public view virtual returns (UFixed collateralizationLevel) {
|
263
|
-
return _getPoolStorage()._collateralizationLevel;
|
264
|
-
}
|
265
|
-
|
266
|
-
|
267
|
-
function getRetentionLevel() public view virtual returns (UFixed retentionLevel) {
|
268
|
-
return _getPoolStorage()._retentionLevel;
|
269
|
-
}
|
270
|
-
|
271
|
-
|
272
|
-
function isExternallyManaged() public view virtual returns (bool) {
|
273
|
-
return _getPoolStorage()._isExternallyManaged;
|
274
|
-
}
|
275
|
-
|
276
|
-
|
277
|
-
function isVerifyingApplications() public view virtual returns (bool isConfirmingApplication) {
|
278
|
-
return _getPoolStorage()._isVerifyingApplications;
|
279
|
-
}
|
280
|
-
|
281
|
-
|
282
|
-
function getMaxCapitalAmount() public view virtual returns (uint256 maxCapitalAmount) {
|
283
|
-
return _getPoolStorage()._maxCapitalAmount;
|
284
|
-
}
|
285
|
-
|
286
|
-
|
287
|
-
function isInterceptingBundleTransfers() public view virtual returns (bool) {
|
288
|
-
return isNftInterceptor();
|
289
|
-
}
|
290
|
-
|
291
|
-
|
292
|
-
function getBundleOwnerRole() public view returns (RoleId bundleOwnerRole) {
|
293
|
-
return _getPoolStorage()._bundleOwnerRole;
|
294
|
-
}
|
295
|
-
|
296
|
-
|
297
214
|
/// @dev see {IPoolComponent.applicationMatchesBundle}
|
298
215
|
/// Override this function to implement any custom application verification
|
299
216
|
/// Default implementation always returns true
|
@@ -313,14 +230,8 @@ abstract contract Pool is
|
|
313
230
|
}
|
314
231
|
|
315
232
|
|
316
|
-
function
|
317
|
-
|
318
|
-
setupInfo = reader.getPoolSetupInfo(getNftId());
|
319
|
-
|
320
|
-
// fallback to initial setup info (wallet is always != address(0))
|
321
|
-
if(setupInfo.wallet == address(0)) {
|
322
|
-
setupInfo = _getInitialSetupInfo();
|
323
|
-
}
|
233
|
+
function getPoolInfo() external view returns (IComponents.PoolInfo memory poolInfo) {
|
234
|
+
poolInfo = abi.decode(getComponentInfo().data, (IComponents.PoolInfo));
|
324
235
|
}
|
325
236
|
|
326
237
|
// Internals
|
@@ -328,14 +239,14 @@ abstract contract Pool is
|
|
328
239
|
function _createBundle(
|
329
240
|
address bundleOwner,
|
330
241
|
Fee memory fee,
|
331
|
-
|
242
|
+
Amount amount,
|
332
243
|
Seconds lifetime,
|
333
244
|
bytes memory filter
|
334
245
|
)
|
335
246
|
internal
|
336
247
|
returns(NftId bundleNftId)
|
337
248
|
{
|
338
|
-
bundleNftId = _getPoolStorage().
|
249
|
+
bundleNftId = _getPoolStorage()._poolService.createBundle(
|
339
250
|
bundleOwner,
|
340
251
|
fee,
|
341
252
|
amount,
|
@@ -350,23 +261,37 @@ abstract contract Pool is
|
|
350
261
|
return keccak256(abi.encode(uint256(keccak256(name)) - 1)) & ~bytes32(uint256(0xff));
|
351
262
|
}
|
352
263
|
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
264
|
+
/// @dev defines initial pool specification
|
265
|
+
/// overwrite this function according to your use case
|
266
|
+
function _getInitialInfo()
|
267
|
+
internal
|
268
|
+
view
|
269
|
+
virtual override
|
270
|
+
returns (IComponents.ComponentInfo memory info)
|
271
|
+
{
|
272
|
+
return IComponents.ComponentInfo(
|
273
|
+
getName(),
|
274
|
+
getToken(),
|
275
|
+
TokenHandler(address(0)), // will be created by GIF service during registration
|
276
|
+
address(this), // contract is its own wallet
|
277
|
+
AmountLib.zero(), // balance amount
|
278
|
+
AmountLib.zero(), // fee amount
|
279
|
+
abi.encode(
|
280
|
+
IComponents.PoolInfo(
|
281
|
+
NftIdLib.zero(), // will be set when GIF registers the related product
|
282
|
+
PUBLIC_ROLE(), // bundleOwnerRole
|
283
|
+
type(uint256).max, // maxCapitalAmount,
|
284
|
+
0, // initial balance amount
|
285
|
+
0, // initial fee amount
|
286
|
+
isNftInterceptor(), // isInterceptingBundleTransfers
|
287
|
+
false, // isExternallyManaged,
|
288
|
+
false, // isVerifyingApplications,
|
289
|
+
UFixedLib.toUFixed(1), // collateralizationLevel,
|
290
|
+
UFixedLib.toUFixed(1), // retentionLevel,
|
291
|
+
FeeLib.zeroFee(), // initialPoolFee,
|
292
|
+
FeeLib.zeroFee(), // initialStakingFee,
|
293
|
+
FeeLib.zeroFee() // initialPerformanceFee,
|
294
|
+
)));
|
370
295
|
}
|
371
296
|
|
372
297
|
|
@@ -24,6 +24,7 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
24
24
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
25
25
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
26
26
|
import {ISetup} from "../instance/module/ISetup.sol";
|
27
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
27
28
|
import {Pool} from "../components/Pool.sol";
|
28
29
|
import {Distribution} from "../components/Distribution.sol";
|
29
30
|
|
@@ -265,6 +266,9 @@ abstract contract Product is
|
|
265
266
|
function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
266
267
|
ProductStorage storage $ = _getProductStorage();
|
267
268
|
|
269
|
+
ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
|
270
|
+
IComponents.PoolInfo memory poolInfo = $._pool.getPoolInfo();
|
271
|
+
|
268
272
|
return ISetup.ProductSetupInfo(
|
269
273
|
getToken(),
|
270
274
|
$._tokenHandler,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
5
|
+
|
6
|
+
|
7
|
+
contract AccessManagerUpgradeableInitializeable is AccessManagerUpgradeable {
|
8
|
+
|
9
|
+
function initialize(address initialAdmin) initializer public {
|
10
|
+
__AccessManager_init(initialAdmin);
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|