@instadapp/interop-x 0.0.0-dev.92afe89 → 0.0.0-dev.9e91661

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 (112) hide show
  1. package/.env.example +2 -1
  2. package/dist/package.json +73 -0
  3. package/dist/src/abi/erc20.json +350 -0
  4. package/dist/src/abi/gnosisSafe.json +747 -0
  5. package/dist/src/abi/index.js +15 -0
  6. package/dist/src/abi/interopBridgeToken.json +298 -0
  7. package/dist/src/abi/interopXGateway.json +184 -0
  8. package/dist/src/api/index.js +36 -0
  9. package/dist/src/config/index.js +31 -0
  10. package/dist/src/constants/addresses.js +20 -0
  11. package/dist/{constants → src/constants}/index.js +2 -0
  12. package/dist/src/constants/itokens.js +13 -0
  13. package/dist/src/constants/tokens.js +107 -0
  14. package/dist/{db → src/db}/index.js +0 -0
  15. package/dist/{db → src/db}/models/index.js +1 -1
  16. package/dist/src/db/models/transaction.js +54 -0
  17. package/dist/{db → src/db}/sequelize.js +2 -1
  18. package/dist/src/gnosis/actions/deposit.js +40 -0
  19. package/dist/src/gnosis/actions/index.js +11 -0
  20. package/dist/src/gnosis/actions/withdraw.js +45 -0
  21. package/dist/src/gnosis/index.js +16 -0
  22. package/dist/src/index.js +130 -0
  23. package/dist/{logger → src/logger}/index.js +0 -0
  24. package/dist/{net → src/net}/index.js +0 -0
  25. package/dist/{net → src/net}/peer/index.js +13 -8
  26. package/dist/{net → src/net}/pool/index.js +34 -11
  27. package/dist/{net → src/net}/protocol/dial/BaseDialProtocol.js +1 -1
  28. package/dist/{net → src/net}/protocol/dial/SignatureDialProtocol.js +16 -14
  29. package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +28 -0
  30. package/dist/{net → src/net}/protocol/index.js +44 -4
  31. package/dist/src/tasks/AutoUpdateTask.js +70 -0
  32. package/dist/{tasks → src/tasks}/BaseTask.js +14 -6
  33. package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +147 -0
  34. package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +71 -0
  35. package/dist/src/tasks/InteropBridge/SyncMintEvents.js +67 -0
  36. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +163 -0
  37. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +74 -0
  38. package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +72 -0
  39. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +53 -0
  40. package/dist/src/tasks/index.js +55 -0
  41. package/dist/src/typechain/Erc20.js +2 -0
  42. package/dist/src/typechain/GnosisSafe.js +2 -0
  43. package/dist/src/typechain/InteropBridgeToken.js +2 -0
  44. package/dist/src/typechain/InteropXGateway.js +2 -0
  45. package/dist/src/typechain/common.js +2 -0
  46. package/dist/src/typechain/factories/Erc20__factory.js +367 -0
  47. package/dist/src/typechain/factories/GnosisSafe__factory.js +1174 -0
  48. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +471 -0
  49. package/dist/src/typechain/factories/InteropXGateway__factory.js +265 -0
  50. package/dist/src/typechain/factories/index.js +14 -0
  51. package/dist/src/typechain/index.js +35 -0
  52. package/dist/{types.js → src/types.js} +0 -0
  53. package/dist/src/utils/index.js +157 -0
  54. package/package.json +21 -7
  55. package/patches/@ethersproject+properties+5.6.0.patch +13 -0
  56. package/src/abi/erc20.json +350 -0
  57. package/src/abi/gnosisSafe.json +747 -0
  58. package/src/abi/index.ts +11 -0
  59. package/src/abi/interopBridgeToken.json +298 -0
  60. package/src/abi/interopXGateway.json +184 -0
  61. package/src/api/index.ts +36 -0
  62. package/src/config/index.ts +18 -2
  63. package/src/constants/addresses.ts +10 -3
  64. package/src/constants/index.ts +2 -0
  65. package/src/constants/itokens.ts +10 -0
  66. package/src/constants/tokens.ts +104 -0
  67. package/src/db/index.ts +1 -1
  68. package/src/db/models/index.ts +1 -1
  69. package/src/db/models/transaction.ts +96 -0
  70. package/src/db/sequelize.ts +2 -1
  71. package/src/gnosis/actions/deposit.ts +54 -0
  72. package/src/gnosis/actions/index.ts +7 -0
  73. package/src/gnosis/actions/withdraw.ts +61 -0
  74. package/src/gnosis/index.ts +13 -0
  75. package/src/index.ts +128 -6
  76. package/src/net/peer/index.ts +12 -10
  77. package/src/net/pool/index.ts +43 -13
  78. package/src/net/protocol/dial/BaseDialProtocol.ts +1 -1
  79. package/src/net/protocol/dial/SignatureDialProtocol.ts +19 -17
  80. package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +31 -0
  81. package/src/net/protocol/index.ts +60 -4
  82. package/src/tasks/AutoUpdateTask.ts +82 -0
  83. package/src/tasks/BaseTask.ts +16 -7
  84. package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +232 -0
  85. package/src/tasks/InteropBridge/SyncBurnEvents.ts +121 -0
  86. package/src/tasks/InteropBridge/SyncMintEvents.ts +99 -0
  87. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +258 -0
  88. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +124 -0
  89. package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +105 -0
  90. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +65 -0
  91. package/src/tasks/index.ts +45 -1
  92. package/src/typechain/Erc20.ts +491 -0
  93. package/src/typechain/GnosisSafe.ts +1728 -0
  94. package/src/typechain/InteropBridgeToken.ts +692 -0
  95. package/src/typechain/InteropXGateway.ts +407 -0
  96. package/src/typechain/common.ts +44 -0
  97. package/src/typechain/factories/Erc20__factory.ts +368 -0
  98. package/src/typechain/factories/GnosisSafe__factory.ts +1178 -0
  99. package/src/typechain/factories/InteropBridgeToken__factory.ts +478 -0
  100. package/src/typechain/factories/InteropXGateway__factory.ts +272 -0
  101. package/src/typechain/factories/index.ts +7 -0
  102. package/src/typechain/index.ts +12 -0
  103. package/src/types.ts +2 -2
  104. package/src/utils/index.ts +87 -5
  105. package/tsconfig.json +3 -0
  106. package/dist/config/index.js +0 -17
  107. package/dist/constants/addresses.js +0 -13
  108. package/dist/db/models/execution.js +0 -38
  109. package/dist/index.js +0 -34
  110. package/dist/tasks/index.js +0 -19
  111. package/dist/utils/index.js +0 -89
  112. package/src/db/models/execution.ts +0 -57
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseTask_1 = require("../BaseTask");
7
+ const logger_1 = __importDefault(require("@/logger"));
8
+ const ethers_1 = require("ethers");
9
+ const abi_1 = __importDefault(require("@/abi"));
10
+ const db_1 = require("@/db");
11
+ const utils_1 = require("@/utils");
12
+ const constants_1 = require("@/constants");
13
+ const config_1 = __importDefault(require("@/config"));
14
+ class SyncDepositEvents extends BaseTask_1.BaseTask {
15
+ constructor({ chainId }) {
16
+ super({
17
+ logger: new logger_1.default("InteropXGateway::SyncDepositEvents"),
18
+ });
19
+ this.chainId = chainId;
20
+ }
21
+ async pollHandler() {
22
+ const currentBlock = await this.provider.getBlockNumber();
23
+ const events = await this.contract.queryFilter(this.contract.filters.LogGatewayDeposit(), currentBlock - 2000, currentBlock);
24
+ let processedEvents = 0;
25
+ for (const event of events) {
26
+ try {
27
+ if (!event.args) {
28
+ continue;
29
+ }
30
+ const { sourceChainId, targetChainId, user, vnonce, amount, token } = event.args;
31
+ const uniqueIdentifier = {
32
+ action: 'deposit',
33
+ submitTransactionHash: event.transactionHash,
34
+ sourceChainId: sourceChainId,
35
+ targetChainId: targetChainId,
36
+ };
37
+ if (await db_1.Transaction.findOne({ where: uniqueIdentifier })) {
38
+ continue;
39
+ }
40
+ const tx = await event.getTransaction();
41
+ await db_1.Transaction.create(Object.assign(Object.assign({}, uniqueIdentifier), { transactionHash: (0, utils_1.generateInteropTransactionHash)(uniqueIdentifier), from: tx.from, to: user, submitTransactionHash: event.transactionHash, submitBlockNumber: event.blockNumber,
42
+ // submit & source are the same
43
+ sourceTransactionHash: event.transactionHash, sourceBlockNumber: event.blockNumber, sourceStatus: "success", targetStatus: "uninitialised", submitEvent: {
44
+ user,
45
+ sourceChainId: sourceChainId.toString(),
46
+ targetChainId: targetChainId.toString(),
47
+ token: token,
48
+ amount: amount.toString(),
49
+ vnonce: vnonce.toString(),
50
+ }, sourceEvent: {
51
+ user,
52
+ sourceChainId: sourceChainId.toString(),
53
+ targetChainId: targetChainId.toString(),
54
+ token: token,
55
+ amount: amount.toString(),
56
+ vnonce: vnonce.toString(),
57
+ }, status: "pending" }));
58
+ this.logger.info(`Deposit queued: ${event.transactionHash} ${event.blockNumber}`);
59
+ }
60
+ catch (error) {
61
+ this.logger.error(error);
62
+ }
63
+ }
64
+ if (processedEvents > 0)
65
+ this.logger.info(`${processedEvents} events processed`);
66
+ }
67
+ async start() {
68
+ this.contractAddress = constants_1.addresses[this.chainId].interopXGateway;
69
+ this.provider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(this.chainId));
70
+ this.contract = (0, utils_1.getContract)(this.contractAddress, abi_1.default.interopXGateway, new ethers_1.ethers.Wallet(config_1.default.privateKey, this.provider));
71
+ await super.start();
72
+ }
73
+ }
74
+ exports.default = SyncDepositEvents;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseTask_1 = require("../BaseTask");
7
+ const logger_1 = __importDefault(require("@/logger"));
8
+ const ethers_1 = require("ethers");
9
+ const abi_1 = __importDefault(require("@/abi"));
10
+ const db_1 = require("@/db");
11
+ const utils_1 = require("@/utils");
12
+ const constants_1 = require("@/constants");
13
+ const config_1 = __importDefault(require("@/config"));
14
+ class SyncWithdrawEvents extends BaseTask_1.BaseTask {
15
+ constructor({ chainId }) {
16
+ super({
17
+ logger: new logger_1.default("InteropXGateway::SyncWithdrawEvents"),
18
+ });
19
+ this.chainId = chainId;
20
+ }
21
+ async pollHandler() {
22
+ const currentBlock = await this.provider.getBlockNumber();
23
+ const events = await this.contract.queryFilter(this.contract.filters.LogGatewayWithdraw(), currentBlock - 500, currentBlock);
24
+ let processedEvents = 0;
25
+ for (const event of events) {
26
+ try {
27
+ if (!event.args) {
28
+ continue;
29
+ }
30
+ const { user, token, amount, sourceChainId, targetChainId, transactionHash } = event.args;
31
+ const uniqueIdentifier = {
32
+ action: 'withdraw',
33
+ submitTransactionHash: transactionHash,
34
+ sourceChainId: sourceChainId,
35
+ targetChainId: targetChainId,
36
+ targetEvent: null
37
+ };
38
+ const transaction = await db_1.Transaction.findOne({ where: uniqueIdentifier });
39
+ if (!transaction) {
40
+ return;
41
+ }
42
+ const tx = await event.getTransaction();
43
+ transaction.targetStatus = 'success';
44
+ transaction.targetErrors = [];
45
+ transaction.targetTransactionHash = tx.hash;
46
+ transaction.targetEvent = {
47
+ user,
48
+ token,
49
+ amount: amount.toString(),
50
+ sourceChainId,
51
+ targetChainId,
52
+ transactionHash,
53
+ };
54
+ transaction.status = 'success';
55
+ await transaction.save();
56
+ this.logger.info(`Witdraw confirmation received: ${transaction.transactionHash} `);
57
+ }
58
+ catch (error) {
59
+ this.logger.error(error);
60
+ }
61
+ }
62
+ if (processedEvents > 0)
63
+ this.logger.info(`${processedEvents} events processed`);
64
+ }
65
+ async start() {
66
+ this.contractAddress = constants_1.addresses[this.chainId].interopXGateway;
67
+ this.provider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(this.chainId));
68
+ this.contract = (0, utils_1.getContract)(this.contractAddress, abi_1.default.interopXGateway, new ethers_1.ethers.Wallet(config_1.default.privateKey, this.provider));
69
+ await super.start();
70
+ }
71
+ }
72
+ exports.default = SyncWithdrawEvents;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseTask_1 = require("../BaseTask");
7
+ const logger_1 = __importDefault(require("@/logger"));
8
+ const net_1 = require("@/net");
9
+ const db_1 = require("@/db");
10
+ const sequelize_1 = require("sequelize");
11
+ class SyncTransactionStatusTask extends BaseTask_1.BaseTask {
12
+ constructor() {
13
+ super({
14
+ logger: new logger_1.default("SyncTransactionStatusTask"),
15
+ });
16
+ this.pollIntervalMs = 60 * 1000;
17
+ this.exceptLeadNode = true;
18
+ }
19
+ async pollHandler() {
20
+ // if transaction is pending for more than 1 hour, check lead node for status
21
+ const leadNode = net_1.peerPool.getLeadPeer();
22
+ if (!leadNode) {
23
+ return;
24
+ }
25
+ const transaction = await db_1.Transaction.findOne({
26
+ where: {
27
+ status: 'pending',
28
+ sourceCreatedAt: {
29
+ [sequelize_1.Op.gte]: new Date(Date.now() - 60 * 60 * 1000),
30
+ },
31
+ }
32
+ });
33
+ if (!transaction) {
34
+ return;
35
+ }
36
+ this.logger.info(`Requesting transaction status for ${transaction.transactionHash}`);
37
+ const transactionStatus = await net_1.protocol.requestTransactionStatus(transaction.transactionHash, leadNode.id);
38
+ if (!transactionStatus) {
39
+ return;
40
+ }
41
+ this.logger.info(`Received transaction status for ${transaction.transactionHash}`);
42
+ transaction.sourceStatus = transactionStatus.sourceStatus;
43
+ transaction.sourceTransactionHash = transactionStatus.sourceTransactionHash;
44
+ transaction.sourceErrors = transactionStatus.sourceErrors;
45
+ transaction.targetStatus = transactionStatus.targetStatus;
46
+ transaction.targetTransactionHash = transactionStatus.targetTransactionHash;
47
+ transaction.targetErrors = transactionStatus.targetErrors;
48
+ transaction.status = transactionStatus.status;
49
+ await transaction.save();
50
+ this.logger.info(`Updated transaction status for ${transaction.transactionHash}`);
51
+ }
52
+ }
53
+ exports.default = SyncTransactionStatusTask;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Tasks = void 0;
7
+ const ProcessDepositEvents_1 = __importDefault(require("./InteropXGateway/ProcessDepositEvents"));
8
+ const SyncDepositEvents_1 = __importDefault(require("./InteropXGateway/SyncDepositEvents"));
9
+ const SyncWithdrawtEvents_1 = __importDefault(require("./InteropXGateway/SyncWithdrawtEvents"));
10
+ const ProcessWithdrawEvents_1 = __importDefault(require("./InteropBridge/ProcessWithdrawEvents"));
11
+ const SyncBurnEvents_1 = __importDefault(require("./InteropBridge/SyncBurnEvents"));
12
+ const SyncMintEvents_1 = __importDefault(require("./InteropBridge/SyncMintEvents"));
13
+ const SyncTransactionStatusTask_1 = __importDefault(require("./Transactions/SyncTransactionStatusTask"));
14
+ const AutoUpdateTask_1 = __importDefault(require("./AutoUpdateTask"));
15
+ class Tasks {
16
+ constructor() {
17
+ this.tasks = [
18
+ new SyncTransactionStatusTask_1.default(),
19
+ new AutoUpdateTask_1.default(),
20
+ // InteropXGateway
21
+ new SyncDepositEvents_1.default({
22
+ chainId: 43114
23
+ }),
24
+ new ProcessDepositEvents_1.default({
25
+ chainId: 43114
26
+ }),
27
+ new SyncWithdrawtEvents_1.default({
28
+ chainId: 43114
29
+ }),
30
+ // InteropBridge
31
+ new ProcessWithdrawEvents_1.default({
32
+ chainId: 137,
33
+ }),
34
+ new SyncMintEvents_1.default({
35
+ chainId: 137,
36
+ itokenAddress: '0x62c0045f3277e7067cacad3c8038eeabb1bd92d1',
37
+ }),
38
+ new SyncBurnEvents_1.default({
39
+ chainId: 137,
40
+ itokenAddress: '0x62c0045f3277e7067cacad3c8038eeabb1bd92d1',
41
+ })
42
+ ];
43
+ }
44
+ async start() {
45
+ for (const task of this.tasks) {
46
+ try {
47
+ task.start();
48
+ }
49
+ catch (error) {
50
+ console.error(`Error starting task: ${task.constructor.name}`);
51
+ }
52
+ }
53
+ }
54
+ }
55
+ exports.Tasks = Tasks;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+ /* Autogenerated file. Do not edit manually. */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Erc20__factory = void 0;
7
+ const ethers_1 = require("ethers");
8
+ const _abi = [
9
+ {
10
+ inputs: [
11
+ {
12
+ internalType: "uint256",
13
+ name: "_totalSupply",
14
+ type: "uint256",
15
+ },
16
+ ],
17
+ payable: false,
18
+ stateMutability: "nonpayable",
19
+ type: "constructor",
20
+ },
21
+ {
22
+ anonymous: false,
23
+ inputs: [
24
+ {
25
+ indexed: true,
26
+ internalType: "address",
27
+ name: "owner",
28
+ type: "address",
29
+ },
30
+ {
31
+ indexed: true,
32
+ internalType: "address",
33
+ name: "spender",
34
+ type: "address",
35
+ },
36
+ {
37
+ indexed: false,
38
+ internalType: "uint256",
39
+ name: "value",
40
+ type: "uint256",
41
+ },
42
+ ],
43
+ name: "Approval",
44
+ type: "event",
45
+ },
46
+ {
47
+ anonymous: false,
48
+ inputs: [
49
+ {
50
+ indexed: true,
51
+ internalType: "address",
52
+ name: "from",
53
+ type: "address",
54
+ },
55
+ {
56
+ indexed: true,
57
+ internalType: "address",
58
+ name: "to",
59
+ type: "address",
60
+ },
61
+ {
62
+ indexed: false,
63
+ internalType: "uint256",
64
+ name: "value",
65
+ type: "uint256",
66
+ },
67
+ ],
68
+ name: "Transfer",
69
+ type: "event",
70
+ },
71
+ {
72
+ constant: true,
73
+ inputs: [],
74
+ name: "DOMAIN_SEPARATOR",
75
+ outputs: [
76
+ {
77
+ internalType: "bytes32",
78
+ name: "",
79
+ type: "bytes32",
80
+ },
81
+ ],
82
+ payable: false,
83
+ stateMutability: "view",
84
+ type: "function",
85
+ },
86
+ {
87
+ constant: true,
88
+ inputs: [],
89
+ name: "PERMIT_TYPEHASH",
90
+ outputs: [
91
+ {
92
+ internalType: "bytes32",
93
+ name: "",
94
+ type: "bytes32",
95
+ },
96
+ ],
97
+ payable: false,
98
+ stateMutability: "view",
99
+ type: "function",
100
+ },
101
+ {
102
+ constant: true,
103
+ inputs: [
104
+ {
105
+ internalType: "address",
106
+ name: "",
107
+ type: "address",
108
+ },
109
+ {
110
+ internalType: "address",
111
+ name: "",
112
+ type: "address",
113
+ },
114
+ ],
115
+ name: "allowance",
116
+ outputs: [
117
+ {
118
+ internalType: "uint256",
119
+ name: "",
120
+ type: "uint256",
121
+ },
122
+ ],
123
+ payable: false,
124
+ stateMutability: "view",
125
+ type: "function",
126
+ },
127
+ {
128
+ constant: false,
129
+ inputs: [
130
+ {
131
+ internalType: "address",
132
+ name: "spender",
133
+ type: "address",
134
+ },
135
+ {
136
+ internalType: "uint256",
137
+ name: "value",
138
+ type: "uint256",
139
+ },
140
+ ],
141
+ name: "approve",
142
+ outputs: [
143
+ {
144
+ internalType: "bool",
145
+ name: "",
146
+ type: "bool",
147
+ },
148
+ ],
149
+ payable: false,
150
+ stateMutability: "nonpayable",
151
+ type: "function",
152
+ },
153
+ {
154
+ constant: true,
155
+ inputs: [
156
+ {
157
+ internalType: "address",
158
+ name: "",
159
+ type: "address",
160
+ },
161
+ ],
162
+ name: "balanceOf",
163
+ outputs: [
164
+ {
165
+ internalType: "uint256",
166
+ name: "",
167
+ type: "uint256",
168
+ },
169
+ ],
170
+ payable: false,
171
+ stateMutability: "view",
172
+ type: "function",
173
+ },
174
+ {
175
+ constant: true,
176
+ inputs: [],
177
+ name: "decimals",
178
+ outputs: [
179
+ {
180
+ internalType: "uint8",
181
+ name: "",
182
+ type: "uint8",
183
+ },
184
+ ],
185
+ payable: false,
186
+ stateMutability: "view",
187
+ type: "function",
188
+ },
189
+ {
190
+ constant: true,
191
+ inputs: [],
192
+ name: "name",
193
+ outputs: [
194
+ {
195
+ internalType: "string",
196
+ name: "",
197
+ type: "string",
198
+ },
199
+ ],
200
+ payable: false,
201
+ stateMutability: "view",
202
+ type: "function",
203
+ },
204
+ {
205
+ constant: true,
206
+ inputs: [
207
+ {
208
+ internalType: "address",
209
+ name: "",
210
+ type: "address",
211
+ },
212
+ ],
213
+ name: "nonces",
214
+ outputs: [
215
+ {
216
+ internalType: "uint256",
217
+ name: "",
218
+ type: "uint256",
219
+ },
220
+ ],
221
+ payable: false,
222
+ stateMutability: "view",
223
+ type: "function",
224
+ },
225
+ {
226
+ constant: false,
227
+ inputs: [
228
+ {
229
+ internalType: "address",
230
+ name: "owner",
231
+ type: "address",
232
+ },
233
+ {
234
+ internalType: "address",
235
+ name: "spender",
236
+ type: "address",
237
+ },
238
+ {
239
+ internalType: "uint256",
240
+ name: "value",
241
+ type: "uint256",
242
+ },
243
+ {
244
+ internalType: "uint256",
245
+ name: "deadline",
246
+ type: "uint256",
247
+ },
248
+ {
249
+ internalType: "uint8",
250
+ name: "v",
251
+ type: "uint8",
252
+ },
253
+ {
254
+ internalType: "bytes32",
255
+ name: "r",
256
+ type: "bytes32",
257
+ },
258
+ {
259
+ internalType: "bytes32",
260
+ name: "s",
261
+ type: "bytes32",
262
+ },
263
+ ],
264
+ name: "permit",
265
+ outputs: [],
266
+ payable: false,
267
+ stateMutability: "nonpayable",
268
+ type: "function",
269
+ },
270
+ {
271
+ constant: true,
272
+ inputs: [],
273
+ name: "symbol",
274
+ outputs: [
275
+ {
276
+ internalType: "string",
277
+ name: "",
278
+ type: "string",
279
+ },
280
+ ],
281
+ payable: false,
282
+ stateMutability: "view",
283
+ type: "function",
284
+ },
285
+ {
286
+ constant: true,
287
+ inputs: [],
288
+ name: "totalSupply",
289
+ outputs: [
290
+ {
291
+ internalType: "uint256",
292
+ name: "",
293
+ type: "uint256",
294
+ },
295
+ ],
296
+ payable: false,
297
+ stateMutability: "view",
298
+ type: "function",
299
+ },
300
+ {
301
+ constant: false,
302
+ inputs: [
303
+ {
304
+ internalType: "address",
305
+ name: "to",
306
+ type: "address",
307
+ },
308
+ {
309
+ internalType: "uint256",
310
+ name: "value",
311
+ type: "uint256",
312
+ },
313
+ ],
314
+ name: "transfer",
315
+ outputs: [
316
+ {
317
+ internalType: "bool",
318
+ name: "",
319
+ type: "bool",
320
+ },
321
+ ],
322
+ payable: false,
323
+ stateMutability: "nonpayable",
324
+ type: "function",
325
+ },
326
+ {
327
+ constant: false,
328
+ inputs: [
329
+ {
330
+ internalType: "address",
331
+ name: "from",
332
+ type: "address",
333
+ },
334
+ {
335
+ internalType: "address",
336
+ name: "to",
337
+ type: "address",
338
+ },
339
+ {
340
+ internalType: "uint256",
341
+ name: "value",
342
+ type: "uint256",
343
+ },
344
+ ],
345
+ name: "transferFrom",
346
+ outputs: [
347
+ {
348
+ internalType: "bool",
349
+ name: "",
350
+ type: "bool",
351
+ },
352
+ ],
353
+ payable: false,
354
+ stateMutability: "nonpayable",
355
+ type: "function",
356
+ },
357
+ ];
358
+ class Erc20__factory {
359
+ static createInterface() {
360
+ return new ethers_1.utils.Interface(_abi);
361
+ }
362
+ static connect(address, signerOrProvider) {
363
+ return new ethers_1.Contract(address, _abi, signerOrProvider);
364
+ }
365
+ }
366
+ exports.Erc20__factory = Erc20__factory;
367
+ Erc20__factory.abi = _abi;