@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
@@ -117,8 +117,8 @@
|
|
117
117
|
"type": "function"
|
118
118
|
}
|
119
119
|
],
|
120
|
-
"bytecode": "0x61041061003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632cf96bf9146100715780633f093cd6146100a457806355ee6275146100d05780637bc32ecf146100f1578063a420c78714610114578063bc1b392d14610137575b600080fd5b61008c61007f36600461021e565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100b76100b2366004610265565b61013e565b6040516001600160c01b0319909116815260200161009b565b6100e36100de36600461021e565b610171565b60405190815260200161009b565b6101046100ff36600461021e565b61020b565b604051901515815260200161009b565b61012561012236600461033a565b90565b60405160ff909116815260200161009b565b60006100b7565b6000828260405160200161015392919061035d565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
121
|
-
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632cf96bf9146100715780633f093cd6146100a457806355ee6275146100d05780637bc32ecf146100f1578063a420c78714610114578063bc1b392d14610137575b600080fd5b61008c61007f36600461021e565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100b76100b2366004610265565b61013e565b6040516001600160c01b0319909116815260200161009b565b6100e36100de36600461021e565b610171565b60405190815260200161009b565b6101046100ff36600461021e565b61020b565b604051901515815260200161009b565b61012561012236600461033a565b90565b60405160ff909116815260200161009b565b60006100b7565b6000828260405160200161015392919061035d565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
120
|
+
"bytecode": "0x61041061003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632cf96bf9146100715780633f093cd6146100a457806355ee6275146100d05780637bc32ecf146100f1578063a420c78714610114578063bc1b392d14610137575b600080fd5b61008c61007f36600461021e565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100b76100b2366004610265565b61013e565b6040516001600160c01b0319909116815260200161009b565b6100e36100de36600461021e565b610171565b60405190815260200161009b565b6101046100ff36600461021e565b61020b565b604051901515815260200161009b565b61012561012236600461033a565b90565b60405160ff909116815260200161009b565b60006100b7565b6000828260405160200161015392919061035d565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020591906103c1565b92915050565b60006001600160c01b0319821615610205565b60006020828403121561023057600080fd5b81356001600160c01b03198116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561027857600080fd5b82356bffffffffffffffffffffffff8116811461029457600080fd5b9150602083013567ffffffffffffffff808211156102b157600080fd5b818501915085601f8301126102c557600080fd5b8135818111156102d7576102d761024f565b604051601f8201601f19908116603f011681019083821181831017156102ff576102ff61024f565b8160405282815288602084870101111561031857600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561034c57600080fd5b813560ff8116811461024857600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561039f57858101830151858201606001528201610383565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156103d357600080fd5b505191905056fea2646970667358221220dd056262c1202693d24667cc3fa292c0c78f308163ae1c9263c67dab81491f8564736f6c63430008140033",
|
121
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c80632cf96bf9146100715780633f093cd6146100a457806355ee6275146100d05780637bc32ecf146100f1578063a420c78714610114578063bc1b392d14610137575b600080fd5b61008c61007f36600461021e565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100b76100b2366004610265565b61013e565b6040516001600160c01b0319909116815260200161009b565b6100e36100de36600461021e565b610171565b60405190815260200161009b565b6101046100ff36600461021e565b61020b565b604051901515815260200161009b565b61012561012236600461033a565b90565b60405160ff909116815260200161009b565b60006100b7565b6000828260405160200161015392919061035d565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020591906103c1565b92915050565b60006001600160c01b0319821615610205565b60006020828403121561023057600080fd5b81356001600160c01b03198116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561027857600080fd5b82356bffffffffffffffffffffffff8116811461029457600080fd5b9150602083013567ffffffffffffffff808211156102b157600080fd5b818501915085601f8301126102c557600080fd5b8135818111156102d7576102d761024f565b604051601f8201601f19908116603f011681019083821181831017156102ff576102ff61024f565b8160405282815288602084870101111561031857600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561034c57600080fd5b813560ff8116811461024857600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561039f57858101830151858201606001528201610383565b506000606082860101526060601f19601f830116850101925050509392505050565b6000602082840312156103d357600080fd5b505191905056fea2646970667358221220dd056262c1202693d24667cc3fa292c0c78f308163ae1c9263c67dab81491f8564736f6c63430008140033",
|
122
122
|
"linkReferences": {
|
123
123
|
"contracts/types/Key32.sol": {
|
124
124
|
"Key32Lib": [
|
@@ -61,8 +61,8 @@
|
|
61
61
|
"type": "function"
|
62
62
|
}
|
63
63
|
],
|
64
|
-
"bytecode": "0x61032f61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
65
|
-
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
64
|
+
"bytecode": "0x61032f61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea26469706673582212200548278561b146a0e65573d2f79dc26313cd18b7687b0aef81ef6cfd019f487d64736f6c63430008140033",
|
65
|
+
"deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea26469706673582212200548278561b146a0e65573d2f79dc26313cd18b7687b0aef81ef6cfd019f487d64736f6c63430008140033",
|
66
66
|
"linkReferences": {
|
67
67
|
"contracts/types/Key32.sol": {
|
68
68
|
"Key32Lib": [
|
@@ -131,8 +131,8 @@
|
|
131
131
|
"type": "function"
|
132
132
|
}
|
133
133
|
],
|
134
|
-
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
135
|
-
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$
|
134
|
+
"bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea26469706673582212203660a82977ddfc4eba71f947431e7a360093cacc7d8cf235484f4ea935646cb464736f6c63430008140033",
|
135
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea26469706673582212203660a82977ddfc4eba71f947431e7a360093cacc7d8cf235484f4ea935646cb464736f6c63430008140033",
|
136
136
|
"linkReferences": {
|
137
137
|
"contracts/types/Key32.sol": {
|
138
138
|
"Key32Lib": [
|
@@ -20,6 +20,7 @@ import {VersionPart} from "../types/Version.sol";
|
|
20
20
|
import {Registerable} from "../shared/Registerable.sol";
|
21
21
|
import {RoleId, RoleIdLib} from "../types/RoleId.sol";
|
22
22
|
import {IAccess} from "../instance/module/IAccess.sol";
|
23
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
23
24
|
import {VersionPart} from "../types/Version.sol";
|
24
25
|
|
25
26
|
// TODO discuss to inherit from oz accessmanaged
|
@@ -95,14 +96,28 @@ abstract contract Component is
|
|
95
96
|
registerInterface(type(IComponent).interfaceId);
|
96
97
|
}
|
97
98
|
|
98
|
-
function lock() external onlyOwner
|
99
|
+
function lock() external onlyOwner {
|
99
100
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
100
101
|
}
|
101
102
|
|
102
|
-
function unlock() external onlyOwner
|
103
|
+
function unlock() external onlyOwner {
|
103
104
|
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
104
105
|
}
|
105
106
|
|
107
|
+
function approveTokenHandler(uint256 spendingLimitAmount) external onlyOwner {
|
108
|
+
IComponents.ComponentInfo memory info = getComponentInfo();
|
109
|
+
|
110
|
+
if(info.wallet != address(this)) {
|
111
|
+
revert ErrorComponentWalletNotComponent();
|
112
|
+
}
|
113
|
+
|
114
|
+
info.token.approve(
|
115
|
+
address(info.tokenHandler),
|
116
|
+
spendingLimitAmount);
|
117
|
+
|
118
|
+
emit LogComponentTokenHandlerApproved(spendingLimitAmount);
|
119
|
+
}
|
120
|
+
|
106
121
|
function setWallet(address newWallet)
|
107
122
|
external
|
108
123
|
override
|
@@ -197,6 +212,10 @@ abstract contract Component is
|
|
197
212
|
return _getComponentStorage()._token;
|
198
213
|
}
|
199
214
|
|
215
|
+
function getTokenHandler() public view returns (TokenHandler tokenHandler) {
|
216
|
+
return getComponentInfo().tokenHandler;
|
217
|
+
}
|
218
|
+
|
200
219
|
function isNftInterceptor() public view override returns(bool isInterceptor) {
|
201
220
|
return _getComponentStorage()._isNftInterceptor;
|
202
221
|
}
|
@@ -140,10 +140,11 @@ abstract contract Distribution is
|
|
140
140
|
// and add it
|
141
141
|
{
|
142
142
|
DistributionStorage storage $ = _getDistributionStorage();
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
143
|
+
// TODO re-enable once implemented
|
144
|
+
// $._distributionService.updateDistributorType(
|
145
|
+
// distributorNftId,
|
146
|
+
// distributorType,
|
147
|
+
// data);
|
147
148
|
}
|
148
149
|
|
149
150
|
/**
|
@@ -12,6 +12,7 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
12
12
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
13
|
import {NftId} from "../types/NftId.sol";
|
14
14
|
import {ObjectType} from "../types/ObjectType.sol";
|
15
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
15
16
|
|
16
17
|
/// @dev component base class
|
17
18
|
/// component examples are product, distribution, pool and oracle
|
@@ -29,9 +30,13 @@ interface IComponent is
|
|
29
30
|
error ErrorComponentWalletAddressIsSameAsCurrent();
|
30
31
|
error ErrorComponentWalletAllowanceTooSmall(address oldWallet, address newWallet, uint256 allowance, uint256 balance);
|
31
32
|
|
33
|
+
error ErrorComponentWalletNotComponent();
|
34
|
+
|
32
35
|
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
33
36
|
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
34
37
|
|
38
|
+
event LogComponentTokenHandlerApproved(uint256 limit);
|
39
|
+
|
35
40
|
/// @dev locks component to disable functions that may change state related to this component, the only exception is function "unlock"
|
36
41
|
/// only component owner (nft holder) is authorizes to call this function
|
37
42
|
function lock() external;
|
@@ -40,6 +45,11 @@ interface IComponent is
|
|
40
45
|
/// only component owner (nft holder) is authorizes to call this function
|
41
46
|
function unlock() external;
|
42
47
|
|
48
|
+
/// @dev approves token hanlder to spend up to the specified amount of tokens
|
49
|
+
/// reverts if component wallet is not component itself
|
50
|
+
/// only component owner (nft holder) is authorizes to call this function
|
51
|
+
function approveTokenHandler(uint256 spendingLimitAmount) external;
|
52
|
+
|
43
53
|
/// @dev sets the wallet address for the component
|
44
54
|
/// if the current wallet has tokens, these will be transferred
|
45
55
|
/// if the new wallet address is externally owned, an approval from the
|
@@ -49,6 +59,9 @@ interface IComponent is
|
|
49
59
|
/// @dev only product service may set product nft id during registration of product setup
|
50
60
|
function setProductNftId(NftId productNftId) external;
|
51
61
|
|
62
|
+
/// @dev defines the instance to which this component is linked to
|
63
|
+
function getInstance() external view returns (IInstance instance);
|
64
|
+
|
52
65
|
/// @dev returns the name of this component
|
53
66
|
/// to successfully register the component with an instance the name MUST be unique in the linked instance
|
54
67
|
function getName() external view returns (string memory name);
|
@@ -56,8 +69,9 @@ interface IComponent is
|
|
56
69
|
/// @dev defines which ERC20 token is used by this component
|
57
70
|
function getToken() external view returns (IERC20Metadata token);
|
58
71
|
|
59
|
-
/// @dev
|
60
|
-
|
72
|
+
/// @dev returns token handler for this component
|
73
|
+
/// only registered components return a non zero token handler
|
74
|
+
function getTokenHandler() external view returns (TokenHandler tokenHandler);
|
61
75
|
|
62
76
|
/// @dev defines the wallet address used to hold the ERC20 tokens related to this component
|
63
77
|
/// the default address is the component token address
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../types/Amount.sol";
|
4
5
|
import {Fee} from "../types/Fee.sol";
|
5
6
|
import {IComponent} from "./IComponent.sol";
|
6
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
@@ -18,17 +19,17 @@ interface IPoolComponent is IComponent {
|
|
18
19
|
|
19
20
|
error ErrorPoolApplicationBundleMismatch(NftId applicationNftId);
|
20
21
|
|
21
|
-
event LogPoolVerifiedByPool(address pool, NftId applicationNftId,
|
22
|
+
event LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount);
|
22
23
|
|
23
24
|
/// @dev increases the staked tokens by the specified amount
|
24
25
|
/// only the bundle owner may stake tokens
|
25
26
|
/// bundle MUST be in active or locked state
|
26
|
-
function stake(NftId bundleNftId,
|
27
|
+
function stake(NftId bundleNftId, Amount amount) external;
|
27
28
|
|
28
29
|
/// @dev decreases the staked tokens by the specified amount
|
29
30
|
/// only the bundle owner may unstake tokens from the bundle
|
30
31
|
/// bundle MUST be in active, locked or closed state
|
31
|
-
function unstake(NftId bundleNftId,
|
32
|
+
function unstake(NftId bundleNftId, Amount amount) external;
|
32
33
|
|
33
34
|
/// @dev extends the bundle lifetime of the bundle by the specified time
|
34
35
|
/// only the bundle owner may extend the bundle's lifetime
|
@@ -61,7 +62,7 @@ interface IPoolComponent is IComponent {
|
|
61
62
|
|
62
63
|
/// @dev sets the maximum overall capital amound held by this pool
|
63
64
|
/// function may only be called by pool owner
|
64
|
-
function setMaxCapitalAmount(
|
65
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount) external;
|
65
66
|
|
66
67
|
/// @dev sets the required role to create/own bundles
|
67
68
|
/// may only be called once after setting up a pool
|
@@ -88,7 +89,7 @@ interface IPoolComponent is IComponent {
|
|
88
89
|
bytes memory applicationData,
|
89
90
|
NftId bundleNftId,
|
90
91
|
bytes memory bundleFilter,
|
91
|
-
|
92
|
+
Amount collateralizationAmount
|
92
93
|
) external;
|
93
94
|
|
94
95
|
/// @dev returns true iff the application matches with the bundle
|
@@ -99,7 +100,7 @@ interface IPoolComponent is IComponent {
|
|
99
100
|
bytes memory applicationData,
|
100
101
|
NftId bundleNftId,
|
101
102
|
bytes memory bundleFilter,
|
102
|
-
|
103
|
+
Amount collateralizationAmount
|
103
104
|
)
|
104
105
|
external
|
105
106
|
view
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../types/Amount.sol";
|
4
5
|
import {Fee} from "../types/Fee.sol";
|
5
6
|
import {IComponent} from "./IComponent.sol";
|
6
7
|
import {ISetup} from "../instance/module/ISetup.sol";
|
@@ -19,20 +20,20 @@ interface IProductComponent is IComponent {
|
|
19
20
|
) external;
|
20
21
|
|
21
22
|
function calculatePremium(
|
22
|
-
|
23
|
+
Amount sumInsuredAmount,
|
23
24
|
RiskId riskId,
|
24
25
|
Seconds lifetime,
|
25
26
|
bytes memory applicationData,
|
26
27
|
NftId bundleNftId,
|
27
28
|
ReferralId referralId
|
28
|
-
) external view returns (
|
29
|
+
) external view returns (Amount premiumAmount);
|
29
30
|
|
30
31
|
function calculateNetPremium(
|
31
|
-
|
32
|
+
Amount sumInsuredAmount,
|
32
33
|
RiskId riskId,
|
33
34
|
Seconds lifetime,
|
34
35
|
bytes memory applicationData
|
35
|
-
) external view returns (
|
36
|
+
) external view returns (Amount netPremiumAmount);
|
36
37
|
|
37
38
|
|
38
39
|
function getPoolNftId() external view returns (NftId poolNftId);
|
@@ -69,7 +69,7 @@ abstract contract Pool is
|
|
69
69
|
|
70
70
|
function stake(
|
71
71
|
NftId bundleNftId,
|
72
|
-
|
72
|
+
Amount amount
|
73
73
|
)
|
74
74
|
public
|
75
75
|
virtual
|
@@ -82,7 +82,7 @@ abstract contract Pool is
|
|
82
82
|
|
83
83
|
function unstake(
|
84
84
|
NftId bundleNftId,
|
85
|
-
|
85
|
+
Amount amount
|
86
86
|
)
|
87
87
|
public
|
88
88
|
virtual
|
@@ -149,7 +149,7 @@ abstract contract Pool is
|
|
149
149
|
}
|
150
150
|
|
151
151
|
|
152
|
-
function setMaxCapitalAmount(
|
152
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount)
|
153
153
|
public
|
154
154
|
virtual
|
155
155
|
restricted()
|
@@ -189,7 +189,7 @@ abstract contract Pool is
|
|
189
189
|
bytes memory applicationData,
|
190
190
|
NftId bundleNftId,
|
191
191
|
bytes memory bundleFilter,
|
192
|
-
|
192
|
+
Amount collateralizationAmount
|
193
193
|
)
|
194
194
|
public
|
195
195
|
virtual
|
@@ -218,7 +218,7 @@ abstract contract Pool is
|
|
218
218
|
bytes memory applicationData,
|
219
219
|
NftId bundleNftId,
|
220
220
|
bytes memory bundleFilter,
|
221
|
-
|
221
|
+
Amount collateralizationAmount
|
222
222
|
)
|
223
223
|
public
|
224
224
|
view
|
@@ -279,9 +279,9 @@ abstract contract Pool is
|
|
279
279
|
IComponents.PoolInfo(
|
280
280
|
NftIdLib.zero(), // will be set when GIF registers the related product
|
281
281
|
PUBLIC_ROLE(), // bundleOwnerRole
|
282
|
-
|
283
|
-
|
284
|
-
|
282
|
+
AmountLib.max(), // maxCapitalAmount,
|
283
|
+
AmountLib.zero(), // initial balance amount
|
284
|
+
AmountLib.zero(), // initial fee amount
|
285
285
|
isNftInterceptor(), // isInterceptingBundleTransfers
|
286
286
|
false, // isExternallyManaged,
|
287
287
|
false, // isVerifyingApplications,
|
@@ -3,7 +3,7 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {Amount} from "../types/Amount.sol";
|
6
|
+
import {Amount, AmountLib} from "../types/Amount.sol";
|
7
7
|
import {ClaimId} from "../types/ClaimId.sol";
|
8
8
|
import {Component} from "./Component.sol";
|
9
9
|
import {Fee} from "../types/Fee.sol";
|
@@ -12,10 +12,11 @@ import {IApplicationService} from "../instance/service/IApplicationService.sol";
|
|
12
12
|
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
13
13
|
import {IProductService} from "../instance/service/IProductService.sol";
|
14
14
|
import {IClaimService} from "../instance/service/IClaimService.sol";
|
15
|
+
import {IPricingService} from "../instance/service/IPricingService.sol";
|
15
16
|
import {IProductComponent} from "./IProductComponent.sol";
|
16
17
|
import {NftId, NftIdLib} from "../types/NftId.sol";
|
17
18
|
import {PayoutId} from "../types/PayoutId.sol";
|
18
|
-
import {PRODUCT, APPLICATION, POLICY, CLAIM } from "../types/ObjectType.sol";
|
19
|
+
import {PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../types/ObjectType.sol";
|
19
20
|
import {ReferralId} from "../types/Referral.sol";
|
20
21
|
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
21
22
|
import {Seconds} from "../types/Seconds.sol";
|
@@ -43,6 +44,7 @@ abstract contract Product is
|
|
43
44
|
IApplicationService _applicationService;
|
44
45
|
IPolicyService _policyService;
|
45
46
|
IClaimService _claimService;
|
47
|
+
IPricingService _pricingService;
|
46
48
|
Pool _pool;
|
47
49
|
Distribution _distribution;
|
48
50
|
Fee _initialProductFee;
|
@@ -78,6 +80,7 @@ abstract contract Product is
|
|
78
80
|
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
79
81
|
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
80
82
|
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
83
|
+
$._pricingService = IPricingService(_getServiceAddress(PRICE()));
|
81
84
|
$._pool = Pool(pool);
|
82
85
|
$._distribution = Distribution(distribution);
|
83
86
|
$._initialProductFee = productFee;
|
@@ -139,7 +142,7 @@ abstract contract Product is
|
|
139
142
|
function _createApplication(
|
140
143
|
address applicationOwner,
|
141
144
|
RiskId riskId,
|
142
|
-
|
145
|
+
Amount sumInsuredAmount,
|
143
146
|
Seconds lifetime,
|
144
147
|
NftId bundleNftId,
|
145
148
|
ReferralId referralId,
|
@@ -211,7 +214,7 @@ abstract contract Product is
|
|
211
214
|
internal
|
212
215
|
returns(ClaimId)
|
213
216
|
{
|
214
|
-
return _getProductStorage().
|
217
|
+
return _getProductStorage()._claimService.submit(
|
215
218
|
policyNftId,
|
216
219
|
claimAmount,
|
217
220
|
claimData);
|
@@ -224,7 +227,7 @@ abstract contract Product is
|
|
224
227
|
)
|
225
228
|
internal
|
226
229
|
{
|
227
|
-
_getProductStorage().
|
230
|
+
_getProductStorage()._claimService.confirm(
|
228
231
|
policyNftId,
|
229
232
|
claimId,
|
230
233
|
confirmedAmount);
|
@@ -236,7 +239,7 @@ abstract contract Product is
|
|
236
239
|
)
|
237
240
|
internal
|
238
241
|
{
|
239
|
-
_getProductStorage().
|
242
|
+
_getProductStorage()._claimService.decline(
|
240
243
|
policyNftId,
|
241
244
|
claimId);
|
242
245
|
}
|
@@ -247,7 +250,7 @@ abstract contract Product is
|
|
247
250
|
)
|
248
251
|
internal
|
249
252
|
{
|
250
|
-
_getProductStorage().
|
253
|
+
_getProductStorage()._claimService.close(
|
251
254
|
policyNftId,
|
252
255
|
claimId);
|
253
256
|
}
|
@@ -261,7 +264,7 @@ abstract contract Product is
|
|
261
264
|
internal
|
262
265
|
returns (PayoutId)
|
263
266
|
{
|
264
|
-
return _getProductStorage().
|
267
|
+
return _getProductStorage()._claimService.createPayout(
|
265
268
|
policyNftId,
|
266
269
|
claimId,
|
267
270
|
amount,
|
@@ -274,13 +277,13 @@ abstract contract Product is
|
|
274
277
|
)
|
275
278
|
internal
|
276
279
|
{
|
277
|
-
_getProductStorage().
|
280
|
+
_getProductStorage()._claimService.processPayout(
|
278
281
|
policyNftId,
|
279
282
|
payoutId);
|
280
283
|
}
|
281
284
|
|
282
285
|
function calculatePremium(
|
283
|
-
|
286
|
+
Amount sumInsuredAmount,
|
284
287
|
RiskId riskId,
|
285
288
|
Seconds lifetime,
|
286
289
|
bytes memory applicationData,
|
@@ -290,9 +293,9 @@ abstract contract Product is
|
|
290
293
|
external
|
291
294
|
view
|
292
295
|
override
|
293
|
-
returns (
|
296
|
+
returns (Amount premiumAmount)
|
294
297
|
{
|
295
|
-
IPolicy.Premium memory premium = _getProductStorage().
|
298
|
+
IPolicy.Premium memory premium = _getProductStorage()._pricingService.calculatePremium(
|
296
299
|
getNftId(),
|
297
300
|
riskId,
|
298
301
|
sumInsuredAmount,
|
@@ -301,11 +304,12 @@ abstract contract Product is
|
|
301
304
|
bundleNftId,
|
302
305
|
referralId
|
303
306
|
);
|
304
|
-
|
307
|
+
|
308
|
+
return AmountLib.toAmount(premium.premiumAmount);
|
305
309
|
}
|
306
310
|
|
307
311
|
function calculateNetPremium(
|
308
|
-
|
312
|
+
Amount sumInsuredAmount,
|
309
313
|
RiskId riskId,
|
310
314
|
Seconds lifetime,
|
311
315
|
bytes memory applicationData
|
@@ -313,10 +317,10 @@ abstract contract Product is
|
|
313
317
|
external
|
314
318
|
view
|
315
319
|
virtual override
|
316
|
-
returns (
|
320
|
+
returns (Amount netPremiumAmount)
|
317
321
|
{
|
318
322
|
// default 10% of sum insured
|
319
|
-
return sumInsuredAmount / 10;
|
323
|
+
return AmountLib.toAmount(sumInsuredAmount.toInt() / 10);
|
320
324
|
}
|
321
325
|
|
322
326
|
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
@@ -368,4 +372,4 @@ abstract contract Product is
|
|
368
372
|
function _getProductService() internal view returns (IProductService) {
|
369
373
|
return _getProductStorage()._productService;
|
370
374
|
}
|
371
|
-
}
|
375
|
+
}
|