@etherisc/gif-next 0.0.2-cc253b3 → 0.0.2-d250c72

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  2. package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/InstanceLinked.json +2 -2
  4. package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +1 -1
  5. package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  7. package/artifacts/contracts/components/Pool.sol/Pool.json +2 -2
  8. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  9. package/artifacts/contracts/components/Product.sol/Product.json +2 -2
  10. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  11. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  12. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  13. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  14. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  15. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  16. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  17. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  22. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  23. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  24. package/artifacts/contracts/instance/Instance.sol/Instance.json +16 -8
  25. package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +1 -1
  26. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +1 -1
  27. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +1 -1
  28. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +1 -1
  29. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +1 -1
  30. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
  31. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +1 -1
  32. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +2 -2
  33. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +1 -1
  34. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +1 -1
  35. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +1 -1
  36. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +1 -1
  37. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +1 -1
  38. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
  39. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
  40. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
  41. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +1 -1
  42. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
  43. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
  44. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +1 -1
  45. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +1 -1
  46. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +1 -1
  47. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +1 -1
  48. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +2 -2
  49. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  50. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
  51. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +1 -1
  52. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +1 -1
  53. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  54. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +1 -1
  55. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +1 -1
  56. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  57. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  58. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +1 -1
  59. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +2 -2
  60. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  61. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  62. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +28 -4
  63. package/contracts/instance/component/ComponentModule.sol +2 -2
  64. package/contracts/types/NftId.sol +10 -1
  65. package/package.json +1 -1
@@ -3,6 +3,30 @@
3
3
  "contractName": "NftIdLib",
4
4
  "sourceName": "contracts/types/NftId.sol",
5
5
  "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "NftId",
10
+ "name": "a",
11
+ "type": "uint96"
12
+ },
13
+ {
14
+ "internalType": "NftId",
15
+ "name": "b",
16
+ "type": "uint96"
17
+ }
18
+ ],
19
+ "name": "eq",
20
+ "outputs": [
21
+ {
22
+ "internalType": "bool",
23
+ "name": "isSame",
24
+ "type": "bool"
25
+ }
26
+ ],
27
+ "stateMutability": "pure",
28
+ "type": "function"
29
+ },
6
30
  {
7
31
  "inputs": [
8
32
  {
@@ -52,17 +76,17 @@
52
76
  "name": "toInt",
53
77
  "outputs": [
54
78
  {
55
- "internalType": "uint256",
79
+ "internalType": "uint96",
56
80
  "name": "",
57
- "type": "uint256"
81
+ "type": "uint96"
58
82
  }
59
83
  ],
60
84
  "stateMutability": "pure",
61
85
  "type": "function"
62
86
  }
63
87
  ],
64
- "bytecode": "0x610242610053600b82828239805160001a607314610046577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c806308dc895e1461005057806330b8415f1461008057806352694ee8146100b0575b600080fd5b61006a60048036038101906100659190610175565b6100e0565b60405161007791906101bb565b60405180910390f35b61009a60048036038101906100959190610175565b6100f8565b6040516100a791906101f1565b60405180910390f35b6100ca60048036038101906100c59190610175565b610112565b6040516100d791906101f1565b60405180910390f35b6000816bffffffffffffffffffffffff169050919050565b600080826bffffffffffffffffffffffff16119050919050565b600080826bffffffffffffffffffffffff16149050919050565b600080fd5b60006bffffffffffffffffffffffff82169050919050565b61015281610131565b811461015d57600080fd5b50565b60008135905061016f81610149565b92915050565b60006020828403121561018b5761018a61012c565b5b600061019984828501610160565b91505092915050565b6000819050919050565b6101b5816101a2565b82525050565b60006020820190506101d060008301846101ac565b92915050565b60008115159050919050565b6101eb816101d6565b82525050565b600060208201905061020660008301846101e2565b9291505056fea26469706673582212209affa62d114e1cb53bcb21f3612272fd3a48ab7679330e8ca5b746a63a2d60e164736f6c63430008140033",
65
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c806308dc895e1461005057806330b8415f1461008057806352694ee8146100b0575b600080fd5b61006a60048036038101906100659190610175565b6100e0565b60405161007791906101bb565b60405180910390f35b61009a60048036038101906100959190610175565b6100f8565b6040516100a791906101f1565b60405180910390f35b6100ca60048036038101906100c59190610175565b610112565b6040516100d791906101f1565b60405180910390f35b6000816bffffffffffffffffffffffff169050919050565b600080826bffffffffffffffffffffffff16119050919050565b600080826bffffffffffffffffffffffff16149050919050565b600080fd5b60006bffffffffffffffffffffffff82169050919050565b61015281610131565b811461015d57600080fd5b50565b60008135905061016f81610149565b92915050565b60006020828403121561018b5761018a61012c565b5b600061019984828501610160565b91505092915050565b6000819050919050565b6101b5816101a2565b82525050565b60006020820190506101d060008301846101ac565b92915050565b60008115159050919050565b6101eb816101d6565b82525050565b600060208201905061020660008301846101e2565b9291505056fea26469706673582212209affa62d114e1cb53bcb21f3612272fd3a48ab7679330e8ca5b746a63a2d60e164736f6c63430008140033",
88
+ "bytecode": "0x6102e2610053600b82828239805160001a607314610046577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c806308dc895e1461005b57806330b8415f1461008b57806352694ee8146100bb578063c4cade9d146100eb575b600080fd5b610075600480360381019061007091906101df565b61011b565b604051610082919061021b565b60405180910390f35b6100a560048036038101906100a091906101df565b610125565b6040516100b29190610251565b60405180910390f35b6100d560048036038101906100d091906101df565b61013f565b6040516100e29190610251565b60405180910390f35b6101056004803603810190610100919061026c565b610159565b6040516101129190610251565b60405180910390f35b6000819050919050565b600080826bffffffffffffffffffffffff16119050919050565b600080826bffffffffffffffffffffffff16149050919050565b6000610165838361016d565b905092915050565b6000816bffffffffffffffffffffffff16836bffffffffffffffffffffffff1614905092915050565b600080fd5b60006bffffffffffffffffffffffff82169050919050565b6101bc8161019b565b81146101c757600080fd5b50565b6000813590506101d9816101b3565b92915050565b6000602082840312156101f5576101f4610196565b5b6000610203848285016101ca565b91505092915050565b6102158161019b565b82525050565b6000602082019050610230600083018461020c565b92915050565b60008115159050919050565b61024b81610236565b82525050565b60006020820190506102666000830184610242565b92915050565b6000806040838503121561028357610282610196565b5b6000610291858286016101ca565b92505060206102a2858286016101ca565b915050925092905056fea264697066735822122055c506374fbe6d33aafb031778f35f7d28d6e6f8afcfb93598673c7f2a4e119a64736f6c63430008140033",
89
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c806308dc895e1461005b57806330b8415f1461008b57806352694ee8146100bb578063c4cade9d146100eb575b600080fd5b610075600480360381019061007091906101df565b61011b565b604051610082919061021b565b60405180910390f35b6100a560048036038101906100a091906101df565b610125565b6040516100b29190610251565b60405180910390f35b6100d560048036038101906100d091906101df565b61013f565b6040516100e29190610251565b60405180910390f35b6101056004803603810190610100919061026c565b610159565b6040516101129190610251565b60405180910390f35b6000819050919050565b600080826bffffffffffffffffffffffff16119050919050565b600080826bffffffffffffffffffffffff16149050919050565b6000610165838361016d565b905092915050565b6000816bffffffffffffffffffffffff16836bffffffffffffffffffffffff1614905092915050565b600080fd5b60006bffffffffffffffffffffffff82169050919050565b6101bc8161019b565b81146101c757600080fd5b50565b6000813590506101d9816101b3565b92915050565b6000602082840312156101f5576101f4610196565b5b6000610203848285016101ca565b91505092915050565b6102158161019b565b82525050565b6000602082019050610230600083018461020c565b92915050565b60008115159050919050565b61024b81610236565b82525050565b60006020820190506102666000830184610242565b92915050565b6000806040838503121561028357610282610196565b5b6000610291858286016101ca565b92505060206102a2858286016101ca565b915050925092905056fea264697066735822122055c506374fbe6d33aafb031778f35f7d28d6e6f8afcfb93598673c7f2a4e119a64736f6c63430008140033",
66
90
  "linkReferences": {},
67
91
  "deployedLinkReferences": {}
68
92
  }
@@ -9,7 +9,7 @@ import {IInstance} from "../IInstance.sol";
9
9
  import {IComponent, IComponentContract, IComponentModule, IComponentOwnerService} from "./IComponent.sol";
10
10
  import {IProductComponent} from "../../components/IProduct.sol";
11
11
  import {IPoolModule} from "../pool/IPoolModule.sol";
12
- import {NftId, NftIdLib, eqNftId} from "../../types/NftId.sol";
12
+ import {NftId, NftIdLib} from "../../types/NftId.sol";
13
13
 
14
14
  abstract contract ComponentModule is
15
15
  IRegistryLinked,
@@ -106,7 +106,7 @@ abstract contract ComponentModule is
106
106
  {
107
107
  nftId = info.nftId;
108
108
  require(
109
- nftId.gtz() && eqNftId(_componentInfo[nftId].nftId, nftId),
109
+ nftId.gtz() && _componentInfo[nftId].nftId.eq(nftId),
110
110
  "ERROR:CMP-006:COMPONENT_UNKNOWN");
111
111
 
112
112
  _componentInfo[nftId] = info;
@@ -12,15 +12,24 @@ using {
12
12
  } for NftId global;
13
13
 
14
14
  // general pure free functions
15
+ /// @dev Converts the uint256 to a NftId.
15
16
  function toNftId(uint256 id) pure returns(NftId) { return NftId.wrap(uint96(id)); }
16
17
 
18
+ /// @dev Return the NftId zero (0)
19
+ function zeroNftId() pure returns(NftId) { return NftId.wrap(0); }
20
+
17
21
  // pure free functions for operators
18
22
  function eqNftId(NftId a, NftId b) pure returns(bool isSame) { return NftId.unwrap(a) == NftId.unwrap(b); }
19
23
  function neNftId(NftId a, NftId b) pure returns(bool isDifferent) { return NftId.unwrap(a) != NftId.unwrap(b); }
20
24
 
21
25
  // library functions that operate on user defined type
22
26
  library NftIdLib {
23
- function toInt(NftId nftId) public pure returns(uint256) { return uint256(NftId.unwrap(nftId)); }
27
+ /// @dev Converts the NftId to a uint256.
28
+ function toInt(NftId nftId) public pure returns(uint96) { return uint96(NftId.unwrap(nftId)); }
29
+ /// @dev Returns true if the value is non-zero (> 0).
24
30
  function gtz(NftId a) public pure returns(bool) { return NftId.unwrap(a) > 0; }
31
+ /// @dev Returns true if the value is zero (== 0).
25
32
  function eqz(NftId a) public pure returns(bool) { return NftId.unwrap(a) == 0; }
33
+ /// @dev Returns true if the values are equal (==).
34
+ function eq(NftId a, NftId b) public pure returns(bool isSame) { return eqNftId(a, b); }
26
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etherisc/gif-next",
3
- "version": "0.0.2-cc253b3",
3
+ "version": "0.0.2-d250c72",
4
4
  "description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
5
5
  "main": "index.js",
6
6
  "scripts": {