@etherisc/gif-next 0.0.2-f2df3e2-873 → 0.0.2-f398177-971
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +37 -6
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +44 -13
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +37 -6
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +44 -13
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +55 -24
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +52 -21
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +55 -24
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +52 -21
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +252 -2210
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +21 -38
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +346 -2685
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +67 -49
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +219 -53
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +59 -220
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +32 -117
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +37 -13
- 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/IComponents.sol/IComponents.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/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +75 -217
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +33 -66
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +155 -133
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +35 -64
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +463 -119
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +109 -42
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +181 -399
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +81 -94
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +11 -145
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +79 -30
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +229 -88
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +23 -273
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +40 -326
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +265 -32
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +510 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +5 -13
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +213 -443
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +74 -75
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +439 -54
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +84 -37
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +1004 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +688 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +55 -31
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +22 -35
- 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/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +5 -13
- 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 +2 -2
- 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 -25
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +21 -34
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +10 -23
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
- 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/INftOwnable.sol/INftOwnable.json +0 -13
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +5 -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 +6 -19
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -27
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +6 -19
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +5 -13
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
- 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/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 +6 -19
- 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 +17 -25
- 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/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +100 -4
- 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/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +2 -2
- 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 +42 -18
- 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 +2 -2
- 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 +2 -2
- 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/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/Component.sol +21 -2
- package/contracts/components/Distribution.sol +5 -4
- package/contracts/components/IComponent.sol +16 -2
- package/contracts/components/IPoolComponent.sol +7 -6
- package/contracts/components/IProductComponent.sol +5 -4
- package/contracts/components/Pool.sol +8 -8
- package/contracts/components/Product.sol +21 -17
- package/contracts/instance/IInstance.sol +28 -53
- package/contracts/instance/IInstanceService.sol +15 -10
- package/contracts/instance/Instance.sol +90 -171
- package/contracts/instance/InstanceAccessManager.sol +35 -21
- package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
- package/contracts/instance/InstanceReader.sol +56 -5
- package/contracts/instance/InstanceService.sol +96 -266
- package/contracts/instance/InstanceStore.sol +212 -0
- package/contracts/instance/ObjectManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +47 -20
- package/contracts/instance/base/KeyValueStore.sol +0 -31
- package/contracts/instance/base/Lifecycle.sol +7 -4
- package/contracts/instance/module/IComponents.sol +3 -3
- package/contracts/instance/module/IDistribution.sol +3 -2
- package/contracts/instance/module/IPolicy.sol +5 -5
- package/contracts/instance/service/ApplicationService.sol +58 -227
- package/contracts/instance/service/BundleService.sol +65 -119
- package/contracts/instance/service/ClaimService.sol +232 -34
- package/contracts/instance/service/DistributionService.sol +51 -134
- package/contracts/instance/service/IApplicationService.sol +5 -21
- package/contracts/instance/service/IBundleService.sol +32 -10
- package/contracts/instance/service/IClaimService.sol +37 -39
- package/contracts/instance/service/IDistributionService.sol +10 -22
- package/contracts/instance/service/IPolicyService.sol +15 -72
- package/contracts/instance/service/IPoolService.sol +18 -3
- package/contracts/instance/service/IPricingService.sol +37 -0
- package/contracts/instance/service/PolicyService.sol +112 -277
- package/contracts/instance/service/PoolService.sol +121 -21
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +10 -10
- package/contracts/registry/IRegistryService.sol +0 -2
- package/contracts/registry/RegistryService.sol +14 -10
- package/contracts/shared/IPolicyHolder.sol +23 -9
- package/contracts/shared/IRegistryLinked.sol +0 -1
- package/contracts/shared/IService.sol +2 -0
- package/contracts/shared/NftOwnable.sol +0 -2
- package/contracts/shared/PolicyHolder.sol +30 -17
- package/contracts/shared/Registerable.sol +10 -9
- package/contracts/shared/RegistryLinked.sol +0 -5
- package/contracts/shared/TokenHandler.sol +4 -2
- package/contracts/types/Amount.sol +44 -0
- package/contracts/types/Fee.sol +7 -6
- package/contracts/types/ObjectType.sol +5 -1
- package/package.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
@@ -19,7 +19,7 @@ import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
|
|
19
19
|
import {Registerable} from "../../contracts/shared/Registerable.sol";
|
20
20
|
|
21
21
|
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/types/RoleId.sol";
|
22
|
-
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE} from "../../contracts/types/ObjectType.sol";
|
22
|
+
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE, PRICE} from "../../contracts/types/ObjectType.sol";
|
23
23
|
import {StateId, ACTIVE, PAUSED} from "../../contracts/types/StateId.sol";
|
24
24
|
import {NftId, NftIdLib, zeroNftId} from "../../contracts/types/NftId.sol";
|
25
25
|
import {Fee, FeeLib} from "../../contracts/types/Fee.sol";
|
@@ -176,7 +176,7 @@ contract RegistryService is
|
|
176
176
|
FunctionConfig[] memory config
|
177
177
|
)
|
178
178
|
{
|
179
|
-
config = new FunctionConfig[](
|
179
|
+
config = new FunctionConfig[](9);
|
180
180
|
|
181
181
|
// order of service registrations MUST be reverse to this array
|
182
182
|
/*config[-1].serviceDomain = STAKE();
|
@@ -205,15 +205,19 @@ contract RegistryService is
|
|
205
205
|
config[5].selectors = new bytes4[](1);
|
206
206
|
config[5].selectors[0] = RegistryService.registerBundle.selector;
|
207
207
|
|
208
|
-
|
209
|
-
config[6].
|
210
|
-
config[6].selectors
|
211
|
-
config[6].selectors[1] = RegistryService.registerDistributor.selector;
|
208
|
+
// registration of pricing service must preceed registration of application service
|
209
|
+
config[6].serviceDomain = PRICE();
|
210
|
+
config[6].selectors = new bytes4[](0);
|
212
211
|
|
213
|
-
//
|
214
|
-
config[7].serviceDomain =
|
215
|
-
config[7].selectors = new bytes4[](
|
216
|
-
config[7].selectors[0] = RegistryService.
|
212
|
+
// registration of distribution service must preceed registration of pricing service
|
213
|
+
config[7].serviceDomain = DISTRIBUTION();
|
214
|
+
config[7].selectors = new bytes4[](2);
|
215
|
+
config[7].selectors[0] = RegistryService.registerDistribution.selector;
|
216
|
+
config[7].selectors[1] = RegistryService.registerDistributor.selector;
|
217
|
+
|
218
|
+
config[8].serviceDomain = INSTANCE();
|
219
|
+
config[8].selectors = new bytes4[](1);
|
220
|
+
config[8].selectors[0] = RegistryService.registerInstance.selector;
|
217
221
|
}
|
218
222
|
|
219
223
|
// Internal
|
@@ -4,23 +4,37 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
|
6
6
|
|
7
|
-
import {
|
7
|
+
import {Amount} from "../types/Amount.sol";
|
8
|
+
import {ClaimId} from "../types/ClaimId.sol";
|
9
|
+
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
8
10
|
import {NftId} from "../types/NftId.sol";
|
9
|
-
import {
|
11
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
10
12
|
|
11
13
|
/// @dev generic interface for contracts that need to hold policies and receive payouts
|
12
14
|
/// GIF will notify policy holder contracts for policy creation and payout execution
|
13
|
-
|
15
|
+
interface IPolicyHolder is
|
16
|
+
IERC165,
|
17
|
+
IERC721Receiver,
|
18
|
+
IRegistryLinked
|
19
|
+
{
|
14
20
|
|
15
|
-
|
21
|
+
/// @dev callback function that will be called after successful policy activation
|
22
|
+
/// active policies may open claims under the activated policy
|
23
|
+
function policyActivated(NftId policyNftId) external;
|
16
24
|
|
17
|
-
/// @dev callback function
|
18
|
-
|
25
|
+
/// @dev callback function to indicate the specified policy has expired
|
26
|
+
/// expired policies may no longer open claims
|
27
|
+
/// it is optional for products to notifiy policy holder of expired claims
|
28
|
+
function policyExpired(NftId policyNftId) external;
|
29
|
+
|
30
|
+
/// @dev callback function to notify the confirmation of the specified claim
|
31
|
+
/// active policies may open claims under the activated policy
|
32
|
+
function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external;
|
19
33
|
|
20
34
|
/// @dev callback function that will be called after a successful payout
|
21
|
-
function
|
35
|
+
function payoutExecuted(NftId policyNftId, PayoutId payoutId, address beneficiary, Amount amount) external;
|
22
36
|
|
23
|
-
/// @dev determines
|
37
|
+
/// @dev determines policy and claim specific beneficiary address
|
24
38
|
/// returned address will override GIF default where the policy nft holder is treated as beneficiary
|
25
|
-
function getBeneficiary(NftId
|
39
|
+
function getBeneficiary(NftId policyNftId, ClaimId claimId) external view returns (address beneficiary);
|
26
40
|
}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
// import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
5
|
-
|
6
4
|
import {ERC165} from "./ERC165.sol";
|
7
5
|
import {INftOwnable} from "./INftOwnable.sol";
|
8
6
|
import {NftId} from "../types/NftId.sol";
|
@@ -5,11 +5,12 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
5
5
|
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
|
6
6
|
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
7
7
|
|
8
|
+
import {Amount} from "../types/Amount.sol";
|
9
|
+
import {ClaimId, ClaimIdLib} from "../types/ClaimId.sol";
|
8
10
|
import {ERC165} from "./ERC165.sol";
|
9
11
|
import {IPolicyHolder} from "./IPolicyHolder.sol";
|
10
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
11
12
|
import {NftId} from "../types/NftId.sol";
|
12
|
-
import {
|
13
|
+
import {PayoutId} from "../types/PayoutId.sol";
|
13
14
|
import {RegistryLinked} from "./RegistryLinked.sol";
|
14
15
|
|
15
16
|
/// @dev template implementation for IPolicyHolder
|
@@ -22,33 +23,43 @@ contract PolicyHolder is
|
|
22
23
|
// TODO fix address
|
23
24
|
bytes32 public constant POLICY_HOLDER_STORAGE_LOCATION_V1 = 0x07ebcf49758b6ed3af50fa146bec0abe157c0218fe65dc0874c286e9d5da4f00;
|
24
25
|
|
25
|
-
// TODO uncomment/fix/refactor
|
26
26
|
struct PolicyHolderStorage {
|
27
|
-
|
28
|
-
// mapping(NftId policyId => address beneficiary) private _beneficiary;
|
29
|
-
bool dummy;
|
27
|
+
mapping(NftId policyId => mapping(ClaimId claimId => address beneficiary)) _beneficiary;
|
30
28
|
}
|
31
29
|
|
32
30
|
function initializePolicyHolder(
|
33
|
-
address registryAddress
|
31
|
+
address registryAddress,
|
32
|
+
address beneficiaryDefault
|
34
33
|
)
|
35
34
|
public
|
36
35
|
virtual
|
37
36
|
onlyInitializing()
|
38
37
|
{
|
39
38
|
initializeRegistryLinked(registryAddress);
|
39
|
+
registerInterface(type(IPolicyHolder).interfaceId);
|
40
40
|
}
|
41
41
|
|
42
42
|
/// @dev empty default implementation
|
43
|
-
function
|
43
|
+
function policyActivated(NftId policyNftId) external {}
|
44
44
|
|
45
45
|
/// @dev empty default implementation
|
46
|
-
function
|
46
|
+
function policyExpired(NftId policyNftId) external {}
|
47
47
|
|
48
|
-
/// @dev
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
/// @dev empty default implementation
|
49
|
+
function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external {}
|
50
|
+
|
51
|
+
/// @dev empty default implementation
|
52
|
+
function payoutExecuted(NftId policyNftId, PayoutId payoutId, address beneficiary, Amount amount) external {}
|
53
|
+
|
54
|
+
/// @dev returns claim specific beneficiary
|
55
|
+
/// when no such beneficiary is defined the policy specific beneficiary is returned
|
56
|
+
function getBeneficiary(NftId policyNftId, ClaimId claimId) external virtual view returns (address beneficiary) {
|
57
|
+
beneficiary = _getPolicyHolderStorage()._beneficiary[policyNftId][claimId];
|
58
|
+
|
59
|
+
// fallback to claim independent beneficiary
|
60
|
+
if(beneficiary == address(0) && claimId.gtz()) {
|
61
|
+
beneficiary = _getPolicyHolderStorage()._beneficiary[policyNftId][ClaimIdLib.zero()];
|
62
|
+
}
|
52
63
|
}
|
53
64
|
|
54
65
|
//--- IERC165 functions ---------------//
|
@@ -65,12 +76,14 @@ contract PolicyHolder is
|
|
65
76
|
return IERC721Receiver.onERC721Received.selector;
|
66
77
|
}
|
67
78
|
|
68
|
-
|
69
|
-
|
79
|
+
/// @dev sets policy specific beneficiary (used when no claim specific beneficiary is defined)
|
80
|
+
function _setBeneficiary(NftId policyNftId, address beneficiary) internal {
|
81
|
+
_setBeneficiary(policyNftId, ClaimIdLib.zero(), beneficiary);
|
70
82
|
}
|
71
83
|
|
72
|
-
|
73
|
-
|
84
|
+
/// @dev sets policy and claim specific beneficiary
|
85
|
+
function _setBeneficiary(NftId policyNftId, ClaimId claimId, address beneficiary) internal {
|
86
|
+
_getPolicyHolderStorage()._beneficiary[policyNftId][claimId] = beneficiary;
|
74
87
|
}
|
75
88
|
|
76
89
|
function _getPolicyHolderStorage() private pure returns (PolicyHolderStorage storage $) {
|
@@ -9,7 +9,6 @@ import {ObjectType} from "../types/ObjectType.sol";
|
|
9
9
|
|
10
10
|
import {IRegistry} from "../registry/IRegistry.sol";
|
11
11
|
import {IRegisterable} from "./IRegisterable.sol";
|
12
|
-
import {Versionable} from "./Versionable.sol";
|
13
12
|
|
14
13
|
contract Registerable is
|
15
14
|
NftOwnable,
|
@@ -25,12 +24,6 @@ contract Registerable is
|
|
25
24
|
bytes _data;
|
26
25
|
}
|
27
26
|
|
28
|
-
function _getRegisterableStorage() private pure returns (RegisterableStorage storage $) {
|
29
|
-
assembly {
|
30
|
-
$.slot := REGISTERABLE_LOCATION_V1
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
27
|
function initializeRegisterable(
|
35
28
|
address registryAddress,
|
36
29
|
NftId parentNftId,
|
@@ -47,7 +40,11 @@ contract Registerable is
|
|
47
40
|
initialOwner,
|
48
41
|
registryAddress);
|
49
42
|
|
50
|
-
RegisterableStorage storage
|
43
|
+
RegisterableStorage storage $;
|
44
|
+
assembly {
|
45
|
+
$.slot := REGISTERABLE_LOCATION_V1
|
46
|
+
}
|
47
|
+
|
51
48
|
$._parentNftId = parentNftId;
|
52
49
|
$._objectType = objectType;
|
53
50
|
$._isInterceptor = isInterceptor;
|
@@ -61,7 +58,11 @@ contract Registerable is
|
|
61
58
|
virtual
|
62
59
|
returns (IRegistry.ObjectInfo memory info)
|
63
60
|
{
|
64
|
-
RegisterableStorage
|
61
|
+
RegisterableStorage storage $;
|
62
|
+
assembly {
|
63
|
+
$.slot := REGISTERABLE_LOCATION_V1
|
64
|
+
}
|
65
|
+
|
65
66
|
info = IRegistry.ObjectInfo(
|
66
67
|
zeroNftId(),
|
67
68
|
$._parentNftId,
|
@@ -4,6 +4,8 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../types/Amount.sol";
|
8
|
+
|
7
9
|
/// @dev token specific transfer helper
|
8
10
|
/// relies internally on oz SafeERC20.safeTransferFrom
|
9
11
|
contract TokenHandler {
|
@@ -16,11 +18,11 @@ contract TokenHandler {
|
|
16
18
|
function transfer(
|
17
19
|
address from,
|
18
20
|
address to,
|
19
|
-
|
21
|
+
Amount amount
|
20
22
|
)
|
21
23
|
external
|
22
24
|
{
|
23
|
-
SafeERC20.safeTransferFrom(_token, from, to, amount);
|
25
|
+
SafeERC20.safeTransferFrom(_token, from, to, amount.toInt());
|
24
26
|
}
|
25
27
|
|
26
28
|
function getToken()
|
@@ -6,6 +6,12 @@ import {UFixed, UFixedLib} from "./UFixed.sol";
|
|
6
6
|
type Amount is uint96;
|
7
7
|
|
8
8
|
using {
|
9
|
+
addAmount as +,
|
10
|
+
subAmount as -,
|
11
|
+
eqAmount as ==,
|
12
|
+
ltAmount as <,
|
13
|
+
gtAmount as >,
|
14
|
+
AmountLib.eq,
|
9
15
|
AmountLib.eqz,
|
10
16
|
AmountLib.gtz,
|
11
17
|
AmountLib.toInt,
|
@@ -13,6 +19,25 @@ using {
|
|
13
19
|
AmountLib.toUFixed
|
14
20
|
} for Amount global;
|
15
21
|
|
22
|
+
function addAmount(Amount a, Amount b) pure returns (Amount) {
|
23
|
+
return AmountLib.add(a, b);
|
24
|
+
}
|
25
|
+
|
26
|
+
function subAmount(Amount a, Amount b) pure returns (Amount) {
|
27
|
+
return AmountLib.sub(a, b);
|
28
|
+
}
|
29
|
+
|
30
|
+
function eqAmount(Amount a, Amount b) pure returns (bool) {
|
31
|
+
return AmountLib.eq(a, b);
|
32
|
+
}
|
33
|
+
|
34
|
+
function ltAmount(Amount a, Amount b) pure returns (bool) {
|
35
|
+
return AmountLib.lt(a, b);
|
36
|
+
}
|
37
|
+
|
38
|
+
function gtAmount(Amount a, Amount b) pure returns (bool) {
|
39
|
+
return AmountLib.gt(a, b);
|
40
|
+
}
|
16
41
|
|
17
42
|
library AmountLib {
|
18
43
|
|
@@ -41,6 +66,21 @@ library AmountLib {
|
|
41
66
|
return Amount.unwrap(amount) == 0;
|
42
67
|
}
|
43
68
|
|
69
|
+
/// @dev return true if amount1 equals amount2
|
70
|
+
function eq(Amount amount1, Amount amount2) public pure returns (bool) {
|
71
|
+
return Amount.unwrap(amount1) == Amount.unwrap(amount2);
|
72
|
+
}
|
73
|
+
|
74
|
+
/// @dev return true if amount a1 is smaller than a2
|
75
|
+
function lt(Amount a1, Amount a2) public pure returns (bool) {
|
76
|
+
return Amount.unwrap(a1) < Amount.unwrap(a2);
|
77
|
+
}
|
78
|
+
|
79
|
+
/// @dev return true if amount a1 is larger than a2
|
80
|
+
function gt(Amount a1, Amount a2) public pure returns (bool) {
|
81
|
+
return Amount.unwrap(a1) > Amount.unwrap(a2);
|
82
|
+
}
|
83
|
+
|
44
84
|
/// @dev return true if amount is larger than 0
|
45
85
|
function gtz(Amount amount) public pure returns (bool) {
|
46
86
|
return Amount.unwrap(amount) > 0;
|
@@ -50,6 +90,10 @@ library AmountLib {
|
|
50
90
|
return Amount.wrap(Amount.unwrap(a1) + Amount.unwrap(a2));
|
51
91
|
}
|
52
92
|
|
93
|
+
function sub(Amount a1, Amount a2) public pure returns (Amount) {
|
94
|
+
return Amount.wrap(Amount.unwrap(a1) - Amount.unwrap(a2));
|
95
|
+
}
|
96
|
+
|
53
97
|
function toInt(Amount amount) public pure returns (uint256) {
|
54
98
|
return uint256(uint96(Amount.unwrap(amount)));
|
55
99
|
}
|
package/contracts/types/Fee.sol
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
+
import {Amount, AmountLib} from "./Amount.sol";
|
4
5
|
import {UFixed, UFixedLib} from "./UFixed.sol";
|
5
6
|
|
6
7
|
struct Fee {
|
@@ -12,21 +13,21 @@ library FeeLib {
|
|
12
13
|
|
13
14
|
function calculateFee(
|
14
15
|
Fee memory fee,
|
15
|
-
|
16
|
+
Amount amount
|
16
17
|
)
|
17
18
|
public
|
18
19
|
pure
|
19
20
|
returns (
|
20
|
-
|
21
|
-
|
21
|
+
Amount feeAmount,
|
22
|
+
Amount netAmount
|
22
23
|
)
|
23
24
|
{
|
24
25
|
netAmount = amount;
|
25
26
|
if(gtz(fee)) {
|
26
27
|
UFixed fractionalAmount =
|
27
|
-
|
28
|
-
feeAmount = fractionalAmount.toInt() + fee.fixedFee;
|
29
|
-
netAmount
|
28
|
+
amount.toUFixed() * fee.fractionalFee;
|
29
|
+
feeAmount = AmountLib.toAmount(fractionalAmount.toInt() + fee.fixedFee);
|
30
|
+
netAmount = netAmount - feeAmount;
|
30
31
|
}
|
31
32
|
}
|
32
33
|
|
@@ -110,6 +110,10 @@ function PAYOUT() pure returns (ObjectType) {
|
|
110
110
|
return toObjectType(213);
|
111
111
|
}
|
112
112
|
|
113
|
+
function PRICE() pure returns (ObjectType) {
|
114
|
+
return toObjectType(230);
|
115
|
+
}
|
116
|
+
|
113
117
|
/// @dev Converts the uint8 to a ObjectType.
|
114
118
|
function toObjectType(uint256 objectType) pure returns (ObjectType) {
|
115
119
|
return ObjectType.wrap(uint8(objectType));
|
@@ -154,4 +158,4 @@ library ObjectTypeLib {
|
|
154
158
|
function eq(ObjectType a, ObjectType b) public pure returns (bool isSame) {
|
155
159
|
return eqObjectType(a, b);
|
156
160
|
}
|
157
|
-
}
|
161
|
+
}
|
package/package.json
CHANGED
File without changes
|