@etherisc/gif-next 0.0.2-ed4dd55 → 0.0.2-f74fcad-685

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. package/README.md +33 -0
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/Component.json +35 -9
  4. package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +1 -1
  5. package/artifacts/contracts/components/Component.sol/InstanceLinked.json +2 -2
  6. package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IPool.sol/IPoolComponent.json +84 -8
  8. package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +34 -152
  10. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  11. package/artifacts/contracts/components/Pool.sol/Pool.json +146 -13
  12. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  13. package/artifacts/contracts/components/Product.sol/Product.json +148 -15
  14. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +4 -0
  15. package/artifacts/contracts/experiment/errors/Require.sol/Require.json +105 -0
  16. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +4 -0
  17. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +105 -0
  18. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +2 -2
  20. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +2 -2
  22. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +4 -0
  29. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +59 -0
  30. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +4 -0
  31. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +124 -0
  32. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +4 -0
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +74 -0
  34. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +4 -0
  35. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +124 -0
  36. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +4 -0
  37. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +207 -0
  38. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  39. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +2 -2
  40. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  41. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +2 -2
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +714 -127
  44. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  45. package/artifacts/contracts/instance/Instance.sol/Instance.json +845 -129
  46. package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +1 -1
  47. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +1 -1
  48. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +1 -1
  49. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +1 -1
  50. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +1 -1
  51. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
  52. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.json +31 -59
  53. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +1 -1
  54. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +103 -6
  55. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +1 -1
  56. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +1 -1
  57. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.json +34 -8
  58. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +1 -1
  59. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +31 -59
  60. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +1 -1
  61. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +50 -3
  62. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +1 -1
  63. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  64. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.json +134 -0
  65. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +4 -0
  66. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.json +182 -0
  67. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +4 -0
  68. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.json +221 -0
  69. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
  70. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
  71. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.json +44 -21
  72. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
  73. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +44 -21
  74. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +1 -1
  75. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
  76. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.json +23 -43
  77. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
  78. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.json +28 -35
  79. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +1 -1
  80. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.json +21 -8
  82. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +1 -1
  83. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +1 -1
  84. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +85 -14
  85. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.dbg.json +4 -0
  86. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.json +10 -0
  87. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.dbg.json +4 -0
  88. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.json +490 -0
  89. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  90. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.json +45 -0
  91. package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +4 -0
  92. package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.json +490 -0
  93. package/artifacts/contracts/mock/Dip.sol/DIP.dbg.json +4 -0
  94. package/artifacts/contracts/mock/Dip.sol/DIP.json +338 -0
  95. package/artifacts/contracts/mock/TestPool.sol/TestPool.dbg.json +4 -0
  96. package/artifacts/contracts/mock/TestPool.sol/TestPool.json +294 -0
  97. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.dbg.json +4 -0
  98. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.json +384 -0
  99. package/artifacts/contracts/mock/Usdc.sol/USDC.dbg.json +4 -0
  100. package/artifacts/contracts/mock/Usdc.sol/USDC.json +338 -0
  101. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  102. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  103. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
  104. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +1 -1
  105. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +1 -1
  106. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +8 -8
  107. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  108. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +20 -111
  109. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +1 -1
  110. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +1 -1
  111. package/artifacts/contracts/registry/Registry.sol/Registerable.json +9 -9
  112. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  113. package/artifacts/contracts/registry/Registry.sol/Registry.json +66 -115
  114. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +1 -1
  115. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +2 -2
  116. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  117. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
  118. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  119. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +2 -2
  120. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  121. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +85 -3
  122. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  123. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
  124. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
  125. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
  126. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
  127. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +174 -0
  128. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +4 -0
  129. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +479 -0
  130. package/contracts/components/Component.sol +39 -24
  131. package/contracts/components/IPool.sol +9 -3
  132. package/contracts/components/IProduct.sol +11 -6
  133. package/contracts/components/Pool.sol +37 -14
  134. package/contracts/components/Product.sol +48 -24
  135. package/contracts/experiment/errors/Require.sol +38 -0
  136. package/contracts/experiment/errors/Revert.sol +44 -0
  137. package/contracts/experiment/inheritance/A.sol +8 -11
  138. package/contracts/experiment/inheritance/B.sol +10 -5
  139. package/contracts/experiment/inheritance/C.sol +11 -5
  140. package/contracts/experiment/inheritance/IA.sol +2 -7
  141. package/contracts/experiment/inheritance/IB.sol +3 -2
  142. package/contracts/experiment/inheritance/IC.sol +4 -3
  143. package/contracts/experiment/statemachine/Dummy.sol +27 -0
  144. package/contracts/experiment/statemachine/ISM.sol +25 -0
  145. package/contracts/experiment/statemachine/README.md +112 -0
  146. package/contracts/experiment/statemachine/SM.sol +57 -0
  147. package/contracts/experiment/statemachine/SimpleStateMachine.sol +31 -0
  148. package/contracts/experiment/types/TypeA.sol +14 -9
  149. package/contracts/experiment/types/TypeB.sol +14 -9
  150. package/contracts/instance/IInstance.sol +8 -3
  151. package/contracts/instance/Instance.sol +24 -15
  152. package/contracts/instance/access/Access.sol +63 -116
  153. package/contracts/instance/access/IAccess.sol +28 -48
  154. package/contracts/instance/component/ComponentModule.sol +162 -147
  155. package/contracts/instance/component/IComponent.sol +41 -61
  156. package/contracts/instance/lifecycle/ILifecycle.sol +47 -0
  157. package/contracts/instance/lifecycle/LifecycleModule.sol +88 -0
  158. package/contracts/instance/policy/IPolicy.sol +19 -35
  159. package/contracts/instance/policy/PolicyModule.sol +52 -44
  160. package/contracts/instance/pool/IPoolModule.sol +9 -26
  161. package/contracts/instance/pool/PoolModule.sol +43 -45
  162. package/contracts/instance/product/IProductService.sol +10 -19
  163. package/contracts/instance/product/ProductService.sol +86 -55
  164. package/contracts/instance/treasury/ITreasury.sol +91 -0
  165. package/contracts/instance/treasury/TokenHandler.sol +24 -0
  166. package/contracts/instance/treasury/TreasuryModule.sol +168 -0
  167. package/contracts/mock/Dip.sol +26 -0
  168. package/contracts/mock/TestPool.sol +16 -0
  169. package/contracts/mock/TestProduct.sol +39 -0
  170. package/contracts/mock/Usdc.sol +26 -0
  171. package/contracts/registry/ChainNft.sol +23 -61
  172. package/contracts/registry/IChainNft.sol +10 -7
  173. package/contracts/registry/IRegistry.sol +40 -41
  174. package/contracts/registry/Registry.sol +73 -67
  175. package/contracts/types/Blocknumber.sol +118 -0
  176. package/contracts/types/ChainId.sol +24 -10
  177. package/contracts/types/Fee.sol +32 -0
  178. package/contracts/types/NftId.sol +36 -10
  179. package/contracts/types/ObjectType.sol +107 -0
  180. package/contracts/types/StateId.sol +91 -0
  181. package/contracts/types/Timestamp.sol +102 -0
  182. package/contracts/types/UFixed.sol +210 -0
  183. package/package.json +14 -5
@@ -3,6 +3,104 @@
3
3
  "contractName": "IInstance",
4
4
  "sourceName": "contracts/instance/IInstance.sol",
5
5
  "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "NftId",
10
+ "name": "nftId",
11
+ "type": "uint96"
12
+ },
13
+ {
14
+ "internalType": "ObjectType",
15
+ "name": "objectType",
16
+ "type": "uint8"
17
+ },
18
+ {
19
+ "internalType": "StateId",
20
+ "name": "fromStateId",
21
+ "type": "uint8"
22
+ },
23
+ {
24
+ "internalType": "StateId",
25
+ "name": "toStateId",
26
+ "type": "uint8"
27
+ }
28
+ ],
29
+ "name": "ErrorInvalidStateTransition",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [
34
+ {
35
+ "internalType": "NftId",
36
+ "name": "nftId",
37
+ "type": "uint96"
38
+ },
39
+ {
40
+ "internalType": "ObjectType",
41
+ "name": "objectType",
42
+ "type": "uint8"
43
+ }
44
+ ],
45
+ "name": "ErrorNoLifecycle",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "anonymous": false,
50
+ "inputs": [
51
+ {
52
+ "indexed": false,
53
+ "internalType": "NftId",
54
+ "name": "nftId",
55
+ "type": "uint96"
56
+ },
57
+ {
58
+ "indexed": false,
59
+ "internalType": "StateId",
60
+ "name": "fromStateId",
61
+ "type": "uint8"
62
+ },
63
+ {
64
+ "indexed": false,
65
+ "internalType": "StateId",
66
+ "name": "toStateId",
67
+ "type": "uint8"
68
+ }
69
+ ],
70
+ "name": "LogBundleStateChanged",
71
+ "type": "event"
72
+ },
73
+ {
74
+ "anonymous": false,
75
+ "inputs": [
76
+ {
77
+ "indexed": false,
78
+ "internalType": "NftId",
79
+ "name": "nftId",
80
+ "type": "uint96"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "internalType": "ObjectType",
85
+ "name": "objectType",
86
+ "type": "uint8"
87
+ },
88
+ {
89
+ "indexed": false,
90
+ "internalType": "StateId",
91
+ "name": "fromStateId",
92
+ "type": "uint8"
93
+ },
94
+ {
95
+ "indexed": false,
96
+ "internalType": "StateId",
97
+ "name": "toStateId",
98
+ "type": "uint8"
99
+ }
100
+ ],
101
+ "name": "LogComponentStateChanged",
102
+ "type": "event"
103
+ },
6
104
  {
7
105
  "anonymous": false,
8
106
  "inputs": [
@@ -28,6 +126,31 @@
28
126
  "name": "LogDebug",
29
127
  "type": "event"
30
128
  },
129
+ {
130
+ "anonymous": false,
131
+ "inputs": [
132
+ {
133
+ "indexed": false,
134
+ "internalType": "NftId",
135
+ "name": "nftId",
136
+ "type": "uint96"
137
+ },
138
+ {
139
+ "indexed": false,
140
+ "internalType": "StateId",
141
+ "name": "fromStateId",
142
+ "type": "uint8"
143
+ },
144
+ {
145
+ "indexed": false,
146
+ "internalType": "StateId",
147
+ "name": "toStateId",
148
+ "type": "uint8"
149
+ }
150
+ ],
151
+ "name": "LogPolicyStateChanged",
152
+ "type": "event"
153
+ },
31
154
  {
32
155
  "inputs": [],
33
156
  "name": "ORACLE_OWNER_ROLE",
@@ -70,9 +193,9 @@
70
193
  {
71
194
  "inputs": [
72
195
  {
73
- "internalType": "uint256",
196
+ "internalType": "NftId",
74
197
  "name": "nftId",
75
- "type": "uint256"
198
+ "type": "uint96"
76
199
  }
77
200
  ],
78
201
  "name": "activate",
@@ -80,6 +203,47 @@
80
203
  "stateMutability": "nonpayable",
81
204
  "type": "function"
82
205
  },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "uint256",
210
+ "name": "amount",
211
+ "type": "uint256"
212
+ },
213
+ {
214
+ "components": [
215
+ {
216
+ "internalType": "UFixed",
217
+ "name": "fractionalFee",
218
+ "type": "uint256"
219
+ },
220
+ {
221
+ "internalType": "uint256",
222
+ "name": "fixedFee",
223
+ "type": "uint256"
224
+ }
225
+ ],
226
+ "internalType": "struct Fee",
227
+ "name": "fee",
228
+ "type": "tuple"
229
+ }
230
+ ],
231
+ "name": "calculateFeeAmount",
232
+ "outputs": [
233
+ {
234
+ "internalType": "uint256",
235
+ "name": "feeAmount",
236
+ "type": "uint256"
237
+ },
238
+ {
239
+ "internalType": "uint256",
240
+ "name": "netAmount",
241
+ "type": "uint256"
242
+ }
243
+ ],
244
+ "stateMutability": "pure",
245
+ "type": "function"
246
+ },
83
247
  {
84
248
  "inputs": [],
85
249
  "name": "components",
@@ -98,19 +262,19 @@
98
262
  {
99
263
  "components": [
100
264
  {
101
- "internalType": "uint256",
265
+ "internalType": "NftId",
102
266
  "name": "nftId",
103
- "type": "uint256"
267
+ "type": "uint96"
104
268
  },
105
269
  {
106
- "internalType": "uint256",
270
+ "internalType": "NftId",
107
271
  "name": "parentNftId",
108
- "type": "uint256"
272
+ "type": "uint96"
109
273
  },
110
274
  {
111
- "internalType": "uint256",
275
+ "internalType": "ObjectType",
112
276
  "name": "objectType",
113
- "type": "uint256"
277
+ "type": "uint8"
114
278
  },
115
279
  {
116
280
  "internalType": "address",
@@ -148,42 +312,19 @@
148
312
  "type": "uint256"
149
313
  },
150
314
  {
151
- "internalType": "uint256",
315
+ "internalType": "NftId",
152
316
  "name": "bundleNftId",
153
- "type": "uint256"
317
+ "type": "uint96"
154
318
  }
155
319
  ],
156
320
  "name": "createApplication",
157
321
  "outputs": [
158
322
  {
159
- "internalType": "uint256",
160
- "name": "nftId",
161
- "type": "uint256"
162
- }
163
- ],
164
- "stateMutability": "nonpayable",
165
- "type": "function"
166
- },
167
- {
168
- "inputs": [
169
- {
170
- "internalType": "uint256",
323
+ "internalType": "NftId",
171
324
  "name": "nftId",
172
- "type": "uint256"
173
- },
174
- {
175
- "internalType": "address",
176
- "name": "wallet",
177
- "type": "address"
178
- },
179
- {
180
- "internalType": "address",
181
- "name": "token",
182
- "type": "address"
325
+ "type": "uint96"
183
326
  }
184
327
  ],
185
- "name": "createPoolInfo",
186
- "outputs": [],
187
328
  "stateMutability": "nonpayable",
188
329
  "type": "function"
189
330
  },
@@ -235,17 +376,17 @@
235
376
  {
236
377
  "inputs": [
237
378
  {
238
- "internalType": "uint256",
379
+ "internalType": "NftId",
239
380
  "name": "nftId",
240
- "type": "uint256"
381
+ "type": "uint96"
241
382
  }
242
383
  ],
243
384
  "name": "getBundleNftForPolicy",
244
385
  "outputs": [
245
386
  {
246
- "internalType": "uint256",
387
+ "internalType": "NftId",
247
388
  "name": "bundleNft",
248
- "type": "uint256"
389
+ "type": "uint96"
249
390
  }
250
391
  ],
251
392
  "stateMutability": "view",
@@ -262,9 +403,9 @@
262
403
  "name": "getComponentId",
263
404
  "outputs": [
264
405
  {
265
- "internalType": "uint256",
266
- "name": "id",
267
- "type": "uint256"
406
+ "internalType": "NftId",
407
+ "name": "nftId",
408
+ "type": "uint96"
268
409
  }
269
410
  ],
270
411
  "stateMutability": "view",
@@ -281,9 +422,9 @@
281
422
  "name": "getComponentId",
282
423
  "outputs": [
283
424
  {
284
- "internalType": "uint256",
285
- "name": "id",
286
- "type": "uint256"
425
+ "internalType": "NftId",
426
+ "name": "nftId",
427
+ "type": "uint96"
287
428
  }
288
429
  ],
289
430
  "stateMutability": "view",
@@ -292,9 +433,9 @@
292
433
  {
293
434
  "inputs": [
294
435
  {
295
- "internalType": "uint256",
296
- "name": "id",
297
- "type": "uint256"
436
+ "internalType": "NftId",
437
+ "name": "nftId",
438
+ "type": "uint96"
298
439
  }
299
440
  ],
300
441
  "name": "getComponentInfo",
@@ -302,14 +443,19 @@
302
443
  {
303
444
  "components": [
304
445
  {
305
- "internalType": "uint256",
446
+ "internalType": "NftId",
306
447
  "name": "nftId",
307
- "type": "uint256"
448
+ "type": "uint96"
308
449
  },
309
450
  {
310
- "internalType": "enum IComponent.CState",
451
+ "internalType": "StateId",
311
452
  "name": "state",
312
453
  "type": "uint8"
454
+ },
455
+ {
456
+ "internalType": "contract IERC20Metadata",
457
+ "name": "token",
458
+ "type": "address"
313
459
  }
314
460
  ],
315
461
  "internalType": "struct IComponent.ComponentInfo",
@@ -320,25 +466,6 @@
320
466
  "stateMutability": "view",
321
467
  "type": "function"
322
468
  },
323
- {
324
- "inputs": [
325
- {
326
- "internalType": "uint256",
327
- "name": "id",
328
- "type": "uint256"
329
- }
330
- ],
331
- "name": "getComponentOwner",
332
- "outputs": [
333
- {
334
- "internalType": "address",
335
- "name": "owner",
336
- "type": "address"
337
- }
338
- ],
339
- "stateMutability": "view",
340
- "type": "function"
341
- },
342
469
  {
343
470
  "inputs": [],
344
471
  "name": "getComponentOwnerService",
@@ -378,14 +505,33 @@
378
505
  "stateMutability": "view",
379
506
  "type": "function"
380
507
  },
508
+ {
509
+ "inputs": [
510
+ {
511
+ "internalType": "ObjectType",
512
+ "name": "objectType",
513
+ "type": "uint8"
514
+ }
515
+ ],
516
+ "name": "getInitialState",
517
+ "outputs": [
518
+ {
519
+ "internalType": "StateId",
520
+ "name": "",
521
+ "type": "uint8"
522
+ }
523
+ ],
524
+ "stateMutability": "view",
525
+ "type": "function"
526
+ },
381
527
  {
382
528
  "inputs": [],
383
529
  "name": "getNftId",
384
530
  "outputs": [
385
531
  {
386
- "internalType": "uint256",
532
+ "internalType": "NftId",
387
533
  "name": "nftId",
388
- "type": "uint256"
534
+ "type": "uint96"
389
535
  }
390
536
  ],
391
537
  "stateMutability": "view",
@@ -409,9 +555,9 @@
409
555
  "name": "getParentNftId",
410
556
  "outputs": [
411
557
  {
412
- "internalType": "uint256",
558
+ "internalType": "NftId",
413
559
  "name": "parentNftId",
414
- "type": "uint256"
560
+ "type": "uint96"
415
561
  }
416
562
  ],
417
563
  "stateMutability": "view",
@@ -420,9 +566,9 @@
420
566
  {
421
567
  "inputs": [
422
568
  {
423
- "internalType": "uint256",
569
+ "internalType": "NftId",
424
570
  "name": "nftId",
425
- "type": "uint256"
571
+ "type": "uint96"
426
572
  }
427
573
  ],
428
574
  "name": "getPolicyInfo",
@@ -430,12 +576,12 @@
430
576
  {
431
577
  "components": [
432
578
  {
433
- "internalType": "uint256",
579
+ "internalType": "NftId",
434
580
  "name": "nftId",
435
- "type": "uint256"
581
+ "type": "uint96"
436
582
  },
437
583
  {
438
- "internalType": "enum IPolicy.PolicyState",
584
+ "internalType": "StateId",
439
585
  "name": "state",
440
586
  "type": "uint8"
441
587
  },
@@ -449,6 +595,11 @@
449
595
  "name": "premiumAmount",
450
596
  "type": "uint256"
451
597
  },
598
+ {
599
+ "internalType": "uint256",
600
+ "name": "premiumPaidAmount",
601
+ "type": "uint256"
602
+ },
452
603
  {
453
604
  "internalType": "uint256",
454
605
  "name": "lifetime",
@@ -459,6 +610,11 @@
459
610
  "name": "createdAt",
460
611
  "type": "uint256"
461
612
  },
613
+ {
614
+ "internalType": "uint256",
615
+ "name": "updatedAt",
616
+ "type": "uint256"
617
+ },
462
618
  {
463
619
  "internalType": "uint256",
464
620
  "name": "activatedAt",
@@ -486,9 +642,9 @@
486
642
  {
487
643
  "inputs": [
488
644
  {
489
- "internalType": "uint256",
645
+ "internalType": "NftId",
490
646
  "name": "nftId",
491
- "type": "uint256"
647
+ "type": "uint96"
492
648
  }
493
649
  ],
494
650
  "name": "getPoolInfo",
@@ -496,19 +652,9 @@
496
652
  {
497
653
  "components": [
498
654
  {
499
- "internalType": "uint256",
655
+ "internalType": "NftId",
500
656
  "name": "nftId",
501
- "type": "uint256"
502
- },
503
- {
504
- "internalType": "address",
505
- "name": "wallet",
506
- "type": "address"
507
- },
508
- {
509
- "internalType": "address",
510
- "name": "token",
511
- "type": "address"
657
+ "type": "uint96"
512
658
  },
513
659
  {
514
660
  "internalType": "uint256",
@@ -532,17 +678,63 @@
532
678
  {
533
679
  "inputs": [
534
680
  {
535
- "internalType": "uint256",
536
- "name": "productNftId",
537
- "type": "uint256"
681
+ "internalType": "NftId",
682
+ "name": "poolNftId",
683
+ "type": "uint96"
538
684
  }
539
685
  ],
540
- "name": "getPoolNftId",
686
+ "name": "getPoolSetup",
541
687
  "outputs": [
542
688
  {
543
- "internalType": "uint256",
544
- "name": "poolNftId",
545
- "type": "uint256"
689
+ "components": [
690
+ {
691
+ "internalType": "NftId",
692
+ "name": "poolNftId",
693
+ "type": "uint96"
694
+ },
695
+ {
696
+ "internalType": "address",
697
+ "name": "wallet",
698
+ "type": "address"
699
+ },
700
+ {
701
+ "components": [
702
+ {
703
+ "internalType": "UFixed",
704
+ "name": "fractionalFee",
705
+ "type": "uint256"
706
+ },
707
+ {
708
+ "internalType": "uint256",
709
+ "name": "fixedFee",
710
+ "type": "uint256"
711
+ }
712
+ ],
713
+ "internalType": "struct Fee",
714
+ "name": "stakingFee",
715
+ "type": "tuple"
716
+ },
717
+ {
718
+ "components": [
719
+ {
720
+ "internalType": "UFixed",
721
+ "name": "fractionalFee",
722
+ "type": "uint256"
723
+ },
724
+ {
725
+ "internalType": "uint256",
726
+ "name": "fixedFee",
727
+ "type": "uint256"
728
+ }
729
+ ],
730
+ "internalType": "struct Fee",
731
+ "name": "performanceFee",
732
+ "type": "tuple"
733
+ }
734
+ ],
735
+ "internalType": "struct ITreasuryModule.PoolSetup",
736
+ "name": "setup",
737
+ "type": "tuple"
546
738
  }
547
739
  ],
548
740
  "stateMutability": "view",
@@ -562,19 +754,104 @@
562
754
  "type": "function"
563
755
  },
564
756
  {
565
- "inputs": [],
566
- "name": "getRegistry",
567
- "outputs": [
757
+ "inputs": [
568
758
  {
569
- "internalType": "contract IRegistry",
570
- "name": "registry",
571
- "type": "address"
759
+ "internalType": "NftId",
760
+ "name": "productNftId",
761
+ "type": "uint96"
572
762
  }
573
763
  ],
574
- "stateMutability": "view",
575
- "type": "function"
576
- },
577
- {
764
+ "name": "getProductSetup",
765
+ "outputs": [
766
+ {
767
+ "components": [
768
+ {
769
+ "internalType": "NftId",
770
+ "name": "productNftId",
771
+ "type": "uint96"
772
+ },
773
+ {
774
+ "internalType": "NftId",
775
+ "name": "distributorNftId",
776
+ "type": "uint96"
777
+ },
778
+ {
779
+ "internalType": "NftId",
780
+ "name": "poolNftId",
781
+ "type": "uint96"
782
+ },
783
+ {
784
+ "internalType": "contract IERC20",
785
+ "name": "token",
786
+ "type": "address"
787
+ },
788
+ {
789
+ "internalType": "contract TokenHandler",
790
+ "name": "tokenHandler",
791
+ "type": "address"
792
+ },
793
+ {
794
+ "internalType": "address",
795
+ "name": "wallet",
796
+ "type": "address"
797
+ },
798
+ {
799
+ "components": [
800
+ {
801
+ "internalType": "UFixed",
802
+ "name": "fractionalFee",
803
+ "type": "uint256"
804
+ },
805
+ {
806
+ "internalType": "uint256",
807
+ "name": "fixedFee",
808
+ "type": "uint256"
809
+ }
810
+ ],
811
+ "internalType": "struct Fee",
812
+ "name": "policyFee",
813
+ "type": "tuple"
814
+ },
815
+ {
816
+ "components": [
817
+ {
818
+ "internalType": "UFixed",
819
+ "name": "fractionalFee",
820
+ "type": "uint256"
821
+ },
822
+ {
823
+ "internalType": "uint256",
824
+ "name": "fixedFee",
825
+ "type": "uint256"
826
+ }
827
+ ],
828
+ "internalType": "struct Fee",
829
+ "name": "processingFee",
830
+ "type": "tuple"
831
+ }
832
+ ],
833
+ "internalType": "struct ITreasuryModule.ProductSetup",
834
+ "name": "setup",
835
+ "type": "tuple"
836
+ }
837
+ ],
838
+ "stateMutability": "view",
839
+ "type": "function"
840
+ },
841
+ {
842
+ "inputs": [],
843
+ "name": "getRegistry",
844
+ "outputs": [
845
+ {
846
+ "internalType": "contract IRegistry",
847
+ "name": "registry",
848
+ "type": "address"
849
+ }
850
+ ],
851
+ "stateMutability": "view",
852
+ "type": "function"
853
+ },
854
+ {
578
855
  "inputs": [
579
856
  {
580
857
  "internalType": "uint256",
@@ -704,14 +981,33 @@
704
981
  "stateMutability": "view",
705
982
  "type": "function"
706
983
  },
984
+ {
985
+ "inputs": [
986
+ {
987
+ "internalType": "NftId",
988
+ "name": "productNftId",
989
+ "type": "uint96"
990
+ }
991
+ ],
992
+ "name": "getTokenHandler",
993
+ "outputs": [
994
+ {
995
+ "internalType": "contract TokenHandler",
996
+ "name": "tokenHandler",
997
+ "type": "address"
998
+ }
999
+ ],
1000
+ "stateMutability": "view",
1001
+ "type": "function"
1002
+ },
707
1003
  {
708
1004
  "inputs": [],
709
1005
  "name": "getType",
710
1006
  "outputs": [
711
1007
  {
712
- "internalType": "uint256",
1008
+ "internalType": "ObjectType",
713
1009
  "name": "objectType",
714
- "type": "uint256"
1010
+ "type": "uint8"
715
1011
  }
716
1012
  ],
717
1013
  "stateMutability": "view",
@@ -785,14 +1081,74 @@
785
1081
  "stateMutability": "view",
786
1082
  "type": "function"
787
1083
  },
1084
+ {
1085
+ "inputs": [
1086
+ {
1087
+ "internalType": "ObjectType",
1088
+ "name": "objectType",
1089
+ "type": "uint8"
1090
+ },
1091
+ {
1092
+ "internalType": "StateId",
1093
+ "name": "fromId",
1094
+ "type": "uint8"
1095
+ },
1096
+ {
1097
+ "internalType": "StateId",
1098
+ "name": "toId",
1099
+ "type": "uint8"
1100
+ }
1101
+ ],
1102
+ "name": "isValidTransition",
1103
+ "outputs": [
1104
+ {
1105
+ "internalType": "bool",
1106
+ "name": "",
1107
+ "type": "bool"
1108
+ }
1109
+ ],
1110
+ "stateMutability": "view",
1111
+ "type": "function"
1112
+ },
1113
+ {
1114
+ "inputs": [
1115
+ {
1116
+ "internalType": "NftId",
1117
+ "name": "nftId",
1118
+ "type": "uint96"
1119
+ }
1120
+ ],
1121
+ "name": "processPremium",
1122
+ "outputs": [],
1123
+ "stateMutability": "nonpayable",
1124
+ "type": "function"
1125
+ },
1126
+ {
1127
+ "inputs": [
1128
+ {
1129
+ "internalType": "NftId",
1130
+ "name": "policyNftId",
1131
+ "type": "uint96"
1132
+ },
1133
+ {
1134
+ "internalType": "NftId",
1135
+ "name": "productNftId",
1136
+ "type": "uint96"
1137
+ }
1138
+ ],
1139
+ "name": "processPremium",
1140
+ "outputs": [],
1141
+ "stateMutability": "nonpayable",
1142
+ "type": "function"
1143
+ },
788
1144
  {
789
1145
  "inputs": [],
790
1146
  "name": "register",
791
1147
  "outputs": [
792
1148
  {
793
- "internalType": "uint256",
1149
+ "internalType": "NftId",
794
1150
  "name": "nftId",
795
- "type": "uint256"
1151
+ "type": "uint96"
796
1152
  }
797
1153
  ],
798
1154
  "stateMutability": "nonpayable",
@@ -809,11 +1165,143 @@
809
1165
  "name": "registerComponent",
810
1166
  "outputs": [
811
1167
  {
812
- "internalType": "uint256",
813
- "name": "nftInfo",
814
- "type": "uint256"
1168
+ "internalType": "NftId",
1169
+ "name": "nftId",
1170
+ "type": "uint96"
1171
+ }
1172
+ ],
1173
+ "stateMutability": "nonpayable",
1174
+ "type": "function"
1175
+ },
1176
+ {
1177
+ "inputs": [
1178
+ {
1179
+ "internalType": "NftId",
1180
+ "name": "nftId",
1181
+ "type": "uint96"
815
1182
  }
816
1183
  ],
1184
+ "name": "registerPool",
1185
+ "outputs": [],
1186
+ "stateMutability": "nonpayable",
1187
+ "type": "function"
1188
+ },
1189
+ {
1190
+ "inputs": [
1191
+ {
1192
+ "internalType": "NftId",
1193
+ "name": "poolNftId",
1194
+ "type": "uint96"
1195
+ },
1196
+ {
1197
+ "internalType": "address",
1198
+ "name": "wallet",
1199
+ "type": "address"
1200
+ },
1201
+ {
1202
+ "components": [
1203
+ {
1204
+ "internalType": "UFixed",
1205
+ "name": "fractionalFee",
1206
+ "type": "uint256"
1207
+ },
1208
+ {
1209
+ "internalType": "uint256",
1210
+ "name": "fixedFee",
1211
+ "type": "uint256"
1212
+ }
1213
+ ],
1214
+ "internalType": "struct Fee",
1215
+ "name": "stakingFee",
1216
+ "type": "tuple"
1217
+ },
1218
+ {
1219
+ "components": [
1220
+ {
1221
+ "internalType": "UFixed",
1222
+ "name": "fractionalFee",
1223
+ "type": "uint256"
1224
+ },
1225
+ {
1226
+ "internalType": "uint256",
1227
+ "name": "fixedFee",
1228
+ "type": "uint256"
1229
+ }
1230
+ ],
1231
+ "internalType": "struct Fee",
1232
+ "name": "performanceFee",
1233
+ "type": "tuple"
1234
+ }
1235
+ ],
1236
+ "name": "registerPool",
1237
+ "outputs": [],
1238
+ "stateMutability": "nonpayable",
1239
+ "type": "function"
1240
+ },
1241
+ {
1242
+ "inputs": [
1243
+ {
1244
+ "internalType": "NftId",
1245
+ "name": "productNftId",
1246
+ "type": "uint96"
1247
+ },
1248
+ {
1249
+ "internalType": "NftId",
1250
+ "name": "distributorNftId",
1251
+ "type": "uint96"
1252
+ },
1253
+ {
1254
+ "internalType": "NftId",
1255
+ "name": "poolNftId",
1256
+ "type": "uint96"
1257
+ },
1258
+ {
1259
+ "internalType": "contract IERC20",
1260
+ "name": "token",
1261
+ "type": "address"
1262
+ },
1263
+ {
1264
+ "internalType": "address",
1265
+ "name": "wallet",
1266
+ "type": "address"
1267
+ },
1268
+ {
1269
+ "components": [
1270
+ {
1271
+ "internalType": "UFixed",
1272
+ "name": "fractionalFee",
1273
+ "type": "uint256"
1274
+ },
1275
+ {
1276
+ "internalType": "uint256",
1277
+ "name": "fixedFee",
1278
+ "type": "uint256"
1279
+ }
1280
+ ],
1281
+ "internalType": "struct Fee",
1282
+ "name": "policyFee",
1283
+ "type": "tuple"
1284
+ },
1285
+ {
1286
+ "components": [
1287
+ {
1288
+ "internalType": "UFixed",
1289
+ "name": "fractionalFee",
1290
+ "type": "uint256"
1291
+ },
1292
+ {
1293
+ "internalType": "uint256",
1294
+ "name": "fixedFee",
1295
+ "type": "uint256"
1296
+ }
1297
+ ],
1298
+ "internalType": "struct Fee",
1299
+ "name": "processingFee",
1300
+ "type": "tuple"
1301
+ }
1302
+ ],
1303
+ "name": "registerProduct",
1304
+ "outputs": [],
817
1305
  "stateMutability": "nonpayable",
818
1306
  "type": "function"
819
1307
  },
@@ -840,14 +1328,19 @@
840
1328
  {
841
1329
  "components": [
842
1330
  {
843
- "internalType": "uint256",
1331
+ "internalType": "NftId",
844
1332
  "name": "nftId",
845
- "type": "uint256"
1333
+ "type": "uint96"
846
1334
  },
847
1335
  {
848
- "internalType": "enum IComponent.CState",
1336
+ "internalType": "StateId",
849
1337
  "name": "state",
850
1338
  "type": "uint8"
1339
+ },
1340
+ {
1341
+ "internalType": "contract IERC20Metadata",
1342
+ "name": "token",
1343
+ "type": "address"
851
1344
  }
852
1345
  ],
853
1346
  "internalType": "struct IComponent.ComponentInfo",
@@ -858,9 +1351,9 @@
858
1351
  "name": "setComponentInfo",
859
1352
  "outputs": [
860
1353
  {
861
- "internalType": "uint256",
862
- "name": "componentId",
863
- "type": "uint256"
1354
+ "internalType": "NftId",
1355
+ "name": "componentNftId",
1356
+ "type": "uint96"
864
1357
  }
865
1358
  ],
866
1359
  "stateMutability": "nonpayable",
@@ -869,14 +1362,108 @@
869
1362
  {
870
1363
  "inputs": [
871
1364
  {
872
- "internalType": "uint256",
1365
+ "internalType": "NftId",
873
1366
  "name": "poolNftId",
874
- "type": "uint256"
1367
+ "type": "uint96"
875
1368
  },
876
1369
  {
877
- "internalType": "uint256",
1370
+ "components": [
1371
+ {
1372
+ "internalType": "UFixed",
1373
+ "name": "fractionalFee",
1374
+ "type": "uint256"
1375
+ },
1376
+ {
1377
+ "internalType": "uint256",
1378
+ "name": "fixedFee",
1379
+ "type": "uint256"
1380
+ }
1381
+ ],
1382
+ "internalType": "struct Fee",
1383
+ "name": "stakingFee",
1384
+ "type": "tuple"
1385
+ },
1386
+ {
1387
+ "components": [
1388
+ {
1389
+ "internalType": "UFixed",
1390
+ "name": "fractionalFee",
1391
+ "type": "uint256"
1392
+ },
1393
+ {
1394
+ "internalType": "uint256",
1395
+ "name": "fixedFee",
1396
+ "type": "uint256"
1397
+ }
1398
+ ],
1399
+ "internalType": "struct Fee",
1400
+ "name": "performanceFee",
1401
+ "type": "tuple"
1402
+ }
1403
+ ],
1404
+ "name": "setPoolFees",
1405
+ "outputs": [],
1406
+ "stateMutability": "nonpayable",
1407
+ "type": "function"
1408
+ },
1409
+ {
1410
+ "inputs": [
1411
+ {
1412
+ "internalType": "NftId",
1413
+ "name": "productNftId",
1414
+ "type": "uint96"
1415
+ },
1416
+ {
1417
+ "components": [
1418
+ {
1419
+ "internalType": "UFixed",
1420
+ "name": "fractionalFee",
1421
+ "type": "uint256"
1422
+ },
1423
+ {
1424
+ "internalType": "uint256",
1425
+ "name": "fixedFee",
1426
+ "type": "uint256"
1427
+ }
1428
+ ],
1429
+ "internalType": "struct Fee",
1430
+ "name": "policyFee",
1431
+ "type": "tuple"
1432
+ },
1433
+ {
1434
+ "components": [
1435
+ {
1436
+ "internalType": "UFixed",
1437
+ "name": "fractionalFee",
1438
+ "type": "uint256"
1439
+ },
1440
+ {
1441
+ "internalType": "uint256",
1442
+ "name": "fixedFee",
1443
+ "type": "uint256"
1444
+ }
1445
+ ],
1446
+ "internalType": "struct Fee",
1447
+ "name": "processingFee",
1448
+ "type": "tuple"
1449
+ }
1450
+ ],
1451
+ "name": "setProductFees",
1452
+ "outputs": [],
1453
+ "stateMutability": "nonpayable",
1454
+ "type": "function"
1455
+ },
1456
+ {
1457
+ "inputs": [
1458
+ {
1459
+ "internalType": "NftId",
878
1460
  "name": "policyNftId",
879
- "type": "uint256"
1461
+ "type": "uint96"
1462
+ },
1463
+ {
1464
+ "internalType": "NftId",
1465
+ "name": "productNftId",
1466
+ "type": "uint96"
880
1467
  }
881
1468
  ],
882
1469
  "name": "underwrite",