@etherisc/gif-next 0.0.2-ebbe63d → 0.0.2-f619be3-760

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. package/README.md +144 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  3. package/artifacts/contracts/components/Component.sol/Component.json +205 -0
  4. package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +4 -0
  5. package/artifacts/contracts/components/Component.sol/InstanceLinked.json +35 -0
  6. package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +4 -0
  7. package/artifacts/contracts/components/IPool.sol/IPoolComponent.json +255 -0
  8. package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +4 -0
  9. package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +74 -0
  10. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +4 -0
  11. package/artifacts/contracts/components/Pool.sol/Pool.json +328 -0
  12. package/artifacts/contracts/components/Product.sol/Product.dbg.json +4 -0
  13. package/artifacts/contracts/components/Product.sol/Product.json +346 -0
  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 +4 -0
  19. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +128 -0
  20. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +4 -0
  21. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +42 -0
  22. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +4 -0
  23. package/artifacts/contracts/experiment/inheritance/B.sol/B.json +76 -0
  24. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +4 -0
  25. package/artifacts/contracts/experiment/inheritance/C.sol/C.json +89 -0
  26. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +4 -0
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +128 -0
  28. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +4 -0
  29. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +37 -0
  30. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +4 -0
  31. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +50 -0
  32. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +4 -0
  33. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +63 -0
  34. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +4 -0
  35. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +59 -0
  36. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +4 -0
  37. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +124 -0
  38. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +4 -0
  39. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +74 -0
  40. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +4 -0
  41. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +124 -0
  42. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +4 -0
  43. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +207 -0
  44. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +4 -0
  45. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +10 -0
  46. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +4 -0
  47. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +10 -0
  48. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +4 -0
  49. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1479 -0
  50. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +4 -0
  51. package/artifacts/contracts/instance/Instance.sol/Instance.json +1725 -0
  52. package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +4 -0
  53. package/artifacts/contracts/instance/access/Access.sol/AccessModule.json +400 -0
  54. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +4 -0
  55. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.json +10 -0
  56. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +4 -0
  57. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.json +35 -0
  58. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +4 -0
  59. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.json +50 -0
  60. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +4 -0
  61. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.json +336 -0
  62. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +4 -0
  63. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.json +299 -0
  64. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +4 -0
  65. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +202 -0
  66. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +4 -0
  67. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.json +10 -0
  68. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +4 -0
  69. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.json +205 -0
  70. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +4 -0
  71. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +217 -0
  72. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +4 -0
  73. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +141 -0
  74. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +4 -0
  75. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.json +24 -0
  76. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  77. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.json +134 -0
  78. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +4 -0
  79. package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.json +182 -0
  80. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +4 -0
  81. package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.json +221 -0
  82. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +4 -0
  83. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.json +10 -0
  84. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +4 -0
  85. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.json +254 -0
  86. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +4 -0
  87. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +254 -0
  88. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +4 -0
  89. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.json +10 -0
  90. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +4 -0
  91. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.json +129 -0
  92. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +4 -0
  93. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.json +155 -0
  94. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +4 -0
  95. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.json +75 -0
  96. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +4 -0
  97. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.json +127 -0
  98. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +4 -0
  99. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.json +75 -0
  100. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +4 -0
  101. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +196 -0
  102. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.dbg.json +4 -0
  103. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.json +10 -0
  104. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.dbg.json +4 -0
  105. package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.json +490 -0
  106. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  107. package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.json +45 -0
  108. package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +4 -0
  109. package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.json +490 -0
  110. package/artifacts/contracts/mock/Dip.sol/DIP.dbg.json +4 -0
  111. package/artifacts/contracts/mock/Dip.sol/DIP.json +338 -0
  112. package/artifacts/contracts/mock/TestPool.sol/TestPool.dbg.json +4 -0
  113. package/artifacts/contracts/mock/TestPool.sol/TestPool.json +294 -0
  114. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.dbg.json +4 -0
  115. package/artifacts/contracts/mock/TestProduct.sol/TestProduct.json +384 -0
  116. package/artifacts/contracts/mock/Usdc.sol/USDC.dbg.json +4 -0
  117. package/artifacts/contracts/mock/Usdc.sol/USDC.json +338 -0
  118. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
  119. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +534 -0
  120. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +4 -0
  121. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +452 -0
  122. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +4 -0
  123. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.json +24 -0
  124. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +4 -0
  125. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +166 -0
  126. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
  127. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +188 -0
  128. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +4 -0
  129. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +49 -0
  130. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +4 -0
  131. package/artifacts/contracts/registry/Registry.sol/Registerable.json +166 -0
  132. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
  133. package/artifacts/contracts/registry/Registry.sol/Registry.json +256 -0
  134. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +4 -0
  135. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +60 -0
  136. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  137. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
  138. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +4 -0
  139. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +10 -0
  140. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +4 -0
  141. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +92 -0
  142. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  143. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
  144. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
  145. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
  146. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
  147. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +174 -0
  148. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +4 -0
  149. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +479 -0
  150. package/contracts/components/Component.sol +77 -0
  151. package/contracts/components/IPool.sol +15 -0
  152. package/contracts/components/IProduct.sol +16 -0
  153. package/contracts/components/Pool.sol +52 -0
  154. package/contracts/components/Product.sol +89 -0
  155. package/contracts/experiment/errors/Require.sol +38 -0
  156. package/contracts/experiment/errors/Revert.sol +44 -0
  157. package/contracts/experiment/inheritance/A.sol +53 -0
  158. package/contracts/experiment/inheritance/B.sol +28 -0
  159. package/contracts/experiment/inheritance/C.sol +34 -0
  160. package/contracts/experiment/inheritance/IA.sol +13 -0
  161. package/contracts/experiment/inheritance/IB.sol +10 -0
  162. package/contracts/experiment/inheritance/IC.sol +12 -0
  163. package/contracts/experiment/statemachine/Dummy.sol +27 -0
  164. package/contracts/experiment/statemachine/ISM.sol +25 -0
  165. package/contracts/experiment/statemachine/README.md +112 -0
  166. package/contracts/experiment/statemachine/SM.sol +57 -0
  167. package/contracts/experiment/statemachine/SimpleStateMachine.sol +31 -0
  168. package/contracts/experiment/types/TypeA.sol +47 -0
  169. package/contracts/experiment/types/TypeB.sol +29 -0
  170. package/contracts/instance/IInstance.sol +25 -0
  171. package/contracts/instance/Instance.sol +72 -0
  172. package/contracts/instance/access/Access.sol +165 -0
  173. package/contracts/instance/access/IAccess.sol +63 -0
  174. package/contracts/instance/component/ComponentModule.sol +274 -0
  175. package/contracts/instance/component/IComponent.sol +74 -0
  176. package/contracts/instance/lifecycle/ILifecycle.sol +47 -0
  177. package/contracts/instance/lifecycle/LifecycleModule.sol +88 -0
  178. package/contracts/instance/policy/IPolicy.sol +50 -0
  179. package/contracts/instance/policy/PolicyModule.sol +114 -0
  180. package/contracts/instance/pool/IPoolModule.sol +23 -0
  181. package/contracts/instance/pool/PoolModule.sol +81 -0
  182. package/contracts/instance/product/IProductService.sol +36 -0
  183. package/contracts/instance/product/ProductService.sol +136 -0
  184. package/contracts/instance/treasury/ITreasury.sol +91 -0
  185. package/contracts/instance/treasury/TokenHandler.sol +24 -0
  186. package/contracts/instance/treasury/TreasuryModule.sol +168 -0
  187. package/contracts/mock/TestPool.sol +16 -0
  188. package/contracts/mock/TestProduct.sol +39 -0
  189. package/contracts/mock/Usdc.sol +26 -0
  190. package/contracts/registry/ChainNft.sol +135 -0
  191. package/contracts/registry/IChainNft.sol +21 -0
  192. package/contracts/registry/IRegistry.sol +67 -0
  193. package/contracts/registry/Registry.sol +182 -0
  194. package/contracts/types/Blocknumber.sol +118 -0
  195. package/contracts/types/ChainId.sol +38 -0
  196. package/contracts/types/Fee.sol +32 -0
  197. package/contracts/types/NftId.sol +51 -0
  198. package/contracts/types/ObjectType.sol +107 -0
  199. package/contracts/types/StateId.sol +91 -0
  200. package/contracts/types/Timestamp.sol +102 -0
  201. package/contracts/types/UFixed.sol +210 -0
  202. package/package.json +19 -9
  203. package/artifacts/contracts/Dip.sol/DIP.dbg.json +0 -4
  204. package/artifacts/contracts/Dip.sol/DIP.json +0 -338
  205. package/artifacts/contracts/Lock.sol/Lock.dbg.json +0 -4
  206. package/artifacts/contracts/Lock.sol/Lock.json +0 -74
  207. package/contracts/Lock.sol +0 -34
  208. /package/contracts/{Dip.sol → mock/Dip.sol} +0 -0
@@ -0,0 +1,479 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "UFixedMathLib",
4
+ "sourceName": "contracts/types/UFixed.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "EXP",
9
+ "outputs": [
10
+ {
11
+ "internalType": "int8",
12
+ "name": "",
13
+ "type": "int8"
14
+ }
15
+ ],
16
+ "stateMutability": "view",
17
+ "type": "function"
18
+ },
19
+ {
20
+ "inputs": [],
21
+ "name": "MULTIPLIER",
22
+ "outputs": [
23
+ {
24
+ "internalType": "uint256",
25
+ "name": "",
26
+ "type": "uint256"
27
+ }
28
+ ],
29
+ "stateMutability": "view",
30
+ "type": "function"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "MULTIPLIER_HALF",
35
+ "outputs": [
36
+ {
37
+ "internalType": "uint256",
38
+ "name": "",
39
+ "type": "uint256"
40
+ }
41
+ ],
42
+ "stateMutability": "view",
43
+ "type": "function"
44
+ },
45
+ {
46
+ "inputs": [],
47
+ "name": "ROUNDING_DOWN",
48
+ "outputs": [
49
+ {
50
+ "internalType": "uint8",
51
+ "name": "",
52
+ "type": "uint8"
53
+ }
54
+ ],
55
+ "stateMutability": "pure",
56
+ "type": "function"
57
+ },
58
+ {
59
+ "inputs": [],
60
+ "name": "ROUNDING_HALF_UP",
61
+ "outputs": [
62
+ {
63
+ "internalType": "uint8",
64
+ "name": "",
65
+ "type": "uint8"
66
+ }
67
+ ],
68
+ "stateMutability": "pure",
69
+ "type": "function"
70
+ },
71
+ {
72
+ "inputs": [],
73
+ "name": "ROUNDING_UP",
74
+ "outputs": [
75
+ {
76
+ "internalType": "uint8",
77
+ "name": "",
78
+ "type": "uint8"
79
+ }
80
+ ],
81
+ "stateMutability": "pure",
82
+ "type": "function"
83
+ },
84
+ {
85
+ "inputs": [
86
+ {
87
+ "internalType": "UFixed",
88
+ "name": "a",
89
+ "type": "uint256"
90
+ },
91
+ {
92
+ "internalType": "UFixed",
93
+ "name": "b",
94
+ "type": "uint256"
95
+ }
96
+ ],
97
+ "name": "add",
98
+ "outputs": [
99
+ {
100
+ "internalType": "UFixed",
101
+ "name": "",
102
+ "type": "uint256"
103
+ }
104
+ ],
105
+ "stateMutability": "pure",
106
+ "type": "function"
107
+ },
108
+ {
109
+ "inputs": [],
110
+ "name": "decimals",
111
+ "outputs": [
112
+ {
113
+ "internalType": "uint256",
114
+ "name": "",
115
+ "type": "uint256"
116
+ }
117
+ ],
118
+ "stateMutability": "pure",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [
123
+ {
124
+ "internalType": "UFixed",
125
+ "name": "a",
126
+ "type": "uint256"
127
+ },
128
+ {
129
+ "internalType": "UFixed",
130
+ "name": "b",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "name": "delta",
135
+ "outputs": [
136
+ {
137
+ "internalType": "UFixed",
138
+ "name": "",
139
+ "type": "uint256"
140
+ }
141
+ ],
142
+ "stateMutability": "pure",
143
+ "type": "function"
144
+ },
145
+ {
146
+ "inputs": [
147
+ {
148
+ "internalType": "UFixed",
149
+ "name": "a",
150
+ "type": "uint256"
151
+ },
152
+ {
153
+ "internalType": "UFixed",
154
+ "name": "b",
155
+ "type": "uint256"
156
+ }
157
+ ],
158
+ "name": "div",
159
+ "outputs": [
160
+ {
161
+ "internalType": "UFixed",
162
+ "name": "",
163
+ "type": "uint256"
164
+ }
165
+ ],
166
+ "stateMutability": "pure",
167
+ "type": "function"
168
+ },
169
+ {
170
+ "inputs": [
171
+ {
172
+ "internalType": "UFixed",
173
+ "name": "a",
174
+ "type": "uint256"
175
+ },
176
+ {
177
+ "internalType": "UFixed",
178
+ "name": "b",
179
+ "type": "uint256"
180
+ }
181
+ ],
182
+ "name": "eq",
183
+ "outputs": [
184
+ {
185
+ "internalType": "bool",
186
+ "name": "isEqual",
187
+ "type": "bool"
188
+ }
189
+ ],
190
+ "stateMutability": "pure",
191
+ "type": "function"
192
+ },
193
+ {
194
+ "inputs": [
195
+ {
196
+ "internalType": "UFixed",
197
+ "name": "a",
198
+ "type": "uint256"
199
+ }
200
+ ],
201
+ "name": "eqz",
202
+ "outputs": [
203
+ {
204
+ "internalType": "bool",
205
+ "name": "isZero",
206
+ "type": "bool"
207
+ }
208
+ ],
209
+ "stateMutability": "pure",
210
+ "type": "function"
211
+ },
212
+ {
213
+ "inputs": [
214
+ {
215
+ "internalType": "UFixed",
216
+ "name": "a",
217
+ "type": "uint256"
218
+ },
219
+ {
220
+ "internalType": "uint8",
221
+ "name": "rounding",
222
+ "type": "uint8"
223
+ }
224
+ ],
225
+ "name": "ftoi",
226
+ "outputs": [
227
+ {
228
+ "internalType": "uint256",
229
+ "name": "",
230
+ "type": "uint256"
231
+ }
232
+ ],
233
+ "stateMutability": "pure",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [
238
+ {
239
+ "internalType": "UFixed",
240
+ "name": "a",
241
+ "type": "uint256"
242
+ }
243
+ ],
244
+ "name": "ftoi",
245
+ "outputs": [
246
+ {
247
+ "internalType": "uint256",
248
+ "name": "",
249
+ "type": "uint256"
250
+ }
251
+ ],
252
+ "stateMutability": "pure",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "inputs": [
257
+ {
258
+ "internalType": "UFixed",
259
+ "name": "a",
260
+ "type": "uint256"
261
+ },
262
+ {
263
+ "internalType": "UFixed",
264
+ "name": "b",
265
+ "type": "uint256"
266
+ }
267
+ ],
268
+ "name": "gt",
269
+ "outputs": [
270
+ {
271
+ "internalType": "bool",
272
+ "name": "isGreaterThan",
273
+ "type": "bool"
274
+ }
275
+ ],
276
+ "stateMutability": "pure",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [
281
+ {
282
+ "internalType": "UFixed",
283
+ "name": "a",
284
+ "type": "uint256"
285
+ },
286
+ {
287
+ "internalType": "UFixed",
288
+ "name": "b",
289
+ "type": "uint256"
290
+ }
291
+ ],
292
+ "name": "gte",
293
+ "outputs": [
294
+ {
295
+ "internalType": "bool",
296
+ "name": "isGreaterThan",
297
+ "type": "bool"
298
+ }
299
+ ],
300
+ "stateMutability": "pure",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [
305
+ {
306
+ "internalType": "UFixed",
307
+ "name": "a",
308
+ "type": "uint256"
309
+ }
310
+ ],
311
+ "name": "gtz",
312
+ "outputs": [
313
+ {
314
+ "internalType": "bool",
315
+ "name": "isZero",
316
+ "type": "bool"
317
+ }
318
+ ],
319
+ "stateMutability": "pure",
320
+ "type": "function"
321
+ },
322
+ {
323
+ "inputs": [
324
+ {
325
+ "internalType": "uint256",
326
+ "name": "a",
327
+ "type": "uint256"
328
+ }
329
+ ],
330
+ "name": "itof",
331
+ "outputs": [
332
+ {
333
+ "internalType": "UFixed",
334
+ "name": "",
335
+ "type": "uint256"
336
+ }
337
+ ],
338
+ "stateMutability": "pure",
339
+ "type": "function"
340
+ },
341
+ {
342
+ "inputs": [
343
+ {
344
+ "internalType": "uint256",
345
+ "name": "a",
346
+ "type": "uint256"
347
+ },
348
+ {
349
+ "internalType": "int8",
350
+ "name": "exp",
351
+ "type": "int8"
352
+ }
353
+ ],
354
+ "name": "itof",
355
+ "outputs": [
356
+ {
357
+ "internalType": "UFixed",
358
+ "name": "",
359
+ "type": "uint256"
360
+ }
361
+ ],
362
+ "stateMutability": "pure",
363
+ "type": "function"
364
+ },
365
+ {
366
+ "inputs": [
367
+ {
368
+ "internalType": "UFixed",
369
+ "name": "a",
370
+ "type": "uint256"
371
+ },
372
+ {
373
+ "internalType": "UFixed",
374
+ "name": "b",
375
+ "type": "uint256"
376
+ }
377
+ ],
378
+ "name": "lt",
379
+ "outputs": [
380
+ {
381
+ "internalType": "bool",
382
+ "name": "isGreaterThan",
383
+ "type": "bool"
384
+ }
385
+ ],
386
+ "stateMutability": "pure",
387
+ "type": "function"
388
+ },
389
+ {
390
+ "inputs": [
391
+ {
392
+ "internalType": "UFixed",
393
+ "name": "a",
394
+ "type": "uint256"
395
+ },
396
+ {
397
+ "internalType": "UFixed",
398
+ "name": "b",
399
+ "type": "uint256"
400
+ }
401
+ ],
402
+ "name": "lte",
403
+ "outputs": [
404
+ {
405
+ "internalType": "bool",
406
+ "name": "isGreaterThan",
407
+ "type": "bool"
408
+ }
409
+ ],
410
+ "stateMutability": "pure",
411
+ "type": "function"
412
+ },
413
+ {
414
+ "inputs": [
415
+ {
416
+ "internalType": "UFixed",
417
+ "name": "a",
418
+ "type": "uint256"
419
+ },
420
+ {
421
+ "internalType": "UFixed",
422
+ "name": "b",
423
+ "type": "uint256"
424
+ }
425
+ ],
426
+ "name": "mul",
427
+ "outputs": [
428
+ {
429
+ "internalType": "UFixed",
430
+ "name": "",
431
+ "type": "uint256"
432
+ }
433
+ ],
434
+ "stateMutability": "pure",
435
+ "type": "function"
436
+ },
437
+ {
438
+ "inputs": [
439
+ {
440
+ "internalType": "UFixed",
441
+ "name": "a",
442
+ "type": "uint256"
443
+ },
444
+ {
445
+ "internalType": "UFixed",
446
+ "name": "b",
447
+ "type": "uint256"
448
+ }
449
+ ],
450
+ "name": "sub",
451
+ "outputs": [
452
+ {
453
+ "internalType": "UFixed",
454
+ "name": "",
455
+ "type": "uint256"
456
+ }
457
+ ],
458
+ "stateMutability": "pure",
459
+ "type": "function"
460
+ },
461
+ {
462
+ "inputs": [],
463
+ "name": "zero",
464
+ "outputs": [
465
+ {
466
+ "internalType": "UFixed",
467
+ "name": "",
468
+ "type": "uint256"
469
+ }
470
+ ],
471
+ "stateMutability": "pure",
472
+ "type": "function"
473
+ }
474
+ ],
475
+ "bytecode": "0x610a2d61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c806393aa8725116100cd578063c8a4ac9c11610086578063c8a4ac9c146102af578063cc8b7b73146102c2578063d05b0452146102d5578063dd45daa1146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b806393aa872514610261578063a391c15b14610268578063b47733291461027b578063b67d77c51461028e578063bc1b392d146102a1578063bdbb4630146102a857600080fd5b8063753b14a51161011f578063753b14a5146101ed578063771602f7146102005780637a858b971461021357806389fa8ed7146102265780638f24f6011461023b57806392ae8ce01461024e57600080fd5b8063059f8b1614610167578063118fc88c146101825780631a12cd47146101a557806321e5749b146101c0578063313ce567146101d357806332148d73146101da575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61019561019036600461079a565b610325565b6040519015158152602001610179565b6101ad601281565b60405160009190910b8152602001610179565b6101956101ce36600461079a565b610334565b601261016f565b6101956101e836600461079a565b61033e565b6101956101fb3660046107bc565b610348565b61016f61020e36600461079a565b610351565b6101956102213660046107bc565b61035d565b60025b60405160ff9091168152602001610179565b61016f6102493660046107d5565b610367565b61016f61025c3660046107bc565b6103e9565b6000610229565b61016f61027636600461079a565b610401565b61019561028936600461079a565b61040d565b61016f61029c36600461079a565b610418565b600061016f565b6001610229565b61016f6102bd36600461079a565b610424565b61016f6102d036600461079a565b610430565b61016f6102e33660046107bc565b61043c565b61016f6102f636600461080b565b610449565b61019561030936600461079a565b61052b565b61016f610536565b6103226012600a610930565b81565b60008282115b90505b92915050565b600082821061032b565b600081831461032b565b6000811561032e565b600061032b838361054e565b600081151561032e565b600060011960ff8316016103b6576103af60026103866012600a610930565b6103909190610952565b61039a9085610974565b60016103a86012600a610930565b600061055a565b905061032e565b60ff82166103d0576103af8360016103a86012600a610930565b6103af8360016103e26012600a610930565b600161055a565b60006103f76012600a610930565b61032e9083610987565b600061032b83836105b7565b60008282111561032b565b600061032b838361061b565b600061032b8383610677565b600061032b838361068c565b600061032e826002610367565b60008061045783601261099e565b60000b12156104ad5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b60406104ba83601261099e565b60000b131561050b5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c415247450060448201526064016104a4565b61051682601261099e565b61052190600a6109bf565b61032b9084610987565b60008282101561032b565b60026105446012600a610930565b6103229190610952565b600061032b8284610974565b6000806105688686866106aa565b9050600183600281111561057e5761057e6109ce565b14801561059b5750600084806105965761059661093c565b868809115b156105ae576105ab600182610974565b90505b95945050505050565b60008082116106085760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f00000000000060448201526064016104a4565b61032b83670de0b6b3a7640000846106aa565b60008282111561066d5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c5400000060448201526064016104a4565b61032b82846109e4565b600061032b8383670de0b6b3a76400006106aa565b6000828210156106a0576103af838361061b565b61032b828461061b565b60008080600019858709858702925082811083820303915050806000036106e4578382816106da576106da61093c565b0492505050610793565b80841161072b5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016104a4565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107ad57600080fd5b50508035926020909101359150565b6000602082840312156107ce57600080fd5b5035919050565b600080604083850312156107e857600080fd5b82359150602083013560ff8116811461080057600080fd5b809150509250929050565b6000806040838503121561081e57600080fd5b8235915060208301358060000b811461080057600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088757816000190482111561086d5761086d610836565b8085161561087a57918102915b93841c9390800290610851565b509250929050565b60008261089e5750600161032e565b816108ab5750600061032e565b81600181146108c157600281146108cb576108e7565b600191505061032e565b60ff8411156108dc576108dc610836565b50506001821b61032e565b5060208310610133831016604e8410600b841016171561090a575081810a61032e565b610914838361084c565b806000190482111561092857610928610836565b029392505050565b600061032b838361088f565b634e487b7160e01b600052601260045260246000fd5b60008261096f57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561032e5761032e610836565b808202811582820484141761032e5761032e610836565b600081810b9083900b01607f8113607f198212171561032e5761032e610836565b600061032b60ff84168361088f565b634e487b7160e01b600052602160045260246000fd5b8181038181111561032e5761032e61083656fea2646970667358221220a5d86e098c418522257789f942a85f958c24134c3527e49c06970e7022704f0964736f6c63430008140033",
476
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106101625760003560e01c806393aa8725116100cd578063c8a4ac9c11610086578063c8a4ac9c146102af578063cc8b7b73146102c2578063d05b0452146102d5578063dd45daa1146102e8578063ea6515c4146102fb578063eb646d711461030e57600080fd5b806393aa872514610261578063a391c15b14610268578063b47733291461027b578063b67d77c51461028e578063bc1b392d146102a1578063bdbb4630146102a857600080fd5b8063753b14a51161011f578063753b14a5146101ed578063771602f7146102005780637a858b971461021357806389fa8ed7146102265780638f24f6011461023b57806392ae8ce01461024e57600080fd5b8063059f8b1614610167578063118fc88c146101825780631a12cd47146101a557806321e5749b146101c0578063313ce567146101d357806332148d73146101da575b600080fd5b61016f610316565b6040519081526020015b60405180910390f35b61019561019036600461079a565b610325565b6040519015158152602001610179565b6101ad601281565b60405160009190910b8152602001610179565b6101956101ce36600461079a565b610334565b601261016f565b6101956101e836600461079a565b61033e565b6101956101fb3660046107bc565b610348565b61016f61020e36600461079a565b610351565b6101956102213660046107bc565b61035d565b60025b60405160ff9091168152602001610179565b61016f6102493660046107d5565b610367565b61016f61025c3660046107bc565b6103e9565b6000610229565b61016f61027636600461079a565b610401565b61019561028936600461079a565b61040d565b61016f61029c36600461079a565b610418565b600061016f565b6001610229565b61016f6102bd36600461079a565b610424565b61016f6102d036600461079a565b610430565b61016f6102e33660046107bc565b61043c565b61016f6102f636600461080b565b610449565b61019561030936600461079a565b61052b565b61016f610536565b6103226012600a610930565b81565b60008282115b90505b92915050565b600082821061032b565b600081831461032b565b6000811561032e565b600061032b838361054e565b600081151561032e565b600060011960ff8316016103b6576103af60026103866012600a610930565b6103909190610952565b61039a9085610974565b60016103a86012600a610930565b600061055a565b905061032e565b60ff82166103d0576103af8360016103a86012600a610930565b6103af8360016103e26012600a610930565b600161055a565b60006103f76012600a610930565b61032e9083610987565b600061032b83836105b7565b60008282111561032b565b600061032b838361061b565b600061032b8383610677565b600061032b838361068c565b600061032e826002610367565b60008061045783601261099e565b60000b12156104ad5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031303a4558504f4e454e545f544f4f5f534d414c4c0060448201526064015b60405180910390fd5b60406104ba83601261099e565b60000b131561050b5760405162461bcd60e51b815260206004820152601f60248201527f4552524f523a464d2d3031313a4558504f4e454e545f544f4f5f4c415247450060448201526064016104a4565b61051682601261099e565b61052190600a6109bf565b61032b9084610987565b60008282101561032b565b60026105446012600a610930565b6103229190610952565b600061032b8284610974565b6000806105688686866106aa565b9050600183600281111561057e5761057e6109ce565b14801561059b5750600084806105965761059661093c565b868809115b156105ae576105ab600182610974565b90505b95945050505050565b60008082116106085760405162461bcd60e51b815260206004820152601a60248201527f4552524f523a55464d2d3032303a44495649534f525f5a45524f00000000000060448201526064016104a4565b61032b83670de0b6b3a7640000846106aa565b60008282111561066d5760405162461bcd60e51b815260206004820152601d60248201527f4552524f523a55464d2d3031303a4e454741544956455f524553554c5400000060448201526064016104a4565b61032b82846109e4565b600061032b8383670de0b6b3a76400006106aa565b6000828210156106a0576103af838361061b565b61032b828461061b565b60008080600019858709858702925082811083820303915050806000036106e4578382816106da576106da61093c565b0492505050610793565b80841161072b5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b60448201526064016104a4565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b600080604083850312156107ad57600080fd5b50508035926020909101359150565b6000602082840312156107ce57600080fd5b5035919050565b600080604083850312156107e857600080fd5b82359150602083013560ff8116811461080057600080fd5b809150509250929050565b6000806040838503121561081e57600080fd5b8235915060208301358060000b811461080057600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561088757816000190482111561086d5761086d610836565b8085161561087a57918102915b93841c9390800290610851565b509250929050565b60008261089e5750600161032e565b816108ab5750600061032e565b81600181146108c157600281146108cb576108e7565b600191505061032e565b60ff8411156108dc576108dc610836565b50506001821b61032e565b5060208310610133831016604e8410600b841016171561090a575081810a61032e565b610914838361084c565b806000190482111561092857610928610836565b029392505050565b600061032b838361088f565b634e487b7160e01b600052601260045260246000fd5b60008261096f57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561032e5761032e610836565b808202811582820484141761032e5761032e610836565b600081810b9083900b01607f8113607f198212171561032e5761032e610836565b600061032b60ff84168361088f565b634e487b7160e01b600052602160045260246000fd5b8181038181111561032e5761032e61083656fea2646970667358221220a5d86e098c418522257789f942a85f958c24134c3527e49c06970e7022704f0964736f6c63430008140033",
477
+ "linkReferences": {},
478
+ "deployedLinkReferences": {}
479
+ }
@@ -0,0 +1,77 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
6
+ import {IRegistry, IRegisterable, IRegistryLinked} from "../registry/IRegistry.sol";
7
+ import {Registerable} from "../registry/Registry.sol";
8
+ import {IInstance} from "../instance/IInstance.sol";
9
+
10
+ import {IInstanceLinked, IComponent, IComponentContract, IComponentModule, IComponentOwnerService} from "../instance/component/IComponent.sol";
11
+ import {NftId} from "../types/NftId.sol";
12
+
13
+ contract InstanceLinked is IInstanceLinked {
14
+ IInstance internal _instance;
15
+
16
+ constructor(address instance) {
17
+ _instance = IInstance(instance);
18
+ }
19
+
20
+ function getInstance() public view override returns (IInstance instance) {
21
+ return _instance;
22
+ }
23
+ }
24
+
25
+ abstract contract Component is
26
+ Registerable,
27
+ InstanceLinked,
28
+ IComponentContract
29
+ {
30
+ address private _deployer;
31
+ address private _wallet;
32
+ IERC20Metadata private _token;
33
+
34
+ constructor(
35
+ address registry,
36
+ address instance,
37
+ address token
38
+ ) Registerable(registry) InstanceLinked(instance) {
39
+ _wallet = address(this);
40
+ _token = IERC20Metadata(token);
41
+ }
42
+
43
+ // from registerable
44
+ function register() public override returns (NftId componentId) {
45
+ require(msg.sender == getInitialOwner(), "");
46
+ require(
47
+ address(_registry) != address(0),
48
+ "ERROR:PRD-001:REGISTRY_ZERO"
49
+ );
50
+ require(
51
+ _registry.isRegistered(address(_instance)),
52
+ "ERROR:PRD-002:INSTANCE_NOT_REGISTERED"
53
+ );
54
+
55
+ IComponentOwnerService cos = _instance.getComponentOwnerService();
56
+ componentId = cos.register(this);
57
+ }
58
+
59
+ // from registerable
60
+ function getParentNftId() public view override returns (NftId) {
61
+ return getInstance().getNftId();
62
+ }
63
+
64
+ // from component contract
65
+ function getWallet()
66
+ external
67
+ view
68
+ override
69
+ returns (address walletAddress)
70
+ {
71
+ return _wallet;
72
+ }
73
+
74
+ function getToken() external view override returns (IERC20Metadata token) {
75
+ return _token;
76
+ }
77
+ }
@@ -0,0 +1,15 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {Fee} from "../types/Fee.sol";
5
+ import {IComponentContract} from "../instance/component/IComponent.sol";
6
+
7
+ // just marker interface for now
8
+ interface IPoolComponent is IComponentContract {
9
+ function getStakingFee() external view returns (Fee memory stakingFee);
10
+
11
+ function getPerformanceFee()
12
+ external
13
+ view
14
+ returns (Fee memory performanceFee);
15
+ }
@@ -0,0 +1,16 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {NftId} from "../types/NftId.sol";
5
+ import {Fee} from "../types/Fee.sol";
6
+
7
+ interface IProductComponent {
8
+ function getPoolNftId() external view returns (NftId poolNftId);
9
+
10
+ function getPolicyFee() external view returns (Fee memory policyFee);
11
+
12
+ function getProcessingFee()
13
+ external
14
+ view
15
+ returns (Fee memory processingFee);
16
+ }
@@ -0,0 +1,52 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {ObjectType, POOL} from "../types/ObjectType.sol";
5
+ import {Fee} from "../types/Fee.sol";
6
+ import {IPoolComponent} from "./IPool.sol";
7
+ import {Component} from "./Component.sol";
8
+
9
+ contract Pool is Component, IPoolComponent {
10
+ Fee private _stakingFee;
11
+ Fee private _performanceFee;
12
+
13
+ constructor(
14
+ address registry,
15
+ address instance,
16
+ address token,
17
+ Fee memory stakingFee,
18
+ Fee memory performanceFee
19
+ ) Component(registry, instance, token) {
20
+ _stakingFee = stakingFee;
21
+ _performanceFee = performanceFee;
22
+ }
23
+
24
+ // from pool component
25
+ function getStakingFee()
26
+ external
27
+ view
28
+ override
29
+ returns (Fee memory stakingFee)
30
+ {
31
+ return _stakingFee;
32
+ }
33
+
34
+ function getPerformanceFee()
35
+ external
36
+ view
37
+ override
38
+ returns (Fee memory performanceFee)
39
+ {
40
+ return _performanceFee;
41
+ }
42
+
43
+ // from registerable
44
+ function getType() public pure override returns (ObjectType) {
45
+ return POOL();
46
+ }
47
+
48
+ // from registerable
49
+ function getData() external view override returns (bytes memory data) {
50
+ return bytes(abi.encode(getInstance().getNftId()));
51
+ }
52
+ }