@etherisc/gif-next 0.0.2-aa8d0c4-506 → 0.0.2-ab4c2da-820
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +126 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +136 -62
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +88 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +0 -52
- 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 +168 -102
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +144 -64
- 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/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/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- 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} +86 -2
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +981 -10
- 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 +30 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +169 -139
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +55 -32
- 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 +74 -40
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +269 -94
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +102 -34
- 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 +30 -19
- 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/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- 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 +39 -52
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +43 -53
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +15 -23
- 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/IComponentOwnerService.sol/IComponentOwnerService.json +13 -13
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -13
- 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 +15 -77
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +25 -240
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +971 -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 +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +42 -157
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +15 -35
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +755 -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/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +82 -262
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +188 -65
- 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 +112 -331
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +37 -79
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -112
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +551 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +14 -27
- 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/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +13 -13
- 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 +2 -2
- 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/Service.sol/Service.json +13 -13
- 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 +31 -31
- 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/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 +49 -8
- package/contracts/components/Distribution.sol +12 -15
- package/contracts/components/IBaseComponent.sol +6 -0
- package/contracts/components/IDistributionComponent.sol +0 -2
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/Pool.sol +49 -25
- package/contracts/components/Product.sol +41 -46
- 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 +25 -4
- package/contracts/instance/IInstanceBase.sol +26 -0
- package/contracts/instance/IInstanceService.sol +7 -3
- package/contracts/instance/Instance.sol +44 -23
- package/contracts/instance/InstanceAccessManager.sol +6 -6
- package/contracts/instance/InstanceBase.sol +41 -0
- package/contracts/instance/InstanceReader.sol +9 -0
- package/contracts/instance/InstanceService.sol +190 -73
- package/contracts/instance/InstanceServiceManager.sol +8 -6
- package/contracts/instance/ObjectManager.sol +101 -0
- package/contracts/instance/base/ComponentServiceBase.sol +36 -24
- package/contracts/instance/module/ISetup.sol +3 -1
- package/contracts/instance/service/BundleService.sol +260 -0
- package/contracts/instance/service/BundleServiceManager.sol +55 -0
- package/contracts/instance/service/ComponentOwnerService.sol +4 -6
- package/contracts/instance/service/DistributionService.sol +41 -26
- package/contracts/instance/service/DistributionServiceManager.sol +8 -6
- 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 +503 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +46 -129
- package/contracts/instance/service/PoolServiceManager.sol +8 -6
- package/contracts/instance/service/ProductService.sol +168 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +16 -33
- package/contracts/registry/IRegistryService.sol +37 -12
- package/contracts/registry/Registry.sol +138 -242
- package/contracts/registry/RegistryAccessManager.sol +207 -0
- package/contracts/registry/RegistryService.sol +83 -152
- package/contracts/registry/RegistryServiceManager.sol +18 -36
- package/contracts/registry/ReleaseManager.sol +382 -0
- package/contracts/registry/TokenRegistry.sol +5 -6
- package/contracts/shared/IService.sol +2 -1
- package/contracts/shared/NftOwnable.sol +2 -4
- package/contracts/shared/ProxyManager.sol +1 -1
- package/contracts/shared/Service.sol +11 -7
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +7 -5
- 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 -115
- package/contracts/instance/AccessManagerSimple.sol +0 -692
@@ -1,18 +1,15 @@
|
|
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 {IBaseComponent} from "./IBaseComponent.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
14
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,
|
@@ -55,10 +52,12 @@ abstract contract BaseComponent is
|
|
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
|
}
|
@@ -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
|
|
@@ -49,9 +51,10 @@ contract Distribution is
|
|
49
51
|
_isVerifying = verifying;
|
50
52
|
_initialDistributionFee = distributionFee;
|
51
53
|
|
54
|
+
_tokenHandler = TokenHandler(token);
|
55
|
+
|
52
56
|
_distributionService = _instance.getDistributionService();
|
53
|
-
|
54
|
-
// _productService = _instance.getProductService();
|
57
|
+
_productService = _instance.getProductService();
|
55
58
|
|
56
59
|
_registerInterface(type(IDistributionComponent).interfaceId);
|
57
60
|
}
|
@@ -121,16 +124,6 @@ contract Distribution is
|
|
121
124
|
return false;
|
122
125
|
}
|
123
126
|
|
124
|
-
function getInitialSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
125
|
-
return ISetup.DistributionSetupInfo(
|
126
|
-
_productNftId,
|
127
|
-
TokenHandler(address(_token)),
|
128
|
-
_initialDistributionFee,
|
129
|
-
_isVerifying,
|
130
|
-
address(this)
|
131
|
-
);
|
132
|
-
}
|
133
|
-
|
134
127
|
function getSetupInfo() public view returns (ISetup.DistributionSetupInfo memory setupInfo) {
|
135
128
|
InstanceReader reader = _instance.getInstanceReader();
|
136
129
|
return reader.getDistributionSetupInfo(getNftId());
|
@@ -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,6 +20,7 @@ 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);
|
@@ -8,8 +8,6 @@ import {ISetup} from "../instance/module/ISetup.sol";
|
|
8
8
|
|
9
9
|
interface IDistributionComponent {
|
10
10
|
|
11
|
-
function getInitialSetupInfo() external view returns (ISetup.DistributionSetupInfo memory setupInfo);
|
12
|
-
|
13
11
|
function setFees(
|
14
12
|
Fee memory distributionFee
|
15
13
|
) external;
|
@@ -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),
|
@@ -58,7 +63,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
58
63
|
// TODO refactor into tokenNftId
|
59
64
|
address token,
|
60
65
|
bool isInterceptor,
|
61
|
-
bool
|
66
|
+
bool isConfirmingApplication,
|
62
67
|
UFixed collateralizationLevel,
|
63
68
|
Fee memory poolFee,
|
64
69
|
Fee memory stakingFee,
|
@@ -67,16 +72,18 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
67
72
|
)
|
68
73
|
BaseComponent(registry, instanceNftId, token, POOL(), isInterceptor, initialOwner)
|
69
74
|
{
|
70
|
-
|
75
|
+
_isConfirmingApplication = isConfirmingApplication;
|
71
76
|
// TODO add validation
|
72
77
|
_collateralizationLevel = collateralizationLevel;
|
73
78
|
_initialPoolFee = poolFee;
|
74
79
|
_initialStakingFee = stakingFee;
|
75
80
|
_initialPerformanceFee = performanceFee;
|
76
81
|
|
82
|
+
_tokenHandler = new TokenHandler(token);
|
83
|
+
|
77
84
|
_poolService = _instance.getPoolService();
|
78
|
-
|
79
|
-
|
85
|
+
_productService = _instance.getProductService();
|
86
|
+
_bundleService = _instance.getBundleService();
|
80
87
|
|
81
88
|
_registerInterface(type(IPoolComponent).interfaceId);
|
82
89
|
}
|
@@ -92,7 +99,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
92
99
|
returns(NftId bundleNftId)
|
93
100
|
{
|
94
101
|
address owner = msg.sender;
|
95
|
-
bundleNftId =
|
102
|
+
bundleNftId = _bundleService.createBundle(
|
96
103
|
owner,
|
97
104
|
fee,
|
98
105
|
initialAmount,
|
@@ -137,8 +144,8 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
137
144
|
}
|
138
145
|
|
139
146
|
|
140
|
-
function
|
141
|
-
return
|
147
|
+
function isConfirmingApplication() external view override returns (bool isConfirmingApplication) {
|
148
|
+
return _isConfirmingApplication;
|
142
149
|
}
|
143
150
|
|
144
151
|
function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
|
@@ -165,21 +172,29 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
165
172
|
override
|
166
173
|
// TODO add onlyBundleOwner
|
167
174
|
{
|
168
|
-
|
169
|
-
}
|
170
|
-
|
171
|
-
function getInitialSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
172
|
-
return ISetup.PoolSetupInfo(
|
173
|
-
_productNftId,
|
174
|
-
TokenHandler(address(_token)),
|
175
|
-
_collateralizationLevel,
|
176
|
-
_initialPoolFee,
|
177
|
-
_initialStakingFee,
|
178
|
-
_initialPerformanceFee,
|
179
|
-
_isVerifying,
|
180
|
-
_wallet
|
181
|
-
);
|
175
|
+
_bundleService.setBundleFee(bundleNftId, fee);
|
182
176
|
}
|
177
|
+
|
178
|
+
function lockBundle(
|
179
|
+
NftId bundleNftId
|
180
|
+
)
|
181
|
+
external
|
182
|
+
override
|
183
|
+
// TODO add onlyBundleOwner
|
184
|
+
{
|
185
|
+
_bundleService.lockBundle(bundleNftId);
|
186
|
+
}
|
187
|
+
|
188
|
+
function unlockBundle(
|
189
|
+
NftId bundleNftId
|
190
|
+
)
|
191
|
+
external
|
192
|
+
override
|
193
|
+
// TODO add onlyBundleOwner
|
194
|
+
{
|
195
|
+
_bundleService.unlockBundle(bundleNftId);
|
196
|
+
}
|
197
|
+
|
183
198
|
function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
184
199
|
InstanceReader reader = _instance.getInstanceReader();
|
185
200
|
return reader.getPoolSetupInfo(getNftId());
|
@@ -197,13 +212,22 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
197
212
|
{
|
198
213
|
(
|
199
214
|
IRegistry.ObjectInfo memory info,
|
200
|
-
bytes memory data
|
201
215
|
) = super.getInitialInfo();
|
202
216
|
|
203
217
|
return (
|
204
218
|
info,
|
205
219
|
abi.encode(
|
206
|
-
|
220
|
+
ISetup.PoolSetupInfo(
|
221
|
+
_productNftId,
|
222
|
+
_tokenHandler,
|
223
|
+
_collateralizationLevel,
|
224
|
+
_initialPoolFee,
|
225
|
+
_initialStakingFee,
|
226
|
+
_initialPerformanceFee,
|
227
|
+
false,
|
228
|
+
_isConfirmingApplication,
|
229
|
+
_wallet
|
230
|
+
)
|
207
231
|
)
|
208
232
|
);
|
209
233
|
}
|
@@ -236,7 +260,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
236
260
|
internal
|
237
261
|
returns(NftId bundleNftId)
|
238
262
|
{
|
239
|
-
bundleNftId =
|
263
|
+
bundleNftId = _bundleService.createBundle(
|
240
264
|
bundleOwner,
|
241
265
|
fee,
|
242
266
|
amount,
|
@@ -6,6 +6,7 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
6
6
|
import {IRisk} from "../instance/module/IRisk.sol";
|
7
7
|
import {ITreasury} from "../instance/module/ITreasury.sol";
|
8
8
|
import {IProductService} from "../instance/service/IProductService.sol";
|
9
|
+
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
9
10
|
import {IProductComponent} from "./IProductComponent.sol";
|
10
11
|
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
11
12
|
import {ObjectType, PRODUCT} from "../types/ObjectType.sol";
|
@@ -24,6 +25,7 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
24
25
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
25
26
|
import {ISetup} from "../instance/module/ISetup.sol";
|
26
27
|
import {Pool} from "../components/Pool.sol";
|
28
|
+
import {Distribution} from "../components/Distribution.sol";
|
27
29
|
|
28
30
|
import {zeroNftId} from "../types/NftId.sol";
|
29
31
|
|
@@ -31,10 +33,12 @@ contract Product is BaseComponent, IProductComponent {
|
|
31
33
|
using NftIdLib for NftId;
|
32
34
|
|
33
35
|
IProductService internal _productService;
|
36
|
+
IPolicyService internal _policyService;
|
34
37
|
Pool internal _pool;
|
35
|
-
|
38
|
+
Distribution internal _distribution;
|
36
39
|
Fee internal _initialProductFee;
|
37
40
|
Fee internal _initialProcessingFee;
|
41
|
+
TokenHandler internal _tokenHandler;
|
38
42
|
|
39
43
|
NftId internal _poolNftId;
|
40
44
|
NftId internal _distributionNftId;
|
@@ -51,15 +55,17 @@ contract Product is BaseComponent, IProductComponent {
|
|
51
55
|
address initialOwner
|
52
56
|
) BaseComponent(registry, instanceNftid, token, PRODUCT(), isInterceptor, initialOwner) {
|
53
57
|
// TODO add validation
|
54
|
-
|
55
|
-
|
58
|
+
_productService = _instance.getProductService();
|
59
|
+
_policyService = _instance.getPolicyService();
|
56
60
|
_pool = Pool(pool);
|
57
|
-
_distribution = distribution;
|
61
|
+
_distribution = Distribution(distribution);
|
58
62
|
_initialProductFee = productFee;
|
59
63
|
_initialProcessingFee = processingFee;
|
60
64
|
|
65
|
+
_tokenHandler = new TokenHandler(token);
|
66
|
+
|
61
67
|
_poolNftId = getRegistry().getNftId(address(_pool));
|
62
|
-
_distributionNftId = getRegistry().getNftId(_distribution);
|
68
|
+
_distributionNftId = getRegistry().getNftId(address(_distribution));
|
63
69
|
|
64
70
|
_registerInterface(type(IProductComponent).interfaceId);
|
65
71
|
}
|
@@ -78,7 +84,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
78
84
|
override
|
79
85
|
returns (uint256 premiumAmount)
|
80
86
|
{
|
81
|
-
(premiumAmount,,,,) =
|
87
|
+
(premiumAmount,,,,) = _policyService.calculatePremium(
|
82
88
|
riskId,
|
83
89
|
sumInsuredAmount,
|
84
90
|
lifetime,
|
@@ -118,13 +124,13 @@ contract Product is BaseComponent, IProductComponent {
|
|
118
124
|
);
|
119
125
|
}
|
120
126
|
|
121
|
-
function
|
127
|
+
function _updateRisk(
|
122
128
|
RiskId id,
|
123
|
-
|
129
|
+
bytes memory data
|
124
130
|
) internal {
|
125
|
-
_productService.
|
131
|
+
_productService.updateRisk(
|
126
132
|
id,
|
127
|
-
|
133
|
+
data
|
128
134
|
);
|
129
135
|
}
|
130
136
|
|
@@ -151,7 +157,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
151
157
|
NftId bundleNftId,
|
152
158
|
ReferralId referralId
|
153
159
|
) internal returns (NftId nftId) {
|
154
|
-
nftId =
|
160
|
+
nftId = _policyService.createApplication(
|
155
161
|
applicationOwner,
|
156
162
|
riskId,
|
157
163
|
sumInsuredAmount,
|
@@ -169,7 +175,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
169
175
|
)
|
170
176
|
internal
|
171
177
|
{
|
172
|
-
|
178
|
+
_policyService.underwrite(
|
173
179
|
policyNftId,
|
174
180
|
requirePremiumPayment,
|
175
181
|
activateAt);
|
@@ -181,7 +187,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
181
187
|
)
|
182
188
|
internal
|
183
189
|
{
|
184
|
-
|
190
|
+
_policyService.collectPremium(
|
185
191
|
policyNftId,
|
186
192
|
activateAt);
|
187
193
|
}
|
@@ -192,7 +198,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
192
198
|
)
|
193
199
|
internal
|
194
200
|
{
|
195
|
-
|
201
|
+
_policyService.activate(
|
196
202
|
policyNftId,
|
197
203
|
activateAt);
|
198
204
|
}
|
@@ -202,7 +208,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
202
208
|
}
|
203
209
|
|
204
210
|
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
205
|
-
return getRegistry().getNftId(_distribution);
|
211
|
+
return getRegistry().getNftId(address(_distribution));
|
206
212
|
}
|
207
213
|
|
208
214
|
// from product component
|
@@ -218,28 +224,12 @@ contract Product is BaseComponent, IProductComponent {
|
|
218
224
|
}
|
219
225
|
|
220
226
|
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
221
|
-
if (getNftId().eq(zeroNftId())) {
|
222
|
-
return ISetup.ProductSetupInfo(
|
223
|
-
_token,
|
224
|
-
TokenHandler(address(0)),
|
225
|
-
_distributionNftId,
|
226
|
-
_poolNftId,
|
227
|
-
FeeLib.zeroFee(), //_instance.getDistributionFee(_distributionNftId)
|
228
|
-
_initialProductFee,
|
229
|
-
_initialProcessingFee,
|
230
|
-
FeeLib.zeroFee(), //_instance.getPoolFee(_poolNftId)
|
231
|
-
FeeLib.zeroFee(), //_instance.getStakingFee(_poolNftId)
|
232
|
-
FeeLib.zeroFee() //_instance.getPerformanceFee(_poolNftId)
|
233
|
-
);
|
234
|
-
}
|
235
|
-
|
236
227
|
InstanceReader reader = _instance.getInstanceReader();
|
237
228
|
return reader.getProductSetupInfo(getNftId());
|
238
229
|
}
|
239
230
|
|
240
231
|
// from IRegisterable
|
241
232
|
|
242
|
-
// TODO used only once, occupies space
|
243
233
|
function getInitialInfo()
|
244
234
|
public
|
245
235
|
view
|
@@ -251,7 +241,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
251
241
|
IRegistry.ObjectInfo memory productInfo,
|
252
242
|
bytes memory data
|
253
243
|
) = super.getInitialInfo();
|
254
|
-
|
244
|
+
|
255
245
|
// TODO read pool & distribution fees
|
256
246
|
// 1) from pool -> the only option -> pool must be registered first?
|
257
247
|
// 2) from instance -> all fees are set into instance at product registration which is ongoing here
|
@@ -261,35 +251,40 @@ contract Product is BaseComponent, IProductComponent {
|
|
261
251
|
|
262
252
|
// from PoolComponent
|
263
253
|
(
|
264
|
-
|
254
|
+
,
|
265
255
|
bytes memory poolData
|
266
256
|
) = _pool.getInitialInfo();
|
257
|
+
|
258
|
+
(
|
259
|
+
ISetup.PoolSetupInfo memory poolSetupInfo
|
260
|
+
) = abi.decode(poolData, (ISetup.PoolSetupInfo));
|
267
261
|
|
262
|
+
// from DistributionComponent
|
268
263
|
(
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
Fee memory initialPoolFee,
|
273
|
-
Fee memory initialStakingFee,
|
274
|
-
Fee memory initialPerformanceFee
|
275
|
-
) = abi.decode(poolData, (ISetup.PoolSetupInfo, address, IERC20Metadata, Fee, Fee, Fee));
|
264
|
+
,
|
265
|
+
bytes memory distributionData
|
266
|
+
) = _distribution.getInitialInfo();
|
276
267
|
|
277
|
-
|
268
|
+
(
|
269
|
+
ISetup.DistributionSetupInfo memory distributionSetupInfo
|
270
|
+
) = abi.decode(distributionData, (ISetup.DistributionSetupInfo));
|
278
271
|
|
279
272
|
return (
|
280
273
|
productInfo,
|
281
274
|
abi.encode(
|
282
275
|
ISetup.ProductSetupInfo(
|
283
276
|
_token,
|
284
|
-
|
277
|
+
_tokenHandler,
|
285
278
|
_distributionNftId,
|
286
279
|
_poolNftId,
|
287
|
-
|
280
|
+
distributionSetupInfo.distributionFee,
|
288
281
|
_initialProductFee,
|
289
282
|
_initialProcessingFee,
|
290
|
-
|
291
|
-
|
292
|
-
|
283
|
+
poolSetupInfo.poolFee,
|
284
|
+
poolSetupInfo.stakingFee,
|
285
|
+
poolSetupInfo.performanceFee,
|
286
|
+
false,
|
287
|
+
_wallet
|
293
288
|
)
|
294
289
|
)
|
295
290
|
);
|
@@ -0,0 +1,23 @@
|
|
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
|
+
bool private _initialized;
|
10
|
+
|
11
|
+
function __AccessManagerUpgradeableInitializeable_init(address initialAdmin) public {
|
12
|
+
require(!_initialized, "AccessManager: already initialized");
|
13
|
+
|
14
|
+
if (initialAdmin == address(0)) {
|
15
|
+
revert AccessManagerInvalidInitialAdmin(address(0));
|
16
|
+
}
|
17
|
+
|
18
|
+
// admin is active immediately and without any execution delay.
|
19
|
+
_grantRole(ADMIN_ROLE, initialAdmin, 0, 0);
|
20
|
+
_initialized = true;
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|