@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.
- package/README.md +144 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/Component.json +205 -0
- package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/InstanceLinked.json +35 -0
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.json +255 -0
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +74 -0
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/components/Pool.sol/Pool.json +328 -0
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/components/Product.sol/Product.json +346 -0
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +4 -0
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +105 -0
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +4 -0
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +105 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +128 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +42 -0
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +76 -0
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +89 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +128 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +37 -0
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +50 -0
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +4 -0
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +63 -0
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +59 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +124 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +74 -0
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +124 -0
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +4 -0
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +207 -0
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +4 -0
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +10 -0
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +4 -0
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +10 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1479 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +4 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.json +1725 -0
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +4 -0
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.json +400 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +4 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.json +35 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +4 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.json +50 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +4 -0
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.json +336 -0
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +4 -0
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.json +299 -0
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +4 -0
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +202 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponent.json +10 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +4 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.json +205 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +4 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +217 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +4 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +141 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +4 -0
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.json +24 -0
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycle.json +134 -0
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +4 -0
- package/artifacts/contracts/instance/lifecycle/ILifecycle.sol/ILifecycleModule.json +182 -0
- package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +4 -0
- package/artifacts/contracts/instance/lifecycle/LifecycleModule.sol/LifecycleModule.json +221 -0
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.json +10 -0
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +4 -0
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.json +254 -0
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +4 -0
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +254 -0
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +4 -0
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.json +10 -0
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +4 -0
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.json +129 -0
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +4 -0
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.json +155 -0
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +4 -0
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.json +75 -0
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.json +127 -0
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +4 -0
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.json +75 -0
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +196 -0
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.dbg.json +4 -0
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasury.json +10 -0
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.dbg.json +4 -0
- package/artifacts/contracts/instance/treasury/ITreasury.sol/ITreasuryModule.json +490 -0
- package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/instance/treasury/TokenHandler.sol/TokenHandler.json +45 -0
- package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +4 -0
- package/artifacts/contracts/instance/treasury/TreasuryModule.sol/TreasuryModule.json +490 -0
- package/artifacts/contracts/mock/Dip.sol/DIP.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/DIP.json +338 -0
- package/artifacts/contracts/mock/TestPool.sol/TestPool.dbg.json +4 -0
- package/artifacts/contracts/mock/TestPool.sol/TestPool.json +294 -0
- package/artifacts/contracts/mock/TestProduct.sol/TestProduct.dbg.json +4 -0
- package/artifacts/contracts/mock/TestProduct.sol/TestProduct.json +384 -0
- package/artifacts/contracts/mock/Usdc.sol/USDC.dbg.json +4 -0
- package/artifacts/contracts/mock/Usdc.sol/USDC.json +338 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +534 -0
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +4 -0
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +452 -0
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.json +24 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +166 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +188 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +49 -0
- package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +4 -0
- package/artifacts/contracts/registry/Registry.sol/Registerable.json +166 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.json +256 -0
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +60 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +10 -0
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +92 -0
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +174 -0
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +4 -0
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +479 -0
- package/contracts/components/Component.sol +77 -0
- package/contracts/components/IPool.sol +15 -0
- package/contracts/components/IProduct.sol +16 -0
- package/contracts/components/Pool.sol +52 -0
- package/contracts/components/Product.sol +89 -0
- package/contracts/experiment/errors/Require.sol +38 -0
- package/contracts/experiment/errors/Revert.sol +44 -0
- package/contracts/experiment/inheritance/A.sol +53 -0
- package/contracts/experiment/inheritance/B.sol +28 -0
- package/contracts/experiment/inheritance/C.sol +34 -0
- package/contracts/experiment/inheritance/IA.sol +13 -0
- package/contracts/experiment/inheritance/IB.sol +10 -0
- package/contracts/experiment/inheritance/IC.sol +12 -0
- package/contracts/experiment/statemachine/Dummy.sol +27 -0
- package/contracts/experiment/statemachine/ISM.sol +25 -0
- package/contracts/experiment/statemachine/README.md +112 -0
- package/contracts/experiment/statemachine/SM.sol +57 -0
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +31 -0
- package/contracts/experiment/types/TypeA.sol +47 -0
- package/contracts/experiment/types/TypeB.sol +29 -0
- package/contracts/instance/IInstance.sol +25 -0
- package/contracts/instance/Instance.sol +72 -0
- package/contracts/instance/access/Access.sol +165 -0
- package/contracts/instance/access/IAccess.sol +63 -0
- package/contracts/instance/component/ComponentModule.sol +274 -0
- package/contracts/instance/component/IComponent.sol +74 -0
- package/contracts/instance/lifecycle/ILifecycle.sol +47 -0
- package/contracts/instance/lifecycle/LifecycleModule.sol +88 -0
- package/contracts/instance/policy/IPolicy.sol +50 -0
- package/contracts/instance/policy/PolicyModule.sol +114 -0
- package/contracts/instance/pool/IPoolModule.sol +23 -0
- package/contracts/instance/pool/PoolModule.sol +81 -0
- package/contracts/instance/product/IProductService.sol +36 -0
- package/contracts/instance/product/ProductService.sol +136 -0
- package/contracts/instance/treasury/ITreasury.sol +91 -0
- package/contracts/instance/treasury/TokenHandler.sol +24 -0
- package/contracts/instance/treasury/TreasuryModule.sol +168 -0
- package/contracts/mock/TestPool.sol +16 -0
- package/contracts/mock/TestProduct.sol +39 -0
- package/contracts/mock/Usdc.sol +26 -0
- package/contracts/registry/ChainNft.sol +135 -0
- package/contracts/registry/IChainNft.sol +21 -0
- package/contracts/registry/IRegistry.sol +67 -0
- package/contracts/registry/Registry.sol +182 -0
- package/contracts/types/Blocknumber.sol +118 -0
- package/contracts/types/ChainId.sol +38 -0
- package/contracts/types/Fee.sol +32 -0
- package/contracts/types/NftId.sol +51 -0
- package/contracts/types/ObjectType.sol +107 -0
- package/contracts/types/StateId.sol +91 -0
- package/contracts/types/Timestamp.sol +102 -0
- package/contracts/types/UFixed.sol +210 -0
- package/package.json +19 -9
- package/artifacts/contracts/Dip.sol/DIP.dbg.json +0 -4
- package/artifacts/contracts/Dip.sol/DIP.json +0 -338
- package/artifacts/contracts/Lock.sol/Lock.dbg.json +0 -4
- package/artifacts/contracts/Lock.sol/Lock.json +0 -74
- package/contracts/Lock.sol +0 -34
- /package/contracts/{Dip.sol → mock/Dip.sol} +0 -0
@@ -0,0 +1,210 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
5
|
+
|
6
|
+
/// @dev UFixed is a fixed point number with 18 decimals precision.
|
7
|
+
type UFixed is uint256;
|
8
|
+
|
9
|
+
using {
|
10
|
+
addUFixed as +,
|
11
|
+
subUFixed as -,
|
12
|
+
mulUFixed as *,
|
13
|
+
divUFixed as /,
|
14
|
+
gtUFixed as >,
|
15
|
+
gteUFixed as >=,
|
16
|
+
ltUFixed as <,
|
17
|
+
lteUFixed as <=,
|
18
|
+
eqUFixed as ==
|
19
|
+
} for UFixed global;
|
20
|
+
|
21
|
+
function addUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
22
|
+
return UFixed.wrap(UFixed.unwrap(a) + UFixed.unwrap(b));
|
23
|
+
}
|
24
|
+
|
25
|
+
function subUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
26
|
+
require(a >= b, "ERROR:UFM-010:NEGATIVE_RESULT");
|
27
|
+
return UFixed.wrap(UFixed.unwrap(a) - UFixed.unwrap(b));
|
28
|
+
}
|
29
|
+
|
30
|
+
function mulUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
31
|
+
return
|
32
|
+
UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), UFixed.unwrap(b), 10 ** 18));
|
33
|
+
}
|
34
|
+
|
35
|
+
function divUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
36
|
+
require(UFixed.unwrap(b) > 0, "ERROR:UFM-020:DIVISOR_ZERO");
|
37
|
+
|
38
|
+
return
|
39
|
+
UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), 10 ** 18, UFixed.unwrap(b)));
|
40
|
+
}
|
41
|
+
|
42
|
+
function gtUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
43
|
+
return UFixed.unwrap(a) > UFixed.unwrap(b);
|
44
|
+
}
|
45
|
+
|
46
|
+
function gteUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
47
|
+
return UFixed.unwrap(a) >= UFixed.unwrap(b);
|
48
|
+
}
|
49
|
+
|
50
|
+
function ltUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
51
|
+
return UFixed.unwrap(a) < UFixed.unwrap(b);
|
52
|
+
}
|
53
|
+
|
54
|
+
function lteUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
|
55
|
+
return UFixed.unwrap(a) <= UFixed.unwrap(b);
|
56
|
+
}
|
57
|
+
|
58
|
+
function eqUFixed(UFixed a, UFixed b) pure returns (bool isEqual) {
|
59
|
+
return UFixed.unwrap(a) == UFixed.unwrap(b);
|
60
|
+
}
|
61
|
+
|
62
|
+
function gtzUFixed(UFixed a) pure returns (bool isZero) {
|
63
|
+
return UFixed.unwrap(a) > 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
function eqzUFixed(UFixed a) pure returns (bool isZero) {
|
67
|
+
return UFixed.unwrap(a) == 0;
|
68
|
+
}
|
69
|
+
|
70
|
+
function deltaUFixed(UFixed a, UFixed b) pure returns (UFixed) {
|
71
|
+
if (a > b) {
|
72
|
+
return a - b;
|
73
|
+
}
|
74
|
+
|
75
|
+
return b - a;
|
76
|
+
}
|
77
|
+
|
78
|
+
library UFixedMathLib {
|
79
|
+
|
80
|
+
int8 public constant EXP = 18;
|
81
|
+
uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
|
82
|
+
uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
|
83
|
+
|
84
|
+
/// @dev returns the rounding mode DOWN - 0.4 becomes 0, 0.5 becomes 0, 0.6 becomes 0
|
85
|
+
function ROUNDING_DOWN() public pure returns (uint8) {
|
86
|
+
return uint8(0);
|
87
|
+
}
|
88
|
+
|
89
|
+
/// @dev returns the rounding mode UP - 0.4 becomes 1, 0.5 becomes 1, 0.6 becomes 1
|
90
|
+
function ROUNDING_UP() public pure returns (uint8) {
|
91
|
+
return uint8(1);
|
92
|
+
}
|
93
|
+
|
94
|
+
/// @dev returns the rounding mode HALF_UP - 0.4 becomes 0, 0.5 becomes 1, 0.6 becomes 1
|
95
|
+
function ROUNDING_HALF_UP() public pure returns (uint8) {
|
96
|
+
return uint8(2);
|
97
|
+
}
|
98
|
+
|
99
|
+
/// @dev returns the decimals precision of the UFixed type
|
100
|
+
function decimals() public pure returns (uint256) {
|
101
|
+
return uint8(EXP);
|
102
|
+
}
|
103
|
+
|
104
|
+
/// @dev Converts the uint256 to a UFixed.
|
105
|
+
function itof(uint256 a) public pure returns (UFixed) {
|
106
|
+
return UFixed.wrap(a * MULTIPLIER);
|
107
|
+
}
|
108
|
+
|
109
|
+
// TODO rename to toUFixed
|
110
|
+
/// @dev Converts the uint256 to a UFixed with given exponent.
|
111
|
+
function itof(uint256 a, int8 exp) public pure returns (UFixed) {
|
112
|
+
require(EXP + exp >= 0, "ERROR:FM-010:EXPONENT_TOO_SMALL");
|
113
|
+
require(EXP + exp <= 64, "ERROR:FM-011:EXPONENT_TOO_LARGE");
|
114
|
+
|
115
|
+
return UFixed.wrap(a * 10 ** uint8(EXP + exp));
|
116
|
+
}
|
117
|
+
|
118
|
+
/// @dev Converts a UFixed to a uint256.
|
119
|
+
function ftoi(UFixed a) public pure returns (uint256) {
|
120
|
+
return ftoi(a, ROUNDING_HALF_UP());
|
121
|
+
}
|
122
|
+
|
123
|
+
/// @dev Converts a UFixed to a uint256 with given rounding mode.
|
124
|
+
function ftoi(UFixed a, uint8 rounding) public pure returns (uint256) {
|
125
|
+
if (rounding == ROUNDING_HALF_UP()) {
|
126
|
+
return
|
127
|
+
Math.mulDiv(
|
128
|
+
UFixed.unwrap(a) + MULTIPLIER_HALF,
|
129
|
+
1,
|
130
|
+
MULTIPLIER,
|
131
|
+
Math.Rounding.Down
|
132
|
+
);
|
133
|
+
} else if (rounding == ROUNDING_DOWN()) {
|
134
|
+
return
|
135
|
+
Math.mulDiv(
|
136
|
+
UFixed.unwrap(a),
|
137
|
+
1,
|
138
|
+
MULTIPLIER,
|
139
|
+
Math.Rounding.Down
|
140
|
+
);
|
141
|
+
} else {
|
142
|
+
return
|
143
|
+
Math.mulDiv(UFixed.unwrap(a), 1, MULTIPLIER, Math.Rounding.Up);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
/// @dev adds two UFixed numbers
|
148
|
+
function add(UFixed a, UFixed b) public pure returns (UFixed) {
|
149
|
+
return addUFixed(a, b);
|
150
|
+
}
|
151
|
+
|
152
|
+
/// @dev subtracts two UFixed numbers
|
153
|
+
function sub(UFixed a, UFixed b) public pure returns (UFixed) {
|
154
|
+
return subUFixed(a, b);
|
155
|
+
}
|
156
|
+
|
157
|
+
/// @dev multiplies two UFixed numbers
|
158
|
+
function mul(UFixed a, UFixed b) public pure returns (UFixed) {
|
159
|
+
return mulUFixed(a, b);
|
160
|
+
}
|
161
|
+
|
162
|
+
/// @dev divides two UFixed numbers
|
163
|
+
function div(UFixed a, UFixed b) public pure returns (UFixed) {
|
164
|
+
return divUFixed(a, b);
|
165
|
+
}
|
166
|
+
|
167
|
+
/// @dev return true if UFixed a is greater than UFixed b
|
168
|
+
function gt(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
169
|
+
return gtUFixed(a, b);
|
170
|
+
}
|
171
|
+
|
172
|
+
/// @dev return true if UFixed a is greater than or equal to UFixed b
|
173
|
+
function gte(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
174
|
+
return gteUFixed(a, b);
|
175
|
+
}
|
176
|
+
|
177
|
+
/// @dev return true if UFixed a is less than UFixed b
|
178
|
+
function lt(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
179
|
+
return ltUFixed(a, b);
|
180
|
+
}
|
181
|
+
|
182
|
+
/// @dev return true if UFixed a is less than or equal to UFixed b
|
183
|
+
function lte(UFixed a, UFixed b) public pure returns (bool isGreaterThan) {
|
184
|
+
return lteUFixed(a, b);
|
185
|
+
}
|
186
|
+
|
187
|
+
/// @dev return true if UFixed a is equal to UFixed b
|
188
|
+
function eq(UFixed a, UFixed b) public pure returns (bool isEqual) {
|
189
|
+
return eqUFixed(a, b);
|
190
|
+
}
|
191
|
+
|
192
|
+
/// @dev return true if UFixed a is not zero
|
193
|
+
function gtz(UFixed a) public pure returns (bool isZero) {
|
194
|
+
return gtzUFixed(a);
|
195
|
+
}
|
196
|
+
|
197
|
+
/// @dev return true if UFixed a is zero
|
198
|
+
function eqz(UFixed a) public pure returns (bool isZero) {
|
199
|
+
return eqzUFixed(a);
|
200
|
+
}
|
201
|
+
|
202
|
+
function zero() public pure returns (UFixed) {
|
203
|
+
return UFixed.wrap(0);
|
204
|
+
}
|
205
|
+
|
206
|
+
/// @dev return the absolute delta between two UFixed numbers
|
207
|
+
function delta(UFixed a, UFixed b) public pure returns (UFixed) {
|
208
|
+
return deltaUFixed(a, b);
|
209
|
+
}
|
210
|
+
}
|
package/package.json
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@etherisc/gif-next",
|
3
|
-
"version": "0.0.2-
|
3
|
+
"version": "0.0.2-f619be3-760",
|
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": {
|
7
|
-
"build": "
|
8
|
-
"test": "
|
9
|
-
"ptest": "
|
10
|
-
"test-with-gas": "REPORT_GAS=true
|
11
|
-
"coverage": "
|
7
|
+
"build": "hh compile",
|
8
|
+
"test": "hh test",
|
9
|
+
"ptest": "hh test --parallel",
|
10
|
+
"test-with-gas": "REPORT_GAS=true hh test",
|
11
|
+
"coverage": "hh coverage",
|
12
|
+
"styleFix": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' 'test_forge/**/*.t.sol'",
|
13
|
+
"styleCheck": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' 'test_forge/**/*.t.sol'",
|
14
|
+
"lint": "solhint 'contracts/**/*.sol' 'test_forge/**/*.t.sol'"
|
12
15
|
},
|
13
16
|
"repository": {
|
14
17
|
"type": "git",
|
@@ -25,12 +28,19 @@
|
|
25
28
|
],
|
26
29
|
"homepage": "https://github.com/etherisc/gif-next#readme",
|
27
30
|
"devDependencies": {
|
28
|
-
"@nomicfoundation/hardhat-foundry": "^1.
|
31
|
+
"@nomicfoundation/hardhat-foundry": "^1.1.1",
|
29
32
|
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
|
30
|
-
"hardhat": "^
|
33
|
+
"@nomicfoundation/hardhat-verify": "^1.1.1",
|
34
|
+
"dotenv": "^16.3.1",
|
35
|
+
"hardhat": "^2.17.2",
|
36
|
+
"prettier": "^3.0.3",
|
37
|
+
"prettier-plugin-solidity": "^1.1.3"
|
31
38
|
},
|
32
39
|
"dependencies": {
|
33
40
|
"@openzeppelin/contracts": "^4.9.3",
|
34
|
-
"@openzeppelin/contracts-upgradeable": "^4.9.3"
|
41
|
+
"@openzeppelin/contracts-upgradeable": "^4.9.3",
|
42
|
+
"abi-coder": "^5.0.0",
|
43
|
+
"ethers": "^6.7.1",
|
44
|
+
"winston": "^3.10.0"
|
35
45
|
}
|
36
46
|
}
|
@@ -1,338 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"_format": "hh-sol-artifact-1",
|
3
|
-
"contractName": "DIP",
|
4
|
-
"sourceName": "contracts/Dip.sol",
|
5
|
-
"abi": [
|
6
|
-
{
|
7
|
-
"inputs": [],
|
8
|
-
"stateMutability": "nonpayable",
|
9
|
-
"type": "constructor"
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"anonymous": false,
|
13
|
-
"inputs": [
|
14
|
-
{
|
15
|
-
"indexed": true,
|
16
|
-
"internalType": "address",
|
17
|
-
"name": "owner",
|
18
|
-
"type": "address"
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"indexed": true,
|
22
|
-
"internalType": "address",
|
23
|
-
"name": "spender",
|
24
|
-
"type": "address"
|
25
|
-
},
|
26
|
-
{
|
27
|
-
"indexed": false,
|
28
|
-
"internalType": "uint256",
|
29
|
-
"name": "value",
|
30
|
-
"type": "uint256"
|
31
|
-
}
|
32
|
-
],
|
33
|
-
"name": "Approval",
|
34
|
-
"type": "event"
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"anonymous": false,
|
38
|
-
"inputs": [
|
39
|
-
{
|
40
|
-
"indexed": true,
|
41
|
-
"internalType": "address",
|
42
|
-
"name": "from",
|
43
|
-
"type": "address"
|
44
|
-
},
|
45
|
-
{
|
46
|
-
"indexed": true,
|
47
|
-
"internalType": "address",
|
48
|
-
"name": "to",
|
49
|
-
"type": "address"
|
50
|
-
},
|
51
|
-
{
|
52
|
-
"indexed": false,
|
53
|
-
"internalType": "uint256",
|
54
|
-
"name": "value",
|
55
|
-
"type": "uint256"
|
56
|
-
}
|
57
|
-
],
|
58
|
-
"name": "Transfer",
|
59
|
-
"type": "event"
|
60
|
-
},
|
61
|
-
{
|
62
|
-
"inputs": [],
|
63
|
-
"name": "DECIMALS",
|
64
|
-
"outputs": [
|
65
|
-
{
|
66
|
-
"internalType": "uint8",
|
67
|
-
"name": "",
|
68
|
-
"type": "uint8"
|
69
|
-
}
|
70
|
-
],
|
71
|
-
"stateMutability": "view",
|
72
|
-
"type": "function"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"inputs": [],
|
76
|
-
"name": "INITIAL_SUPPLY",
|
77
|
-
"outputs": [
|
78
|
-
{
|
79
|
-
"internalType": "uint256",
|
80
|
-
"name": "",
|
81
|
-
"type": "uint256"
|
82
|
-
}
|
83
|
-
],
|
84
|
-
"stateMutability": "view",
|
85
|
-
"type": "function"
|
86
|
-
},
|
87
|
-
{
|
88
|
-
"inputs": [],
|
89
|
-
"name": "NAME",
|
90
|
-
"outputs": [
|
91
|
-
{
|
92
|
-
"internalType": "string",
|
93
|
-
"name": "",
|
94
|
-
"type": "string"
|
95
|
-
}
|
96
|
-
],
|
97
|
-
"stateMutability": "view",
|
98
|
-
"type": "function"
|
99
|
-
},
|
100
|
-
{
|
101
|
-
"inputs": [],
|
102
|
-
"name": "SYMBOL",
|
103
|
-
"outputs": [
|
104
|
-
{
|
105
|
-
"internalType": "string",
|
106
|
-
"name": "",
|
107
|
-
"type": "string"
|
108
|
-
}
|
109
|
-
],
|
110
|
-
"stateMutability": "view",
|
111
|
-
"type": "function"
|
112
|
-
},
|
113
|
-
{
|
114
|
-
"inputs": [
|
115
|
-
{
|
116
|
-
"internalType": "address",
|
117
|
-
"name": "owner",
|
118
|
-
"type": "address"
|
119
|
-
},
|
120
|
-
{
|
121
|
-
"internalType": "address",
|
122
|
-
"name": "spender",
|
123
|
-
"type": "address"
|
124
|
-
}
|
125
|
-
],
|
126
|
-
"name": "allowance",
|
127
|
-
"outputs": [
|
128
|
-
{
|
129
|
-
"internalType": "uint256",
|
130
|
-
"name": "",
|
131
|
-
"type": "uint256"
|
132
|
-
}
|
133
|
-
],
|
134
|
-
"stateMutability": "view",
|
135
|
-
"type": "function"
|
136
|
-
},
|
137
|
-
{
|
138
|
-
"inputs": [
|
139
|
-
{
|
140
|
-
"internalType": "address",
|
141
|
-
"name": "spender",
|
142
|
-
"type": "address"
|
143
|
-
},
|
144
|
-
{
|
145
|
-
"internalType": "uint256",
|
146
|
-
"name": "amount",
|
147
|
-
"type": "uint256"
|
148
|
-
}
|
149
|
-
],
|
150
|
-
"name": "approve",
|
151
|
-
"outputs": [
|
152
|
-
{
|
153
|
-
"internalType": "bool",
|
154
|
-
"name": "",
|
155
|
-
"type": "bool"
|
156
|
-
}
|
157
|
-
],
|
158
|
-
"stateMutability": "nonpayable",
|
159
|
-
"type": "function"
|
160
|
-
},
|
161
|
-
{
|
162
|
-
"inputs": [
|
163
|
-
{
|
164
|
-
"internalType": "address",
|
165
|
-
"name": "account",
|
166
|
-
"type": "address"
|
167
|
-
}
|
168
|
-
],
|
169
|
-
"name": "balanceOf",
|
170
|
-
"outputs": [
|
171
|
-
{
|
172
|
-
"internalType": "uint256",
|
173
|
-
"name": "",
|
174
|
-
"type": "uint256"
|
175
|
-
}
|
176
|
-
],
|
177
|
-
"stateMutability": "view",
|
178
|
-
"type": "function"
|
179
|
-
},
|
180
|
-
{
|
181
|
-
"inputs": [],
|
182
|
-
"name": "decimals",
|
183
|
-
"outputs": [
|
184
|
-
{
|
185
|
-
"internalType": "uint8",
|
186
|
-
"name": "",
|
187
|
-
"type": "uint8"
|
188
|
-
}
|
189
|
-
],
|
190
|
-
"stateMutability": "pure",
|
191
|
-
"type": "function"
|
192
|
-
},
|
193
|
-
{
|
194
|
-
"inputs": [
|
195
|
-
{
|
196
|
-
"internalType": "address",
|
197
|
-
"name": "spender",
|
198
|
-
"type": "address"
|
199
|
-
},
|
200
|
-
{
|
201
|
-
"internalType": "uint256",
|
202
|
-
"name": "subtractedValue",
|
203
|
-
"type": "uint256"
|
204
|
-
}
|
205
|
-
],
|
206
|
-
"name": "decreaseAllowance",
|
207
|
-
"outputs": [
|
208
|
-
{
|
209
|
-
"internalType": "bool",
|
210
|
-
"name": "",
|
211
|
-
"type": "bool"
|
212
|
-
}
|
213
|
-
],
|
214
|
-
"stateMutability": "nonpayable",
|
215
|
-
"type": "function"
|
216
|
-
},
|
217
|
-
{
|
218
|
-
"inputs": [
|
219
|
-
{
|
220
|
-
"internalType": "address",
|
221
|
-
"name": "spender",
|
222
|
-
"type": "address"
|
223
|
-
},
|
224
|
-
{
|
225
|
-
"internalType": "uint256",
|
226
|
-
"name": "addedValue",
|
227
|
-
"type": "uint256"
|
228
|
-
}
|
229
|
-
],
|
230
|
-
"name": "increaseAllowance",
|
231
|
-
"outputs": [
|
232
|
-
{
|
233
|
-
"internalType": "bool",
|
234
|
-
"name": "",
|
235
|
-
"type": "bool"
|
236
|
-
}
|
237
|
-
],
|
238
|
-
"stateMutability": "nonpayable",
|
239
|
-
"type": "function"
|
240
|
-
},
|
241
|
-
{
|
242
|
-
"inputs": [],
|
243
|
-
"name": "name",
|
244
|
-
"outputs": [
|
245
|
-
{
|
246
|
-
"internalType": "string",
|
247
|
-
"name": "",
|
248
|
-
"type": "string"
|
249
|
-
}
|
250
|
-
],
|
251
|
-
"stateMutability": "view",
|
252
|
-
"type": "function"
|
253
|
-
},
|
254
|
-
{
|
255
|
-
"inputs": [],
|
256
|
-
"name": "symbol",
|
257
|
-
"outputs": [
|
258
|
-
{
|
259
|
-
"internalType": "string",
|
260
|
-
"name": "",
|
261
|
-
"type": "string"
|
262
|
-
}
|
263
|
-
],
|
264
|
-
"stateMutability": "view",
|
265
|
-
"type": "function"
|
266
|
-
},
|
267
|
-
{
|
268
|
-
"inputs": [],
|
269
|
-
"name": "totalSupply",
|
270
|
-
"outputs": [
|
271
|
-
{
|
272
|
-
"internalType": "uint256",
|
273
|
-
"name": "",
|
274
|
-
"type": "uint256"
|
275
|
-
}
|
276
|
-
],
|
277
|
-
"stateMutability": "view",
|
278
|
-
"type": "function"
|
279
|
-
},
|
280
|
-
{
|
281
|
-
"inputs": [
|
282
|
-
{
|
283
|
-
"internalType": "address",
|
284
|
-
"name": "to",
|
285
|
-
"type": "address"
|
286
|
-
},
|
287
|
-
{
|
288
|
-
"internalType": "uint256",
|
289
|
-
"name": "amount",
|
290
|
-
"type": "uint256"
|
291
|
-
}
|
292
|
-
],
|
293
|
-
"name": "transfer",
|
294
|
-
"outputs": [
|
295
|
-
{
|
296
|
-
"internalType": "bool",
|
297
|
-
"name": "",
|
298
|
-
"type": "bool"
|
299
|
-
}
|
300
|
-
],
|
301
|
-
"stateMutability": "nonpayable",
|
302
|
-
"type": "function"
|
303
|
-
},
|
304
|
-
{
|
305
|
-
"inputs": [
|
306
|
-
{
|
307
|
-
"internalType": "address",
|
308
|
-
"name": "from",
|
309
|
-
"type": "address"
|
310
|
-
},
|
311
|
-
{
|
312
|
-
"internalType": "address",
|
313
|
-
"name": "to",
|
314
|
-
"type": "address"
|
315
|
-
},
|
316
|
-
{
|
317
|
-
"internalType": "uint256",
|
318
|
-
"name": "amount",
|
319
|
-
"type": "uint256"
|
320
|
-
}
|
321
|
-
],
|
322
|
-
"name": "transferFrom",
|
323
|
-
"outputs": [
|
324
|
-
{
|
325
|
-
"internalType": "bool",
|
326
|
-
"name": "",
|
327
|
-
"type": "bool"
|
328
|
-
}
|
329
|
-
],
|
330
|
-
"stateMutability": "nonpayable",
|
331
|
-
"type": "function"
|
332
|
-
}
|
333
|
-
],
|
334
|
-
"bytecode": "0x608060405234801562000010575f80fd5b5060405180606001604052806028815260200162001d84602891396040518060400160405280600381526020017f44495000000000000000000000000000000000000000000000000000000000008152508160039081620000729190620004a8565b508060049081620000849190620004a8565b505050620000c86200009b620000ce60201b60201c565b6012600a620000ab919062000715565b633b9aca00620000bc919062000765565b620000d560201b60201c565b62000893565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160362000146576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200013d906200080d565b60405180910390fd5b620001595f83836200023a60201b60201c565b8060025f8282546200016c91906200082d565b92505081905550805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508173ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200021b919062000878565b60405180910390a3620002365f83836200023f60201b60201c565b5050565b505050565b505050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680620002c057607f821691505b602082108103620002d657620002d56200027b565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026200033a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620002fd565b620003468683620002fd565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f620003906200038a62000384846200035e565b62000367565b6200035e565b9050919050565b5f819050919050565b620003ab8362000370565b620003c3620003ba8262000397565b84845462000309565b825550505050565b5f90565b620003d9620003cb565b620003e6818484620003a0565b505050565b5b818110156200040d57620004015f82620003cf565b600181019050620003ec565b5050565b601f8211156200045c576200042681620002dc565b6200043184620002ee565b8101602085101562000441578190505b620004596200045085620002ee565b830182620003eb565b50505b505050565b5f82821c905092915050565b5f6200047e5f198460080262000461565b1980831691505092915050565b5f6200049883836200046d565b9150826002028217905092915050565b620004b38262000244565b67ffffffffffffffff811115620004cf57620004ce6200024e565b5b620004db8254620002a8565b620004e882828562000411565b5f60209050601f8311600181146200051e575f841562000509578287015190505b6200051585826200048b565b86555062000584565b601f1984166200052e86620002dc565b5f5b82811015620005575784890151825560018201915060208501945060208101905062000530565b8683101562000577578489015162000573601f8916826200046d565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b60018511156200061657808604811115620005ee57620005ed6200058c565b5b6001851615620005fe5780820291505b80810290506200060e85620005b9565b9450620005ce565b94509492505050565b5f8262000630576001905062000702565b816200063f575f905062000702565b8160018114620006585760028114620006635762000699565b600191505062000702565b60ff8411156200067857620006776200058c565b5b8360020a9150848211156200069257620006916200058c565b5b5062000702565b5060208310610133831016604e8410600b8410161715620006d35782820a905083811115620006cd57620006cc6200058c565b5b62000702565b620006e28484846001620005c5565b92509050818404811115620006fc57620006fb6200058c565b5b81810290505b9392505050565b5f60ff82169050919050565b5f62000721826200035e565b91506200072e8362000709565b92506200075d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846200061f565b905092915050565b5f62000771826200035e565b91506200077e836200035e565b92508282026200078e816200035e565b91508282048414831517620007a857620007a76200058c565b5b5092915050565b5f82825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f2061646472657373005f82015250565b5f620007f5601f83620007af565b91506200080282620007bf565b602082019050919050565b5f6020820190508181035f8301526200082681620007e7565b9050919050565b5f62000839826200035e565b915062000846836200035e565b92508282019050808211156200086157620008606200058c565b5b92915050565b62000872816200035e565b82525050565b5f6020820190506200088d5f83018462000867565b92915050565b6114e380620008a15f395ff3fe608060405234801561000f575f80fd5b50600436106100f3575f3560e01c80633950935111610095578063a457c2d711610064578063a457c2d714610289578063a9059cbb146102b9578063dd62ed3e146102e9578063f76f8d7814610319576100f3565b806339509351146101ed57806370a082311461021d57806395d89b411461024d578063a3f4df7e1461026b576100f3565b806323b872dd116100d157806323b872dd146101635780632e0f2625146101935780632ff2e9dc146101b1578063313ce567146101cf576100f3565b806306fdde03146100f7578063095ea7b31461011557806318160ddd14610145575b5f80fd5b6100ff610337565b60405161010c9190610c1b565b60405180910390f35b61012f600480360381019061012a9190610ccc565b6103c7565b60405161013c9190610d24565b60405180910390f35b61014d6103e9565b60405161015a9190610d4c565b60405180910390f35b61017d60048036038101906101789190610d65565b6103f2565b60405161018a9190610d24565b60405180910390f35b61019b610420565b6040516101a89190610dd0565b60405180910390f35b6101b9610425565b6040516101c69190610d4c565b60405180910390f35b6101d7610445565b6040516101e49190610dd0565b60405180910390f35b61020760048036038101906102029190610ccc565b61044d565b6040516102149190610d24565b60405180910390f35b61023760048036038101906102329190610de9565b610483565b6040516102449190610d4c565b60405180910390f35b6102556104c8565b6040516102629190610c1b565b60405180910390f35b610273610558565b6040516102809190610c1b565b60405180910390f35b6102a3600480360381019061029e9190610ccc565b610574565b6040516102b09190610d24565b60405180910390f35b6102d360048036038101906102ce9190610ccc565b6105e9565b6040516102e09190610d24565b60405180910390f35b61030360048036038101906102fe9190610e14565b61060b565b6040516103109190610d4c565b60405180910390f35b61032161068d565b60405161032e9190610c1b565b60405180910390f35b60606003805461034690610e7f565b80601f016020809104026020016040519081016040528092919081815260200182805461037290610e7f565b80156103bd5780601f10610394576101008083540402835291602001916103bd565b820191905f5260205f20905b8154815290600101906020018083116103a057829003601f168201915b5050505050905090565b5f806103d16106c6565b90506103de8185856106cd565b600191505092915050565b5f600254905090565b5f806103fc6106c6565b9050610409858285610890565b61041485858561091b565b60019150509392505050565b601281565b6012600a610433919061100b565b633b9aca006104429190611055565b81565b5f6012905090565b5f806104576106c6565b9050610478818585610469858961060b565b6104739190611096565b6106cd565b600191505092915050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6060600480546104d790610e7f565b80601f016020809104026020016040519081016040528092919081815260200182805461050390610e7f565b801561054e5780601f106105255761010080835404028352916020019161054e565b820191905f5260205f20905b81548152906001019060200180831161053157829003601f168201915b5050505050905090565b6040518060600160405280602881526020016114866028913981565b5f8061057e6106c6565b90505f61058b828661060b565b9050838110156105d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c790611139565b60405180910390fd5b6105dd82868684036106cd565b60019250505092915050565b5f806105f36106c6565b905061060081858561091b565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b6040518060400160405280600381526020017f444950000000000000000000000000000000000000000000000000000000000081525081565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361073b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610732906111c7565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090611255565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516108839190610d4c565b60405180910390a3505050565b5f61089b848461060b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146109155781811015610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe906112bd565b60405180910390fd5b61091484848484036106cd565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109809061134b565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036109f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ee906113d9565b60405180910390fd5b610a02838383610b87565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7c90611467565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b6e9190610d4c565b60405180910390a3610b81848484610b8c565b50505050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610bc8578082015181840152602081019050610bad565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610bed82610b91565b610bf78185610b9b565b9350610c07818560208601610bab565b610c1081610bd3565b840191505092915050565b5f6020820190508181035f830152610c338184610be3565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610c6882610c3f565b9050919050565b610c7881610c5e565b8114610c82575f80fd5b50565b5f81359050610c9381610c6f565b92915050565b5f819050919050565b610cab81610c99565b8114610cb5575f80fd5b50565b5f81359050610cc681610ca2565b92915050565b5f8060408385031215610ce257610ce1610c3b565b5b5f610cef85828601610c85565b9250506020610d0085828601610cb8565b9150509250929050565b5f8115159050919050565b610d1e81610d0a565b82525050565b5f602082019050610d375f830184610d15565b92915050565b610d4681610c99565b82525050565b5f602082019050610d5f5f830184610d3d565b92915050565b5f805f60608486031215610d7c57610d7b610c3b565b5b5f610d8986828701610c85565b9350506020610d9a86828701610c85565b9250506040610dab86828701610cb8565b9150509250925092565b5f60ff82169050919050565b610dca81610db5565b82525050565b5f602082019050610de35f830184610dc1565b92915050565b5f60208284031215610dfe57610dfd610c3b565b5b5f610e0b84828501610c85565b91505092915050565b5f8060408385031215610e2a57610e29610c3b565b5b5f610e3785828601610c85565b9250506020610e4885828601610c85565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610e9657607f821691505b602082108103610ea957610ea8610e52565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115610f3157808604811115610f0d57610f0c610eaf565b5b6001851615610f1c5780820291505b8081029050610f2a85610edc565b9450610ef1565b94509492505050565b5f82610f495760019050611004565b81610f56575f9050611004565b8160018114610f6c5760028114610f7657610fa5565b6001915050611004565b60ff841115610f8857610f87610eaf565b5b8360020a915084821115610f9f57610f9e610eaf565b5b50611004565b5060208310610133831016604e8410600b8410161715610fda5782820a905083811115610fd557610fd4610eaf565b5b611004565b610fe78484846001610ee8565b92509050818404811115610ffe57610ffd610eaf565b5b81810290505b9392505050565b5f61101582610c99565b915061102083610db5565b925061104d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484610f3a565b905092915050565b5f61105f82610c99565b915061106a83610c99565b925082820261107881610c99565b9150828204841483151761108f5761108e610eaf565b5b5092915050565b5f6110a082610c99565b91506110ab83610c99565b92508282019050808211156110c3576110c2610eaf565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f611123602583610b9b565b915061112e826110c9565b604082019050919050565b5f6020820190508181035f83015261115081611117565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6111b1602483610b9b565b91506111bc82611157565b604082019050919050565b5f6020820190508181035f8301526111de816111a5565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f61123f602283610b9b565b915061124a826111e5565b604082019050919050565b5f6020820190508181035f83015261126c81611233565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f6112a7601d83610b9b565b91506112b282611273565b602082019050919050565b5f6020820190508181035f8301526112d48161129b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f611335602583610b9b565b9150611340826112db565b604082019050919050565b5f6020820190508181035f83015261136281611329565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6113c3602383610b9b565b91506113ce82611369565b604082019050919050565b5f6020820190508181035f8301526113f0816113b7565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611451602683610b9b565b915061145c826113f7565b604082019050919050565b5f6020820190508181035f83015261147e81611445565b905091905056fe446563656e7472616c697a656420496e737572616e63652050726f746f636f6c202d2044554d4d59a2646970667358221220b5817fafe4925dedfbf7a88cb88310c1b3164f71f2d48445c354b2ba8929211964736f6c63430008140033446563656e7472616c697a656420496e737572616e63652050726f746f636f6c202d2044554d4d59",
|
335
|
-
"deployedBytecode": "0x608060405234801561000f575f80fd5b50600436106100f3575f3560e01c80633950935111610095578063a457c2d711610064578063a457c2d714610289578063a9059cbb146102b9578063dd62ed3e146102e9578063f76f8d7814610319576100f3565b806339509351146101ed57806370a082311461021d57806395d89b411461024d578063a3f4df7e1461026b576100f3565b806323b872dd116100d157806323b872dd146101635780632e0f2625146101935780632ff2e9dc146101b1578063313ce567146101cf576100f3565b806306fdde03146100f7578063095ea7b31461011557806318160ddd14610145575b5f80fd5b6100ff610337565b60405161010c9190610c1b565b60405180910390f35b61012f600480360381019061012a9190610ccc565b6103c7565b60405161013c9190610d24565b60405180910390f35b61014d6103e9565b60405161015a9190610d4c565b60405180910390f35b61017d60048036038101906101789190610d65565b6103f2565b60405161018a9190610d24565b60405180910390f35b61019b610420565b6040516101a89190610dd0565b60405180910390f35b6101b9610425565b6040516101c69190610d4c565b60405180910390f35b6101d7610445565b6040516101e49190610dd0565b60405180910390f35b61020760048036038101906102029190610ccc565b61044d565b6040516102149190610d24565b60405180910390f35b61023760048036038101906102329190610de9565b610483565b6040516102449190610d4c565b60405180910390f35b6102556104c8565b6040516102629190610c1b565b60405180910390f35b610273610558565b6040516102809190610c1b565b60405180910390f35b6102a3600480360381019061029e9190610ccc565b610574565b6040516102b09190610d24565b60405180910390f35b6102d360048036038101906102ce9190610ccc565b6105e9565b6040516102e09190610d24565b60405180910390f35b61030360048036038101906102fe9190610e14565b61060b565b6040516103109190610d4c565b60405180910390f35b61032161068d565b60405161032e9190610c1b565b60405180910390f35b60606003805461034690610e7f565b80601f016020809104026020016040519081016040528092919081815260200182805461037290610e7f565b80156103bd5780601f10610394576101008083540402835291602001916103bd565b820191905f5260205f20905b8154815290600101906020018083116103a057829003601f168201915b5050505050905090565b5f806103d16106c6565b90506103de8185856106cd565b600191505092915050565b5f600254905090565b5f806103fc6106c6565b9050610409858285610890565b61041485858561091b565b60019150509392505050565b601281565b6012600a610433919061100b565b633b9aca006104429190611055565b81565b5f6012905090565b5f806104576106c6565b9050610478818585610469858961060b565b6104739190611096565b6106cd565b600191505092915050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6060600480546104d790610e7f565b80601f016020809104026020016040519081016040528092919081815260200182805461050390610e7f565b801561054e5780601f106105255761010080835404028352916020019161054e565b820191905f5260205f20905b81548152906001019060200180831161053157829003601f168201915b5050505050905090565b6040518060600160405280602881526020016114866028913981565b5f8061057e6106c6565b90505f61058b828661060b565b9050838110156105d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c790611139565b60405180910390fd5b6105dd82868684036106cd565b60019250505092915050565b5f806105f36106c6565b905061060081858561091b565b600191505092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b6040518060400160405280600381526020017f444950000000000000000000000000000000000000000000000000000000000081525081565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361073b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610732906111c7565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090611255565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516108839190610d4c565b60405180910390a3505050565b5f61089b848461060b565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146109155781811015610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe906112bd565b60405180910390fd5b61091484848484036106cd565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109809061134b565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036109f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ee906113d9565b60405180910390fd5b610a02838383610b87565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7c90611467565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b6e9190610d4c565b60405180910390a3610b81848484610b8c565b50505050565b505050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610bc8578082015181840152602081019050610bad565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610bed82610b91565b610bf78185610b9b565b9350610c07818560208601610bab565b610c1081610bd3565b840191505092915050565b5f6020820190508181035f830152610c338184610be3565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610c6882610c3f565b9050919050565b610c7881610c5e565b8114610c82575f80fd5b50565b5f81359050610c9381610c6f565b92915050565b5f819050919050565b610cab81610c99565b8114610cb5575f80fd5b50565b5f81359050610cc681610ca2565b92915050565b5f8060408385031215610ce257610ce1610c3b565b5b5f610cef85828601610c85565b9250506020610d0085828601610cb8565b9150509250929050565b5f8115159050919050565b610d1e81610d0a565b82525050565b5f602082019050610d375f830184610d15565b92915050565b610d4681610c99565b82525050565b5f602082019050610d5f5f830184610d3d565b92915050565b5f805f60608486031215610d7c57610d7b610c3b565b5b5f610d8986828701610c85565b9350506020610d9a86828701610c85565b9250506040610dab86828701610cb8565b9150509250925092565b5f60ff82169050919050565b610dca81610db5565b82525050565b5f602082019050610de35f830184610dc1565b92915050565b5f60208284031215610dfe57610dfd610c3b565b5b5f610e0b84828501610c85565b91505092915050565b5f8060408385031215610e2a57610e29610c3b565b5b5f610e3785828601610c85565b9250506020610e4885828601610c85565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610e9657607f821691505b602082108103610ea957610ea8610e52565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115610f3157808604811115610f0d57610f0c610eaf565b5b6001851615610f1c5780820291505b8081029050610f2a85610edc565b9450610ef1565b94509492505050565b5f82610f495760019050611004565b81610f56575f9050611004565b8160018114610f6c5760028114610f7657610fa5565b6001915050611004565b60ff841115610f8857610f87610eaf565b5b8360020a915084821115610f9f57610f9e610eaf565b5b50611004565b5060208310610133831016604e8410600b8410161715610fda5782820a905083811115610fd557610fd4610eaf565b5b611004565b610fe78484846001610ee8565b92509050818404811115610ffe57610ffd610eaf565b5b81810290505b9392505050565b5f61101582610c99565b915061102083610db5565b925061104d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484610f3a565b905092915050565b5f61105f82610c99565b915061106a83610c99565b925082820261107881610c99565b9150828204841483151761108f5761108e610eaf565b5b5092915050565b5f6110a082610c99565b91506110ab83610c99565b92508282019050808211156110c3576110c2610eaf565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f611123602583610b9b565b915061112e826110c9565b604082019050919050565b5f6020820190508181035f83015261115081611117565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6111b1602483610b9b565b91506111bc82611157565b604082019050919050565b5f6020820190508181035f8301526111de816111a5565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f61123f602283610b9b565b915061124a826111e5565b604082019050919050565b5f6020820190508181035f83015261126c81611233565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f6112a7601d83610b9b565b91506112b282611273565b602082019050919050565b5f6020820190508181035f8301526112d48161129b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f611335602583610b9b565b9150611340826112db565b604082019050919050565b5f6020820190508181035f83015261136281611329565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6113c3602383610b9b565b91506113ce82611369565b604082019050919050565b5f6020820190508181035f8301526113f0816113b7565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611451602683610b9b565b915061145c826113f7565b604082019050919050565b5f6020820190508181035f83015261147e81611445565b905091905056fe446563656e7472616c697a656420496e737572616e63652050726f746f636f6c202d2044554d4d59a2646970667358221220b5817fafe4925dedfbf7a88cb88310c1b3164f71f2d48445c354b2ba8929211964736f6c63430008140033",
|
336
|
-
"linkReferences": {},
|
337
|
-
"deployedLinkReferences": {}
|
338
|
-
}
|