essential-eth 0.2.2 → 0.3.3
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/lib/cjs/classes/Contract.d.ts +69 -0
- package/lib/cjs/classes/Contract.js +122 -0
- package/lib/cjs/{rpc → classes}/get-block.test.d.ts +0 -0
- package/lib/cjs/{rpc → classes}/get-block.test.js +5 -5
- package/lib/cjs/classes/test/Contract/crv-abi.d.ts +2 -0
- package/lib/cjs/classes/test/Contract/crv-abi.js +488 -0
- package/lib/{esm/rpc/get-block.test.d.ts → cjs/classes/test/Contract/crv.test.d.ts} +0 -0
- package/lib/cjs/classes/test/Contract/crv.test.js +48 -0
- package/lib/cjs/classes/test/Contract/fei-abi.d.ts +2 -0
- package/lib/cjs/classes/test/Contract/fei-abi.js +526 -0
- package/lib/cjs/classes/test/Contract/fei.test.d.ts +1 -0
- package/lib/cjs/classes/test/Contract/fei.test.js +62 -0
- package/lib/cjs/classes/test/Contract/foo-abi.d.ts +2 -0
- package/lib/cjs/classes/test/Contract/foo-abi.js +42 -0
- package/lib/cjs/classes/test/Contract/foo.test.d.ts +1 -0
- package/lib/cjs/classes/test/Contract/foo.test.js +25 -0
- package/lib/cjs/classes/test/Contract/uni.test.d.ts +1 -0
- package/lib/cjs/classes/test/Contract/uni.test.js +67 -0
- package/lib/cjs/classes/test/Contract/uniswap-abi.d.ts +2 -0
- package/lib/cjs/classes/test/Contract/uniswap-abi.js +121 -0
- package/lib/cjs/{rpc → classes}/utils/clean-block.d.ts +0 -0
- package/lib/cjs/{rpc → classes}/utils/clean-block.js +0 -0
- package/lib/cjs/{rpc → classes}/utils/clean-transaction.d.ts +0 -0
- package/lib/cjs/{rpc → classes}/utils/clean-transaction.js +0 -0
- package/lib/cjs/classes/utils/encode-decode-transaction.d.ts +3 -0
- package/lib/cjs/classes/utils/encode-decode-transaction.js +100 -0
- package/lib/cjs/classes/utils/fetchers.d.ts +9 -0
- package/lib/cjs/{rpc → classes}/utils/fetchers.js +8 -1
- package/lib/cjs/{rpc → classes}/utils/hex-to-decimal.d.ts +0 -0
- package/lib/cjs/{rpc → classes}/utils/hex-to-decimal.js +0 -0
- package/lib/cjs/index.d.ts +10 -6
- package/lib/cjs/index.js +12 -9
- package/lib/cjs/{rpc/index.d.ts → providers/JsonRpcProvider.d.ts} +5 -1
- package/lib/cjs/{rpc/index.js → providers/JsonRpcProvider.js} +14 -7
- package/lib/cjs/shared/tiny-big/tiny-big.d.ts +2 -2
- package/lib/cjs/types/Contract.types.d.ts +22 -0
- package/lib/cjs/types/Contract.types.js +2 -0
- package/lib/cjs/{ether-to-wei.d.ts → utils/ether-to-wei.d.ts} +3 -2
- package/lib/cjs/{ether-to-wei.js → utils/ether-to-wei.js} +4 -8
- package/lib/cjs/{is-address.d.ts → utils/is-address.d.ts} +0 -0
- package/lib/cjs/{is-address.js → utils/is-address.js} +3 -3
- package/lib/cjs/utils/tests/ether-to-wei.test.d.ts +1 -0
- package/lib/cjs/utils/tests/ether-to-wei.test.js +66 -0
- package/lib/cjs/utils/tests/is-address.test.d.ts +1 -0
- package/lib/cjs/utils/tests/is-address.test.js +56 -0
- package/lib/cjs/utils/tests/to-checksum-address.test.d.ts +1 -0
- package/lib/cjs/utils/tests/to-checksum-address.test.js +43 -0
- package/lib/cjs/utils/tests/wei-to-ether.test.d.ts +1 -0
- package/lib/cjs/utils/tests/wei-to-ether.test.js +69 -0
- package/lib/cjs/{to-checksum-address.d.ts → utils/to-checksum-address.d.ts} +0 -0
- package/lib/cjs/{to-checksum-address.js → utils/to-checksum-address.js} +1 -1
- package/lib/cjs/{wei-to-ether.d.ts → utils/wei-to-ether.d.ts} +3 -1
- package/lib/cjs/{wei-to-ether.js → utils/wei-to-ether.js} +4 -8
- package/lib/esm/classes/Contract.d.ts +12 -0
- package/lib/esm/classes/Contract.js +63 -0
- package/lib/esm/classes/get-block.test.d.ts +1 -0
- package/lib/esm/{rpc → classes}/get-block.test.js +5 -5
- package/lib/esm/classes/test/Contract/crv-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/crv-abi.js +470 -0
- package/lib/esm/classes/test/Contract/crv.test.d.ts +1 -0
- package/lib/esm/classes/test/Contract/crv.test.js +43 -0
- package/lib/esm/classes/test/Contract/fei-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/fei-abi.js +521 -0
- package/lib/esm/classes/test/Contract/fei.test.d.ts +1 -0
- package/lib/esm/classes/test/Contract/fei.test.js +46 -0
- package/lib/esm/classes/test/Contract/foo-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/foo-abi.js +33 -0
- package/lib/esm/classes/test/Contract/foo.test.d.ts +1 -0
- package/lib/esm/classes/test/Contract/foo.test.js +14 -0
- package/lib/esm/classes/test/Contract/uni.test.d.ts +1 -0
- package/lib/esm/classes/test/Contract/uni.test.js +59 -0
- package/lib/esm/classes/test/Contract/uniswap-abi.d.ts +2 -0
- package/lib/esm/classes/test/Contract/uniswap-abi.js +116 -0
- package/lib/esm/{rpc → classes}/utils/clean-block.d.ts +0 -0
- package/lib/esm/{rpc → classes}/utils/clean-block.js +0 -0
- package/lib/esm/{rpc → classes}/utils/clean-transaction.d.ts +0 -0
- package/lib/esm/{rpc → classes}/utils/clean-transaction.js +0 -0
- package/lib/esm/classes/utils/encode-decode-transaction.d.ts +3 -0
- package/lib/esm/classes/utils/encode-decode-transaction.js +85 -0
- package/lib/esm/classes/utils/fetchers.d.ts +9 -0
- package/lib/esm/{rpc → classes}/utils/fetchers.js +8 -1
- package/lib/esm/{rpc → classes}/utils/hex-to-decimal.d.ts +0 -0
- package/lib/esm/{rpc → classes}/utils/hex-to-decimal.js +0 -0
- package/lib/esm/index.d.ts +10 -6
- package/lib/esm/index.js +7 -6
- package/lib/esm/{rpc/index.d.ts → providers/JsonRpcProvider.d.ts} +2 -1
- package/lib/esm/{rpc/index.js → providers/JsonRpcProvider.js} +8 -5
- package/lib/esm/shared/tiny-big/tiny-big.d.ts +2 -2
- package/lib/esm/types/Contract.types.d.ts +22 -0
- package/lib/esm/types/Contract.types.js +1 -0
- package/lib/esm/utils/ether-to-wei.d.ts +3 -0
- package/lib/esm/utils/ether-to-wei.js +7 -0
- package/lib/esm/{is-address.d.ts → utils/is-address.d.ts} +0 -0
- package/lib/esm/{is-address.js → utils/is-address.js} +2 -2
- package/lib/esm/utils/tests/ether-to-wei.test.d.ts +1 -0
- package/lib/esm/utils/tests/ether-to-wei.test.js +36 -0
- package/lib/esm/utils/tests/is-address.test.d.ts +1 -0
- package/lib/esm/utils/tests/is-address.test.js +49 -0
- package/lib/esm/utils/tests/to-checksum-address.test.d.ts +1 -0
- package/lib/esm/utils/tests/to-checksum-address.test.js +36 -0
- package/lib/esm/utils/tests/wei-to-ether.test.d.ts +1 -0
- package/lib/esm/utils/tests/wei-to-ether.test.js +38 -0
- package/lib/esm/{to-checksum-address.d.ts → utils/to-checksum-address.d.ts} +0 -0
- package/lib/esm/{to-checksum-address.js → utils/to-checksum-address.js} +1 -1
- package/lib/esm/utils/wei-to-ether.d.ts +3 -0
- package/lib/esm/utils/wei-to-ether.js +7 -0
- package/package.json +11 -11
- package/readme.md +68 -5
- package/lib/cjs/rpc/utils/fetchers.d.ts +0 -7
- package/lib/esm/ether-to-wei.d.ts +0 -2
- package/lib/esm/ether-to-wei.js +0 -8
- package/lib/esm/rpc/utils/fetchers.d.ts +0 -7
- package/lib/esm/wei-to-ether.d.ts +0 -1
- package/lib/esm/wei-to-ether.js +0 -8
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.abi = void 0;
|
|
4
|
+
exports.abi =
|
|
5
|
+
// 20210406000308
|
|
6
|
+
// http://api.etherscan.io/api?module=contract&action=getabi&address=0x575CCD8e2D300e2377B43478339E364000318E2c&format=raw
|
|
7
|
+
[
|
|
8
|
+
{
|
|
9
|
+
name: 'Fund',
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
type: 'address',
|
|
13
|
+
name: 'recipient',
|
|
14
|
+
indexed: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'uint256',
|
|
18
|
+
name: 'amount',
|
|
19
|
+
indexed: false,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
anonymous: false,
|
|
23
|
+
type: 'event',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Claim',
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
type: 'address',
|
|
30
|
+
name: 'recipient',
|
|
31
|
+
indexed: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'uint256',
|
|
35
|
+
name: 'claimed',
|
|
36
|
+
indexed: false,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
anonymous: false,
|
|
40
|
+
type: 'event',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'ToggleDisable',
|
|
44
|
+
inputs: [
|
|
45
|
+
{
|
|
46
|
+
type: 'address',
|
|
47
|
+
name: 'recipient',
|
|
48
|
+
indexed: false,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'bool',
|
|
52
|
+
name: 'disabled',
|
|
53
|
+
indexed: false,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
anonymous: false,
|
|
57
|
+
type: 'event',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'CommitOwnership',
|
|
61
|
+
inputs: [
|
|
62
|
+
{
|
|
63
|
+
type: 'address',
|
|
64
|
+
name: 'admin',
|
|
65
|
+
indexed: false,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
anonymous: false,
|
|
69
|
+
type: 'event',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'ApplyOwnership',
|
|
73
|
+
inputs: [
|
|
74
|
+
{
|
|
75
|
+
type: 'address',
|
|
76
|
+
name: 'admin',
|
|
77
|
+
indexed: false,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
anonymous: false,
|
|
81
|
+
type: 'event',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
outputs: [],
|
|
85
|
+
inputs: [
|
|
86
|
+
{
|
|
87
|
+
type: 'address',
|
|
88
|
+
name: '_token',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'uint256',
|
|
92
|
+
name: '_start_time',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: 'uint256',
|
|
96
|
+
name: '_end_time',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: 'bool',
|
|
100
|
+
name: '_can_disable',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'address[4]',
|
|
104
|
+
name: '_fund_admins',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
stateMutability: 'nonpayable',
|
|
108
|
+
type: 'constructor',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'add_tokens',
|
|
112
|
+
outputs: [],
|
|
113
|
+
inputs: [
|
|
114
|
+
{
|
|
115
|
+
type: 'uint256',
|
|
116
|
+
name: '_amount',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
stateMutability: 'nonpayable',
|
|
120
|
+
type: 'function',
|
|
121
|
+
gas: 39108,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'fund',
|
|
125
|
+
outputs: [],
|
|
126
|
+
inputs: [
|
|
127
|
+
{
|
|
128
|
+
type: 'address[100]',
|
|
129
|
+
name: '_recipients',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: 'uint256[100]',
|
|
133
|
+
name: '_amounts',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
stateMutability: 'nonpayable',
|
|
137
|
+
type: 'function',
|
|
138
|
+
gas: 3962646,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'toggle_disable',
|
|
142
|
+
outputs: [],
|
|
143
|
+
inputs: [
|
|
144
|
+
{
|
|
145
|
+
type: 'address',
|
|
146
|
+
name: '_recipient',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
stateMutability: 'nonpayable',
|
|
150
|
+
type: 'function',
|
|
151
|
+
gas: 40280,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'disable_can_disable',
|
|
155
|
+
outputs: [],
|
|
156
|
+
inputs: [],
|
|
157
|
+
stateMutability: 'nonpayable',
|
|
158
|
+
type: 'function',
|
|
159
|
+
gas: 21295,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'disable_fund_admins',
|
|
163
|
+
outputs: [],
|
|
164
|
+
inputs: [],
|
|
165
|
+
stateMutability: 'nonpayable',
|
|
166
|
+
type: 'function',
|
|
167
|
+
gas: 21325,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'vestedSupply',
|
|
171
|
+
outputs: [
|
|
172
|
+
{
|
|
173
|
+
type: 'uint256',
|
|
174
|
+
name: '',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
inputs: [],
|
|
178
|
+
stateMutability: 'view',
|
|
179
|
+
type: 'function',
|
|
180
|
+
gas: 4468,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'lockedSupply',
|
|
184
|
+
outputs: [
|
|
185
|
+
{
|
|
186
|
+
type: 'uint256',
|
|
187
|
+
name: '',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
inputs: [],
|
|
191
|
+
stateMutability: 'view',
|
|
192
|
+
type: 'function',
|
|
193
|
+
gas: 5465,
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'vestedOf',
|
|
197
|
+
outputs: [
|
|
198
|
+
{
|
|
199
|
+
type: 'uint256',
|
|
200
|
+
name: '',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
inputs: [
|
|
204
|
+
{
|
|
205
|
+
type: 'address',
|
|
206
|
+
name: '_recipient',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
stateMutability: 'view',
|
|
210
|
+
type: 'function',
|
|
211
|
+
gas: 5163,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'balanceOf',
|
|
215
|
+
outputs: [
|
|
216
|
+
{
|
|
217
|
+
type: 'uint256',
|
|
218
|
+
name: '',
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
inputs: [
|
|
222
|
+
{
|
|
223
|
+
type: 'address',
|
|
224
|
+
name: '_recipient',
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
stateMutability: 'view',
|
|
228
|
+
type: 'function',
|
|
229
|
+
gas: 6275,
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'lockedOf',
|
|
233
|
+
outputs: [
|
|
234
|
+
{
|
|
235
|
+
type: 'uint256',
|
|
236
|
+
name: '',
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
inputs: [
|
|
240
|
+
{
|
|
241
|
+
type: 'address',
|
|
242
|
+
name: '_recipient',
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
stateMutability: 'view',
|
|
246
|
+
type: 'function',
|
|
247
|
+
gas: 6305,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'claim',
|
|
251
|
+
outputs: [],
|
|
252
|
+
inputs: [],
|
|
253
|
+
stateMutability: 'nonpayable',
|
|
254
|
+
type: 'function',
|
|
255
|
+
},
|
|
256
|
+
// {
|
|
257
|
+
// name: 'claim',
|
|
258
|
+
// outputs: [],
|
|
259
|
+
// inputs: [
|
|
260
|
+
// {
|
|
261
|
+
// type: 'address',
|
|
262
|
+
// name: 'addr',
|
|
263
|
+
// },
|
|
264
|
+
// ],
|
|
265
|
+
// stateMutability: 'nonpayable',
|
|
266
|
+
// type: 'function',
|
|
267
|
+
// },
|
|
268
|
+
{
|
|
269
|
+
name: 'commit_transfer_ownership',
|
|
270
|
+
outputs: [
|
|
271
|
+
{
|
|
272
|
+
type: 'bool',
|
|
273
|
+
name: '',
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
inputs: [
|
|
277
|
+
{
|
|
278
|
+
type: 'address',
|
|
279
|
+
name: 'addr',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
stateMutability: 'nonpayable',
|
|
283
|
+
type: 'function',
|
|
284
|
+
gas: 38032,
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'apply_transfer_ownership',
|
|
288
|
+
outputs: [
|
|
289
|
+
{
|
|
290
|
+
type: 'bool',
|
|
291
|
+
name: '',
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
inputs: [],
|
|
295
|
+
stateMutability: 'nonpayable',
|
|
296
|
+
type: 'function',
|
|
297
|
+
gas: 38932,
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'token',
|
|
301
|
+
outputs: [
|
|
302
|
+
{
|
|
303
|
+
type: 'address',
|
|
304
|
+
name: '',
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
inputs: [],
|
|
308
|
+
stateMutability: 'view',
|
|
309
|
+
type: 'function',
|
|
310
|
+
gas: 1601,
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'start_time',
|
|
314
|
+
outputs: [
|
|
315
|
+
{
|
|
316
|
+
type: 'uint256',
|
|
317
|
+
name: '',
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
inputs: [],
|
|
321
|
+
stateMutability: 'view',
|
|
322
|
+
type: 'function',
|
|
323
|
+
gas: 1631,
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: 'end_time',
|
|
327
|
+
outputs: [
|
|
328
|
+
{
|
|
329
|
+
type: 'uint256',
|
|
330
|
+
name: '',
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
inputs: [],
|
|
334
|
+
stateMutability: 'view',
|
|
335
|
+
type: 'function',
|
|
336
|
+
gas: 1661,
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: 'initial_locked',
|
|
340
|
+
outputs: [
|
|
341
|
+
{
|
|
342
|
+
type: 'uint256',
|
|
343
|
+
name: '',
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
inputs: [
|
|
347
|
+
{
|
|
348
|
+
type: 'address',
|
|
349
|
+
name: 'arg0',
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
stateMutability: 'view',
|
|
353
|
+
type: 'function',
|
|
354
|
+
gas: 1845,
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: 'total_claimed',
|
|
358
|
+
outputs: [
|
|
359
|
+
{
|
|
360
|
+
type: 'uint256',
|
|
361
|
+
name: '',
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
inputs: [
|
|
365
|
+
{
|
|
366
|
+
type: 'address',
|
|
367
|
+
name: 'arg0',
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
stateMutability: 'view',
|
|
371
|
+
type: 'function',
|
|
372
|
+
gas: 1875,
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: 'initial_locked_supply',
|
|
376
|
+
outputs: [
|
|
377
|
+
{
|
|
378
|
+
type: 'uint256',
|
|
379
|
+
name: '',
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
inputs: [],
|
|
383
|
+
stateMutability: 'view',
|
|
384
|
+
type: 'function',
|
|
385
|
+
gas: 1751,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: 'unallocated_supply',
|
|
389
|
+
outputs: [
|
|
390
|
+
{
|
|
391
|
+
type: 'uint256',
|
|
392
|
+
name: '',
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
inputs: [],
|
|
396
|
+
stateMutability: 'view',
|
|
397
|
+
type: 'function',
|
|
398
|
+
gas: 1781,
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'can_disable',
|
|
402
|
+
outputs: [
|
|
403
|
+
{
|
|
404
|
+
type: 'bool',
|
|
405
|
+
name: '',
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
inputs: [],
|
|
409
|
+
stateMutability: 'view',
|
|
410
|
+
type: 'function',
|
|
411
|
+
gas: 1811,
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: 'disabled_at',
|
|
415
|
+
outputs: [
|
|
416
|
+
{
|
|
417
|
+
type: 'uint256',
|
|
418
|
+
name: '',
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
inputs: [
|
|
422
|
+
{
|
|
423
|
+
type: 'address',
|
|
424
|
+
name: 'arg0',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
stateMutability: 'view',
|
|
428
|
+
type: 'function',
|
|
429
|
+
gas: 1995,
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: 'admin',
|
|
433
|
+
outputs: [
|
|
434
|
+
{
|
|
435
|
+
type: 'address',
|
|
436
|
+
name: '',
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
inputs: [],
|
|
440
|
+
stateMutability: 'view',
|
|
441
|
+
type: 'function',
|
|
442
|
+
gas: 1871,
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: 'future_admin',
|
|
446
|
+
outputs: [
|
|
447
|
+
{
|
|
448
|
+
type: 'address',
|
|
449
|
+
name: '',
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
inputs: [],
|
|
453
|
+
stateMutability: 'view',
|
|
454
|
+
type: 'function',
|
|
455
|
+
gas: 1901,
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: 'fund_admins_enabled',
|
|
459
|
+
outputs: [
|
|
460
|
+
{
|
|
461
|
+
type: 'bool',
|
|
462
|
+
name: '',
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
inputs: [],
|
|
466
|
+
stateMutability: 'view',
|
|
467
|
+
type: 'function',
|
|
468
|
+
gas: 1931,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: 'fund_admins',
|
|
472
|
+
outputs: [
|
|
473
|
+
{
|
|
474
|
+
type: 'bool',
|
|
475
|
+
name: '',
|
|
476
|
+
},
|
|
477
|
+
],
|
|
478
|
+
inputs: [
|
|
479
|
+
{
|
|
480
|
+
type: 'address',
|
|
481
|
+
name: 'arg0',
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
stateMutability: 'view',
|
|
485
|
+
type: 'function',
|
|
486
|
+
gas: 2115,
|
|
487
|
+
},
|
|
488
|
+
];
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const contracts_1 = require("@ethersproject/contracts");
|
|
13
|
+
const ethers_1 = require("ethers");
|
|
14
|
+
const JsonRpcProvider_1 = require("../../../providers/JsonRpcProvider");
|
|
15
|
+
const Contract_1 = require("../../Contract");
|
|
16
|
+
const crv_abi_1 = require("./crv-abi");
|
|
17
|
+
// The JSONABI
|
|
18
|
+
const JSONABI = crv_abi_1.abi;
|
|
19
|
+
const rpcURL = 'https://free-eth-node.com/api/eth';
|
|
20
|
+
const ethersProvider = (0, ethers_1.getDefaultProvider)(rpcURL);
|
|
21
|
+
const essentialEthProvider = new JsonRpcProvider_1.JsonRpcProvider(rpcURL);
|
|
22
|
+
// https://etherscan.io/address/0x575CCD8e2D300e2377B43478339E364000318E2c
|
|
23
|
+
const contractAddress = '0x575CCD8e2D300e2377B43478339E364000318E2c';
|
|
24
|
+
const ethersContract = new contracts_1.Contract(contractAddress, JSONABI, ethersProvider);
|
|
25
|
+
const essentialEthContract = new Contract_1.Contract(contractAddress, JSONABI, essentialEthProvider);
|
|
26
|
+
describe('CRV contract', () => {
|
|
27
|
+
const address = '0xf8cd644baf494d13406187cf8628754dca0a10c2';
|
|
28
|
+
it('should fetch "uint256" balanceOf', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const [ethersBalanceOf, essentialEthBalanceOf] = yield Promise.all([
|
|
30
|
+
ethersContract.balanceOf(address, {
|
|
31
|
+
gasLimit: 40955,
|
|
32
|
+
}),
|
|
33
|
+
essentialEthContract.balanceOf(address, {
|
|
34
|
+
gasLimit: 40955,
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
expect(ethersBalanceOf.toString()).toStrictEqual(essentialEthBalanceOf.toString());
|
|
38
|
+
}));
|
|
39
|
+
it('should fetch "uint256" total_claimed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const [ethersTotalClaimed, essentialEthTotalClaimed] = yield Promise.all([
|
|
41
|
+
// ensure library also handles empty options
|
|
42
|
+
ethersContract.total_claimed(address, {}),
|
|
43
|
+
essentialEthContract.total_claimed(address, {}),
|
|
44
|
+
]);
|
|
45
|
+
expect(ethersTotalClaimed.toString()).toStrictEqual(essentialEthTotalClaimed.toString());
|
|
46
|
+
expect(ethersTotalClaimed.toNumber()).toStrictEqual(essentialEthTotalClaimed.toNumber());
|
|
47
|
+
}));
|
|
48
|
+
});
|