quantumswap 0.0.6 → 0.0.8

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.
Files changed (38) hide show
  1. package/README.md +307 -307
  2. package/examples/README.md +46 -46
  3. package/examples/package-lock.json +12 -12
  4. package/examples/package.json +1 -1
  5. package/index.d.ts +1 -1
  6. package/index.js +45 -45
  7. package/package.json +32 -32
  8. package/src/IERC20.d.ts +24 -24
  9. package/src/IERC20.js +348 -348
  10. package/src/IERC20__factory.d.ts +10 -10
  11. package/src/IERC20__factory.js +29 -29
  12. package/src/QuantumSwapV2ERC20.d.ts +24 -24
  13. package/src/QuantumSwapV2ERC20.js +353 -353
  14. package/src/QuantumSwapV2ERC20__factory.d.ts +10 -10
  15. package/src/QuantumSwapV2ERC20__factory.js +29 -29
  16. package/src/QuantumSwapV2Factory.d.ts +24 -24
  17. package/src/QuantumSwapV2Factory.js +310 -310
  18. package/src/QuantumSwapV2Factory__factory.d.ts +10 -10
  19. package/src/QuantumSwapV2Factory__factory.js +29 -29
  20. package/src/QuantumSwapV2Pair.d.ts +44 -44
  21. package/src/QuantumSwapV2Pair.js +847 -847
  22. package/src/QuantumSwapV2Pair__factory.d.ts +10 -10
  23. package/src/QuantumSwapV2Pair__factory.js +29 -29
  24. package/src/QuantumSwapV2Router02.d.ts +47 -47
  25. package/src/QuantumSwapV2Router02.js +1109 -1109
  26. package/src/QuantumSwapV2Router02__factory.d.ts +10 -10
  27. package/src/QuantumSwapV2Router02__factory.js +29 -29
  28. package/src/WQ.d.ts +28 -28
  29. package/src/WQ.js +435 -435
  30. package/src/WQ__factory.d.ts +10 -10
  31. package/src/WQ__factory.js +29 -29
  32. package/src/index.d.ts +14 -14
  33. package/src/index.js +15 -15
  34. package/src/quantumcoin-shims.d.ts +25 -25
  35. package/src/types.d.ts +3 -3
  36. package/src/types.js +3 -3
  37. package/test/e2e/IERC20.e2e.test.js +8 -13
  38. package/test/e2e/all-contracts.e2e.test.js +10 -5
package/src/WQ.js CHANGED
@@ -1,435 +1,435 @@
1
- // Auto-generated by sdkgen
2
- const { Contract } = require("quantumcoin");
3
-
4
- /**
5
- * WQ - A typed contract interface for WQ
6
- */
7
- class WQ extends Contract {
8
- static abi = [
9
- {
10
- "anonymous": false,
11
- "inputs": [
12
- {
13
- "indexed": true,
14
- "internalType": "address",
15
- "name": "src",
16
- "type": "address"
17
- },
18
- {
19
- "indexed": true,
20
- "internalType": "address",
21
- "name": "guy",
22
- "type": "address"
23
- },
24
- {
25
- "indexed": false,
26
- "internalType": "uint256",
27
- "name": "wad",
28
- "type": "uint256"
29
- }
30
- ],
31
- "name": "Approval",
32
- "type": "event"
33
- },
34
- {
35
- "anonymous": false,
36
- "inputs": [
37
- {
38
- "indexed": true,
39
- "internalType": "address",
40
- "name": "dst",
41
- "type": "address"
42
- },
43
- {
44
- "indexed": false,
45
- "internalType": "uint256",
46
- "name": "wad",
47
- "type": "uint256"
48
- }
49
- ],
50
- "name": "Deposit",
51
- "type": "event"
52
- },
53
- {
54
- "anonymous": false,
55
- "inputs": [
56
- {
57
- "indexed": true,
58
- "internalType": "address",
59
- "name": "src",
60
- "type": "address"
61
- },
62
- {
63
- "indexed": true,
64
- "internalType": "address",
65
- "name": "dst",
66
- "type": "address"
67
- },
68
- {
69
- "indexed": false,
70
- "internalType": "uint256",
71
- "name": "wad",
72
- "type": "uint256"
73
- }
74
- ],
75
- "name": "Transfer",
76
- "type": "event"
77
- },
78
- {
79
- "anonymous": false,
80
- "inputs": [
81
- {
82
- "indexed": true,
83
- "internalType": "address",
84
- "name": "src",
85
- "type": "address"
86
- },
87
- {
88
- "indexed": false,
89
- "internalType": "uint256",
90
- "name": "wad",
91
- "type": "uint256"
92
- }
93
- ],
94
- "name": "Withdrawal",
95
- "type": "event"
96
- },
97
- {
98
- "inputs": [
99
- {
100
- "internalType": "address",
101
- "name": "",
102
- "type": "address"
103
- },
104
- {
105
- "internalType": "address",
106
- "name": "",
107
- "type": "address"
108
- }
109
- ],
110
- "name": "allowance",
111
- "outputs": [
112
- {
113
- "internalType": "uint256",
114
- "name": "",
115
- "type": "uint256"
116
- }
117
- ],
118
- "stateMutability": "view",
119
- "type": "function"
120
- },
121
- {
122
- "inputs": [
123
- {
124
- "internalType": "address",
125
- "name": "guy",
126
- "type": "address"
127
- },
128
- {
129
- "internalType": "uint256",
130
- "name": "wad",
131
- "type": "uint256"
132
- }
133
- ],
134
- "name": "approve",
135
- "outputs": [
136
- {
137
- "internalType": "bool",
138
- "name": "",
139
- "type": "bool"
140
- }
141
- ],
142
- "stateMutability": "nonpayable",
143
- "type": "function"
144
- },
145
- {
146
- "inputs": [
147
- {
148
- "internalType": "address",
149
- "name": "",
150
- "type": "address"
151
- }
152
- ],
153
- "name": "balanceOf",
154
- "outputs": [
155
- {
156
- "internalType": "uint256",
157
- "name": "",
158
- "type": "uint256"
159
- }
160
- ],
161
- "stateMutability": "view",
162
- "type": "function"
163
- },
164
- {
165
- "inputs": [],
166
- "name": "decimals",
167
- "outputs": [
168
- {
169
- "internalType": "uint8",
170
- "name": "",
171
- "type": "uint8"
172
- }
173
- ],
174
- "stateMutability": "view",
175
- "type": "function"
176
- },
177
- {
178
- "inputs": [],
179
- "name": "deposit",
180
- "outputs": [],
181
- "stateMutability": "payable",
182
- "type": "function"
183
- },
184
- {
185
- "inputs": [],
186
- "name": "name",
187
- "outputs": [
188
- {
189
- "internalType": "string",
190
- "name": "",
191
- "type": "string"
192
- }
193
- ],
194
- "stateMutability": "view",
195
- "type": "function"
196
- },
197
- {
198
- "inputs": [],
199
- "name": "symbol",
200
- "outputs": [
201
- {
202
- "internalType": "string",
203
- "name": "",
204
- "type": "string"
205
- }
206
- ],
207
- "stateMutability": "view",
208
- "type": "function"
209
- },
210
- {
211
- "inputs": [],
212
- "name": "totalSupply",
213
- "outputs": [
214
- {
215
- "internalType": "uint256",
216
- "name": "",
217
- "type": "uint256"
218
- }
219
- ],
220
- "stateMutability": "view",
221
- "type": "function"
222
- },
223
- {
224
- "inputs": [
225
- {
226
- "internalType": "address",
227
- "name": "dst",
228
- "type": "address"
229
- },
230
- {
231
- "internalType": "uint256",
232
- "name": "wad",
233
- "type": "uint256"
234
- }
235
- ],
236
- "name": "transfer",
237
- "outputs": [
238
- {
239
- "internalType": "bool",
240
- "name": "",
241
- "type": "bool"
242
- }
243
- ],
244
- "stateMutability": "nonpayable",
245
- "type": "function"
246
- },
247
- {
248
- "inputs": [
249
- {
250
- "internalType": "address",
251
- "name": "src",
252
- "type": "address"
253
- },
254
- {
255
- "internalType": "address",
256
- "name": "dst",
257
- "type": "address"
258
- },
259
- {
260
- "internalType": "uint256",
261
- "name": "wad",
262
- "type": "uint256"
263
- }
264
- ],
265
- "name": "transferFrom",
266
- "outputs": [
267
- {
268
- "internalType": "bool",
269
- "name": "",
270
- "type": "bool"
271
- }
272
- ],
273
- "stateMutability": "nonpayable",
274
- "type": "function"
275
- },
276
- {
277
- "inputs": [
278
- {
279
- "internalType": "uint256",
280
- "name": "wad",
281
- "type": "uint256"
282
- }
283
- ],
284
- "name": "withdraw",
285
- "outputs": [],
286
- "stateMutability": "nonpayable",
287
- "type": "function"
288
- },
289
- {
290
- "stateMutability": "payable",
291
- "type": "receive"
292
- }
293
- ];
294
- static bytecode = "0x60806040526040518060400160405280600981526020017f57726170706564205100000000000000000000000000000000000000000000008152506000908051906020019061004f9291906100ca565b506040518060400160405280600281526020017f57510000000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100ca565b506012600260006101000a81548160ff021916908360ff1602179055503480156100c457600080fd5b50610175565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826101005760008555610147565b82601f1061011957805160ff1916838001178555610147565b82800160010185558215610147579182015b8281111561014657825182559160200191906001019061012b565b5b5090506101549190610158565b5090565b5b80821115610171576000816000905550600101610159565b5090565b6108ef806101846000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461026a57806370a082311461029857806395d89b41146102e7578063a9059cbb14610377578063d0e30db0146103d2578063dd62ed3e146103dc576100af565b806306fdde03146100b4578063095ea7b31461014457806318160ddd1461019f57806323b872dd146101ca5780632e1a7d4d1461022f576100af565b366100af576100ad610435565b005b600080fd5b3480156100c057600080fd5b506100c9610490565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b506101876004803603604081101561016757600080fd5b81019080803590602001909291908035906020019092919050505061052e565b60405180821515815260200191505060405180910390f35b3480156101ab57600080fd5b506101b461059c565b6040518082815260200191505060405180910390f35b3480156101d657600080fd5b50610217600480360360608110156101ed57600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506105a4565b60405180821515815260200191505060405180910390f35b34801561023b57600080fd5b506102686004803603602081101561025257600080fd5b8101908080359060200190929190505050610709565b005b34801561027657600080fd5b5061027f6107b6565b604051808260ff16815260200191505060405180910390f35b3480156102a457600080fd5b506102d1600480360360208110156102bb57600080fd5b81019080803590602001909291905050506107c9565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc6107e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033c578082015181840152602081019050610321565b50505050905090810190601f1680156103695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038357600080fd5b506103ba6004803603604081101561039a57600080fd5b81019080803590602001909291908035906020019092919050505061087f565b60405180821515815260200191505060405180910390f35b6103da610435565b005b3480156103e857600080fd5b5061041f600480360360408110156103ff57600080fd5b810190808035906020019092919080359060200190929190505050610894565b6040518082815260200191505060405180910390f35b346003600033815260200190815260200160002060008282540192505081905550337fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105265780601f106104fb57610100808354040283529160200191610526565b820191906000526020600020905b81548152906001019060200180831161050957829003601f168201915b505050505081565b6000816004600033815260200190815260200160002060008581526020019081526020016000208190555082337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600047905090565b600081600360008681526020019081526020016000205410156105c657600080fd5b33841415801561061a57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6004600086815260200190815260200160002060003381526020019081526020016000205414155b15610683578160046000868152602001908152602001600020600033815260200190815260200160002054101561065057600080fd5b81600460008681526020019081526020016000206000338152602001908152602001600020600082825403925050819055505b81600360008681526020019081526020016000206000828254039250508190555081600360008581526020019081526020016000206000828254019250508190555082847fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b806003600033815260200190815260200160002054101561072957600080fd5b806003600033815260200190815260200160002060008282540392505081905550336108fc829081150290604051600060405180830381858888f1935050505015801561077a573d6000803e3d6000fd5b50337f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b505050505081565b600061088c3384846105a4565b905092915050565b600460205281600052604060002060205280600052604060002060009150915050548156fea2646970667358221220e6a100d0088383759832f6501e6cf6751a3c35ed6b4f90fdb6dc96e40bd369eb64736f6c63430007060033";
295
-
296
- static connect(address, runner) {
297
- return new WQ(address, runner);
298
- }
299
-
300
- constructor(address, runner, _deployTx) {
301
- super(address, WQ.abi, runner, WQ.bytecode);
302
- this._deployTx = _deployTx;
303
-
304
- // Typed populateTransaction helpers (offline signing / sendRawTransaction flows)
305
- this.populateTransaction = {
306
- approve: async (guy, wad, overrides) => {
307
- const data = this.interface.encodeFunctionData("approve", [guy, wad]);
308
- return { to: this.address, data, ...(overrides || {}) };
309
- },
310
- deposit: async (overrides) => {
311
- const data = this.interface.encodeFunctionData("deposit", []);
312
- return { to: this.address, data, ...(overrides || {}) };
313
- },
314
- transfer: async (dst, wad, overrides) => {
315
- const data = this.interface.encodeFunctionData("transfer", [dst, wad]);
316
- return { to: this.address, data, ...(overrides || {}) };
317
- },
318
- transferFrom: async (src, dst, wad, overrides) => {
319
- const data = this.interface.encodeFunctionData("transferFrom", [src, dst, wad]);
320
- return { to: this.address, data, ...(overrides || {}) };
321
- },
322
- withdraw: async (wad, overrides) => {
323
- const data = this.interface.encodeFunctionData("withdraw", [wad]);
324
- return { to: this.address, data, ...(overrides || {}) };
325
- },
326
- };
327
- }
328
-
329
- /**
330
- * allowance
331
- * @param {import("quantumcoin/types").AddressLike} arg
332
- * @param {import("quantumcoin/types").AddressLike} arg
333
- * @returns {Promise<import("quantumcoin/types").Uint256>}
334
- */
335
- async allowance(arg0, arg1) {
336
- const res = await this.call("allowance", [arg0, arg1]);
337
- return Array.isArray(res) ? res[0] : res;
338
- }
339
-
340
- /**
341
- * approve
342
- * @param {import("quantumcoin/types").AddressLike} guy
343
- * @param {import("quantumcoin/types").Uint256Like} wad
344
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
345
- */
346
- async approve(guy, wad, overrides) {
347
- return this.send("approve", [guy, wad], overrides);
348
- }
349
-
350
- /**
351
- * balanceOf
352
- * @param {import("quantumcoin/types").AddressLike} arg
353
- * @returns {Promise<import("quantumcoin/types").Uint256>}
354
- */
355
- async balanceOf(arg0) {
356
- const res = await this.call("balanceOf", [arg0]);
357
- return Array.isArray(res) ? res[0] : res;
358
- }
359
-
360
- /**
361
- * decimals
362
- * @returns {Promise<import("quantumcoin/types").Uint8>}
363
- */
364
- async decimals() {
365
- const res = await this.call("decimals", []);
366
- return Array.isArray(res) ? res[0] : res;
367
- }
368
-
369
- /**
370
- * deposit
371
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
372
- */
373
- async deposit(overrides) {
374
- return this.send("deposit", [], overrides);
375
- }
376
-
377
- /**
378
- * name
379
- * @returns {Promise<string>}
380
- */
381
- async name() {
382
- const res = await this.call("name", []);
383
- return Array.isArray(res) ? res[0] : res;
384
- }
385
-
386
- /**
387
- * symbol
388
- * @returns {Promise<string>}
389
- */
390
- async symbol() {
391
- const res = await this.call("symbol", []);
392
- return Array.isArray(res) ? res[0] : res;
393
- }
394
-
395
- /**
396
- * totalSupply
397
- * @returns {Promise<import("quantumcoin/types").Uint256>}
398
- */
399
- async totalSupply() {
400
- const res = await this.call("totalSupply", []);
401
- return Array.isArray(res) ? res[0] : res;
402
- }
403
-
404
- /**
405
- * transfer
406
- * @param {import("quantumcoin/types").AddressLike} dst
407
- * @param {import("quantumcoin/types").Uint256Like} wad
408
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
409
- */
410
- async transfer(dst, wad, overrides) {
411
- return this.send("transfer", [dst, wad], overrides);
412
- }
413
-
414
- /**
415
- * transferFrom
416
- * @param {import("quantumcoin/types").AddressLike} src
417
- * @param {import("quantumcoin/types").AddressLike} dst
418
- * @param {import("quantumcoin/types").Uint256Like} wad
419
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
420
- */
421
- async transferFrom(src, dst, wad, overrides) {
422
- return this.send("transferFrom", [src, dst, wad], overrides);
423
- }
424
-
425
- /**
426
- * withdraw
427
- * @param {import("quantumcoin/types").Uint256Like} wad
428
- * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
429
- */
430
- async withdraw(wad, overrides) {
431
- return this.send("withdraw", [wad], overrides);
432
- }
433
- }
434
-
435
- module.exports = { WQ };
1
+ // Auto-generated by sdkgen
2
+ const { Contract } = require("quantumcoin");
3
+
4
+ /**
5
+ * WQ - A typed contract interface for WQ
6
+ */
7
+ class WQ extends Contract {
8
+ static abi = [
9
+ {
10
+ "anonymous": false,
11
+ "inputs": [
12
+ {
13
+ "indexed": true,
14
+ "internalType": "address",
15
+ "name": "src",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "indexed": true,
20
+ "internalType": "address",
21
+ "name": "guy",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "indexed": false,
26
+ "internalType": "uint256",
27
+ "name": "wad",
28
+ "type": "uint256"
29
+ }
30
+ ],
31
+ "name": "Approval",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "anonymous": false,
36
+ "inputs": [
37
+ {
38
+ "indexed": true,
39
+ "internalType": "address",
40
+ "name": "dst",
41
+ "type": "address"
42
+ },
43
+ {
44
+ "indexed": false,
45
+ "internalType": "uint256",
46
+ "name": "wad",
47
+ "type": "uint256"
48
+ }
49
+ ],
50
+ "name": "Deposit",
51
+ "type": "event"
52
+ },
53
+ {
54
+ "anonymous": false,
55
+ "inputs": [
56
+ {
57
+ "indexed": true,
58
+ "internalType": "address",
59
+ "name": "src",
60
+ "type": "address"
61
+ },
62
+ {
63
+ "indexed": true,
64
+ "internalType": "address",
65
+ "name": "dst",
66
+ "type": "address"
67
+ },
68
+ {
69
+ "indexed": false,
70
+ "internalType": "uint256",
71
+ "name": "wad",
72
+ "type": "uint256"
73
+ }
74
+ ],
75
+ "name": "Transfer",
76
+ "type": "event"
77
+ },
78
+ {
79
+ "anonymous": false,
80
+ "inputs": [
81
+ {
82
+ "indexed": true,
83
+ "internalType": "address",
84
+ "name": "src",
85
+ "type": "address"
86
+ },
87
+ {
88
+ "indexed": false,
89
+ "internalType": "uint256",
90
+ "name": "wad",
91
+ "type": "uint256"
92
+ }
93
+ ],
94
+ "name": "Withdrawal",
95
+ "type": "event"
96
+ },
97
+ {
98
+ "inputs": [
99
+ {
100
+ "internalType": "address",
101
+ "name": "",
102
+ "type": "address"
103
+ },
104
+ {
105
+ "internalType": "address",
106
+ "name": "",
107
+ "type": "address"
108
+ }
109
+ ],
110
+ "name": "allowance",
111
+ "outputs": [
112
+ {
113
+ "internalType": "uint256",
114
+ "name": "",
115
+ "type": "uint256"
116
+ }
117
+ ],
118
+ "stateMutability": "view",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [
123
+ {
124
+ "internalType": "address",
125
+ "name": "guy",
126
+ "type": "address"
127
+ },
128
+ {
129
+ "internalType": "uint256",
130
+ "name": "wad",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "name": "approve",
135
+ "outputs": [
136
+ {
137
+ "internalType": "bool",
138
+ "name": "",
139
+ "type": "bool"
140
+ }
141
+ ],
142
+ "stateMutability": "nonpayable",
143
+ "type": "function"
144
+ },
145
+ {
146
+ "inputs": [
147
+ {
148
+ "internalType": "address",
149
+ "name": "",
150
+ "type": "address"
151
+ }
152
+ ],
153
+ "name": "balanceOf",
154
+ "outputs": [
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "",
158
+ "type": "uint256"
159
+ }
160
+ ],
161
+ "stateMutability": "view",
162
+ "type": "function"
163
+ },
164
+ {
165
+ "inputs": [],
166
+ "name": "decimals",
167
+ "outputs": [
168
+ {
169
+ "internalType": "uint8",
170
+ "name": "",
171
+ "type": "uint8"
172
+ }
173
+ ],
174
+ "stateMutability": "view",
175
+ "type": "function"
176
+ },
177
+ {
178
+ "inputs": [],
179
+ "name": "deposit",
180
+ "outputs": [],
181
+ "stateMutability": "payable",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [],
186
+ "name": "name",
187
+ "outputs": [
188
+ {
189
+ "internalType": "string",
190
+ "name": "",
191
+ "type": "string"
192
+ }
193
+ ],
194
+ "stateMutability": "view",
195
+ "type": "function"
196
+ },
197
+ {
198
+ "inputs": [],
199
+ "name": "symbol",
200
+ "outputs": [
201
+ {
202
+ "internalType": "string",
203
+ "name": "",
204
+ "type": "string"
205
+ }
206
+ ],
207
+ "stateMutability": "view",
208
+ "type": "function"
209
+ },
210
+ {
211
+ "inputs": [],
212
+ "name": "totalSupply",
213
+ "outputs": [
214
+ {
215
+ "internalType": "uint256",
216
+ "name": "",
217
+ "type": "uint256"
218
+ }
219
+ ],
220
+ "stateMutability": "view",
221
+ "type": "function"
222
+ },
223
+ {
224
+ "inputs": [
225
+ {
226
+ "internalType": "address",
227
+ "name": "dst",
228
+ "type": "address"
229
+ },
230
+ {
231
+ "internalType": "uint256",
232
+ "name": "wad",
233
+ "type": "uint256"
234
+ }
235
+ ],
236
+ "name": "transfer",
237
+ "outputs": [
238
+ {
239
+ "internalType": "bool",
240
+ "name": "",
241
+ "type": "bool"
242
+ }
243
+ ],
244
+ "stateMutability": "nonpayable",
245
+ "type": "function"
246
+ },
247
+ {
248
+ "inputs": [
249
+ {
250
+ "internalType": "address",
251
+ "name": "src",
252
+ "type": "address"
253
+ },
254
+ {
255
+ "internalType": "address",
256
+ "name": "dst",
257
+ "type": "address"
258
+ },
259
+ {
260
+ "internalType": "uint256",
261
+ "name": "wad",
262
+ "type": "uint256"
263
+ }
264
+ ],
265
+ "name": "transferFrom",
266
+ "outputs": [
267
+ {
268
+ "internalType": "bool",
269
+ "name": "",
270
+ "type": "bool"
271
+ }
272
+ ],
273
+ "stateMutability": "nonpayable",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "inputs": [
278
+ {
279
+ "internalType": "uint256",
280
+ "name": "wad",
281
+ "type": "uint256"
282
+ }
283
+ ],
284
+ "name": "withdraw",
285
+ "outputs": [],
286
+ "stateMutability": "nonpayable",
287
+ "type": "function"
288
+ },
289
+ {
290
+ "stateMutability": "payable",
291
+ "type": "receive"
292
+ }
293
+ ];
294
+ static bytecode = "0x60806040526040518060400160405280600981526020017f57726170706564205100000000000000000000000000000000000000000000008152506000908051906020019061004f9291906100ca565b506040518060400160405280600281526020017f57510000000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100ca565b506012600260006101000a81548160ff021916908360ff1602179055503480156100c457600080fd5b50610175565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826101005760008555610147565b82601f1061011957805160ff1916838001178555610147565b82800160010185558215610147579182015b8281111561014657825182559160200191906001019061012b565b5b5090506101549190610158565b5090565b5b80821115610171576000816000905550600101610159565b5090565b6108ef806101846000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461026a57806370a082311461029857806395d89b41146102e7578063a9059cbb14610377578063d0e30db0146103d2578063dd62ed3e146103dc576100af565b806306fdde03146100b4578063095ea7b31461014457806318160ddd1461019f57806323b872dd146101ca5780632e1a7d4d1461022f576100af565b366100af576100ad610435565b005b600080fd5b3480156100c057600080fd5b506100c9610490565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b506101876004803603604081101561016757600080fd5b81019080803590602001909291908035906020019092919050505061052e565b60405180821515815260200191505060405180910390f35b3480156101ab57600080fd5b506101b461059c565b6040518082815260200191505060405180910390f35b3480156101d657600080fd5b50610217600480360360608110156101ed57600080fd5b810190808035906020019092919080359060200190929190803590602001909291905050506105a4565b60405180821515815260200191505060405180910390f35b34801561023b57600080fd5b506102686004803603602081101561025257600080fd5b8101908080359060200190929190505050610709565b005b34801561027657600080fd5b5061027f6107b6565b604051808260ff16815260200191505060405180910390f35b3480156102a457600080fd5b506102d1600480360360208110156102bb57600080fd5b81019080803590602001909291905050506107c9565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc6107e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033c578082015181840152602081019050610321565b50505050905090810190601f1680156103695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038357600080fd5b506103ba6004803603604081101561039a57600080fd5b81019080803590602001909291908035906020019092919050505061087f565b60405180821515815260200191505060405180910390f35b6103da610435565b005b3480156103e857600080fd5b5061041f600480360360408110156103ff57600080fd5b810190808035906020019092919080359060200190929190505050610894565b6040518082815260200191505060405180910390f35b346003600033815260200190815260200160002060008282540192505081905550337fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105265780601f106104fb57610100808354040283529160200191610526565b820191906000526020600020905b81548152906001019060200180831161050957829003601f168201915b505050505081565b6000816004600033815260200190815260200160002060008581526020019081526020016000208190555082337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600047905090565b600081600360008681526020019081526020016000205410156105c657600080fd5b33841415801561061a57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6004600086815260200190815260200160002060003381526020019081526020016000205414155b15610683578160046000868152602001908152602001600020600033815260200190815260200160002054101561065057600080fd5b81600460008681526020019081526020016000206000338152602001908152602001600020600082825403925050819055505b81600360008681526020019081526020016000206000828254039250508190555081600360008581526020019081526020016000206000828254019250508190555082847fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b806003600033815260200190815260200160002054101561072957600080fd5b806003600033815260200190815260200160002060008282540392505081905550336108fc829081150290604051600060405180830381858888f1935050505015801561077a573d6000803e3d6000fd5b50337f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b505050505081565b600061088c3384846105a4565b905092915050565b600460205281600052604060002060205280600052604060002060009150915050548156fea2646970667358221220e6a100d0088383759832f6501e6cf6751a3c35ed6b4f90fdb6dc96e40bd369eb64736f6c63430007060033";
295
+
296
+ static connect(address, runner) {
297
+ return new WQ(address, runner);
298
+ }
299
+
300
+ constructor(address, runner, _deployTx) {
301
+ super(address, WQ.abi, runner, WQ.bytecode);
302
+ this._deployTx = _deployTx;
303
+
304
+ // Typed populateTransaction helpers (offline signing / sendRawTransaction flows)
305
+ this.populateTransaction = {
306
+ approve: async (guy, wad, overrides) => {
307
+ const data = this.interface.encodeFunctionData("approve", [guy, wad]);
308
+ return { to: this.address, data, ...(overrides || {}) };
309
+ },
310
+ deposit: async (overrides) => {
311
+ const data = this.interface.encodeFunctionData("deposit", []);
312
+ return { to: this.address, data, ...(overrides || {}) };
313
+ },
314
+ transfer: async (dst, wad, overrides) => {
315
+ const data = this.interface.encodeFunctionData("transfer", [dst, wad]);
316
+ return { to: this.address, data, ...(overrides || {}) };
317
+ },
318
+ transferFrom: async (src, dst, wad, overrides) => {
319
+ const data = this.interface.encodeFunctionData("transferFrom", [src, dst, wad]);
320
+ return { to: this.address, data, ...(overrides || {}) };
321
+ },
322
+ withdraw: async (wad, overrides) => {
323
+ const data = this.interface.encodeFunctionData("withdraw", [wad]);
324
+ return { to: this.address, data, ...(overrides || {}) };
325
+ },
326
+ };
327
+ }
328
+
329
+ /**
330
+ * allowance
331
+ * @param {import("quantumcoin/types").AddressLike} arg
332
+ * @param {import("quantumcoin/types").AddressLike} arg
333
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
334
+ */
335
+ async allowance(arg0, arg1) {
336
+ const res = await this.call("allowance", [arg0, arg1]);
337
+ return Array.isArray(res) ? res[0] : res;
338
+ }
339
+
340
+ /**
341
+ * approve
342
+ * @param {import("quantumcoin/types").AddressLike} guy
343
+ * @param {import("quantumcoin/types").Uint256Like} wad
344
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
345
+ */
346
+ async approve(guy, wad, overrides) {
347
+ return this.send("approve", [guy, wad], overrides);
348
+ }
349
+
350
+ /**
351
+ * balanceOf
352
+ * @param {import("quantumcoin/types").AddressLike} arg
353
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
354
+ */
355
+ async balanceOf(arg0) {
356
+ const res = await this.call("balanceOf", [arg0]);
357
+ return Array.isArray(res) ? res[0] : res;
358
+ }
359
+
360
+ /**
361
+ * decimals
362
+ * @returns {Promise<import("quantumcoin/types").Uint8>}
363
+ */
364
+ async decimals() {
365
+ const res = await this.call("decimals", []);
366
+ return Array.isArray(res) ? res[0] : res;
367
+ }
368
+
369
+ /**
370
+ * deposit
371
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
372
+ */
373
+ async deposit(overrides) {
374
+ return this.send("deposit", [], overrides);
375
+ }
376
+
377
+ /**
378
+ * name
379
+ * @returns {Promise<string>}
380
+ */
381
+ async name() {
382
+ const res = await this.call("name", []);
383
+ return Array.isArray(res) ? res[0] : res;
384
+ }
385
+
386
+ /**
387
+ * symbol
388
+ * @returns {Promise<string>}
389
+ */
390
+ async symbol() {
391
+ const res = await this.call("symbol", []);
392
+ return Array.isArray(res) ? res[0] : res;
393
+ }
394
+
395
+ /**
396
+ * totalSupply
397
+ * @returns {Promise<import("quantumcoin/types").Uint256>}
398
+ */
399
+ async totalSupply() {
400
+ const res = await this.call("totalSupply", []);
401
+ return Array.isArray(res) ? res[0] : res;
402
+ }
403
+
404
+ /**
405
+ * transfer
406
+ * @param {import("quantumcoin/types").AddressLike} dst
407
+ * @param {import("quantumcoin/types").Uint256Like} wad
408
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
409
+ */
410
+ async transfer(dst, wad, overrides) {
411
+ return this.send("transfer", [dst, wad], overrides);
412
+ }
413
+
414
+ /**
415
+ * transferFrom
416
+ * @param {import("quantumcoin/types").AddressLike} src
417
+ * @param {import("quantumcoin/types").AddressLike} dst
418
+ * @param {import("quantumcoin/types").Uint256Like} wad
419
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
420
+ */
421
+ async transferFrom(src, dst, wad, overrides) {
422
+ return this.send("transferFrom", [src, dst, wad], overrides);
423
+ }
424
+
425
+ /**
426
+ * withdraw
427
+ * @param {import("quantumcoin/types").Uint256Like} wad
428
+ * @returns {Promise<import("quantumcoin").ContractTransactionResponse>}
429
+ */
430
+ async withdraw(wad, overrides) {
431
+ return this.send("withdraw", [wad], overrides);
432
+ }
433
+ }
434
+
435
+ module.exports = { WQ };