@instadapp/avocado-base 0.0.0-dev.0d3d1e2

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.
@@ -0,0 +1,499 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import type { Provider } from "@ethersproject/providers";
7
+ import type { GaslessWallet, GaslessWalletInterface } from "../GaslessWallet";
8
+
9
+ const _abi = [
10
+ {
11
+ inputs: [
12
+ {
13
+ internalType: "contract IGSWVersionsRegistry",
14
+ name: "gswVersionsRegistry_",
15
+ type: "address",
16
+ },
17
+ {
18
+ internalType: "address",
19
+ name: "gswForwarder_",
20
+ type: "address",
21
+ },
22
+ ],
23
+ stateMutability: "nonpayable",
24
+ type: "constructor",
25
+ },
26
+ {
27
+ inputs: [],
28
+ name: "GaslessSmartWallet__Expired",
29
+ type: "error",
30
+ },
31
+ {
32
+ inputs: [],
33
+ name: "GaslessSmartWallet__InvalidParams",
34
+ type: "error",
35
+ },
36
+ {
37
+ inputs: [],
38
+ name: "GaslessSmartWallet__InvalidSignature",
39
+ type: "error",
40
+ },
41
+ {
42
+ inputs: [],
43
+ name: "GaslessSmartWallet__Unauthorized",
44
+ type: "error",
45
+ },
46
+ {
47
+ inputs: [],
48
+ name: "SelfUpgradeable__Unauthorized",
49
+ type: "error",
50
+ },
51
+ {
52
+ anonymous: false,
53
+ inputs: [
54
+ {
55
+ indexed: true,
56
+ internalType: "address",
57
+ name: "source",
58
+ type: "address",
59
+ },
60
+ {
61
+ indexed: true,
62
+ internalType: "address",
63
+ name: "caller",
64
+ type: "address",
65
+ },
66
+ {
67
+ indexed: false,
68
+ internalType: "bytes",
69
+ name: "metadata",
70
+ type: "bytes",
71
+ },
72
+ ],
73
+ name: "CastExecuted",
74
+ type: "event",
75
+ },
76
+ {
77
+ anonymous: false,
78
+ inputs: [
79
+ {
80
+ indexed: true,
81
+ internalType: "address",
82
+ name: "source",
83
+ type: "address",
84
+ },
85
+ {
86
+ indexed: true,
87
+ internalType: "address",
88
+ name: "caller",
89
+ type: "address",
90
+ },
91
+ {
92
+ indexed: false,
93
+ internalType: "string",
94
+ name: "reason",
95
+ type: "string",
96
+ },
97
+ {
98
+ indexed: false,
99
+ internalType: "bytes",
100
+ name: "metadata",
101
+ type: "bytes",
102
+ },
103
+ ],
104
+ name: "CastFailed",
105
+ type: "event",
106
+ },
107
+ {
108
+ anonymous: false,
109
+ inputs: [
110
+ {
111
+ indexed: false,
112
+ internalType: "uint8",
113
+ name: "version",
114
+ type: "uint8",
115
+ },
116
+ ],
117
+ name: "Initialized",
118
+ type: "event",
119
+ },
120
+ {
121
+ anonymous: false,
122
+ inputs: [
123
+ {
124
+ indexed: true,
125
+ internalType: "address",
126
+ name: "gswImpl",
127
+ type: "address",
128
+ },
129
+ ],
130
+ name: "Upgraded",
131
+ type: "event",
132
+ },
133
+ {
134
+ inputs: [],
135
+ name: "ACTION_TYPE_HASH",
136
+ outputs: [
137
+ {
138
+ internalType: "bytes32",
139
+ name: "",
140
+ type: "bytes32",
141
+ },
142
+ ],
143
+ stateMutability: "view",
144
+ type: "function",
145
+ },
146
+ {
147
+ inputs: [],
148
+ name: "CAST_TYPE_HASH",
149
+ outputs: [
150
+ {
151
+ internalType: "bytes32",
152
+ name: "",
153
+ type: "bytes32",
154
+ },
155
+ ],
156
+ stateMutability: "view",
157
+ type: "function",
158
+ },
159
+ {
160
+ inputs: [],
161
+ name: "DEFAULT_CHAIN_ID",
162
+ outputs: [
163
+ {
164
+ internalType: "uint256",
165
+ name: "",
166
+ type: "uint256",
167
+ },
168
+ ],
169
+ stateMutability: "view",
170
+ type: "function",
171
+ },
172
+ {
173
+ inputs: [],
174
+ name: "DOMAIN_SEPARATOR_NAME",
175
+ outputs: [
176
+ {
177
+ internalType: "string",
178
+ name: "",
179
+ type: "string",
180
+ },
181
+ ],
182
+ stateMutability: "view",
183
+ type: "function",
184
+ },
185
+ {
186
+ inputs: [],
187
+ name: "DOMAIN_SEPARATOR_VERSION",
188
+ outputs: [
189
+ {
190
+ internalType: "string",
191
+ name: "",
192
+ type: "string",
193
+ },
194
+ ],
195
+ stateMutability: "view",
196
+ type: "function",
197
+ },
198
+ {
199
+ inputs: [],
200
+ name: "TYPE_HASH",
201
+ outputs: [
202
+ {
203
+ internalType: "bytes32",
204
+ name: "",
205
+ type: "bytes32",
206
+ },
207
+ ],
208
+ stateMutability: "view",
209
+ type: "function",
210
+ },
211
+ {
212
+ inputs: [
213
+ {
214
+ components: [
215
+ {
216
+ internalType: "address",
217
+ name: "target",
218
+ type: "address",
219
+ },
220
+ {
221
+ internalType: "bytes",
222
+ name: "data",
223
+ type: "bytes",
224
+ },
225
+ {
226
+ internalType: "uint256",
227
+ name: "value",
228
+ type: "uint256",
229
+ },
230
+ ],
231
+ internalType: "struct IGaslessSmartWallet.Action[]",
232
+ name: "actions_",
233
+ type: "tuple[]",
234
+ },
235
+ ],
236
+ name: "_callTargets",
237
+ outputs: [],
238
+ stateMutability: "payable",
239
+ type: "function",
240
+ },
241
+ {
242
+ inputs: [
243
+ {
244
+ components: [
245
+ {
246
+ internalType: "address",
247
+ name: "target",
248
+ type: "address",
249
+ },
250
+ {
251
+ internalType: "bytes",
252
+ name: "data",
253
+ type: "bytes",
254
+ },
255
+ {
256
+ internalType: "uint256",
257
+ name: "value",
258
+ type: "uint256",
259
+ },
260
+ ],
261
+ internalType: "struct IGaslessSmartWallet.Action[]",
262
+ name: "actions_",
263
+ type: "tuple[]",
264
+ },
265
+ {
266
+ internalType: "uint256",
267
+ name: "validUntil_",
268
+ type: "uint256",
269
+ },
270
+ {
271
+ internalType: "uint256",
272
+ name: "gas_",
273
+ type: "uint256",
274
+ },
275
+ {
276
+ internalType: "address",
277
+ name: "source_",
278
+ type: "address",
279
+ },
280
+ {
281
+ internalType: "bytes",
282
+ name: "metadata_",
283
+ type: "bytes",
284
+ },
285
+ {
286
+ internalType: "bytes",
287
+ name: "signature_",
288
+ type: "bytes",
289
+ },
290
+ ],
291
+ name: "cast",
292
+ outputs: [
293
+ {
294
+ internalType: "bool",
295
+ name: "success_",
296
+ type: "bool",
297
+ },
298
+ {
299
+ internalType: "string",
300
+ name: "revertReason_",
301
+ type: "string",
302
+ },
303
+ ],
304
+ stateMutability: "payable",
305
+ type: "function",
306
+ },
307
+ {
308
+ inputs: [],
309
+ name: "domainSeparatorV4",
310
+ outputs: [
311
+ {
312
+ internalType: "bytes32",
313
+ name: "",
314
+ type: "bytes32",
315
+ },
316
+ ],
317
+ stateMutability: "view",
318
+ type: "function",
319
+ },
320
+ {
321
+ inputs: [],
322
+ name: "gswForwarder",
323
+ outputs: [
324
+ {
325
+ internalType: "address",
326
+ name: "",
327
+ type: "address",
328
+ },
329
+ ],
330
+ stateMutability: "view",
331
+ type: "function",
332
+ },
333
+ {
334
+ inputs: [],
335
+ name: "gswNonce",
336
+ outputs: [
337
+ {
338
+ internalType: "uint256",
339
+ name: "",
340
+ type: "uint256",
341
+ },
342
+ ],
343
+ stateMutability: "view",
344
+ type: "function",
345
+ },
346
+ {
347
+ inputs: [],
348
+ name: "gswVersionsRegistry",
349
+ outputs: [
350
+ {
351
+ internalType: "contract IGSWVersionsRegistry",
352
+ name: "",
353
+ type: "address",
354
+ },
355
+ ],
356
+ stateMutability: "view",
357
+ type: "function",
358
+ },
359
+ {
360
+ inputs: [
361
+ {
362
+ internalType: "address",
363
+ name: "owner_",
364
+ type: "address",
365
+ },
366
+ ],
367
+ name: "initialize",
368
+ outputs: [],
369
+ stateMutability: "nonpayable",
370
+ type: "function",
371
+ },
372
+ {
373
+ inputs: [],
374
+ name: "owner",
375
+ outputs: [
376
+ {
377
+ internalType: "address",
378
+ name: "",
379
+ type: "address",
380
+ },
381
+ ],
382
+ stateMutability: "view",
383
+ type: "function",
384
+ },
385
+ {
386
+ inputs: [
387
+ {
388
+ internalType: "address",
389
+ name: "gswImpl_",
390
+ type: "address",
391
+ },
392
+ ],
393
+ name: "upgradeTo",
394
+ outputs: [],
395
+ stateMutability: "nonpayable",
396
+ type: "function",
397
+ },
398
+ {
399
+ inputs: [
400
+ {
401
+ internalType: "address",
402
+ name: "gswImpl_",
403
+ type: "address",
404
+ },
405
+ {
406
+ internalType: "bytes",
407
+ name: "data_",
408
+ type: "bytes",
409
+ },
410
+ {
411
+ internalType: "bool",
412
+ name: "forceCall_",
413
+ type: "bool",
414
+ },
415
+ ],
416
+ name: "upgradeToAndCall",
417
+ outputs: [],
418
+ stateMutability: "payable",
419
+ type: "function",
420
+ },
421
+ {
422
+ inputs: [
423
+ {
424
+ components: [
425
+ {
426
+ internalType: "address",
427
+ name: "target",
428
+ type: "address",
429
+ },
430
+ {
431
+ internalType: "bytes",
432
+ name: "data",
433
+ type: "bytes",
434
+ },
435
+ {
436
+ internalType: "uint256",
437
+ name: "value",
438
+ type: "uint256",
439
+ },
440
+ ],
441
+ internalType: "struct IGaslessSmartWallet.Action[]",
442
+ name: "actions_",
443
+ type: "tuple[]",
444
+ },
445
+ {
446
+ internalType: "uint256",
447
+ name: "validUntil_",
448
+ type: "uint256",
449
+ },
450
+ {
451
+ internalType: "uint256",
452
+ name: "gas_",
453
+ type: "uint256",
454
+ },
455
+ {
456
+ internalType: "address",
457
+ name: "source_",
458
+ type: "address",
459
+ },
460
+ {
461
+ internalType: "bytes",
462
+ name: "metadata_",
463
+ type: "bytes",
464
+ },
465
+ {
466
+ internalType: "bytes",
467
+ name: "signature_",
468
+ type: "bytes",
469
+ },
470
+ ],
471
+ name: "verify",
472
+ outputs: [
473
+ {
474
+ internalType: "bool",
475
+ name: "",
476
+ type: "bool",
477
+ },
478
+ ],
479
+ stateMutability: "view",
480
+ type: "function",
481
+ },
482
+ {
483
+ stateMutability: "payable",
484
+ type: "receive",
485
+ },
486
+ ] as const;
487
+
488
+ export class GaslessWallet__factory {
489
+ static readonly abi = _abi;
490
+ static createInterface(): GaslessWalletInterface {
491
+ return new utils.Interface(_abi) as GaslessWalletInterface;
492
+ }
493
+ static connect(
494
+ address: string,
495
+ signerOrProvider: Signer | Provider
496
+ ): GaslessWallet {
497
+ return new Contract(address, _abi, signerOrProvider) as GaslessWallet;
498
+ }
499
+ }
@@ -0,0 +1,8 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export { AvoFactoryProxy__factory } from "./AvoFactoryProxy__factory";
5
+ export { BalanceResolver__factory } from "./BalanceResolver__factory";
6
+ export { Erc20__factory } from "./Erc20__factory";
7
+ export { Forwarder__factory } from "./Forwarder__factory";
8
+ export { GaslessWallet__factory } from "./GaslessWallet__factory";
@@ -0,0 +1,14 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export type { AvoFactoryProxy } from "./AvoFactoryProxy";
5
+ export type { BalanceResolver } from "./BalanceResolver";
6
+ export type { Erc20 } from "./Erc20";
7
+ export type { Forwarder } from "./Forwarder";
8
+ export type { GaslessWallet } from "./GaslessWallet";
9
+ export * as factories from "./factories";
10
+ export { AvoFactoryProxy__factory } from "./factories/AvoFactoryProxy__factory";
11
+ export { BalanceResolver__factory } from "./factories/BalanceResolver__factory";
12
+ export { Erc20__factory } from "./factories/Erc20__factory";
13
+ export { Forwarder__factory } from "./factories/Forwarder__factory";
14
+ export { GaslessWallet__factory } from "./factories/GaslessWallet__factory";
package/nuxt.config.ts ADDED
@@ -0,0 +1,4 @@
1
+ // https://nuxt.com/docs/api/configuration/nuxt-config
2
+ export default defineNuxtConfig({
3
+ modules: ["@nuxtjs/tailwindcss"],
4
+ });
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@instadapp/avocado-base",
3
+ "version": "0.0.0-dev.0d3d1e2",
4
+ "type": "module",
5
+ "main": "./nuxt.config.ts",
6
+ "types": "global.d.ts",
7
+ "scripts": {
8
+ "build": "nuxt build",
9
+ "dev": "nuxt dev",
10
+ "generate": "nuxt generate",
11
+ "preview": "nuxt preview",
12
+ "generate:contracts": "rimraf contracts && typechain --target=ethers-v5 'abi/*.json' --out-dir 'contracts'"
13
+ },
14
+ "devDependencies": {
15
+ "@instadapp/avocado": "^0.1.10",
16
+ "@instadapp/avocado-dev": "npm:@instadapp/avocado@dev",
17
+ "@nuxtjs/tailwindcss": "^6.6.5",
18
+ "@typechain/ethers-v5": "^10.2.0",
19
+ "nuxt": "^3.3.3",
20
+ "rimraf": "^3.0.2",
21
+ "typechain": "^8.1.1"
22
+ },
23
+ "dependencies": {
24
+ "bignumber.js": "^9.1.1",
25
+ "ethers": "^5.7.2"
26
+ }
27
+ }
@@ -0,0 +1,4 @@
1
+ export * from "../../utils/avocado";
2
+ export * from "../../utils/network";
3
+ export * from "../../utils/bignumber";
4
+ export * from "../../utils/formatter";
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ // https://nuxt.com/docs/guide/concepts/typescript
3
+ "extends": "./.nuxt/tsconfig.json"
4
+ }
@@ -0,0 +1,22 @@
1
+ export const AVO_PROD_CHAIN_ID = 634;
2
+ export const AVO_PROD_CHAIN_NAME = "Avocado";
3
+
4
+ export const AVO_STAGING_CHAIN_ID = 63400;
5
+ export const AVO_STAGING_CHAIN_NAME = "Avocado Testnet";
6
+
7
+ export const AVO_PROD_EXPLORER_URL = "https://avoscan.co";
8
+ export const AVO_STAGING_EXPLORER_URL = "https://explorer.avocado.instad.app";
9
+
10
+ export const AVO_PROD_FORWARDER_ADDR =
11
+ "0x375F6B0CD12b34Dc28e34C26853a37012C24dDE5";
12
+ export const AVO_STAGING_FORWARDER_ADDR =
13
+ "0x8CDaAC0371a443985c6Faf07938dDAa7A5818674";
14
+
15
+ export const AVO_PROD_DEPOSIT_ADDRESS =
16
+ "0xE8385fB3A5F15dED06EB5E20E5A81BF43115eb8E";
17
+ export const AVO_STAGING_DEPOSIT_ADDRESS =
18
+ "0x853e991d800Dfd6bC1F83AED3310e859482323dc";
19
+
20
+ export const AVO_PROD_RPC_URL = "https://rpc.avocado.instadapp.io";
21
+
22
+ export const AVO_STAGING_RPC_URL = "https://rpc.avocado.instad.app";
@@ -0,0 +1,31 @@
1
+ import { BigNumber } from "bignumber.js";
2
+ import { BigNumber as BN } from "ethers";
3
+
4
+ export const toBN = (value: BigNumber.Value | BN) =>
5
+ new BigNumber(BN.isBigNumber(value) ? value.toString() : value);
6
+ export const isZero = (value: BigNumber.Value | BN) => toBN(value).isZero();
7
+ export const times = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
8
+ toBN(a).times(toBN(b));
9
+ export const minus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
10
+ toBN(a).minus(toBN(b));
11
+ export const plus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
12
+ toBN(a).plus(toBN(b));
13
+ export const lte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
14
+ toBN(a).lte(toBN(b));
15
+ export const gte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
16
+ toBN(a).gte(toBN(b));
17
+ export const div = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
18
+ toBN(a).div(toBN(b));
19
+ export const lt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
20
+ toBN(a).lt(toBN(b));
21
+ export const gt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
22
+ toBN(a).gt(toBN(b));
23
+ export const ensureValue = (value: any) => {
24
+ if (!value) return toBN("0");
25
+ if (toBN(value).isNaN()) return toBN("0");
26
+
27
+ return toBN(value);
28
+ };
29
+ export const max = (...args: BigNumber.Value[]) => {
30
+ return BigNumber.max(...args);
31
+ };