@etherisc/gif-next 0.0.2-c96f882-016 → 0.0.2-ca9d515-311
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +63 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +139 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +149 -15
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +101 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +28 -2
- 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 +181 -16
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +157 -56
- 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/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 +4 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +788 -0
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/{AccessManagedSimple.sol/AccessManagedSimple.json → Cloneable.sol/Cloneable.json} +74 -3
- 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 +1395 -22
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +448 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +6 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +208 -155
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +57 -47
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +763 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +177 -38
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +341 -57
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +135 -15
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +285 -0
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +40 -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/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +923 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +440 -0
- 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 +684 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +428 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +669 -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/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +664 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +9 -71
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +17 -232
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +984 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +464 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +718 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +428 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +768 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +420 -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 +23 -105
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +94 -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 +70 -145
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +61 -29
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +44 -35
- 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 +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 +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- 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/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/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- 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/NftIdSet.sol/LibNftIdSet.json +26 -3
- 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/VersionPartLib.dbg.json +1 -1
- package/contracts/components/BaseComponent.sol +57 -11
- package/contracts/components/Distribution.sol +15 -18
- package/contracts/components/IBaseComponent.sol +7 -0
- package/contracts/components/IDistributionComponent.sol +1 -0
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/Pool.sol +43 -31
- package/contracts/components/Product.sol +42 -47
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +23 -0
- package/contracts/instance/BundleManager.sol +129 -0
- package/contracts/instance/Cloneable.sol +46 -0
- package/contracts/instance/IInstance.sol +39 -7
- package/contracts/instance/IInstanceBase.sol +26 -0
- package/contracts/instance/IInstanceService.sol +5 -3
- package/contracts/instance/Instance.sol +55 -32
- package/contracts/instance/InstanceAccessManager.sol +6 -6
- package/contracts/instance/InstanceBase.sol +41 -0
- package/contracts/instance/InstanceReader.sol +26 -1
- package/contracts/instance/InstanceService.sol +156 -33
- package/contracts/instance/InstanceServiceManager.sol +6 -5
- package/contracts/instance/ObjectManager.sol +101 -0
- package/contracts/instance/base/ComponentServiceBase.sol +42 -19
- package/contracts/instance/module/IBundle.sol +1 -0
- package/contracts/instance/module/ISetup.sol +3 -0
- package/contracts/instance/service/BundleService.sol +260 -0
- package/contracts/instance/service/BundleServiceManager.sol +54 -0
- package/contracts/instance/service/DistributionService.sol +118 -0
- package/contracts/instance/service/DistributionServiceManager.sol +54 -0
- package/contracts/instance/service/IBundleService.sol +45 -0
- package/contracts/instance/service/IPolicyService.sol +87 -0
- package/contracts/instance/service/IPoolService.sol +6 -23
- package/contracts/instance/service/IProductService.sol +6 -73
- package/contracts/instance/service/PolicyService.sol +508 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +124 -0
- package/contracts/instance/service/PoolServiceManager.sol +54 -0
- package/contracts/instance/service/ProductService.sol +173 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/IRegistry.sol +8 -17
- package/contracts/registry/IRegistryService.sol +27 -12
- package/contracts/registry/Registry.sol +18 -42
- package/contracts/registry/RegistryService.sol +30 -116
- package/contracts/registry/RegistryServiceManager.sol +21 -5
- package/contracts/registry/TokenRegistry.sol +111 -0
- package/contracts/shared/ERC165.sol +6 -2
- package/contracts/shared/NftOwnable.sol +2 -4
- package/contracts/shared/Registerable.sol +1 -0
- package/contracts/shared/Service.sol +1 -0
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +10 -0
- package/contracts/types/StateId.sol +4 -0
- package/package.json +1 -1
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +0 -1132
- package/contracts/instance/AccessManagedSimple.sol +0 -122
- package/contracts/instance/AccessManagerSimple.sol +0 -692
@@ -2,9 +2,32 @@
|
|
2
2
|
"_format": "hh-sol-artifact-1",
|
3
3
|
"contractName": "LibNftIdSet",
|
4
4
|
"sourceName": "contracts/types/NftIdSet.sol",
|
5
|
-
"abi": [
|
6
|
-
|
7
|
-
|
5
|
+
"abi": [
|
6
|
+
{
|
7
|
+
"inputs": [
|
8
|
+
{
|
9
|
+
"internalType": "NftId",
|
10
|
+
"name": "nftId",
|
11
|
+
"type": "uint96"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"name": "ErrorNftIdSetAlreadyAdded",
|
15
|
+
"type": "error"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"inputs": [
|
19
|
+
{
|
20
|
+
"internalType": "NftId",
|
21
|
+
"name": "nftId",
|
22
|
+
"type": "uint96"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"name": "ErrorNftIdSetNotInSet",
|
26
|
+
"type": "error"
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"bytecode": "0x6104c261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de2146100995780638b6233dd146100ac578063a3082a18146100cc578063a73d5756146100ee578063e797d8991461010e575b600080fd5b61008461007f3660046103c8565b610139565b60405190151581526020015b60405180910390f35b6100846100a7366004610404565b541590565b6100be6100ba366004610404565b5490565b604051908152602001610090565b8180156100d857600080fd5b506100ec6100e73660046103c8565b61015d565b005b8180156100fa57600080fd5b506100ec6101093660046103c8565b6101f8565b61012161011c36600461041d565b610380565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b0381166000908152600183016020526040902054156101a6576040516301eae2c560e61b81526001600160601b03821660048201526024015b60405180910390fd5b81546001818101845560008481526020808220600285040180546001600160601b03968716600c968616969096026101000a868102970219169590951790945584549281529301909152604090912055565b6001600160601b03811660009081526001830160205260408120549081900361023f5760405163482084f160e01b81526001600160601b038316600482015260240161019d565b600061024c60018361043f565b84549091506000906102609060019061043f565b905081811461030a57600085600001828154811061028057610280610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03169050808660000184815481106102c1576102c1610460565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908701909152604090208390555b845485908061031b5761031b610476565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055846001016000856001600160601b03166001600160601b03168152602001908152602001600020600090555050505050565b600082600001828154811061039757610397610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103db57600080fd5b8235915060208301356001600160601b03811681146103f957600080fd5b809150509250929050565b60006020828403121561041657600080fd5b5035919050565b6000806040838503121561043057600080fd5b50508035926020909101359150565b8181038181111561015757634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a59021e4afbe697b487a178e328b0427efd3acf42ac7b39308d6f8fbbe16b6d664736f6c63430008140033",
|
30
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632bfdd6b91461007157806331a97de2146100995780638b6233dd146100ac578063a3082a18146100cc578063a73d5756146100ee578063e797d8991461010e575b600080fd5b61008461007f3660046103c8565b610139565b60405190151581526020015b60405180910390f35b6100846100a7366004610404565b541590565b6100be6100ba366004610404565b5490565b604051908152602001610090565b8180156100d857600080fd5b506100ec6100e73660046103c8565b61015d565b005b8180156100fa57600080fd5b506100ec6101093660046103c8565b6101f8565b61012161011c36600461041d565b610380565b6040516001600160601b039091168152602001610090565b6001600160601b038116600090815260018301602052604090205415155b92915050565b6001600160601b0381166000908152600183016020526040902054156101a6576040516301eae2c560e61b81526001600160601b03821660048201526024015b60405180910390fd5b81546001818101845560008481526020808220600285040180546001600160601b03968716600c968616969096026101000a868102970219169590951790945584549281529301909152604090912055565b6001600160601b03811660009081526001830160205260408120549081900361023f5760405163482084f160e01b81526001600160601b038316600482015260240161019d565b600061024c60018361043f565b84549091506000906102609060019061043f565b905081811461030a57600085600001828154811061028057610280610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b03169050808660000184815481106102c1576102c1610460565b60009182526020808320600283040180546001600160601b03958616600c6001958616026101000a90810290870219909116179055939092168152908701909152604090208390555b845485908061031b5761031b610476565b6001900381819060005260206000209060029182820401919006600c026101000a8154906001600160601b0302191690559055846001016000856001600160601b03166001600160601b03168152602001908152602001600020600090555050505050565b600082600001828154811061039757610397610460565b9060005260206000209060029182820401919006600c029054906101000a90046001600160601b0316905092915050565b600080604083850312156103db57600080fd5b8235915060208301356001600160601b03811681146103f957600080fd5b809150509250929050565b60006020828403121561041657600080fd5b5035919050565b6000806040838503121561043057600080fd5b50508035926020909101359150565b8181038181111561015757634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220a59021e4afbe697b487a178e328b0427efd3acf42ac7b39308d6f8fbbe16b6d664736f6c63430008140033",
|
8
31
|
"linkReferences": {},
|
9
32
|
"deployedLinkReferences": {}
|
10
33
|
}
|
@@ -131,8 +131,8 @@
|
|
131
131
|
"type": "function"
|
132
132
|
}
|
133
133
|
],
|
134
|
-
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
135
|
-
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
134
|
+
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220d05b76d7477b717f7dc69d7d48c31f6517affb9cfed8f56df2759e2ab290d86d64736f6c63430008140033",
|
135
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220d05b76d7477b717f7dc69d7d48c31f6517affb9cfed8f56df2759e2ab290d86d64736f6c63430008140033",
|
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
|
}
|
@@ -1,23 +1,22 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IBaseComponent} from "./IBaseComponent.sol";
|
5
|
+
import {IComponentOwnerService} from "../instance/service/IComponentOwnerService.sol";
|
4
6
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
-
|
6
|
-
import {Registerable} from "../shared/Registerable.sol";
|
7
|
-
|
8
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
-
import {IInstance} from "../instance/IInstance.sol";
|
10
|
-
|
11
7
|
import {IInstance} from "../instance/IInstance.sol";
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {NftId} from "../types/NftId.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
+
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
15
10
|
import {ObjectType} from "../types/ObjectType.sol";
|
11
|
+
import {Registerable} from "../shared/Registerable.sol";
|
12
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
16
13
|
|
17
14
|
abstract contract BaseComponent is
|
18
15
|
Registerable,
|
19
16
|
IBaseComponent
|
20
17
|
{
|
18
|
+
using NftIdLib for NftId;
|
19
|
+
|
21
20
|
IComponentOwnerService internal _componentOwnerService;
|
22
21
|
|
23
22
|
address internal _deployer;
|
@@ -29,7 +28,6 @@ abstract contract BaseComponent is
|
|
29
28
|
constructor(
|
30
29
|
address registry,
|
31
30
|
NftId instanceNftId,
|
32
|
-
NftId productNftId,
|
33
31
|
address token,
|
34
32
|
ObjectType componentType,
|
35
33
|
bool isInterceptor,
|
@@ -49,16 +47,17 @@ abstract contract BaseComponent is
|
|
49
47
|
_componentOwnerService = _instance.getComponentOwnerService();
|
50
48
|
_wallet = address(this);
|
51
49
|
_token = IERC20Metadata(token);
|
52
|
-
_productNftId = productNftId;
|
53
50
|
|
54
51
|
_registerInterface(type(IBaseComponent).interfaceId);
|
55
52
|
}
|
56
53
|
|
57
54
|
// from component contract
|
55
|
+
// TODO consider to remove/replace with access manager contract locking
|
58
56
|
function lock() external onlyOwner override {
|
59
57
|
_componentOwnerService.lock(this);
|
60
58
|
}
|
61
59
|
|
60
|
+
// TODO consider to remove/replace with access manager contract locking
|
62
61
|
function unlock() external onlyOwner override {
|
63
62
|
_componentOwnerService.unlock(this);
|
64
63
|
}
|
@@ -72,6 +71,48 @@ abstract contract BaseComponent is
|
|
72
71
|
return _wallet;
|
73
72
|
}
|
74
73
|
|
74
|
+
/// @dev Sets the wallet address for the component.
|
75
|
+
/// if the current wallet has tokens, these will be transferred.
|
76
|
+
/// if the new wallet address is externally owned, an approval from the
|
77
|
+
/// owner of the external wallet for the component to move all tokens must exist.
|
78
|
+
function setWallet(address newWallet) external override onlyOwner {
|
79
|
+
address currentWallet = _wallet;
|
80
|
+
uint256 currentBalance = _token.balanceOf(currentWallet);
|
81
|
+
|
82
|
+
// checks
|
83
|
+
if (newWallet == currentWallet) {
|
84
|
+
revert ErrorBaseComponentWalletAddressIsSameAsCurrent(newWallet);
|
85
|
+
}
|
86
|
+
|
87
|
+
if (currentBalance > 0) {
|
88
|
+
if (currentWallet == address(this)) {
|
89
|
+
// move tokens from component smart contract to external wallet
|
90
|
+
} else {
|
91
|
+
// move tokens from external wallet to component smart contract or another external wallet
|
92
|
+
uint256 allowance = _token.allowance(currentWallet, address(this));
|
93
|
+
if (allowance < currentBalance) {
|
94
|
+
revert ErrorBaseComponentWalletAllowanceTooSmall(currentWallet, newWallet, allowance, currentBalance);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
// effects
|
100
|
+
_wallet = newWallet;
|
101
|
+
emit LogBaseComponentWalletAddressChanged(newWallet);
|
102
|
+
|
103
|
+
// interactions
|
104
|
+
if (currentBalance > 0) {
|
105
|
+
// transfer tokens from current wallet to new wallet
|
106
|
+
if (currentWallet == address(this)) {
|
107
|
+
// transferFrom requires self allowance too
|
108
|
+
_token.approve(address(this), currentBalance);
|
109
|
+
}
|
110
|
+
|
111
|
+
SafeERC20.safeTransferFrom(_token, currentWallet, newWallet, currentBalance);
|
112
|
+
emit LogBaseComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
75
116
|
function getToken() public view override returns (IERC20Metadata token) {
|
76
117
|
return _token;
|
77
118
|
}
|
@@ -80,6 +121,11 @@ abstract contract BaseComponent is
|
|
80
121
|
return _instance;
|
81
122
|
}
|
82
123
|
|
124
|
+
function setProductNftId(NftId productNftId) public override onlyOwner {
|
125
|
+
require(_productNftId.eq(zeroNftId()), "product nft id already set");
|
126
|
+
_productNftId = productNftId;
|
127
|
+
}
|
128
|
+
|
83
129
|
function getProductNftId() public view override returns (NftId productNftId) {
|
84
130
|
return _productNftId;
|
85
131
|
}
|
@@ -25,6 +25,8 @@ contract Distribution is
|
|
25
25
|
Fee internal _initialDistributionFee;
|
26
26
|
bool internal _isVerifying;
|
27
27
|
|
28
|
+
TokenHandler internal _tokenHandler;
|
29
|
+
|
28
30
|
IDistributionService private _distributionService;
|
29
31
|
IProductService private _productService;
|
30
32
|
|
@@ -38,21 +40,21 @@ contract Distribution is
|
|
38
40
|
constructor(
|
39
41
|
address registry,
|
40
42
|
NftId instanceNftId,
|
41
|
-
NftId productNftId,
|
42
43
|
// TODO refactor into tokenNftId
|
43
44
|
address token,
|
44
45
|
bool verifying,
|
45
46
|
Fee memory distributionFee,
|
46
47
|
address initialOwner
|
47
48
|
)
|
48
|
-
BaseComponent(registry, instanceNftId,
|
49
|
+
BaseComponent(registry, instanceNftId, token, DISTRIBUTION(), true, initialOwner)
|
49
50
|
{
|
50
51
|
_isVerifying = verifying;
|
51
52
|
_initialDistributionFee = distributionFee;
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
_tokenHandler = TokenHandler(token);
|
55
|
+
|
56
|
+
_distributionService = _instance.getDistributionService();
|
57
|
+
_productService = _instance.getProductService();
|
56
58
|
|
57
59
|
_registerInterface(type(IDistributionComponent).interfaceId);
|
58
60
|
}
|
@@ -123,19 +125,10 @@ contract Distribution is
|
|
123
125
|
}
|
124
126
|
|
125
127
|
function getSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
126
|
-
if (getNftId().eq(zeroNftId())) {
|
127
|
-
return ISetup.DistributionSetupInfo(
|
128
|
-
_productNftId,
|
129
|
-
TokenHandler(address(0)),
|
130
|
-
_initialDistributionFee,
|
131
|
-
_isVerifying,
|
132
|
-
address(0)
|
133
|
-
);
|
134
|
-
}
|
135
|
-
|
136
128
|
InstanceReader reader = _instance.getInstanceReader();
|
137
129
|
return reader.getDistributionSetupInfo(getNftId());
|
138
130
|
}
|
131
|
+
|
139
132
|
|
140
133
|
/// @dev returns true iff the component needs to be called when selling/renewing policis
|
141
134
|
function isVerifying() external view returns (bool verifying) {
|
@@ -152,14 +145,18 @@ contract Distribution is
|
|
152
145
|
{
|
153
146
|
(
|
154
147
|
IRegistry.ObjectInfo memory info,
|
155
|
-
bytes memory data
|
156
148
|
) = super.getInitialInfo();
|
157
149
|
|
158
150
|
return (
|
159
151
|
info,
|
160
152
|
abi.encode(
|
161
|
-
|
162
|
-
|
153
|
+
ISetup.DistributionSetupInfo(
|
154
|
+
_productNftId,
|
155
|
+
_tokenHandler,
|
156
|
+
_initialDistributionFee,
|
157
|
+
_isVerifying,
|
158
|
+
address(this)
|
159
|
+
)
|
163
160
|
)
|
164
161
|
);
|
165
162
|
}
|
@@ -8,6 +8,11 @@ import {IInstance} from "../instance/IInstance.sol";
|
|
8
8
|
import {NftId} from "../types/NftId.sol";
|
9
9
|
|
10
10
|
interface IBaseComponent is IRegisterable {
|
11
|
+
error ErrorBaseComponentWalletAddressIsSameAsCurrent(address newWallet);
|
12
|
+
error ErrorBaseComponentWalletAllowanceTooSmall(address oldWallet, address newWallet, uint256 allowance, uint256 balance);
|
13
|
+
|
14
|
+
event LogBaseComponentWalletAddressChanged(address newWallet);
|
15
|
+
event LogBaseComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
11
16
|
|
12
17
|
function lock() external;
|
13
18
|
|
@@ -15,10 +20,12 @@ interface IBaseComponent is IRegisterable {
|
|
15
20
|
|
16
21
|
function getToken() external view returns (IERC20Metadata token);
|
17
22
|
|
23
|
+
function setWallet(address walletAddress) external;
|
18
24
|
function getWallet() external view returns (address walletAddress);
|
19
25
|
|
20
26
|
function getInstance() external view returns (IInstance instance);
|
21
27
|
|
28
|
+
function setProductNftId(NftId productNftId) external;
|
22
29
|
function getProductNftId() external view returns (NftId productNftId);
|
23
30
|
|
24
31
|
}
|
@@ -43,6 +43,10 @@ interface IPoolComponent {
|
|
43
43
|
uint256 collateralizationAmount
|
44
44
|
) external;
|
45
45
|
|
46
|
+
function lockBundle(NftId bundleNftId) external;
|
47
|
+
|
48
|
+
function unlockBundle(NftId bundleNftId) external;
|
49
|
+
|
46
50
|
/**
|
47
51
|
* @dev returns true iff the policy application data in policyData matches
|
48
52
|
* with the bundle filter criteria encoded in bundleFilter.
|
@@ -55,7 +59,7 @@ interface IPoolComponent {
|
|
55
59
|
view
|
56
60
|
returns (bool isMatching);
|
57
61
|
|
58
|
-
function
|
62
|
+
function isConfirmingApplication() external view returns (bool isConfirmingApplication);
|
59
63
|
|
60
64
|
function getCollateralizationLevel() external view returns (UFixed collateralizationLevel);
|
61
65
|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {ObjectType, POOL} from "../types/ObjectType.sol";
|
5
5
|
import {IProductService} from "../instance/service/IProductService.sol";
|
6
6
|
import {IPoolService} from "../instance/service/IPoolService.sol";
|
7
|
+
import {IBundleService} from "../instance/service/IBundleService.sol";
|
7
8
|
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
8
9
|
import {Fee} from "../types/Fee.sol";
|
9
10
|
import {UFixed} from "../types/UFixed.sol";
|
@@ -25,19 +26,23 @@ import {Registerable} from "../shared/Registerable.sol";
|
|
25
26
|
contract Pool is BaseComponent, IPoolComponent {
|
26
27
|
using NftIdLib for NftId;
|
27
28
|
|
28
|
-
bool internal
|
29
|
+
bool internal _isConfirmingApplication;
|
29
30
|
UFixed internal _collateralizationLevel;
|
30
31
|
|
31
32
|
Fee internal _initialPoolFee;
|
32
33
|
Fee internal _initialStakingFee;
|
33
34
|
Fee internal _initialPerformanceFee;
|
34
35
|
|
36
|
+
TokenHandler internal _tokenHandler;
|
37
|
+
|
35
38
|
// may be used to interact with instance by derived contracts
|
36
39
|
IPoolService internal _poolService;
|
37
40
|
|
38
41
|
// only relevant to protect callback functions for "active" pools
|
39
42
|
IProductService private _productService;
|
40
43
|
|
44
|
+
IBundleService private _bundleService;
|
45
|
+
|
41
46
|
modifier onlyPoolService() {
|
42
47
|
require(
|
43
48
|
msg.sender == address(_poolService),
|
@@ -55,29 +60,30 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
55
60
|
constructor(
|
56
61
|
address registry,
|
57
62
|
NftId instanceNftId,
|
58
|
-
NftId productNftId,
|
59
63
|
// TODO refactor into tokenNftId
|
60
64
|
address token,
|
61
65
|
bool isInterceptor,
|
62
|
-
bool
|
66
|
+
bool isConfirmingApplication,
|
63
67
|
UFixed collateralizationLevel,
|
64
68
|
Fee memory poolFee,
|
65
69
|
Fee memory stakingFee,
|
66
70
|
Fee memory performanceFee,
|
67
71
|
address initialOwner
|
68
72
|
)
|
69
|
-
BaseComponent(registry, instanceNftId,
|
73
|
+
BaseComponent(registry, instanceNftId, token, POOL(), isInterceptor, initialOwner)
|
70
74
|
{
|
71
|
-
|
75
|
+
_isConfirmingApplication = isConfirmingApplication;
|
72
76
|
// TODO add validation
|
73
77
|
_collateralizationLevel = collateralizationLevel;
|
74
78
|
_initialPoolFee = poolFee;
|
75
79
|
_initialStakingFee = stakingFee;
|
76
80
|
_initialPerformanceFee = performanceFee;
|
77
81
|
|
78
|
-
|
79
|
-
|
80
|
-
|
82
|
+
_tokenHandler = new TokenHandler(token);
|
83
|
+
|
84
|
+
_poolService = _instance.getPoolService();
|
85
|
+
_productService = _instance.getProductService();
|
86
|
+
_bundleService = _instance.getBundleService();
|
81
87
|
|
82
88
|
_registerInterface(type(IPoolComponent).interfaceId);
|
83
89
|
}
|
@@ -93,7 +99,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
93
99
|
returns(NftId bundleNftId)
|
94
100
|
{
|
95
101
|
address owner = msg.sender;
|
96
|
-
bundleNftId =
|
102
|
+
bundleNftId = _bundleService.createBundle(
|
97
103
|
owner,
|
98
104
|
fee,
|
99
105
|
initialAmount,
|
@@ -138,8 +144,8 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
138
144
|
}
|
139
145
|
|
140
146
|
|
141
|
-
function
|
142
|
-
return
|
147
|
+
function isConfirmingApplication() external view override returns (bool isConfirmingApplication) {
|
148
|
+
return _isConfirmingApplication;
|
143
149
|
}
|
144
150
|
|
145
151
|
function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
|
@@ -166,24 +172,30 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
166
172
|
override
|
167
173
|
// TODO add onlyBundleOwner
|
168
174
|
{
|
169
|
-
|
175
|
+
_bundleService.setBundleFee(bundleNftId, fee);
|
170
176
|
}
|
171
177
|
|
172
|
-
function
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
_initialPerformanceFee,
|
182
|
-
_isVerifying,
|
183
|
-
_wallet
|
184
|
-
);
|
185
|
-
}
|
178
|
+
function lockBundle(
|
179
|
+
NftId bundleNftId
|
180
|
+
)
|
181
|
+
external
|
182
|
+
override
|
183
|
+
// TODO add onlyBundleOwner
|
184
|
+
{
|
185
|
+
_bundleService.lockBundle(bundleNftId);
|
186
|
+
}
|
186
187
|
|
188
|
+
function unlockBundle(
|
189
|
+
NftId bundleNftId
|
190
|
+
)
|
191
|
+
external
|
192
|
+
override
|
193
|
+
// TODO add onlyBundleOwner
|
194
|
+
{
|
195
|
+
_bundleService.unlockBundle(bundleNftId);
|
196
|
+
}
|
197
|
+
|
198
|
+
function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
187
199
|
InstanceReader reader = _instance.getInstanceReader();
|
188
200
|
return reader.getPoolSetupInfo(getNftId());
|
189
201
|
}
|
@@ -200,20 +212,20 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
200
212
|
{
|
201
213
|
(
|
202
214
|
IRegistry.ObjectInfo memory info,
|
203
|
-
bytes memory data
|
204
215
|
) = super.getInitialInfo();
|
205
216
|
|
206
217
|
return (
|
207
218
|
info,
|
208
219
|
abi.encode(
|
209
220
|
ISetup.PoolSetupInfo(
|
210
|
-
|
211
|
-
|
221
|
+
_productNftId,
|
222
|
+
_tokenHandler,
|
212
223
|
_collateralizationLevel,
|
213
224
|
_initialPoolFee,
|
214
225
|
_initialStakingFee,
|
215
226
|
_initialPerformanceFee,
|
216
|
-
|
227
|
+
false,
|
228
|
+
_isConfirmingApplication,
|
217
229
|
_wallet
|
218
230
|
)
|
219
231
|
)
|
@@ -248,7 +260,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
248
260
|
internal
|
249
261
|
returns(NftId bundleNftId)
|
250
262
|
{
|
251
|
-
bundleNftId =
|
263
|
+
bundleNftId = _bundleService.createBundle(
|
252
264
|
bundleOwner,
|
253
265
|
fee,
|
254
266
|
amount,
|