@etherisc/gif-next 0.0.2-ebbe63d → 0.0.2-f824182-503

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/README.md +120 -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/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
  111. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +534 -0
  112. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +4 -0
  113. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +452 -0
  114. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +4 -0
  115. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.json +24 -0
  116. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +4 -0
  117. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +166 -0
  118. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
  119. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +188 -0
  120. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +4 -0
  121. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +49 -0
  122. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +4 -0
  123. package/artifacts/contracts/registry/Registry.sol/Registerable.json +166 -0
  124. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
  125. package/artifacts/contracts/registry/Registry.sol/Registry.json +256 -0
  126. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +4 -0
  127. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +60 -0
  128. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  129. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
  130. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +4 -0
  131. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +10 -0
  132. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +4 -0
  133. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +92 -0
  134. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  135. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
  136. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
  137. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
  138. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
  139. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +174 -0
  140. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +4 -0
  141. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +453 -0
  142. package/contracts/components/Component.sol +77 -0
  143. package/contracts/components/IPool.sol +15 -0
  144. package/contracts/components/IProduct.sol +16 -0
  145. package/contracts/components/Pool.sol +52 -0
  146. package/contracts/components/Product.sol +89 -0
  147. package/contracts/experiment/errors/Require.sol +38 -0
  148. package/contracts/experiment/errors/Revert.sol +44 -0
  149. package/contracts/experiment/inheritance/A.sol +53 -0
  150. package/contracts/experiment/inheritance/B.sol +28 -0
  151. package/contracts/experiment/inheritance/C.sol +34 -0
  152. package/contracts/experiment/inheritance/IA.sol +13 -0
  153. package/contracts/experiment/inheritance/IB.sol +10 -0
  154. package/contracts/experiment/inheritance/IC.sol +12 -0
  155. package/contracts/experiment/statemachine/Dummy.sol +27 -0
  156. package/contracts/experiment/statemachine/ISM.sol +25 -0
  157. package/contracts/experiment/statemachine/README.md +112 -0
  158. package/contracts/experiment/statemachine/SM.sol +57 -0
  159. package/contracts/experiment/statemachine/SimpleStateMachine.sol +31 -0
  160. package/contracts/experiment/types/TypeA.sol +47 -0
  161. package/contracts/experiment/types/TypeB.sol +29 -0
  162. package/contracts/instance/IInstance.sol +25 -0
  163. package/contracts/instance/Instance.sol +72 -0
  164. package/contracts/instance/access/Access.sol +165 -0
  165. package/contracts/instance/access/IAccess.sol +63 -0
  166. package/contracts/instance/component/ComponentModule.sol +274 -0
  167. package/contracts/instance/component/IComponent.sol +74 -0
  168. package/contracts/instance/lifecycle/ILifecycle.sol +47 -0
  169. package/contracts/instance/lifecycle/LifecycleModule.sol +88 -0
  170. package/contracts/instance/policy/IPolicy.sol +50 -0
  171. package/contracts/instance/policy/PolicyModule.sol +114 -0
  172. package/contracts/instance/pool/IPoolModule.sol +23 -0
  173. package/contracts/instance/pool/PoolModule.sol +81 -0
  174. package/contracts/instance/product/IProductService.sol +36 -0
  175. package/contracts/instance/product/ProductService.sol +136 -0
  176. package/contracts/instance/treasury/ITreasury.sol +91 -0
  177. package/contracts/instance/treasury/TokenHandler.sol +24 -0
  178. package/contracts/instance/treasury/TreasuryModule.sol +168 -0
  179. package/contracts/registry/ChainNft.sol +135 -0
  180. package/contracts/registry/IChainNft.sol +21 -0
  181. package/contracts/registry/IRegistry.sol +67 -0
  182. package/contracts/registry/Registry.sol +182 -0
  183. package/contracts/types/Blocknumber.sol +118 -0
  184. package/contracts/types/ChainId.sol +38 -0
  185. package/contracts/types/Fee.sol +32 -0
  186. package/contracts/types/NftId.sol +51 -0
  187. package/contracts/types/ObjectType.sol +107 -0
  188. package/contracts/types/StateId.sol +91 -0
  189. package/contracts/types/Timestamp.sol +102 -0
  190. package/contracts/types/UFixed.sol +206 -0
  191. package/package.json +15 -8
  192. package/artifacts/contracts/Dip.sol/DIP.dbg.json +0 -4
  193. package/artifacts/contracts/Dip.sol/DIP.json +0 -338
  194. package/artifacts/contracts/Lock.sol/Lock.dbg.json +0 -4
  195. package/artifacts/contracts/Lock.sol/Lock.json +0 -74
  196. package/contracts/Dip.sol +0 -26
  197. package/contracts/Lock.sol +0 -34
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Hardhat
4
4
 
5
- ### Commands
5
+ ### NPM Commands
6
6
 
7
7
  ```shell
8
8
  npm run build
@@ -13,6 +13,30 @@ npm run test-with-gas
13
13
  npm run coverage
14
14
  ```
15
15
 
16
+ ### Deployment
17
+
18
+ ```
19
+ hh run --network <networkname> scripts/deploy.ts
20
+ ```
21
+
22
+ Networks:
23
+ - hardhat (dynamically created network - https://hardhat.org/hardhat-network/docs/overview)
24
+ - anvil (anvsil chain running in container next when using devcontainer)
25
+ - mumbai (polygon testnet, requires WEB3_INFURA_PROJECT_ID)
26
+ - mainnet (polygon mainnet, requires WEB3_INFURA_PROJECT_ID)
27
+
28
+
29
+ ### Console
30
+
31
+ ```
32
+ hh console --network <networkname>
33
+
34
+ me = hre.ethers.Wallet.fromPhrase('...')
35
+ provider = hre.ethers.provider
36
+ await provider.getBalance(me)
37
+ ```
38
+
39
+
16
40
  ### Documentation
17
41
 
18
42
  https://hardhat.org/hardhat-runner/docs/guides/compile-contracts
@@ -25,9 +49,104 @@ https://hardhat.org/hardhat-runner/docs/guides/compile-contracts
25
49
  forge build
26
50
 
27
51
  forge test
52
+
53
+ # run single test case
54
+ forge test --mt test_decimals
55
+
56
+ # run single test case with substantial logginglogging
57
+ # to include logs as well use -vvvvv
58
+ forge test -vvvv --mt test_decimals
59
+
60
+ # provide gas report for a single test
61
+ forge test --mt test_decimals --gas-report
62
+
63
+ forge coverage
64
+ ```
65
+
66
+ Chisel session
67
+ ```typescript
68
+ import "./contracts/components/Component.sol";
69
+ import "./contracts/components/IPool.sol";
70
+ import "./contracts/components/IProduct.sol";
71
+ import "./contracts/components/Pool.sol";
72
+ import "./contracts/components/Product.sol";
73
+ import "./contracts/instance/access/Access.sol";
74
+ import "./contracts/instance/access/IAccess.sol";
75
+ import "./contracts/instance/component/ComponentModule.sol";
76
+ import "./contracts/instance/component/IComponent.sol";
77
+ import "./contracts/instance/IInstance.sol";
78
+ import "./contracts/instance/policy/IPolicy.sol";
79
+ import "./contracts/instance/policy/PolicyModule.sol";
80
+ import "./contracts/instance/product/IProductService.sol";
81
+ import "./contracts/instance/product/ProductService.sol";
82
+ import "./contracts/registry/IRegistry.sol";
83
+
84
+ import {Instance} from "./contracts/instance/Instance.sol";
85
+ import {Registry} from "./contracts/registry/Registry.sol";
86
+ import {DeployAll} from "./scripts/DeployAll.s.sol";
87
+ import {TestPool} from "./test_forge/mock/TestPool.sol";
88
+ import {TestProduct} from "./test_forge/mock/TestProduct.sol";
89
+
90
+ string memory instanceOwnerName = "instanceOwner";
91
+ address instanceOwner = vm.addr(uint256(keccak256(abi.encodePacked(instanceOwnerName))));
92
+
93
+ string memory productOwnerName = "productOwner";
94
+ address productOwner = vm.addr(uint256(keccak256(abi.encodePacked(productOwnerName))));
95
+
96
+ string memory poolOwnerName = "poolOwner";
97
+ address poolOwner = vm.addr(uint256(keccak256(abi.encodePacked(poolOwnerName))));
98
+
99
+ string memory customerName = "customer";
100
+ address customer = vm.addr(uint256(keccak256(abi.encodePacked(customerName))));
101
+
102
+ DeployAll deployer = new DeployAll();
103
+ (
104
+ Registry registry,
105
+ Instance instance,
106
+ TestProduct product,
107
+ TestPool pool
108
+ ) = deployer.run(
109
+ instanceOwner,
110
+ productOwner,
111
+ poolOwner);
112
+
113
+ ProductService ps = ProductService(address(registry));
114
+
115
+ uint256 bundleNftId = 99;
116
+ uint256 sumInsuredAmount = 1000*10**6;
117
+ uint256 premiumAmount = 110*10**6;
118
+ uint256 lifetime =365*24*3600;
119
+ uint256 policyNftId = ps.createApplicationForBundle(customer, bundleNftId, sumInsuredAmount, premiumAmount, lifetime);
120
+
28
121
  ```
29
122
 
123
+
30
124
  ### Documentation
31
125
 
32
126
  https://book.getfoundry.sh/reference/
33
127
 
128
+ ## Style Guide
129
+
130
+ Solidity code is to be written according to the [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html).
131
+
132
+ Documentation of the code should be written inline using [NatSpec](https://docs.soliditylang.org/en/latest/natspec-format.html).
133
+
134
+ ### Naming conventions
135
+
136
+ Additionally, we use the following naming conventions:
137
+
138
+ - Function arguments and return types: If using custom data types, make the name include the type by appending the Type to the argument name, e.g. `function getInfo(NftId bundleNftId)` instead of `function getInfo(NftId bundleId)`. Background: Custom data types are lost when using the ABI or Typescript binding classes (e.g. instead of `NftID` a `uint96` is used), so the type needs to be included in the name to make it clear what the argument is without having to look at the documentation or checking the solidity source code.
139
+ - When naming a field or an attribute `id` and the context is not clear, call it `nftId` instead so its clear what type if id it is as there will be multiple ids for different kind of objects. Example: if you the function has a bundle nft id and a policy nft id as arguments, call them `bundleNftId` and `policyNftId` instead of `id` and `policyId`. In case of doubt, be a bit more verbose for the sake of clarity.
140
+ - When naming things, remember that the code will likely be used in Javascript/Typescript as well, so avoid names that are reserved in Javascript/Typescript. A list of reserved words in Javascript can be found [here](https://www.w3schools.com/js/js_reserved.asp) and a list of reserved words in Typescript can be found [here](https://www.tektutorialshub.com/typescript/identifiers-keywords-in-typescript/).
141
+
142
+ ### Automatic code formatting
143
+
144
+ We use prettier and the solidity plugin to format the code automatically.
145
+ The plugin is configured to use the style guide mentioned above.
146
+ To execute format checks run `npm run styleCheck`.
147
+ To execute formatting run `npm run styleFix`.
148
+
149
+ ### Linting
150
+
151
+ We use solhint to lint the code.
152
+ To execute linting run `npm run lint`.
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/ddbd31d07c8880f0f0a18b3f2b9bcc56.json"
4
+ }
@@ -0,0 +1,205 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "Component",
4
+ "sourceName": "contracts/components/Component.sol",
5
+ "abi": [
6
+ {
7
+ "anonymous": false,
8
+ "inputs": [
9
+ {
10
+ "indexed": false,
11
+ "internalType": "uint256",
12
+ "name": "idx",
13
+ "type": "uint256"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "internalType": "address",
18
+ "name": "module",
19
+ "type": "address"
20
+ },
21
+ {
22
+ "indexed": false,
23
+ "internalType": "string",
24
+ "name": "comment",
25
+ "type": "string"
26
+ }
27
+ ],
28
+ "name": "LogDebug",
29
+ "type": "event"
30
+ },
31
+ {
32
+ "inputs": [],
33
+ "name": "getData",
34
+ "outputs": [
35
+ {
36
+ "internalType": "bytes",
37
+ "name": "data",
38
+ "type": "bytes"
39
+ }
40
+ ],
41
+ "stateMutability": "view",
42
+ "type": "function"
43
+ },
44
+ {
45
+ "inputs": [],
46
+ "name": "getInitialOwner",
47
+ "outputs": [
48
+ {
49
+ "internalType": "address",
50
+ "name": "deployer",
51
+ "type": "address"
52
+ }
53
+ ],
54
+ "stateMutability": "view",
55
+ "type": "function"
56
+ },
57
+ {
58
+ "inputs": [],
59
+ "name": "getInstance",
60
+ "outputs": [
61
+ {
62
+ "internalType": "contract IInstance",
63
+ "name": "instance",
64
+ "type": "address"
65
+ }
66
+ ],
67
+ "stateMutability": "view",
68
+ "type": "function"
69
+ },
70
+ {
71
+ "inputs": [],
72
+ "name": "getNftId",
73
+ "outputs": [
74
+ {
75
+ "internalType": "NftId",
76
+ "name": "nftId",
77
+ "type": "uint96"
78
+ }
79
+ ],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
83
+ {
84
+ "inputs": [],
85
+ "name": "getOwner",
86
+ "outputs": [
87
+ {
88
+ "internalType": "address",
89
+ "name": "owner",
90
+ "type": "address"
91
+ }
92
+ ],
93
+ "stateMutability": "view",
94
+ "type": "function"
95
+ },
96
+ {
97
+ "inputs": [],
98
+ "name": "getParentNftId",
99
+ "outputs": [
100
+ {
101
+ "internalType": "NftId",
102
+ "name": "",
103
+ "type": "uint96"
104
+ }
105
+ ],
106
+ "stateMutability": "view",
107
+ "type": "function"
108
+ },
109
+ {
110
+ "inputs": [],
111
+ "name": "getRegistry",
112
+ "outputs": [
113
+ {
114
+ "internalType": "contract IRegistry",
115
+ "name": "registry",
116
+ "type": "address"
117
+ }
118
+ ],
119
+ "stateMutability": "view",
120
+ "type": "function"
121
+ },
122
+ {
123
+ "inputs": [],
124
+ "name": "getToken",
125
+ "outputs": [
126
+ {
127
+ "internalType": "contract IERC20Metadata",
128
+ "name": "token",
129
+ "type": "address"
130
+ }
131
+ ],
132
+ "stateMutability": "view",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "inputs": [],
137
+ "name": "getType",
138
+ "outputs": [
139
+ {
140
+ "internalType": "ObjectType",
141
+ "name": "objectType",
142
+ "type": "uint8"
143
+ }
144
+ ],
145
+ "stateMutability": "view",
146
+ "type": "function"
147
+ },
148
+ {
149
+ "inputs": [],
150
+ "name": "getWallet",
151
+ "outputs": [
152
+ {
153
+ "internalType": "address",
154
+ "name": "walletAddress",
155
+ "type": "address"
156
+ }
157
+ ],
158
+ "stateMutability": "view",
159
+ "type": "function"
160
+ },
161
+ {
162
+ "inputs": [],
163
+ "name": "isRegisterable",
164
+ "outputs": [
165
+ {
166
+ "internalType": "bool",
167
+ "name": "",
168
+ "type": "bool"
169
+ }
170
+ ],
171
+ "stateMutability": "pure",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "inputs": [],
176
+ "name": "isRegistered",
177
+ "outputs": [
178
+ {
179
+ "internalType": "bool",
180
+ "name": "",
181
+ "type": "bool"
182
+ }
183
+ ],
184
+ "stateMutability": "view",
185
+ "type": "function"
186
+ },
187
+ {
188
+ "inputs": [],
189
+ "name": "register",
190
+ "outputs": [
191
+ {
192
+ "internalType": "NftId",
193
+ "name": "componentId",
194
+ "type": "uint96"
195
+ }
196
+ ],
197
+ "stateMutability": "nonpayable",
198
+ "type": "function"
199
+ }
200
+ ],
201
+ "bytecode": "0x",
202
+ "deployedBytecode": "0x",
203
+ "linkReferences": {},
204
+ "deployedLinkReferences": {}
205
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/ddbd31d07c8880f0f0a18b3f2b9bcc56.json"
4
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "InstanceLinked",
4
+ "sourceName": "contracts/components/Component.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "instance",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "stateMutability": "nonpayable",
15
+ "type": "constructor"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "getInstance",
20
+ "outputs": [
21
+ {
22
+ "internalType": "contract IInstance",
23
+ "name": "instance",
24
+ "type": "address"
25
+ }
26
+ ],
27
+ "stateMutability": "view",
28
+ "type": "function"
29
+ }
30
+ ],
31
+ "bytecode": "0x608060405234801561001057600080fd5b50604051610249380380610249833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610132806101176000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063de7b5d1414602d575b600080fd5b60336047565b604051603e919060e3565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060af60ab60a7846070565b6090565b6070565b9050919050565b600060bf82609a565b9050919050565b600060cf8260b6565b9050919050565b60dd8160c6565b82525050565b600060208201905060f6600083018460d6565b9291505056fea2646970667358221220fcb5a0020aae4f4c62be3c6596d758b295998722c0558cf6dbbf52e3b5809cf564736f6c63430008140033",
32
+ "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063de7b5d1414602d575b600080fd5b60336047565b604051603e919060e3565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060af60ab60a7846070565b6090565b6070565b9050919050565b600060bf82609a565b9050919050565b600060cf8260b6565b9050919050565b60dd8160c6565b82525050565b600060208201905060f6600083018460d6565b9291505056fea2646970667358221220fcb5a0020aae4f4c62be3c6596d758b295998722c0558cf6dbbf52e3b5809cf564736f6c63430008140033",
33
+ "linkReferences": {},
34
+ "deployedLinkReferences": {}
35
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/ddbd31d07c8880f0f0a18b3f2b9bcc56.json"
4
+ }
@@ -0,0 +1,255 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IPoolComponent",
4
+ "sourceName": "contracts/components/IPool.sol",
5
+ "abi": [
6
+ {
7
+ "anonymous": false,
8
+ "inputs": [
9
+ {
10
+ "indexed": false,
11
+ "internalType": "uint256",
12
+ "name": "idx",
13
+ "type": "uint256"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "internalType": "address",
18
+ "name": "module",
19
+ "type": "address"
20
+ },
21
+ {
22
+ "indexed": false,
23
+ "internalType": "string",
24
+ "name": "comment",
25
+ "type": "string"
26
+ }
27
+ ],
28
+ "name": "LogDebug",
29
+ "type": "event"
30
+ },
31
+ {
32
+ "inputs": [],
33
+ "name": "getData",
34
+ "outputs": [
35
+ {
36
+ "internalType": "bytes",
37
+ "name": "data",
38
+ "type": "bytes"
39
+ }
40
+ ],
41
+ "stateMutability": "view",
42
+ "type": "function"
43
+ },
44
+ {
45
+ "inputs": [],
46
+ "name": "getInitialOwner",
47
+ "outputs": [
48
+ {
49
+ "internalType": "address",
50
+ "name": "initialOwner",
51
+ "type": "address"
52
+ }
53
+ ],
54
+ "stateMutability": "view",
55
+ "type": "function"
56
+ },
57
+ {
58
+ "inputs": [],
59
+ "name": "getInstance",
60
+ "outputs": [
61
+ {
62
+ "internalType": "contract IInstance",
63
+ "name": "instance",
64
+ "type": "address"
65
+ }
66
+ ],
67
+ "stateMutability": "view",
68
+ "type": "function"
69
+ },
70
+ {
71
+ "inputs": [],
72
+ "name": "getNftId",
73
+ "outputs": [
74
+ {
75
+ "internalType": "NftId",
76
+ "name": "nftId",
77
+ "type": "uint96"
78
+ }
79
+ ],
80
+ "stateMutability": "view",
81
+ "type": "function"
82
+ },
83
+ {
84
+ "inputs": [],
85
+ "name": "getOwner",
86
+ "outputs": [
87
+ {
88
+ "internalType": "address",
89
+ "name": "owner",
90
+ "type": "address"
91
+ }
92
+ ],
93
+ "stateMutability": "view",
94
+ "type": "function"
95
+ },
96
+ {
97
+ "inputs": [],
98
+ "name": "getParentNftId",
99
+ "outputs": [
100
+ {
101
+ "internalType": "NftId",
102
+ "name": "parentNftId",
103
+ "type": "uint96"
104
+ }
105
+ ],
106
+ "stateMutability": "view",
107
+ "type": "function"
108
+ },
109
+ {
110
+ "inputs": [],
111
+ "name": "getPerformanceFee",
112
+ "outputs": [
113
+ {
114
+ "components": [
115
+ {
116
+ "internalType": "UFixed",
117
+ "name": "fractionalFee",
118
+ "type": "uint256"
119
+ },
120
+ {
121
+ "internalType": "uint256",
122
+ "name": "fixedFee",
123
+ "type": "uint256"
124
+ }
125
+ ],
126
+ "internalType": "struct Fee",
127
+ "name": "performanceFee",
128
+ "type": "tuple"
129
+ }
130
+ ],
131
+ "stateMutability": "view",
132
+ "type": "function"
133
+ },
134
+ {
135
+ "inputs": [],
136
+ "name": "getRegistry",
137
+ "outputs": [
138
+ {
139
+ "internalType": "contract IRegistry",
140
+ "name": "registry",
141
+ "type": "address"
142
+ }
143
+ ],
144
+ "stateMutability": "view",
145
+ "type": "function"
146
+ },
147
+ {
148
+ "inputs": [],
149
+ "name": "getStakingFee",
150
+ "outputs": [
151
+ {
152
+ "components": [
153
+ {
154
+ "internalType": "UFixed",
155
+ "name": "fractionalFee",
156
+ "type": "uint256"
157
+ },
158
+ {
159
+ "internalType": "uint256",
160
+ "name": "fixedFee",
161
+ "type": "uint256"
162
+ }
163
+ ],
164
+ "internalType": "struct Fee",
165
+ "name": "stakingFee",
166
+ "type": "tuple"
167
+ }
168
+ ],
169
+ "stateMutability": "view",
170
+ "type": "function"
171
+ },
172
+ {
173
+ "inputs": [],
174
+ "name": "getToken",
175
+ "outputs": [
176
+ {
177
+ "internalType": "contract IERC20Metadata",
178
+ "name": "token",
179
+ "type": "address"
180
+ }
181
+ ],
182
+ "stateMutability": "view",
183
+ "type": "function"
184
+ },
185
+ {
186
+ "inputs": [],
187
+ "name": "getType",
188
+ "outputs": [
189
+ {
190
+ "internalType": "ObjectType",
191
+ "name": "objectType",
192
+ "type": "uint8"
193
+ }
194
+ ],
195
+ "stateMutability": "view",
196
+ "type": "function"
197
+ },
198
+ {
199
+ "inputs": [],
200
+ "name": "getWallet",
201
+ "outputs": [
202
+ {
203
+ "internalType": "address",
204
+ "name": "walletAddress",
205
+ "type": "address"
206
+ }
207
+ ],
208
+ "stateMutability": "view",
209
+ "type": "function"
210
+ },
211
+ {
212
+ "inputs": [],
213
+ "name": "isRegisterable",
214
+ "outputs": [
215
+ {
216
+ "internalType": "bool",
217
+ "name": "",
218
+ "type": "bool"
219
+ }
220
+ ],
221
+ "stateMutability": "pure",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [],
226
+ "name": "isRegistered",
227
+ "outputs": [
228
+ {
229
+ "internalType": "bool",
230
+ "name": "",
231
+ "type": "bool"
232
+ }
233
+ ],
234
+ "stateMutability": "view",
235
+ "type": "function"
236
+ },
237
+ {
238
+ "inputs": [],
239
+ "name": "register",
240
+ "outputs": [
241
+ {
242
+ "internalType": "NftId",
243
+ "name": "nftId",
244
+ "type": "uint96"
245
+ }
246
+ ],
247
+ "stateMutability": "nonpayable",
248
+ "type": "function"
249
+ }
250
+ ],
251
+ "bytecode": "0x",
252
+ "deployedBytecode": "0x",
253
+ "linkReferences": {},
254
+ "deployedLinkReferences": {}
255
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/ddbd31d07c8880f0f0a18b3f2b9bcc56.json"
4
+ }