@yaswap/evm-contracts 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +115 -0
- package/artifacts/contracts/ILiqualityHTLC.sol/ILiqualityHTLC.json +216 -0
- package/artifacts/contracts/LibTransfer.sol/LibTransfer.json +10 -0
- package/artifacts/contracts/LiqualityHTLC.sol/LiqualityHTLC.json +260 -0
- package/artifacts/contracts/test/TestERC20.sol/TestERC20.json +304 -0
- package/artifacts/contracts/utils/Multicall.sol/Multicall3.json +449 -0
- package/contracts/ILiqualityHTLC.sol +59 -0
- package/contracts/LibTransfer.sol +11 -0
- package/contracts/LiqualityHTLC.sol +104 -0
- package/contracts/nft/ERC1155.sol +3 -0
- package/contracts/nft/ERC721.sol +3 -0
- package/contracts/test/TestERC20.sol +12 -0
- package/contracts/utils/Multicall.sol +242 -0
- package/package.json +94 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "TestERC20",
|
|
4
|
+
"sourceName": "contracts/test/TestERC20.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
|
+
{
|
|
64
|
+
"internalType": "address",
|
|
65
|
+
"name": "owner",
|
|
66
|
+
"type": "address"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"internalType": "address",
|
|
70
|
+
"name": "spender",
|
|
71
|
+
"type": "address"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"name": "allowance",
|
|
75
|
+
"outputs": [
|
|
76
|
+
{
|
|
77
|
+
"internalType": "uint256",
|
|
78
|
+
"name": "",
|
|
79
|
+
"type": "uint256"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"stateMutability": "view",
|
|
83
|
+
"type": "function"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"inputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "spender",
|
|
90
|
+
"type": "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"internalType": "uint256",
|
|
94
|
+
"name": "amount",
|
|
95
|
+
"type": "uint256"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"name": "approve",
|
|
99
|
+
"outputs": [
|
|
100
|
+
{
|
|
101
|
+
"internalType": "bool",
|
|
102
|
+
"name": "",
|
|
103
|
+
"type": "bool"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"stateMutability": "nonpayable",
|
|
107
|
+
"type": "function"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"inputs": [
|
|
111
|
+
{
|
|
112
|
+
"internalType": "address",
|
|
113
|
+
"name": "account",
|
|
114
|
+
"type": "address"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"name": "balanceOf",
|
|
118
|
+
"outputs": [
|
|
119
|
+
{
|
|
120
|
+
"internalType": "uint256",
|
|
121
|
+
"name": "",
|
|
122
|
+
"type": "uint256"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"stateMutability": "view",
|
|
126
|
+
"type": "function"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "decimals",
|
|
131
|
+
"outputs": [
|
|
132
|
+
{
|
|
133
|
+
"internalType": "uint8",
|
|
134
|
+
"name": "",
|
|
135
|
+
"type": "uint8"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"stateMutability": "view",
|
|
139
|
+
"type": "function"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"inputs": [
|
|
143
|
+
{
|
|
144
|
+
"internalType": "address",
|
|
145
|
+
"name": "spender",
|
|
146
|
+
"type": "address"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"internalType": "uint256",
|
|
150
|
+
"name": "subtractedValue",
|
|
151
|
+
"type": "uint256"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"name": "decreaseAllowance",
|
|
155
|
+
"outputs": [
|
|
156
|
+
{
|
|
157
|
+
"internalType": "bool",
|
|
158
|
+
"name": "",
|
|
159
|
+
"type": "bool"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"stateMutability": "nonpayable",
|
|
163
|
+
"type": "function"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"inputs": [
|
|
167
|
+
{
|
|
168
|
+
"internalType": "address",
|
|
169
|
+
"name": "spender",
|
|
170
|
+
"type": "address"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"internalType": "uint256",
|
|
174
|
+
"name": "addedValue",
|
|
175
|
+
"type": "uint256"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"name": "increaseAllowance",
|
|
179
|
+
"outputs": [
|
|
180
|
+
{
|
|
181
|
+
"internalType": "bool",
|
|
182
|
+
"name": "",
|
|
183
|
+
"type": "bool"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"stateMutability": "nonpayable",
|
|
187
|
+
"type": "function"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [
|
|
191
|
+
{
|
|
192
|
+
"internalType": "address",
|
|
193
|
+
"name": "account",
|
|
194
|
+
"type": "address"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"internalType": "uint256",
|
|
198
|
+
"name": "amount",
|
|
199
|
+
"type": "uint256"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"name": "mint",
|
|
203
|
+
"outputs": [],
|
|
204
|
+
"stateMutability": "nonpayable",
|
|
205
|
+
"type": "function"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"inputs": [],
|
|
209
|
+
"name": "name",
|
|
210
|
+
"outputs": [
|
|
211
|
+
{
|
|
212
|
+
"internalType": "string",
|
|
213
|
+
"name": "",
|
|
214
|
+
"type": "string"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"stateMutability": "view",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [],
|
|
222
|
+
"name": "symbol",
|
|
223
|
+
"outputs": [
|
|
224
|
+
{
|
|
225
|
+
"internalType": "string",
|
|
226
|
+
"name": "",
|
|
227
|
+
"type": "string"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"stateMutability": "view",
|
|
231
|
+
"type": "function"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"inputs": [],
|
|
235
|
+
"name": "totalSupply",
|
|
236
|
+
"outputs": [
|
|
237
|
+
{
|
|
238
|
+
"internalType": "uint256",
|
|
239
|
+
"name": "",
|
|
240
|
+
"type": "uint256"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"stateMutability": "view",
|
|
244
|
+
"type": "function"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"inputs": [
|
|
248
|
+
{
|
|
249
|
+
"internalType": "address",
|
|
250
|
+
"name": "to",
|
|
251
|
+
"type": "address"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"internalType": "uint256",
|
|
255
|
+
"name": "amount",
|
|
256
|
+
"type": "uint256"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"name": "transfer",
|
|
260
|
+
"outputs": [
|
|
261
|
+
{
|
|
262
|
+
"internalType": "bool",
|
|
263
|
+
"name": "",
|
|
264
|
+
"type": "bool"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"stateMutability": "nonpayable",
|
|
268
|
+
"type": "function"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"inputs": [
|
|
272
|
+
{
|
|
273
|
+
"internalType": "address",
|
|
274
|
+
"name": "from",
|
|
275
|
+
"type": "address"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"internalType": "address",
|
|
279
|
+
"name": "to",
|
|
280
|
+
"type": "address"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"internalType": "uint256",
|
|
284
|
+
"name": "amount",
|
|
285
|
+
"type": "uint256"
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"name": "transferFrom",
|
|
289
|
+
"outputs": [
|
|
290
|
+
{
|
|
291
|
+
"internalType": "bool",
|
|
292
|
+
"name": "",
|
|
293
|
+
"type": "bool"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"stateMutability": "nonpayable",
|
|
297
|
+
"type": "function"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"bytecode": "0x608060405234801561001057600080fd5b50604080518082018252600481526315195cdd60e21b602080830191825283518085019094526002845261151560f21b90840152815191929161005591600391610071565b508051610069906004906020840190610071565b505050610145565b82805461007d9061010a565b90600052602060002090601f01602090048101928261009f57600085556100e5565b82601f106100b857805160ff19168380011785556100e5565b828001600101855582156100e5579182015b828111156100e55782518255916020019190600101906100ca565b506100f19291506100f5565b5090565b5b808211156100f157600081556001016100f6565b600181811c9082168061011e57607f821691505b6020821081141561013f57634e487b7160e01b600052602260045260246000fd5b50919050565b610a19806101546000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee919061087f565b60405180910390f35b61010a6101053660046108f0565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091a565b6102b0565b604051601281526020016100ee565b61010a61015c3660046108f0565b6102d4565b61017461016f3660046108f0565b610313565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610321565b61010a6101b53660046108f0565b610330565b61010a6101c83660046108f0565b6103df565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ed565b5060019392505050565b6000336102be858285610511565b6102c98585856105a3565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a6908290869061030e9087906109e6565b6103ed565b61031d82826107a0565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102c982868684036103ed565b6000336102a68185856105a3565b6001600160a01b03831661044f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c9565b6001600160a01b0382166104b05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c9565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461059d57818110156105905760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103c9565b61059d84848484036103ed565b50505050565b6001600160a01b03831661061f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166106815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c9565b6001600160a01b038316600090815260208190526040902054818110156107105760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906107479084906109e6565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161079391815260200190565b60405180910390a361059d565b6001600160a01b0382166107f65760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103c9565b806002600082825461080891906109e6565b90915550506001600160a01b038216600090815260208190526040812080548392906108359084906109e6565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600060208083528351808285015260005b818110156108ac57858101830151858201604001528201610890565b818111156108be576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108eb57600080fd5b919050565b6000806040838503121561090357600080fd5b61090c836108d4565b946020939093013593505050565b60008060006060848603121561092f57600080fd5b610938846108d4565b9250610946602085016108d4565b9150604084013590509250925092565b60006020828403121561096857600080fd5b610971826108d4565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d4565b91506109a2602084016108d4565b90509250929050565b600181811c908216806109bf57607f821691505b602082108114156109e057634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610a0757634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080b000a",
|
|
301
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee919061087f565b60405180910390f35b61010a6101053660046108f0565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091a565b6102b0565b604051601281526020016100ee565b61010a61015c3660046108f0565b6102d4565b61017461016f3660046108f0565b610313565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610321565b61010a6101b53660046108f0565b610330565b61010a6101c83660046108f0565b6103df565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ed565b5060019392505050565b6000336102be858285610511565b6102c98585856105a3565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a6908290869061030e9087906109e6565b6103ed565b61031d82826107a0565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102c982868684036103ed565b6000336102a68185856105a3565b6001600160a01b03831661044f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c9565b6001600160a01b0382166104b05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c9565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461059d57818110156105905760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103c9565b61059d84848484036103ed565b50505050565b6001600160a01b03831661061f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166106815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c9565b6001600160a01b038316600090815260208190526040902054818110156107105760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906107479084906109e6565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161079391815260200190565b60405180910390a361059d565b6001600160a01b0382166107f65760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103c9565b806002600082825461080891906109e6565b90915550506001600160a01b038216600090815260208190526040812080548392906108359084906109e6565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600060208083528351808285015260005b818110156108ac57858101830151858201604001528201610890565b818111156108be576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108eb57600080fd5b919050565b6000806040838503121561090357600080fd5b61090c836108d4565b946020939093013593505050565b60008060006060848603121561092f57600080fd5b610938846108d4565b9250610946602085016108d4565b9150604084013590509250925092565b60006020828403121561096857600080fd5b610971826108d4565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d4565b91506109a2602084016108d4565b90509250929050565b600181811c908216806109bf57607f821691505b602082108114156109e057634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610a0757634e487b7160e01b600052601160045260246000fd5b50019056fea164736f6c634300080b000a",
|
|
302
|
+
"linkReferences": {},
|
|
303
|
+
"deployedLinkReferences": {}
|
|
304
|
+
}
|