@instadapp/interop-x 0.0.0-dev.733ff78 → 0.0.0-dev.76d0265

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/dist/package.json +13 -12
  2. package/dist/src/abi/index.js +2 -4
  3. package/dist/src/abi/interopXContract.json +454 -0
  4. package/dist/src/alias.js +10 -0
  5. package/dist/src/constants/addresses.js +7 -7
  6. package/dist/src/constants/index.js +0 -1
  7. package/dist/src/constants/tokens.js +62 -39
  8. package/dist/src/db/models/transaction.js +19 -11
  9. package/dist/src/gnosis/actions/index.js +0 -2
  10. package/dist/src/gnosis/actions/withdraw/index.js +115 -0
  11. package/dist/src/gnosis/index.js +4 -4
  12. package/dist/src/index.js +5 -19
  13. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +6 -2
  14. package/dist/src/tasks/{InteropBridge/ProcessWithdrawEvents.js → InteropXContract/ProcessBridgeRequestEvents.js} +50 -53
  15. package/dist/src/tasks/InteropXContract/SyncBridgeCommittedEvents.js +93 -0
  16. package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
  17. package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +90 -0
  18. package/dist/src/tasks/index.js +16 -30
  19. package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
  20. package/dist/src/typechain/factories/InteropXContract__factory.js +635 -0
  21. package/dist/src/typechain/factories/index.js +3 -5
  22. package/dist/src/typechain/index.js +3 -5
  23. package/dist/src/utils/index.js +44 -8
  24. package/package.json +13 -12
  25. package/src/abi/index.ts +2 -4
  26. package/src/abi/interopXContract.json +454 -0
  27. package/src/alias.ts +6 -0
  28. package/src/constants/addresses.ts +8 -8
  29. package/src/constants/index.ts +0 -1
  30. package/src/constants/tokens.ts +63 -40
  31. package/src/db/models/transaction.ts +66 -27
  32. package/src/gnosis/actions/index.ts +0 -2
  33. package/src/gnosis/actions/withdraw/index.ts +155 -0
  34. package/src/gnosis/index.ts +5 -5
  35. package/src/index.ts +4 -18
  36. package/src/net/protocol/dial/SignatureDialProtocol.ts +6 -2
  37. package/src/tasks/{InteropBridge/ProcessWithdrawEvents.ts → InteropXContract/ProcessBridgeRequestEvents.ts} +78 -100
  38. package/src/tasks/InteropXContract/SyncBridgeCommittedEvents.ts +125 -0
  39. package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +115 -0
  40. package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +121 -0
  41. package/src/tasks/index.ts +18 -36
  42. package/src/typechain/InteropXContract.ts +680 -0
  43. package/src/typechain/factories/InteropXContract__factory.ts +642 -0
  44. package/src/typechain/factories/index.ts +1 -2
  45. package/src/typechain/index.ts +2 -4
  46. package/src/utils/index.ts +85 -8
  47. package/tsconfig.json +7 -2
  48. package/dist/src/abi/interopBridgeToken.json +0 -298
  49. package/dist/src/abi/interopXGateway.json +0 -184
  50. package/dist/src/constants/itokens.js +0 -13
  51. package/dist/src/gnosis/actions/deposit.js +0 -48
  52. package/dist/src/gnosis/actions/withdraw.js +0 -50
  53. package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +0 -71
  54. package/dist/src/tasks/InteropBridge/SyncMintEvents.js +0 -67
  55. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -164
  56. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -74
  57. package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +0 -72
  58. package/dist/src/typechain/InteropXGateway.js +0 -2
  59. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -471
  60. package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
  61. package/src/abi/interopBridgeToken.json +0 -298
  62. package/src/abi/interopXGateway.json +0 -184
  63. package/src/constants/itokens.ts +0 -10
  64. package/src/gnosis/actions/deposit.ts +0 -63
  65. package/src/gnosis/actions/withdraw.ts +0 -67
  66. package/src/tasks/InteropBridge/SyncBurnEvents.ts +0 -119
  67. package/src/tasks/InteropBridge/SyncMintEvents.ts +0 -99
  68. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -260
  69. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -124
  70. package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +0 -105
  71. package/src/typechain/InteropBridgeToken.ts +0 -692
  72. package/src/typechain/InteropXGateway.ts +0 -407
  73. package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -478
  74. package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getContract = exports.generateInteropTransactionHash = exports.asyncCallWithTimeout = exports.buildSignatureBytes = exports.getRpcProviderUrl = exports.signGnosisSafeTx = exports.short = exports.shortenHash = exports.http = void 0;
6
+ exports.LiquidityError = exports.generateGnosisTransaction = exports.getContract = exports.ContractError = exports.generateInteropTransactionHash = exports.asyncCallWithTimeout = exports.buildSignatureBytes = exports.getRpcProviderUrl = exports.signGnosisSafeTx = exports.short = exports.shortenHash = exports.http = void 0;
7
7
  /**
8
8
  * @module util
9
9
  */
@@ -11,6 +11,7 @@ const axios_1 = __importDefault(require("axios"));
11
11
  const axios_retry_1 = __importDefault(require("axios-retry"));
12
12
  const constants_1 = require("@/constants");
13
13
  const ethers_1 = require("ethers");
14
+ const async_retry_1 = __importDefault(require("async-retry"));
14
15
  exports.http = axios_1.default.create();
15
16
  (0, axios_retry_1.default)(exports.http, { retries: 3, retryDelay: axios_retry_1.default.exponentialDelay });
16
17
  function shortenHash(hash, length = 4) {
@@ -101,14 +102,18 @@ const asyncCallWithTimeout = async (asyncPromise, timeout) => {
101
102
  };
102
103
  exports.asyncCallWithTimeout = asyncCallWithTimeout;
103
104
  const generateInteropTransactionHash = (data) => {
104
- return ethers_1.ethers.utils.solidityKeccak256(['string', 'string', 'string', 'string'], [
105
- String(data.action),
106
- String(data.submitTransactionHash),
105
+ return ethers_1.ethers.utils.solidityKeccak256(['string', 'string', 'string', 'string', 'string'], [
106
+ String(data.actionId),
107
+ String(data.bridger),
108
+ String(data.requestTransactionHash),
107
109
  String(data.sourceChainId),
108
110
  String(data.targetChainId),
109
111
  ]);
110
112
  };
111
113
  exports.generateInteropTransactionHash = generateInteropTransactionHash;
114
+ class ContractError extends Error {
115
+ }
116
+ exports.ContractError = ContractError;
112
117
  function getContract(address, contractInterface, signerOrProvider) {
113
118
  if (!ethers_1.ethers.utils.getAddress(address) || address === ethers_1.ethers.constants.AddressZero) {
114
119
  throw Error(`Invalid 'address' parameter '${address}'.`);
@@ -123,12 +128,22 @@ function getContract(address, contractInterface, signerOrProvider) {
123
128
  get(target, prop, receiver) {
124
129
  const value = Reflect.get(target, prop, receiver);
125
130
  if (typeof value === 'function' && (contract.functions.hasOwnProperty(prop) || ['queryFilter'].includes(String(prop)))) {
131
+ let isConstant = false;
132
+ try {
133
+ isConstant = contract.interface.getFunction(String(prop)).constant;
134
+ }
135
+ catch (error) {
136
+ }
126
137
  return async (...args) => {
127
138
  try {
128
- return await value.bind(contract)(...args);
139
+ return await (0, async_retry_1.default)(async () => await value.bind(contract)(...args), { retries: isConstant ? 1 : 3 });
129
140
  }
130
141
  catch (error) {
131
- throw new Error(`Error calling "${String(prop)}" on "${address}": ${error.reason || error.message}`);
142
+ const err = new ContractError(`Error calling "${String(prop)}" on "${address}": ${error.reason || error.message}`);
143
+ err.method = String(prop);
144
+ err.address = address;
145
+ err.args = [...args];
146
+ throw err;
132
147
  }
133
148
  };
134
149
  }
@@ -140,10 +155,14 @@ function getContract(address, contractInterface, signerOrProvider) {
140
155
  if (typeof value === 'function') {
141
156
  return async (...args) => {
142
157
  try {
143
- return await value.bind(contract)(...args);
158
+ return await (0, async_retry_1.default)(async () => await value.bind(contract)(...args), { retries: parentProp === 'callStatic' ? 3 : 1 });
144
159
  }
145
160
  catch (error) {
146
- throw new Error(`Error calling "${String(prop)}" using "${parentProp}" on "${address}": ${error.reason || error.message}`);
161
+ const err = new ContractError(`Error calling "${String(prop)}" using "${parentProp}" on "${address}": ${error.reason || error.message}`);
162
+ err.method = String(prop);
163
+ err.address = address;
164
+ err.args = [...args];
165
+ throw err;
147
166
  }
148
167
  };
149
168
  }
@@ -155,3 +174,20 @@ function getContract(address, contractInterface, signerOrProvider) {
155
174
  });
156
175
  }
157
176
  exports.getContract = getContract;
177
+ const generateGnosisTransaction = async (transactionData, safeContract) => {
178
+ console.log(transactionData);
179
+ let isExecuted = await safeContract.dataHashes(await safeContract.getTransactionHash(transactionData.to, transactionData.value, transactionData.data, transactionData.operation, transactionData.safeTxGas, transactionData.baseGas, transactionData.gasPrice, transactionData.gasToken, transactionData.refundReceiver, transactionData.nonce));
180
+ while (isExecuted == 1) {
181
+ transactionData.safeTxGas = ethers_1.ethers.BigNumber.from(String(transactionData.safeTxGas)).add(1).toString();
182
+ isExecuted = await safeContract.dataHashes(await safeContract.getTransactionHash(transactionData.to, transactionData.value, transactionData.data, transactionData.operation, transactionData.safeTxGas, transactionData.baseGas, transactionData.gasPrice, transactionData.gasToken, transactionData.refundReceiver, transactionData.nonce));
183
+ }
184
+ return transactionData;
185
+ };
186
+ exports.generateGnosisTransaction = generateGnosisTransaction;
187
+ class LiquidityError extends Error {
188
+ constructor(message) {
189
+ super(message || 'Not enough liquidity');
190
+ Object.setPrototypeOf(this, new.target.prototype);
191
+ }
192
+ }
193
+ exports.LiquidityError = LiquidityError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/interop-x",
3
- "version": "0.0.0-dev.733ff78",
3
+ "version": "0.0.0-dev.76d0265",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -11,7 +11,7 @@
11
11
  "start": "yarn build && node bin/interop-x",
12
12
  "build": "yarn generate-abi-types && export GIT_REF=$(git rev-parse --short HEAD) && rimraf ./dist && tsc -p tsconfig.json && replace-in-file '@GIT_SHORT_HASH@' $GIT_REF ./dist/**/*.js",
13
13
  "dev": "yarn generate-abi-types && NODE_ENV=development nodemon",
14
- "generate-abi-types": "typechain --target=ethers-v5 'src/abi/*.json' --out-dir 'src/typechain'",
14
+ "generate-abi-types": "rimraf src/typechain && typechain --target=ethers-v5 'src/abi/*.json' --out-dir 'src/typechain'",
15
15
  "prepublishOnly": "yarn build",
16
16
  "postinstall": "patch-package"
17
17
  },
@@ -25,16 +25,17 @@
25
25
  "dependencies": {
26
26
  "@achingbrain/libp2p-gossipsub": "^0.12.2",
27
27
  "@fastify/cors": "^7.0.0",
28
+ "async-retry": "^1.3.3",
28
29
  "await-spawn": "^4.0.2",
29
- "axios": "^0.27.1",
30
- "axios-retry": "^3.2.4",
30
+ "axios": "^0.27.2",
31
+ "axios-retry": "^3.2.5",
31
32
  "chalk": "4.1.2",
32
- "dotenv": "^16.0.0",
33
+ "dotenv": "^16.0.1",
33
34
  "ethereumjs-util": "^7.1.4",
34
- "ethers": "^5.6.4",
35
+ "ethers": "^5.6.5",
35
36
  "ethers-multisend": "^2.1.1",
36
37
  "expand-home-dir": "^0.0.3",
37
- "fastify": "^3.28.0",
38
+ "fastify": "^3.29.0",
38
39
  "fs-extra": "^10.1.0",
39
40
  "libp2p": "^0.36.2",
40
41
  "libp2p-bootstrap": "^0.14.0",
@@ -45,12 +46,12 @@
45
46
  "libp2p-pubsub-peer-discovery": "^4.0.0",
46
47
  "libp2p-tcp": "^0.17.2",
47
48
  "libp2p-websockets": "^0.16.2",
48
- "luxon": "^2.3.2",
49
+ "luxon": "^2.4.0",
49
50
  "module-alias": "^2.2.2",
50
51
  "patch-package": "^6.4.7",
51
52
  "postinstall-postinstall": "^2.1.0",
52
53
  "sequelize": "6.18.0",
53
- "sqlite3": "^5.0.5",
54
+ "sqlite3": "^5.0.8",
54
55
  "waait": "^1.0.5"
55
56
  },
56
57
  "bin": {
@@ -61,13 +62,13 @@
61
62
  "@typechain/ethers-v5": "^10.0.0",
62
63
  "@types/bn.js": "^5.1.0",
63
64
  "@types/fs-extra": "^9.0.13",
64
- "@types/node": "^17.0.17",
65
- "nodemon": "^2.0.15",
65
+ "@types/node": "^17.0.33",
66
+ "nodemon": "^2.0.16",
66
67
  "replace-in-file": "^6.3.2",
67
68
  "rimraf": "^3.0.2",
68
69
  "ts-node": "^10.5.0",
69
70
  "tsconfig-paths": "^3.12.0",
70
71
  "typechain": "^8.0.0",
71
- "typescript": "^4.5.5"
72
+ "typescript": "^4.6.4"
72
73
  }
73
74
  }
package/src/abi/index.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  import gnosisSafe from "./gnosisSafe.json";
2
2
  import erc20 from "./erc20.json";
3
- import interopXGateway from "./interopXGateway.json";
4
- import interopBridgeToken from "./interopBridgeToken.json";
3
+ import interopXContract from "./interopXContract.json";
5
4
 
6
5
  export default {
7
6
  gnosisSafe,
8
7
  erc20,
9
- interopXGateway,
10
- interopBridgeToken,
8
+ interopXContract,
11
9
  }
@@ -0,0 +1,454 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": false,
7
+ "internalType": "string",
8
+ "name": "actionId",
9
+ "type": "string"
10
+ },
11
+ {
12
+ "indexed": true,
13
+ "internalType": "address",
14
+ "name": "bridger",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "components": [
19
+ {
20
+ "components": [
21
+ {
22
+ "internalType": "address",
23
+ "name": "sourceToken",
24
+ "type": "address"
25
+ },
26
+ {
27
+ "internalType": "address",
28
+ "name": "targetToken",
29
+ "type": "address"
30
+ },
31
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
32
+ ],
33
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
34
+ "name": "supply",
35
+ "type": "tuple[]"
36
+ },
37
+ {
38
+ "components": [
39
+ {
40
+ "internalType": "address",
41
+ "name": "sourceToken",
42
+ "type": "address"
43
+ },
44
+ {
45
+ "internalType": "address",
46
+ "name": "targetToken",
47
+ "type": "address"
48
+ },
49
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
50
+ ],
51
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
52
+ "name": "withdraw",
53
+ "type": "tuple[]"
54
+ }
55
+ ],
56
+ "indexed": false,
57
+ "internalType": "struct InteropXContractBeta.Position",
58
+ "name": "position",
59
+ "type": "tuple"
60
+ },
61
+ {
62
+ "indexed": true,
63
+ "internalType": "uint32",
64
+ "name": "sourceChainId",
65
+ "type": "uint32"
66
+ },
67
+ {
68
+ "indexed": false,
69
+ "internalType": "uint32",
70
+ "name": "targetChainId",
71
+ "type": "uint32"
72
+ },
73
+ {
74
+ "indexed": true,
75
+ "internalType": "bytes32",
76
+ "name": "requestTransactionHash",
77
+ "type": "bytes32"
78
+ },
79
+ {
80
+ "indexed": false,
81
+ "internalType": "bytes",
82
+ "name": "metadata",
83
+ "type": "bytes"
84
+ }
85
+ ],
86
+ "name": "LogBridgeCommitted",
87
+ "type": "event"
88
+ },
89
+ {
90
+ "anonymous": false,
91
+ "inputs": [
92
+ {
93
+ "indexed": false,
94
+ "internalType": "string",
95
+ "name": "actionId",
96
+ "type": "string"
97
+ },
98
+ {
99
+ "indexed": true,
100
+ "internalType": "address",
101
+ "name": "bridger",
102
+ "type": "address"
103
+ },
104
+ {
105
+ "components": [
106
+ {
107
+ "components": [
108
+ {
109
+ "internalType": "address",
110
+ "name": "sourceToken",
111
+ "type": "address"
112
+ },
113
+ {
114
+ "internalType": "address",
115
+ "name": "targetToken",
116
+ "type": "address"
117
+ },
118
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
119
+ ],
120
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
121
+ "name": "supply",
122
+ "type": "tuple[]"
123
+ },
124
+ {
125
+ "components": [
126
+ {
127
+ "internalType": "address",
128
+ "name": "sourceToken",
129
+ "type": "address"
130
+ },
131
+ {
132
+ "internalType": "address",
133
+ "name": "targetToken",
134
+ "type": "address"
135
+ },
136
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
137
+ ],
138
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
139
+ "name": "withdraw",
140
+ "type": "tuple[]"
141
+ }
142
+ ],
143
+ "indexed": false,
144
+ "internalType": "struct InteropXContractBeta.Position",
145
+ "name": "position",
146
+ "type": "tuple"
147
+ },
148
+ {
149
+ "indexed": false,
150
+ "internalType": "uint256",
151
+ "name": "sourceChainId",
152
+ "type": "uint256"
153
+ },
154
+ {
155
+ "indexed": true,
156
+ "internalType": "uint256",
157
+ "name": "targetChainId",
158
+ "type": "uint256"
159
+ },
160
+ {
161
+ "indexed": true,
162
+ "internalType": "bytes32",
163
+ "name": "requestTransactionHash",
164
+ "type": "bytes32"
165
+ },
166
+ {
167
+ "indexed": false,
168
+ "internalType": "bytes32",
169
+ "name": "targetCommittedTransactionHash",
170
+ "type": "bytes32"
171
+ },
172
+ {
173
+ "indexed": false,
174
+ "internalType": "bytes",
175
+ "name": "metadata",
176
+ "type": "bytes"
177
+ }
178
+ ],
179
+ "name": "LogBridgeCompleted",
180
+ "type": "event"
181
+ },
182
+ {
183
+ "anonymous": false,
184
+ "inputs": [
185
+ {
186
+ "indexed": false,
187
+ "internalType": "string",
188
+ "name": "actionId",
189
+ "type": "string"
190
+ },
191
+ {
192
+ "indexed": true,
193
+ "internalType": "address",
194
+ "name": "bridger",
195
+ "type": "address"
196
+ },
197
+ {
198
+ "components": [
199
+ {
200
+ "components": [
201
+ {
202
+ "internalType": "address",
203
+ "name": "sourceToken",
204
+ "type": "address"
205
+ },
206
+ {
207
+ "internalType": "address",
208
+ "name": "targetToken",
209
+ "type": "address"
210
+ },
211
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
212
+ ],
213
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
214
+ "name": "supply",
215
+ "type": "tuple[]"
216
+ },
217
+ {
218
+ "components": [
219
+ {
220
+ "internalType": "address",
221
+ "name": "sourceToken",
222
+ "type": "address"
223
+ },
224
+ {
225
+ "internalType": "address",
226
+ "name": "targetToken",
227
+ "type": "address"
228
+ },
229
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
230
+ ],
231
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
232
+ "name": "withdraw",
233
+ "type": "tuple[]"
234
+ }
235
+ ],
236
+ "indexed": false,
237
+ "internalType": "struct InteropXContractBeta.Position",
238
+ "name": "position",
239
+ "type": "tuple"
240
+ },
241
+ {
242
+ "indexed": false,
243
+ "internalType": "uint256",
244
+ "name": "sourceChainId",
245
+ "type": "uint256"
246
+ },
247
+ {
248
+ "indexed": true,
249
+ "internalType": "uint256",
250
+ "name": "targetChainId",
251
+ "type": "uint256"
252
+ },
253
+ {
254
+ "indexed": false,
255
+ "internalType": "bytes",
256
+ "name": "metadata",
257
+ "type": "bytes"
258
+ }
259
+ ],
260
+ "name": "LogBridgeRequest",
261
+ "type": "event"
262
+ },
263
+ {
264
+ "anonymous": false,
265
+ "inputs": [
266
+ {
267
+ "indexed": false,
268
+ "internalType": "string",
269
+ "name": "actionId",
270
+ "type": "string"
271
+ },
272
+ {
273
+ "indexed": true,
274
+ "internalType": "address",
275
+ "name": "bridger",
276
+ "type": "address"
277
+ },
278
+ {
279
+ "components": [
280
+ {
281
+ "components": [
282
+ {
283
+ "internalType": "address",
284
+ "name": "sourceToken",
285
+ "type": "address"
286
+ },
287
+ {
288
+ "internalType": "address",
289
+ "name": "targetToken",
290
+ "type": "address"
291
+ },
292
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
293
+ ],
294
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
295
+ "name": "supply",
296
+ "type": "tuple[]"
297
+ },
298
+ {
299
+ "components": [
300
+ {
301
+ "internalType": "address",
302
+ "name": "sourceToken",
303
+ "type": "address"
304
+ },
305
+ {
306
+ "internalType": "address",
307
+ "name": "targetToken",
308
+ "type": "address"
309
+ },
310
+ { "internalType": "uint256", "name": "amount", "type": "uint256" }
311
+ ],
312
+ "internalType": "struct InteropXContractBeta.TokenInfo[]",
313
+ "name": "withdraw",
314
+ "type": "tuple[]"
315
+ }
316
+ ],
317
+ "indexed": false,
318
+ "internalType": "struct InteropXContractBeta.Position",
319
+ "name": "position",
320
+ "type": "tuple"
321
+ },
322
+ {
323
+ "indexed": false,
324
+ "internalType": "uint32",
325
+ "name": "sourceChainId",
326
+ "type": "uint32"
327
+ },
328
+ {
329
+ "indexed": true,
330
+ "internalType": "uint32",
331
+ "name": "targetChainId",
332
+ "type": "uint32"
333
+ },
334
+ {
335
+ "indexed": true,
336
+ "internalType": "bytes32",
337
+ "name": "requestTransactionHash",
338
+ "type": "bytes32"
339
+ },
340
+ {
341
+ "indexed": false,
342
+ "internalType": "bytes",
343
+ "name": "metadata",
344
+ "type": "bytes"
345
+ }
346
+ ],
347
+ "name": "LogBridgeRequestSent",
348
+ "type": "event"
349
+ },
350
+ {
351
+ "inputs": [
352
+ { "internalType": "string", "name": "actionId", "type": "string" },
353
+ { "internalType": "address", "name": "to_", "type": "address" },
354
+ { "internalType": "address", "name": "sourceToken_", "type": "address" },
355
+ { "internalType": "address", "name": "targetToken_", "type": "address" },
356
+ { "internalType": "uint256", "name": "amount_", "type": "uint256" },
357
+ { "internalType": "uint32", "name": "sourceChainId_", "type": "uint32" },
358
+ {
359
+ "internalType": "bytes32",
360
+ "name": "transactionHash_",
361
+ "type": "bytes32"
362
+ },
363
+ { "internalType": "bytes", "name": "metadata_", "type": "bytes" }
364
+ ],
365
+ "name": "completeBridge",
366
+ "outputs": [],
367
+ "stateMutability": "nonpayable",
368
+ "type": "function"
369
+ },
370
+ {
371
+ "inputs": [
372
+ { "internalType": "address", "name": "user", "type": "address" },
373
+ { "internalType": "address[]", "name": "tokens", "type": "address[]" }
374
+ ],
375
+ "name": "getBridgeAmounts",
376
+ "outputs": [
377
+ {
378
+ "components": [
379
+ { "internalType": "uint256", "name": "deposit", "type": "uint256" },
380
+ { "internalType": "uint256", "name": "withdraw", "type": "uint256" }
381
+ ],
382
+ "internalType": "struct InteropXContractBeta.UserData[]",
383
+ "name": "userData",
384
+ "type": "tuple[]"
385
+ }
386
+ ],
387
+ "stateMutability": "view",
388
+ "type": "function"
389
+ },
390
+ {
391
+ "inputs": [
392
+ { "internalType": "string", "name": "actionId", "type": "string" },
393
+ { "internalType": "address", "name": "sourceToken_", "type": "address" },
394
+ { "internalType": "address", "name": "targetToken_", "type": "address" },
395
+ { "internalType": "uint256", "name": "amount_", "type": "uint256" },
396
+ { "internalType": "uint32", "name": "targetChainId_", "type": "uint32" },
397
+ { "internalType": "bytes", "name": "metadata_", "type": "bytes" }
398
+ ],
399
+ "name": "requestWithdraw",
400
+ "outputs": [],
401
+ "stateMutability": "nonpayable",
402
+ "type": "function"
403
+ },
404
+ {
405
+ "inputs": [
406
+ { "internalType": "address", "name": "token", "type": "address" },
407
+ { "internalType": "bool", "name": "toggle", "type": "bool" }
408
+ ],
409
+ "name": "toggleWhitelist",
410
+ "outputs": [],
411
+ "stateMutability": "nonpayable",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "inputs": [
416
+ { "internalType": "address", "name": "", "type": "address" },
417
+ { "internalType": "address", "name": "", "type": "address" }
418
+ ],
419
+ "name": "userMapping",
420
+ "outputs": [
421
+ { "internalType": "uint256", "name": "deposit", "type": "uint256" },
422
+ { "internalType": "uint256", "name": "withdraw", "type": "uint256" }
423
+ ],
424
+ "stateMutability": "view",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
429
+ "name": "whitelistedTokens",
430
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
431
+ "stateMutability": "view",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ { "internalType": "string", "name": "actionId", "type": "string" },
437
+ { "internalType": "address", "name": "user_", "type": "address" },
438
+ { "internalType": "address", "name": "sourceToken_", "type": "address" },
439
+ { "internalType": "address", "name": "targetToken_", "type": "address" },
440
+ { "internalType": "uint256", "name": "amount_", "type": "uint256" },
441
+ { "internalType": "uint32", "name": "chainId_", "type": "uint32" },
442
+ {
443
+ "internalType": "bytes32",
444
+ "name": "transactionHash_",
445
+ "type": "bytes32"
446
+ },
447
+ { "internalType": "bytes", "name": "metadata_", "type": "bytes" }
448
+ ],
449
+ "name": "withdrawRequested",
450
+ "outputs": [],
451
+ "stateMutability": "nonpayable",
452
+ "type": "function"
453
+ }
454
+ ]
package/src/alias.ts ADDED
@@ -0,0 +1,6 @@
1
+ import moduleAlias from 'module-alias';
2
+ moduleAlias.addAliases({
3
+ "@": __dirname,
4
+ })
5
+
6
+ moduleAlias();
@@ -1,17 +1,17 @@
1
1
  export const addresses = {
2
- 1: {
3
- gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
4
- multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
5
- interopXGateway: '',
6
- },
2
+ // 1: {
3
+ // gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
4
+ // multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
5
+ // interopXContract: '',
6
+ // },
7
7
  137: {
8
8
  gnosisSafe: '0x5635d2910e51da33d9DC0422c893CF4F28B69A25',
9
9
  multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
10
- interopXGateway: '',
10
+ interopXContract: '0x28f175FBEAce469c27ed587016aD7Bb72f286759',
11
11
  },
12
12
  43114: {
13
13
  gnosisSafe: '0x31d7a5194Fe60AC209Cf1Ce2d539C9A60662Ed6b',
14
14
  multisend: '0x998739BFdAAdde7C933B942a68053933098f9EDa',
15
- interopXGateway: '0xF0317C5Bc206F2291dd2f3eE9C4cDB5Bbb25418d',
15
+ interopXContract: '0x54d77C42Dae3Fc0f48b4Fdd5a193E776D07C1EEC',
16
16
  }
17
- }
17
+ } as Record<number, { gnosisSafe: string, multisend: string, interopXContract: string }>
@@ -1,3 +1,2 @@
1
1
  export * from './addresses';
2
2
  export * from './tokens';
3
- export * from './itokens';