@etherisc/gif-next 0.0.2-f29e479-370 → 0.0.2-f30e0eb-805
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 +68 -89
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +113 -140
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +65 -73
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +91 -122
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +256 -189
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +69 -145
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +279 -245
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +73 -162
- 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 +171 -308
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +98 -40
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +260 -379
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +448 -121
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +120 -227
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +148 -161
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +31 -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 +1 -1
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +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 +54 -71
- 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 +161 -62
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +33 -25
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +137 -140
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +12 -12
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +3 -3
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +505 -91
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +78 -42
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +110 -27
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +93 -96
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +350 -8
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +21 -64
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +58 -157
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +19 -47
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +114 -17
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +17 -9
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +7 -7
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +4 -4
- 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/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 +5 -5
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +3 -3
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +7 -7
- 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/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 +3 -3
- 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 +1 -1
- 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 +3 -3
- 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 +3 -3
- 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/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +17 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
- 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 +4 -0
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
- 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 +25 -7
- 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 +95 -85
- package/contracts/components/Distribution.sol +12 -19
- package/contracts/components/IComponent.sol +37 -17
- package/contracts/components/IDistributionComponent.sol +1 -22
- package/contracts/components/IPoolComponent.sol +73 -47
- package/contracts/components/IProductComponent.sol +3 -2
- package/contracts/components/Pool.sol +171 -126
- package/contracts/components/Product.sol +26 -18
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +7 -5
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +16 -10
- package/contracts/instance/IInstanceService.sol +18 -5
- package/contracts/instance/Instance.sol +45 -9
- package/contracts/instance/InstanceAccessManager.sol +382 -157
- package/contracts/instance/InstanceReader.sol +7 -10
- package/contracts/instance/InstanceService.sol +174 -155
- package/contracts/instance/ObjectManager.sol +6 -8
- package/contracts/instance/base/ComponentService.sol +5 -5
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +20 -13
- package/contracts/instance/module/IBundle.sol +2 -1
- package/contracts/instance/module/IComponents.sol +35 -0
- package/contracts/instance/module/IDistribution.sol +2 -1
- package/contracts/instance/module/IPolicy.sol +26 -1
- package/contracts/instance/module/ISetup.sol +7 -22
- package/contracts/instance/service/ApplicationService.sol +123 -41
- package/contracts/instance/service/BundleService.sol +76 -38
- package/contracts/instance/service/DistributionService.sol +139 -47
- package/contracts/instance/service/IApplicationService.sol +7 -7
- package/contracts/instance/service/IBundleService.sol +19 -11
- package/contracts/instance/service/IDistributionService.sol +19 -4
- package/contracts/instance/service/IPolicyService.sol +3 -20
- package/contracts/instance/service/IPoolService.sol +17 -2
- package/contracts/instance/service/PolicyService.sol +59 -132
- package/contracts/instance/service/PoolService.sol +128 -17
- package/contracts/instance/service/ProductService.sol +10 -2
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +23 -20
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/shared/Registerable.sol +2 -2
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/Fee.sol +1 -0
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +1 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +13 -6
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +1 -0
- package/contracts/types/Timestamp.sol +13 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +1 -1
@@ -149,7 +149,6 @@ contract Registry is
|
|
149
149
|
}
|
150
150
|
|
151
151
|
if(
|
152
|
-
|
153
152
|
parentType == PROTOCOL() ||
|
154
153
|
parentType == REGISTRY() ||
|
155
154
|
parentType == SERVICE()
|
@@ -186,7 +185,7 @@ contract Registry is
|
|
186
185
|
return _releaseManager.getReleaseInfo(version);
|
187
186
|
}
|
188
187
|
|
189
|
-
function getObjectCount() external view
|
188
|
+
function getObjectCount() external view returns (uint256) {
|
190
189
|
return _chainNft.totalSupply();
|
191
190
|
}
|
192
191
|
|
@@ -198,11 +197,11 @@ contract Registry is
|
|
198
197
|
return _registryNftId;
|
199
198
|
}
|
200
199
|
|
201
|
-
function getNftId(address object) external view
|
200
|
+
function getNftId(address object) external view returns (NftId id) {
|
202
201
|
return _nftIdByAddress[object];
|
203
202
|
}
|
204
203
|
|
205
|
-
function ownerOf(NftId nftId) public view
|
204
|
+
function ownerOf(NftId nftId) public view returns (address) {
|
206
205
|
return _chainNft.ownerOf(nftId.toInt());
|
207
206
|
}
|
208
207
|
|
@@ -210,26 +209,31 @@ contract Registry is
|
|
210
209
|
return _chainNft.ownerOf(_nftIdByAddress[contractAddress].toInt());
|
211
210
|
}
|
212
211
|
|
213
|
-
function getObjectInfo(NftId nftId) external view
|
212
|
+
function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory) {
|
214
213
|
return _info[nftId];
|
215
214
|
}
|
216
215
|
|
217
|
-
function getObjectInfo(address object) external view
|
216
|
+
function getObjectInfo(address object) external view returns (ObjectInfo memory) {
|
218
217
|
return _info[_nftIdByAddress[object]];
|
219
218
|
}
|
220
219
|
|
221
|
-
function isRegistered(NftId nftId) public view
|
220
|
+
function isRegistered(NftId nftId) public view returns (bool) {
|
222
221
|
return _info[nftId].objectType.gtz();
|
223
222
|
}
|
224
223
|
|
225
|
-
function isRegistered(address object) external view
|
224
|
+
function isRegistered(address object) external view returns (bool) {
|
226
225
|
return _nftIdByAddress[object].gtz();
|
227
226
|
}
|
228
227
|
|
229
|
-
function isRegisteredService(address object) external view
|
228
|
+
function isRegisteredService(address object) external view returns (bool) {
|
230
229
|
return _info[_nftIdByAddress[object]].objectType == SERVICE();
|
231
230
|
}
|
232
231
|
|
232
|
+
function isRegisteredComponent(address object) external view returns (bool) {
|
233
|
+
NftId objectParentNftId = _info[_nftIdByAddress[object]].parentNftId;
|
234
|
+
return _info[objectParentNftId].objectType == INSTANCE();
|
235
|
+
}
|
236
|
+
|
233
237
|
function isValidRelease(VersionPart version) external view returns (bool)
|
234
238
|
{
|
235
239
|
return _releaseManager.isValidRelease(version);
|
@@ -287,18 +291,9 @@ contract Registry is
|
|
287
291
|
}
|
288
292
|
|
289
293
|
address interceptor = _getInterceptor(info.isInterceptor, info.objectAddress, parentInfo.isInterceptor, parentAddress);
|
294
|
+
uint256 tokenId = _chainNft.getNextTokenId();
|
295
|
+
nftId = toNftId(tokenId);
|
290
296
|
|
291
|
-
// TODO does external call
|
292
|
-
// compute next nftId, do all checks and stores, mint() at most end...
|
293
|
-
uint256 mintedTokenId = _chainNft.mint(
|
294
|
-
info.initialOwner,
|
295
|
-
interceptor,
|
296
|
-
EMPTY_URI);
|
297
|
-
nftId = toNftId(mintedTokenId);
|
298
|
-
|
299
|
-
// TODO move nftId out of info struct
|
300
|
-
// getters by nftId -> return struct without nftId
|
301
|
-
// getters by address -> return nftId AND struct
|
302
297
|
info.nftId = nftId;
|
303
298
|
_info[nftId] = info;
|
304
299
|
|
@@ -314,6 +309,14 @@ contract Registry is
|
|
314
309
|
}
|
315
310
|
|
316
311
|
emit LogRegistration(nftId, parentNftId, objectType, info.isInterceptor, info.objectAddress, info.initialOwner);
|
312
|
+
|
313
|
+
// calls nft receiver(1) and interceptor(2)
|
314
|
+
uint256 mintedTokenId = _chainNft.mint(
|
315
|
+
info.initialOwner,
|
316
|
+
interceptor,
|
317
|
+
EMPTY_URI);
|
318
|
+
assert(mintedTokenId == tokenId);
|
319
|
+
|
317
320
|
}
|
318
321
|
|
319
322
|
/// @dev obtain interceptor address for this nft if applicable, address(0) otherwise
|
@@ -184,12 +184,12 @@ contract RegistryService is
|
|
184
184
|
/*config[-1].serviceDomain = STAKE();
|
185
185
|
config[-1].selector = RegistryService.registerStake.selector;*/
|
186
186
|
|
187
|
-
config[0].serviceDomain =
|
188
|
-
config[0].selectors = new bytes4[](
|
189
|
-
config[0].selectors[0] = RegistryService.registerPolicy.selector;
|
187
|
+
config[0].serviceDomain = POLICY();
|
188
|
+
config[0].selectors = new bytes4[](0);
|
190
189
|
|
191
|
-
config[1].serviceDomain =
|
192
|
-
config[1].selectors = new bytes4[](
|
190
|
+
config[1].serviceDomain = APPLICATION();
|
191
|
+
config[1].selectors = new bytes4[](1);
|
192
|
+
config[1].selectors[0] = RegistryService.registerPolicy.selector;
|
193
193
|
|
194
194
|
config[2].serviceDomain = CLAIM();
|
195
195
|
config[2].selectors = new bytes4[](0);
|
@@ -37,7 +37,7 @@ contract Registerable is
|
|
37
37
|
ObjectType objectType,
|
38
38
|
bool isInterceptor,
|
39
39
|
address initialOwner,
|
40
|
-
bytes memory data
|
40
|
+
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
41
41
|
)
|
42
42
|
public
|
43
43
|
virtual
|
@@ -51,7 +51,7 @@ contract Registerable is
|
|
51
51
|
$._parentNftId = parentNftId;
|
52
52
|
$._objectType = objectType;
|
53
53
|
$._isInterceptor = isInterceptor;
|
54
|
-
$._data =
|
54
|
+
$._data = registryData;
|
55
55
|
}
|
56
56
|
|
57
57
|
|
@@ -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
|
+
/// @dev token specific transfer helper
|
8
|
+
/// relies internally on oz SafeERC20.safeTransferFrom
|
7
9
|
contract TokenHandler {
|
8
10
|
IERC20Metadata private _token;
|
9
11
|
|
@@ -11,17 +13,21 @@ contract TokenHandler {
|
|
11
13
|
_token = IERC20Metadata(token);
|
12
14
|
}
|
13
15
|
|
14
|
-
// TODO add logging
|
15
16
|
function transfer(
|
16
17
|
address from,
|
17
18
|
address to,
|
18
|
-
uint256 amount
|
19
|
-
)
|
19
|
+
uint256 amount
|
20
|
+
)
|
21
|
+
external
|
22
|
+
{
|
20
23
|
SafeERC20.safeTransferFrom(_token, from, to, amount);
|
21
|
-
// _token.transferFrom(from, to, amount);
|
22
24
|
}
|
23
25
|
|
24
|
-
function getToken()
|
26
|
+
function getToken()
|
27
|
+
external
|
28
|
+
view
|
29
|
+
returns (IERC20Metadata)
|
30
|
+
{
|
25
31
|
return _token;
|
26
32
|
}
|
27
33
|
}
|
@@ -52,6 +52,7 @@ function blockBlocknumber() view returns (Blocknumber) {
|
|
52
52
|
return toBlocknumber(block.number);
|
53
53
|
}
|
54
54
|
|
55
|
+
// TODO move to BlocknumberLib and rename to zero()
|
55
56
|
/// @dev Return the Blocknumber zero (0)
|
56
57
|
function zeroBlocknumber() pure returns (Blocknumber) {
|
57
58
|
return toBlocknumber(0);
|
package/contracts/types/Fee.sol
CHANGED
@@ -24,6 +24,7 @@ function toNftId(uint256 id) pure returns (NftId) {
|
|
24
24
|
return NftId.wrap(uint96(id));
|
25
25
|
}
|
26
26
|
|
27
|
+
// TODO move to NftIdLib and rename to zero()
|
27
28
|
/// @dev Return the NftId zero (0)
|
28
29
|
function zeroNftId() pure returns (NftId) {
|
29
30
|
return NftId.wrap(0);
|
@@ -40,6 +41,13 @@ function neNftId(NftId a, NftId b) pure returns (bool isDifferent) {
|
|
40
41
|
|
41
42
|
// library functions that operate on user defined type
|
42
43
|
library NftIdLib {
|
44
|
+
|
45
|
+
/// @dev the zero nft id
|
46
|
+
/// is never a valid nft id and implies a non-initialized value
|
47
|
+
function zero() public pure returns (NftId) {
|
48
|
+
return NftId.wrap(0);
|
49
|
+
}
|
50
|
+
|
43
51
|
/// @dev Converts the NftId to a uint256.
|
44
52
|
function toInt(NftId nftId) public pure returns (uint96) {
|
45
53
|
return uint96(NftId.unwrap(nftId));
|
@@ -115,6 +115,7 @@ function toObjectType(uint256 objectType) pure returns (ObjectType) {
|
|
115
115
|
return ObjectType.wrap(uint8(objectType));
|
116
116
|
}
|
117
117
|
|
118
|
+
// TODO move to ObjecTypeLib and rename to zero()
|
118
119
|
/// @dev Return the ObjectType zero (0)
|
119
120
|
function zeroObjectType() pure returns (ObjectType) {
|
120
121
|
return ObjectType.wrap(0);
|
@@ -16,19 +16,25 @@ using {
|
|
16
16
|
RoleIdLib.toKey32
|
17
17
|
} for RoleId global;
|
18
18
|
|
19
|
+
|
20
|
+
/// @dev role id needs to match with oz AccessManager.ADMIN_ROLE
|
21
|
+
function ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).min); }
|
22
|
+
|
23
|
+
/// @dev role id needs to match with oz AccessManager.PUBLIC_ROLE
|
24
|
+
function PUBLIC_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).max); }
|
25
|
+
|
19
26
|
// general pure free functions
|
20
27
|
function DISTRIBUTION_OWNER_ROLE_NAME() pure returns (string memory) { return "DistributionOwnerRole"; }
|
21
28
|
function ORACLE_OWNER_ROLE_NAME() pure returns (string memory) { return "OracleOwnerRole"; }
|
22
29
|
function POOL_OWNER_ROLE_NAME() pure returns (string memory) { return "PoolOwnerRole"; }
|
23
30
|
function PRODUCT_OWNER_ROLE_NAME() pure returns (string memory) { return "ProductOwnerRole"; }
|
24
31
|
|
25
|
-
function
|
26
|
-
|
27
|
-
function
|
28
|
-
function
|
29
|
-
function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(300); }
|
30
|
-
function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(400); }
|
32
|
+
function DISTRIBUTION_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2); }
|
33
|
+
function ORACLE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(3); }
|
34
|
+
function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(4); }
|
35
|
+
function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(5); }
|
31
36
|
|
37
|
+
function INSTANCE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1900); }
|
32
38
|
function INSTANCE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2000); }
|
33
39
|
function DISTRIBUTION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2100); }
|
34
40
|
function POOL_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2200); }
|
@@ -37,6 +43,7 @@ function APPLICATION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toR
|
|
37
43
|
function POLICY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2410); }
|
38
44
|
function CLAIM_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2420); }
|
39
45
|
function BUNDLE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2500); }
|
46
|
+
function INSTANCE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2600); }
|
40
47
|
|
41
48
|
function GIF_ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1500); }
|
42
49
|
function GIF_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1600); }
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
type Seconds is uint40;
|
5
|
+
|
6
|
+
using {
|
7
|
+
SecondsLib.eqz,
|
8
|
+
SecondsLib.gtz,
|
9
|
+
SecondsLib.toInt
|
10
|
+
} for Seconds global;
|
11
|
+
|
12
|
+
|
13
|
+
library SecondsLib {
|
14
|
+
|
15
|
+
error ErrorSecondsLibDurationTooBig(uint256 duration);
|
16
|
+
|
17
|
+
function zero() public pure returns (Seconds) {
|
18
|
+
return Seconds.wrap(0);
|
19
|
+
}
|
20
|
+
|
21
|
+
function max() public pure returns (Seconds) {
|
22
|
+
return Seconds.wrap(_max());
|
23
|
+
}
|
24
|
+
|
25
|
+
/// @dev converts the uint duration into Seconds
|
26
|
+
/// function reverts if duration is exceeding max Seconds value
|
27
|
+
function toSeconds(uint256 duration) public pure returns (Seconds) {
|
28
|
+
// if(duration > type(uint40).max) {
|
29
|
+
if(duration > _max()) {
|
30
|
+
revert ErrorSecondsLibDurationTooBig(duration);
|
31
|
+
}
|
32
|
+
|
33
|
+
return Seconds.wrap(uint40(duration));
|
34
|
+
}
|
35
|
+
|
36
|
+
/// @dev return true if duration equals 0
|
37
|
+
function eqz(Seconds duration) public pure returns (bool) {
|
38
|
+
return Seconds.unwrap(duration) == 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
/// @dev return true if duration is larger than 0
|
42
|
+
function gtz(Seconds duration) public pure returns (bool) {
|
43
|
+
return Seconds.unwrap(duration) > 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
function toInt(Seconds duration) public pure returns (uint256) {
|
47
|
+
return uint256(uint40(Seconds.unwrap(duration)));
|
48
|
+
}
|
49
|
+
|
50
|
+
function _max() internal pure returns (uint40) {
|
51
|
+
// IMPORTANT: type nees to match with actual definition for Seconds
|
52
|
+
return type(uint40).max;
|
53
|
+
}
|
54
|
+
}
|
@@ -67,6 +67,7 @@ function toStateId(uint256 id) pure returns (StateId) {
|
|
67
67
|
return StateId.wrap(uint8(id));
|
68
68
|
}
|
69
69
|
|
70
|
+
// TODO move to StateIdLib and rename to zero()
|
70
71
|
/// @dev Return the StateId zero (0)
|
71
72
|
function zeroStateId() pure returns (StateId) {
|
72
73
|
return StateId.wrap(0);
|
@@ -1,5 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Seconds} from "./Seconds.sol";
|
3
5
|
|
4
6
|
type Timestamp is uint40;
|
5
7
|
|
@@ -12,7 +14,8 @@ using {
|
|
12
14
|
neTimestamp as !=,
|
13
15
|
TimestampLib.gtz,
|
14
16
|
TimestampLib.eqz,
|
15
|
-
TimestampLib.addSeconds
|
17
|
+
TimestampLib.addSeconds,
|
18
|
+
TimestampLib.toInt
|
16
19
|
} for Timestamp global;
|
17
20
|
|
18
21
|
/// @dev return true if Timestamp a is after Timestamp b
|
@@ -50,10 +53,7 @@ function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
|
|
50
53
|
return Timestamp.wrap(uint40(timestamp));
|
51
54
|
}
|
52
55
|
|
53
|
-
//
|
54
|
-
// return toTimestamp(block.timestamp);
|
55
|
-
// }
|
56
|
-
|
56
|
+
// TODO move to TimestampLib and rename to zero()
|
57
57
|
/// @dev Return the Timestamp zero (0)
|
58
58
|
function zeroTimestamp() pure returns (Timestamp) {
|
59
59
|
return toTimestamp(0);
|
@@ -103,22 +103,22 @@ library TimestampLib {
|
|
103
103
|
return neTimestamp(a, b);
|
104
104
|
}
|
105
105
|
|
106
|
-
/// @dev return true if Timestamp is larger than 0
|
107
|
-
function gtz(Timestamp timestamp) public pure returns (bool) {
|
108
|
-
return Timestamp.unwrap(timestamp) > 0;
|
109
|
-
}
|
110
|
-
|
111
106
|
/// @dev return true if Timestamp equals 0
|
112
107
|
function eqz(Timestamp timestamp) public pure returns (bool) {
|
113
108
|
return Timestamp.unwrap(timestamp) == 0;
|
114
109
|
}
|
115
110
|
|
111
|
+
/// @dev return true if Timestamp is larger than 0
|
112
|
+
function gtz(Timestamp timestamp) public pure returns (bool) {
|
113
|
+
return Timestamp.unwrap(timestamp) > 0;
|
114
|
+
}
|
115
|
+
|
116
116
|
/// @dev return true if Timestamp a is not equal to Timestamp b
|
117
117
|
function addSeconds(
|
118
118
|
Timestamp timestamp,
|
119
|
-
|
119
|
+
Seconds duration
|
120
120
|
) public pure returns (Timestamp) {
|
121
|
-
return toTimestamp(Timestamp.unwrap(timestamp) +
|
121
|
+
return toTimestamp(Timestamp.unwrap(timestamp) + duration.toInt());
|
122
122
|
}
|
123
123
|
|
124
124
|
function toInt(Timestamp timestamp) public pure returns (uint256) {
|
package/package.json
CHANGED