@etherisc/gif-next 0.0.2-e922e07-736 → 0.0.2-e94f4c7-084
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -83
- 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 +84 -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 +457 -268
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +175 -51
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +426 -476
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +472 -126
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +217 -169
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +304 -210
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +71 -23
- 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 +175 -83
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +29 -13
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +426 -233
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +78 -14
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +372 -86
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +55 -7
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +189 -139
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +48 -56
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +111 -40
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +246 -170
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +251 -58
- 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 +470 -41
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +627 -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 +607 -85
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +71 -19
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +777 -55
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +72 -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 +209 -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/ClaimId.sol/ClaimIdLib.json +83 -4
- 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/PayoutId.sol/PayoutIdLib.json +116 -7
- 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 +17 -4
- 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/Distribution.sol +6 -2
- package/contracts/components/IComponent.sol +9 -1
- package/contracts/components/IPoolComponent.sol +6 -44
- package/contracts/components/Pool.sol +50 -126
- package/contracts/components/Product.sol +141 -59
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +9 -8
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +37 -27
- package/contracts/instance/IInstanceService.sol +18 -9
- package/contracts/instance/Instance.sol +117 -98
- package/contracts/instance/InstanceAccessManager.sol +388 -158
- package/contracts/instance/InstanceReader.sol +36 -12
- package/contracts/instance/InstanceService.sol +193 -204
- 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 +23 -6
- 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/IPolicy.sol +11 -6
- package/contracts/instance/module/ISetup.sol +3 -16
- package/contracts/instance/service/ApplicationService.sol +25 -19
- package/contracts/instance/service/BundleService.sol +224 -80
- package/contracts/instance/service/ClaimService.sol +114 -26
- package/contracts/instance/service/DistributionService.sol +58 -77
- package/contracts/instance/service/IApplicationService.sol +3 -7
- package/contracts/instance/service/IBundleService.sol +72 -25
- package/contracts/instance/service/IClaimService.sol +46 -15
- package/contracts/instance/service/IDistributionService.sol +1 -0
- package/contracts/instance/service/IPolicyService.sol +72 -5
- package/contracts/instance/service/IPoolService.sol +85 -3
- package/contracts/instance/service/PolicyService.sol +320 -143
- package/contracts/instance/service/PoolService.sol +245 -18
- package/contracts/instance/service/ProductService.sol +31 -54
- 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 +70 -0
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +25 -2
- package/contracts/types/Fee.sol +13 -5
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +6 -5
- package/contracts/types/PayoutId.sol +33 -5
- package/contracts/types/RoleId.sol +6 -4
- package/contracts/types/StateId.sol +7 -2
- package/contracts/types/Timestamp.sol +6 -0
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +1 -1
@@ -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
|
+
}
|
@@ -37,6 +37,8 @@ abstract contract Distribution is
|
|
37
37
|
mapping(address distributor => NftId distributorNftId) _distributorNftId;
|
38
38
|
}
|
39
39
|
|
40
|
+
error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
|
41
|
+
|
40
42
|
function initializeDistribution(
|
41
43
|
address registry,
|
42
44
|
NftId instanceNftId,
|
@@ -58,7 +60,7 @@ abstract contract Distribution is
|
|
58
60
|
$._minDistributionOwnerFee = minDistributionOwnerFee;
|
59
61
|
$._distributionFee = distributionFee;
|
60
62
|
$._tokenHandler = new TokenHandler(token);
|
61
|
-
$._distributionService =
|
63
|
+
$._distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
62
64
|
|
63
65
|
registerInterface(type(IDistributionComponent).interfaceId);
|
64
66
|
}
|
@@ -116,7 +118,9 @@ abstract contract Distribution is
|
|
116
118
|
returns(NftId distributorNftId)
|
117
119
|
{
|
118
120
|
DistributionStorage storage $ = _getDistributionStorage();
|
119
|
-
|
121
|
+
if($._distributorNftId[distributor].gtz()) {
|
122
|
+
revert ErrorDistributionAlreadyDistributor(distributor, $._distributorNftId[distributor]);
|
123
|
+
}
|
120
124
|
|
121
125
|
distributorNftId = $._distributionService.createDistributor(
|
122
126
|
distributor,
|
@@ -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
|
@@ -40,7 +37,7 @@ interface IPoolComponent is IComponent {
|
|
40
37
|
|
41
38
|
/// @dev locks the specified bundle
|
42
39
|
/// a bundle to be locked MUST be in active state
|
43
|
-
/// locked bundles may not be used to
|
40
|
+
/// locked bundles may not be used to collateralize any new policy
|
44
41
|
function lockBundle(NftId bundleNftId) external;
|
45
42
|
|
46
43
|
/// @dev unlocks the specified bundle
|
@@ -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,19 @@
|
|
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
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
8
8
|
import {IPoolComponent} from "./IPoolComponent.sol";
|
9
9
|
import {IPoolService} from "../instance/service/IPoolService.sol";
|
10
|
-
import {
|
10
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
11
11
|
import {NftId, NftIdLib} from "../types/NftId.sol";
|
12
|
-
import {POOL} from "../types/ObjectType.sol";
|
12
|
+
import {BUNDLE, POOL} from "../types/ObjectType.sol";
|
13
13
|
import {RoleId, PUBLIC_ROLE} from "../types/RoleId.sol";
|
14
14
|
import {Seconds} from "../types/Seconds.sol";
|
15
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
-
import {UFixed} from "../types/UFixed.sol";
|
17
|
-
|
16
|
+
import {UFixed, UFixedLib} from "../types/UFixed.sol";
|
18
17
|
|
19
18
|
abstract contract Pool is
|
20
19
|
Component,
|
@@ -24,23 +23,6 @@ abstract contract Pool is
|
|
24
23
|
bytes32 public constant POOL_STORAGE_LOCATION_V1 = 0x25e3e51823fbfffb988e0a2744bb93722d9f3e906c07cc0a9e77884c46c58300;
|
25
24
|
|
26
25
|
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
26
|
IPoolService _poolService;
|
45
27
|
IBundleService _bundleService;
|
46
28
|
}
|
@@ -68,10 +50,6 @@ abstract contract Pool is
|
|
68
50
|
string memory name,
|
69
51
|
address token,
|
70
52
|
bool isInterceptingNftTransfers,
|
71
|
-
bool isExternallyManaging,
|
72
|
-
bool isVerifying,
|
73
|
-
UFixed collateralizationLevel,
|
74
|
-
UFixed retentionLevel,
|
75
53
|
address initialOwner,
|
76
54
|
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
77
55
|
)
|
@@ -82,19 +60,8 @@ abstract contract Pool is
|
|
82
60
|
initializeComponent(registry, instanceNftId, name, token, POOL(), isInterceptingNftTransfers, initialOwner, registryData);
|
83
61
|
|
84
62
|
PoolStorage storage $ = _getPoolStorage();
|
85
|
-
|
86
|
-
$.
|
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
|
-
$._poolService = getInstance().getPoolService();
|
97
|
-
$._bundleService = getInstance().getBundleService();
|
63
|
+
$._poolService = IPoolService(_getServiceAddress(POOL()));
|
64
|
+
$._bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
98
65
|
|
99
66
|
registerInterface(type(IPoolComponent).interfaceId);
|
100
67
|
}
|
@@ -142,30 +109,30 @@ abstract contract Pool is
|
|
142
109
|
function lockBundle(NftId bundleNftId)
|
143
110
|
public
|
144
111
|
virtual
|
145
|
-
restricted()
|
112
|
+
//restricted() // TODO consider adding this back
|
146
113
|
onlyBundleOwner(bundleNftId)
|
147
114
|
{
|
148
|
-
_getPoolStorage()._bundleService.
|
115
|
+
_getPoolStorage()._bundleService.lock(bundleNftId);
|
149
116
|
}
|
150
117
|
|
151
118
|
|
152
119
|
function unlockBundle(NftId bundleNftId)
|
153
120
|
public
|
154
121
|
virtual
|
155
|
-
restricted()
|
122
|
+
//restricted()
|
156
123
|
onlyBundleOwner(bundleNftId)
|
157
124
|
{
|
158
|
-
_getPoolStorage()._bundleService.
|
125
|
+
_getPoolStorage()._bundleService.unlock(bundleNftId);
|
159
126
|
}
|
160
127
|
|
161
128
|
|
162
129
|
function close(NftId bundleNftId)
|
163
130
|
public
|
164
131
|
virtual
|
165
|
-
restricted()
|
132
|
+
//restricted()
|
166
133
|
onlyBundleOwner(bundleNftId)
|
167
134
|
{
|
168
|
-
|
135
|
+
_getPoolStorage()._poolService.closeBundle(bundleNftId);
|
169
136
|
}
|
170
137
|
|
171
138
|
|
@@ -178,7 +145,7 @@ abstract contract Pool is
|
|
178
145
|
restricted()
|
179
146
|
onlyBundleOwner(bundleNftId)
|
180
147
|
{
|
181
|
-
_getPoolStorage()._bundleService.
|
148
|
+
_getPoolStorage()._bundleService.setFee(bundleNftId, fee);
|
182
149
|
}
|
183
150
|
|
184
151
|
|
@@ -188,13 +155,7 @@ abstract contract Pool is
|
|
188
155
|
restricted()
|
189
156
|
onlyOwner()
|
190
157
|
{
|
191
|
-
|
192
|
-
// _getPoolStorage()._poolService.setMaxCapitalAmount(...);
|
193
|
-
|
194
|
-
uint256 previousMaxCapitalAmount = _getPoolStorage()._maxCapitalAmount;
|
195
|
-
_getPoolStorage()._maxCapitalAmount = maxCapitalAmount;
|
196
|
-
|
197
|
-
emit LogPoolBundleMaxCapitalAmountUpdated(previousMaxCapitalAmount, maxCapitalAmount);
|
158
|
+
_getPoolStorage()._poolService.setMaxCapitalAmount(maxCapitalAmount);
|
198
159
|
}
|
199
160
|
|
200
161
|
|
@@ -204,16 +165,7 @@ abstract contract Pool is
|
|
204
165
|
restricted()
|
205
166
|
onlyOwner()
|
206
167
|
{
|
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);
|
168
|
+
_getPoolStorage()._poolService.setBundleOwnerRole(bundleOwnerRole);
|
217
169
|
}
|
218
170
|
|
219
171
|
|
@@ -243,7 +195,6 @@ abstract contract Pool is
|
|
243
195
|
virtual
|
244
196
|
restricted()
|
245
197
|
{
|
246
|
-
// validate application data against bundle filter
|
247
198
|
if(!applicationMatchesBundle(
|
248
199
|
applicationNftId,
|
249
200
|
applicationData,
|
@@ -259,41 +210,6 @@ abstract contract Pool is
|
|
259
210
|
}
|
260
211
|
|
261
212
|
|
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
213
|
/// @dev see {IPoolComponent.applicationMatchesBundle}
|
298
214
|
/// Override this function to implement any custom application verification
|
299
215
|
/// Default implementation always returns true
|
@@ -313,14 +229,8 @@ abstract contract Pool is
|
|
313
229
|
}
|
314
230
|
|
315
231
|
|
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
|
-
}
|
232
|
+
function getPoolInfo() external view returns (IComponents.PoolInfo memory poolInfo) {
|
233
|
+
poolInfo = abi.decode(getComponentInfo().data, (IComponents.PoolInfo));
|
324
234
|
}
|
325
235
|
|
326
236
|
// Internals
|
@@ -328,14 +238,14 @@ abstract contract Pool is
|
|
328
238
|
function _createBundle(
|
329
239
|
address bundleOwner,
|
330
240
|
Fee memory fee,
|
331
|
-
|
241
|
+
Amount amount,
|
332
242
|
Seconds lifetime,
|
333
243
|
bytes memory filter
|
334
244
|
)
|
335
245
|
internal
|
336
246
|
returns(NftId bundleNftId)
|
337
247
|
{
|
338
|
-
bundleNftId = _getPoolStorage().
|
248
|
+
bundleNftId = _getPoolStorage()._poolService.createBundle(
|
339
249
|
bundleOwner,
|
340
250
|
fee,
|
341
251
|
amount,
|
@@ -350,23 +260,37 @@ abstract contract Pool is
|
|
350
260
|
return keccak256(abi.encode(uint256(keccak256(name)) - 1)) & ~bytes32(uint256(0xff));
|
351
261
|
}
|
352
262
|
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
263
|
+
/// @dev defines initial pool specification
|
264
|
+
/// overwrite this function according to your use case
|
265
|
+
function _getInitialInfo()
|
266
|
+
internal
|
267
|
+
view
|
268
|
+
virtual override
|
269
|
+
returns (IComponents.ComponentInfo memory info)
|
270
|
+
{
|
271
|
+
return IComponents.ComponentInfo(
|
272
|
+
getName(),
|
273
|
+
getToken(),
|
274
|
+
TokenHandler(address(0)), // will be created by GIF service during registration
|
275
|
+
address(this), // contract is its own wallet
|
276
|
+
AmountLib.zero(), // balance amount
|
277
|
+
AmountLib.zero(), // fee amount
|
278
|
+
abi.encode(
|
279
|
+
IComponents.PoolInfo(
|
280
|
+
NftIdLib.zero(), // will be set when GIF registers the related product
|
281
|
+
PUBLIC_ROLE(), // bundleOwnerRole
|
282
|
+
type(uint256).max, // maxCapitalAmount,
|
283
|
+
0, // initial balance amount
|
284
|
+
0, // initial fee amount
|
285
|
+
isNftInterceptor(), // isInterceptingBundleTransfers
|
286
|
+
false, // isExternallyManaged,
|
287
|
+
false, // isVerifyingApplications,
|
288
|
+
UFixedLib.toUFixed(1), // collateralizationLevel,
|
289
|
+
UFixedLib.toUFixed(1), // retentionLevel,
|
290
|
+
FeeLib.zeroFee(), // initialPoolFee,
|
291
|
+
FeeLib.zeroFee(), // initialStakingFee,
|
292
|
+
FeeLib.zeroFee() // initialPerformanceFee,
|
293
|
+
)));
|
370
294
|
}
|
371
295
|
|
372
296
|
|