@etherisc/gif-next 0.0.2-ebbe63d → 0.0.2-ecbd488-936
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +390 -2
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +4 -0
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +327 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +618 -0
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +280 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +152 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +249 -0
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +157 -0
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/components/Pool.sol/Pool.json +782 -0
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/components/Product.sol/Product.json +719 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +4 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +66 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +4 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +24 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +4 -0
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +42 -0
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +4 -0
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +105 -0
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +4 -0
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +105 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +128 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +42 -0
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +76 -0
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +89 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +128 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +37 -0
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +50 -0
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +63 -0
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +59 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +124 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +74 -0
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +124 -0
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +207 -0
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +4 -0
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +10 -0
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +4 -0
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +10 -0
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.json +101 -0
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +1132 -0
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +4 -0
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +1082 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1014 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +480 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +4 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.json +3552 -0
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +917 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1388 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +931 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +508 -0
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +540 -0
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +113 -0
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +429 -0
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.json +115 -0
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +502 -0
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +169 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +211 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.json +10 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.json +10 -0
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.json +10 -0
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +4 -0
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.json +10 -0
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +4 -0
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +10 -0
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +827 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +716 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +444 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +466 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +446 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +561 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +739 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +839 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +448 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +1046 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +448 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +771 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +626 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +947 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +34 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.json +809 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1293 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +513 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +410 -0
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +107 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +35 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +127 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +201 -0
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/shared/IService.sol/IService.json +421 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +205 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +158 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +349 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +274 -0
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +4 -0
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +442 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/shared/Service.sol/Service.json +468 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +96 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +228 -0
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +4 -0
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +119 -0
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +4 -0
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +305 -0
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +4 -0
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +116 -0
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +4 -0
- package/artifacts/contracts/test/TestService.sol/TestService.json +600 -0
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +4 -0
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +376 -0
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +4 -0
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +218 -0
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +4 -0
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +286 -0
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +4 -0
- package/artifacts/contracts/test/Usdc.sol/USDC.json +376 -0
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +4 -0
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.json +10 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +10 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +104 -0
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +4 -0
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +257 -0
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +125 -0
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +153 -0
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +10 -0
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +100 -0
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +123 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +156 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +249 -0
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +4 -0
- package/artifacts/contracts/types/UFixed.sol/MathLib.json +10 -0
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +479 -0
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +4 -0
- package/artifacts/contracts/types/Version.sol/VersionLib.json +177 -0
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +4 -0
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +49 -0
- package/contracts/components/BaseComponent.sol +91 -0
- package/contracts/components/Distribution.sol +159 -0
- package/contracts/components/IBaseComponent.sol +25 -0
- package/contracts/components/IDistributionComponent.sol +44 -0
- package/contracts/components/IPoolComponent.sol +62 -0
- package/contracts/components/IProductComponent.sol +35 -0
- package/contracts/components/Pool.sol +242 -0
- package/contracts/components/Product.sol +284 -0
- package/contracts/experiment/cloning/Cloner.sol +47 -0
- package/contracts/experiment/errors/Require.sol +38 -0
- package/contracts/experiment/errors/Revert.sol +44 -0
- package/contracts/experiment/inheritance/A.sol +53 -0
- package/contracts/experiment/inheritance/B.sol +28 -0
- package/contracts/experiment/inheritance/C.sol +34 -0
- package/contracts/experiment/inheritance/IA.sol +13 -0
- package/contracts/experiment/inheritance/IB.sol +10 -0
- package/contracts/experiment/inheritance/IC.sol +12 -0
- package/contracts/experiment/statemachine/Dummy.sol +27 -0
- package/contracts/experiment/statemachine/ISM.sol +25 -0
- package/contracts/experiment/statemachine/SM.sol +57 -0
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +31 -0
- package/contracts/experiment/types/TypeA.sol +47 -0
- package/contracts/experiment/types/TypeB.sol +29 -0
- package/contracts/instance/AccessManagedSimple.sol +115 -0
- package/contracts/instance/AccessManagerSimple.sol +692 -0
- package/contracts/instance/IAccessManagerSimple.sol +391 -0
- package/contracts/instance/IInstance.sol +48 -0
- package/contracts/instance/IInstanceService.sol +30 -0
- package/contracts/instance/Instance.sol +443 -0
- package/contracts/instance/InstanceAccessManager.sol +288 -0
- package/contracts/instance/InstanceReader.sol +306 -0
- package/contracts/instance/InstanceService.sol +195 -0
- package/contracts/instance/InstanceServiceManager.sol +57 -0
- package/contracts/instance/base/ComponentServiceBase.sol +124 -0
- package/contracts/instance/base/IInstanceBase.sol +23 -0
- package/contracts/instance/base/IKeyValueStore.sol +49 -0
- package/contracts/instance/base/ILifecycle.sol +30 -0
- package/contracts/instance/base/KeyValueStore.sol +172 -0
- package/contracts/instance/base/Lifecycle.sol +100 -0
- package/contracts/instance/module/IAccess.sol +38 -0
- package/contracts/instance/module/IBundle.sol +20 -0
- package/contracts/instance/module/IDistribution.sol +39 -0
- package/contracts/instance/module/IPolicy.sol +45 -0
- package/contracts/instance/module/IRisk.sol +11 -0
- package/contracts/instance/module/ISetup.sol +44 -0
- package/contracts/instance/module/ITreasury.sol +23 -0
- package/contracts/instance/service/ComponentOwnerService.sol +317 -0
- package/contracts/instance/service/DistributionService.sol +88 -0
- package/contracts/instance/service/DistributionServiceManager.sol +54 -0
- package/contracts/instance/service/IComponentOwnerService.sol +20 -0
- package/contracts/instance/service/IDistributionService.sol +12 -0
- package/contracts/instance/service/IPoolService.sol +37 -0
- package/contracts/instance/service/IProductService.sol +107 -0
- package/contracts/instance/service/PoolService.sol +194 -0
- package/contracts/instance/service/PoolServiceManager.sol +54 -0
- package/contracts/instance/service/ProductService.sol +543 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/ChainNft.sol +202 -0
- package/contracts/registry/IRegistry.sol +79 -0
- package/contracts/registry/IRegistryService.sol +50 -0
- package/contracts/registry/ITransferInterceptor.sol +6 -0
- package/contracts/registry/Registry.sol +444 -0
- package/contracts/registry/RegistryService.sol +358 -0
- package/contracts/registry/RegistryServiceManager.sol +80 -0
- package/contracts/registry/TokenRegistry.sol +111 -0
- package/contracts/shared/ContractDeployerLib.sol +72 -0
- package/contracts/shared/ERC165.sol +25 -0
- package/contracts/shared/INftOwnable.sol +22 -0
- package/contracts/shared/IRegisterable.sol +17 -0
- package/contracts/shared/IService.sol +15 -0
- package/contracts/shared/IVersionable.sol +96 -0
- package/contracts/shared/NftOwnable.sol +134 -0
- package/contracts/shared/ProxyManager.sol +94 -0
- package/contracts/shared/Registerable.sol +90 -0
- package/contracts/shared/RegisterableUpgradable.sol +16 -0
- package/contracts/shared/Service.sol +55 -0
- package/contracts/shared/TokenHandler.sol +27 -0
- package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
- package/contracts/shared/Versionable.sol +147 -0
- package/contracts/test/TestFee.sol +25 -0
- package/contracts/test/TestRegisterable.sol +18 -0
- package/contracts/test/TestRoleId.sol +14 -0
- package/contracts/test/TestService.sol +24 -0
- package/contracts/{Dip.sol → test/TestToken.sol} +5 -5
- package/contracts/test/TestVersion.sol +44 -0
- package/contracts/test/TestVersionable.sol +17 -0
- package/contracts/test/Usdc.sol +26 -0
- package/contracts/types/AddressSet.sol +58 -0
- package/contracts/types/Blocknumber.sol +118 -0
- package/contracts/types/ChainId.sol +38 -0
- package/contracts/types/DistributorType.sol +55 -0
- package/contracts/types/Fee.sol +56 -0
- package/contracts/types/Key32.sol +50 -0
- package/contracts/types/NftId.sol +72 -0
- package/contracts/types/NftIdSet.sol +60 -0
- package/contracts/types/NumberId.sol +52 -0
- package/contracts/types/ObjectType.sol +152 -0
- package/contracts/types/Referral.sol +85 -0
- package/contracts/types/RiskId.sol +43 -0
- package/contracts/types/RoleId.sol +90 -0
- package/contracts/types/StateId.sol +105 -0
- package/contracts/types/Timestamp.sol +127 -0
- package/contracts/types/UFixed.sol +325 -0
- package/contracts/types/Version.sol +107 -0
- package/package.json +26 -10
- package/artifacts/contracts/Dip.sol/DIP.dbg.json +0 -4
- package/artifacts/contracts/Dip.sol/DIP.json +0 -338
- package/artifacts/contracts/Lock.sol/Lock.dbg.json +0 -4
- package/artifacts/contracts/Lock.sol/Lock.json +0 -74
- package/contracts/Lock.sol +0 -34
@@ -0,0 +1,202 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {ERC721, ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
|
5
|
+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
|
6
|
+
|
7
|
+
import {ITransferInterceptor} from "./ITransferInterceptor.sol";
|
8
|
+
|
9
|
+
contract ChainNft is ERC721Enumerable {
|
10
|
+
|
11
|
+
// constants
|
12
|
+
string public constant NAME = "Dezentralized Insurance Protocol NFT";
|
13
|
+
string public constant SYMBOL = "DIPNFT";
|
14
|
+
|
15
|
+
uint256 public constant PROTOCOL_NFT_ID = 1101;
|
16
|
+
uint256 public constant GLOBAL_REGISTRY_ID = 2101;
|
17
|
+
|
18
|
+
// custom errors
|
19
|
+
error CallerNotRegistry(address caller);
|
20
|
+
error RegistryAddressZero();
|
21
|
+
error NftUriEmpty();
|
22
|
+
error NftUriAlreadySet();
|
23
|
+
|
24
|
+
// contract state
|
25
|
+
|
26
|
+
// remember interceptors
|
27
|
+
mapping(uint256 tokenId => address interceptor) private _interceptor;
|
28
|
+
|
29
|
+
// remember token uri
|
30
|
+
mapping(uint256 tokenId => string uri) private _uri;
|
31
|
+
|
32
|
+
// remember registry
|
33
|
+
address private _registry;
|
34
|
+
|
35
|
+
// only used for _getNextTokenId
|
36
|
+
uint256 internal _chainIdInt;
|
37
|
+
uint256 internal _chainIdDigits;
|
38
|
+
uint256 internal _chainIdMultiplier;
|
39
|
+
uint256 internal _idNext;
|
40
|
+
uint256 internal _totalMinted;
|
41
|
+
|
42
|
+
modifier onlyRegistry() {
|
43
|
+
if (msg.sender != _registry) { revert CallerNotRegistry(msg.sender); }
|
44
|
+
_;
|
45
|
+
}
|
46
|
+
|
47
|
+
constructor(address registry) ERC721(NAME, SYMBOL) {
|
48
|
+
if (registry == address(0)) { revert RegistryAddressZero(); }
|
49
|
+
|
50
|
+
_registry = registry;
|
51
|
+
_chainIdInt = block.chainid;
|
52
|
+
_chainIdDigits = 0;
|
53
|
+
|
54
|
+
// count digis
|
55
|
+
uint256 num = _chainIdInt;
|
56
|
+
while (num != 0) {
|
57
|
+
_chainIdDigits++;
|
58
|
+
num /= 10;
|
59
|
+
}
|
60
|
+
|
61
|
+
_chainIdMultiplier = 10 ** _chainIdDigits;
|
62
|
+
_idNext = 4;
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @dev mints a token for a specified token id
|
67
|
+
* not part of the IRegistry interface only needed for
|
68
|
+
* initial registry setup (protocol and global registry objects)
|
69
|
+
*/
|
70
|
+
function mint(address to, uint256 tokenId) external onlyRegistry {
|
71
|
+
_totalMinted++;
|
72
|
+
_safeMint(to, tokenId);
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
/**
|
77
|
+
* @dev mints the next token to register new objects
|
78
|
+
* non-zero transferInterceptors are recorded and called during nft token transfers.
|
79
|
+
* the contract receiving such a notification may decides to revert or record the transfer
|
80
|
+
*/
|
81
|
+
function mint(
|
82
|
+
address to,
|
83
|
+
address interceptor,
|
84
|
+
string memory uri
|
85
|
+
) public onlyRegistry returns (uint256 tokenId) {
|
86
|
+
tokenId = _getNextTokenId();
|
87
|
+
|
88
|
+
if (interceptor != address(0)) {
|
89
|
+
_interceptor[tokenId] = interceptor;
|
90
|
+
}
|
91
|
+
|
92
|
+
if (bytes(uri).length > 0) {
|
93
|
+
_uri[tokenId] = uri;
|
94
|
+
}
|
95
|
+
|
96
|
+
_totalMinted++;
|
97
|
+
_safeMint(to, tokenId);
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
/**
|
102
|
+
* @dev amend the open zeppelin transferFrom function by an interceptor call if such an interceptor is defined for the nft token id
|
103
|
+
* this allows distribution, product and pool components to be notified when distributors, policies and bundles are transferred.
|
104
|
+
*/
|
105
|
+
function transferFrom(address from, address to, uint256 tokenId) public override (ERC721, IERC721) {
|
106
|
+
super.transferFrom(from, to, tokenId);
|
107
|
+
|
108
|
+
if (_interceptor[tokenId] != address(0)) {
|
109
|
+
ITransferInterceptor(_interceptor[tokenId]).nftTransferFrom(from, to, tokenId);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
function burn(uint256 tokenId) external onlyRegistry {
|
115
|
+
_requireOwned(tokenId);
|
116
|
+
_burn(tokenId);
|
117
|
+
delete _uri[tokenId];
|
118
|
+
}
|
119
|
+
|
120
|
+
function setURI(
|
121
|
+
uint256 tokenId,
|
122
|
+
string memory uri
|
123
|
+
) external onlyRegistry {
|
124
|
+
if (bytes(uri).length == 0) { revert NftUriEmpty(); }
|
125
|
+
if (bytes(_uri[tokenId]).length > 0) { revert NftUriAlreadySet(); }
|
126
|
+
|
127
|
+
_requireOwned(tokenId);
|
128
|
+
_uri[tokenId] = uri;
|
129
|
+
}
|
130
|
+
|
131
|
+
function exists(uint256 tokenId) external view returns (bool) {
|
132
|
+
return _ownerOf(tokenId) != address(0);
|
133
|
+
}
|
134
|
+
|
135
|
+
function tokenURI(
|
136
|
+
uint256 tokenId
|
137
|
+
) public view override returns (string memory) {
|
138
|
+
// gif generally does not revert for view functions
|
139
|
+
// this is an exception to keep the openzeppelin nft semantics
|
140
|
+
_requireOwned(tokenId);
|
141
|
+
return _uri[tokenId];
|
142
|
+
}
|
143
|
+
|
144
|
+
function getInterceptor(uint256 tokenId) external view returns (address) {
|
145
|
+
return _interceptor[tokenId];
|
146
|
+
}
|
147
|
+
|
148
|
+
function getRegistryAddress() external view returns (address) {
|
149
|
+
return _registry;
|
150
|
+
}
|
151
|
+
|
152
|
+
function totalMinted() external view returns (uint256) {
|
153
|
+
return _totalMinted;
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @dev token id calculation based on an index value that is supposed
|
158
|
+
* to increase with every minted token
|
159
|
+
*
|
160
|
+
* requirement: each chain registry produces token ids that
|
161
|
+
* are guaranteed to not collide with any token id genereated
|
162
|
+
* on a different chain
|
163
|
+
*
|
164
|
+
* format concat(counter,chainid,2 digits for len-of-chain-id)
|
165
|
+
* restriction chainid up to 99 digits
|
166
|
+
* decode: from right to left:
|
167
|
+
* - 2 right most digits encode length of chainid
|
168
|
+
* - move number of digits to left as determined above (-> chainid)
|
169
|
+
* - the reminder to the left is the counter
|
170
|
+
*
|
171
|
+
* special cases
|
172
|
+
* 1101 -> decentralized insurance protocol
|
173
|
+
* 2102 -> global registry
|
174
|
+
* 2xxxxx -> chain registry, where xxxxx = <chain-part>
|
175
|
+
*
|
176
|
+
* examples
|
177
|
+
* 1101
|
178
|
+
* ^^ ^
|
179
|
+
* || +- 1-digit chain id
|
180
|
+
* |+-- chain id = 1 (mainnet)
|
181
|
+
* +-- 1st token id on mainnet
|
182
|
+
* (1 * 10 ** 1 + 1) * 100 + 1
|
183
|
+
* 42987654321010
|
184
|
+
* ^ ^ ^
|
185
|
+
* | | +- 10-digit chain id
|
186
|
+
* | +-- chain id = 9876543210 (hypothetical chainid)
|
187
|
+
* +-- 42nd token id on this chain
|
188
|
+
* (42 * 10 ** 10 + 9876543210) * 100 + 10
|
189
|
+
* (index * 10 ** digits + chainid) * 100 + digits (1 < digits < 100)
|
190
|
+
*/
|
191
|
+
function calculateTokenId(uint256 idIndex) public view returns (uint256 id) {
|
192
|
+
id =
|
193
|
+
(idIndex * _chainIdMultiplier + _chainIdInt) *
|
194
|
+
100 +
|
195
|
+
_chainIdDigits;
|
196
|
+
}
|
197
|
+
|
198
|
+
function _getNextTokenId() private returns (uint256 id) {
|
199
|
+
id = calculateTokenId(_idNext);
|
200
|
+
_idNext++;
|
201
|
+
}
|
202
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
+
|
6
|
+
import {ChainNft} from "./ChainNft.sol";
|
7
|
+
import {NftId} from "../types/NftId.sol";
|
8
|
+
import {ObjectType} from "../types/ObjectType.sol";
|
9
|
+
import {VersionPart} from "../types/Version.sol";
|
10
|
+
|
11
|
+
interface IRegistry is IERC165 {
|
12
|
+
|
13
|
+
event LogInitialMajorVersionSet(VersionPart majorVersion);
|
14
|
+
event LogMajorVersionSet(VersionPart majorVersionMax);
|
15
|
+
event LogRegistration(ObjectInfo info);
|
16
|
+
event LogServiceNameRegistration(string serviceName, VersionPart majorVersion);
|
17
|
+
|
18
|
+
// setMajorVersion()
|
19
|
+
error NotOwner(address account);
|
20
|
+
error MajorVersionMaxIncreaseInvalid(VersionPart newMajorVersionMax, VersionPart existingMaxMajorVersion);
|
21
|
+
|
22
|
+
// register()
|
23
|
+
error NotRegistryService();
|
24
|
+
error ZeroParentAddress();
|
25
|
+
error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
|
26
|
+
error ContractAlreadyRegistered(address objectAddress);
|
27
|
+
error InvalidServiceVersion(VersionPart majorVersion);
|
28
|
+
error ServiceNameAlreadyRegistered(string name, VersionPart majorVersion);
|
29
|
+
|
30
|
+
struct ObjectInfo {
|
31
|
+
NftId nftId;
|
32
|
+
NftId parentNftId;
|
33
|
+
ObjectType objectType;
|
34
|
+
bool isInterceptor;
|
35
|
+
address objectAddress;
|
36
|
+
address initialOwner;
|
37
|
+
bytes data;
|
38
|
+
}// TODO delete nftId and initialOwner(if not used) from struct
|
39
|
+
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
40
|
+
|
41
|
+
function setMajorVersion(VersionPart newMajorVersionMax) external;
|
42
|
+
|
43
|
+
function register(ObjectInfo memory info) external returns (NftId nftId);
|
44
|
+
|
45
|
+
function getMajorVersionMin() external view returns (VersionPart);
|
46
|
+
|
47
|
+
function getMajorVersionMax() external view returns (VersionPart);
|
48
|
+
|
49
|
+
function getMajorVersion() external view returns (VersionPart);
|
50
|
+
|
51
|
+
function getObjectCount() external view returns (uint256);
|
52
|
+
|
53
|
+
function getNftId() external view returns (NftId nftId);
|
54
|
+
|
55
|
+
function getNftId(address objectAddress) external view returns (NftId nftId);
|
56
|
+
|
57
|
+
function ownerOf(NftId nftId) external view returns (address);
|
58
|
+
|
59
|
+
function ownerOf(address contractAddress) external view returns (address);
|
60
|
+
|
61
|
+
function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory info);
|
62
|
+
|
63
|
+
function getObjectInfo(address object) external view returns (ObjectInfo memory info);
|
64
|
+
|
65
|
+
function isRegistered(NftId nftId) external view returns (bool);
|
66
|
+
|
67
|
+
function isRegistered(address contractAddress) external view returns (bool);
|
68
|
+
|
69
|
+
function getServiceName(NftId nftId) external view returns (string memory name);
|
70
|
+
|
71
|
+
function getServiceAddress(
|
72
|
+
string memory serviceName,
|
73
|
+
VersionPart majorVersion
|
74
|
+
) external view returns (address serviceAddress);
|
75
|
+
|
76
|
+
function getChainNft() external view returns (ChainNft);
|
77
|
+
|
78
|
+
function getOwner() external view returns (address);
|
79
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {NftId} from "../types/NftId.sol";
|
5
|
+
import {ObjectType} from "../types/ObjectType.sol";
|
6
|
+
import {RoleId} from "../types/RoleId.sol";
|
7
|
+
import {IService} from "../shared/IService.sol";
|
8
|
+
import {IRegistry} from "./IRegistry.sol";
|
9
|
+
|
10
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
+
import {IBaseComponent} from "../components/IBaseComponent.sol";
|
12
|
+
|
13
|
+
interface IRegistryService is IService {
|
14
|
+
|
15
|
+
error SelfRegistration();
|
16
|
+
error NotRegistryOwner();
|
17
|
+
|
18
|
+
error NotService();
|
19
|
+
error NotInstance();
|
20
|
+
error NotProduct();
|
21
|
+
error NotPool();
|
22
|
+
error NotDistribution();
|
23
|
+
|
24
|
+
error UnexpectedRegisterableType(ObjectType expected, ObjectType found);
|
25
|
+
error NotRegisterableOwner(address expectedOwner);
|
26
|
+
error RegisterableOwnerIsZero();
|
27
|
+
error RegisterableOwnerIsRegistered();
|
28
|
+
error InvalidInitialOwner(address initialOwner);
|
29
|
+
error InvalidAddress(address registerableAddress);
|
30
|
+
|
31
|
+
|
32
|
+
function registerService(IService service) external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
33
|
+
|
34
|
+
function registerInstance(IRegisterable instance)
|
35
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
36
|
+
|
37
|
+
function registerProduct(IBaseComponent product, address owner)
|
38
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
39
|
+
|
40
|
+
function registerPool(IBaseComponent pool, address owner)
|
41
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
42
|
+
|
43
|
+
function registerDistribution(IBaseComponent distribution, address owner)
|
44
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
45
|
+
|
46
|
+
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId); // -> easy to upgrade
|
47
|
+
|
48
|
+
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
49
|
+
}
|
50
|
+
|