@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.
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/InstanceLinked.json +2 -2
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +2 -2
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +2 -2
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +16 -8
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +1 -1
- package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +1 -1
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +1 -1
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +1 -1
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +2 -2
- package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +1 -1
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +1 -1
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +1 -1
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +1 -1
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +1 -1
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +1 -1
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +2 -2
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +28 -4
- package/contracts/instance/component/ComponentModule.sol +2 -2
- package/contracts/types/NftId.sol +10 -1
- 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": "
|
79
|
+
"internalType": "uint96",
|
56
80
|
"name": "",
|
57
|
-
"type": "
|
81
|
+
"type": "uint96"
|
58
82
|
}
|
59
83
|
],
|
60
84
|
"stateMutability": "pure",
|
61
85
|
"type": "function"
|
62
86
|
}
|
63
87
|
],
|
64
|
-
"bytecode": "
|
65
|
-
"deployedBytecode": "
|
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
|
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() &&
|
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
|
-
|
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