@instadapp/interop-x 0.0.0-dev.67e7c3a → 0.0.0-dev.733ff78

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 (64) hide show
  1. package/dist/package.json +4 -3
  2. package/dist/src/abi/interopBridgeToken.json +21 -9
  3. package/dist/src/abi/interopXGateway.json +11 -11
  4. package/dist/src/api/index.js +6 -3
  5. package/dist/src/config/index.js +10 -1
  6. package/dist/src/constants/addresses.js +1 -1
  7. package/dist/src/constants/itokens.js +1 -1
  8. package/dist/src/db/models/transaction.js +8 -0
  9. package/dist/src/gnosis/actions/deposit.js +48 -0
  10. package/dist/src/gnosis/actions/index.js +11 -0
  11. package/dist/src/gnosis/actions/withdraw.js +50 -0
  12. package/dist/src/gnosis/index.js +20 -0
  13. package/dist/src/index.js +36 -6
  14. package/dist/src/net/peer/index.js +2 -1
  15. package/dist/src/net/pool/index.js +7 -2
  16. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +3 -8
  17. package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
  18. package/dist/src/net/protocol/index.js +26 -5
  19. package/dist/src/tasks/AutoUpdateTask.js +42 -16
  20. package/dist/src/tasks/BaseTask.js +11 -3
  21. package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +17 -2
  22. package/dist/src/tasks/InteropBridge/{SyncWithdrawEvents.js → SyncBurnEvents.js} +10 -9
  23. package/dist/src/tasks/InteropBridge/SyncMintEvents.js +67 -0
  24. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +16 -2
  25. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +2 -3
  26. package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +72 -0
  27. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
  28. package/dist/src/tasks/index.js +17 -4
  29. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +23 -11
  30. package/dist/src/typechain/factories/InteropXGateway__factory.js +14 -14
  31. package/dist/src/utils/index.js +14 -85
  32. package/package.json +4 -3
  33. package/src/abi/interopBridgeToken.json +21 -9
  34. package/src/abi/interopXGateway.json +11 -11
  35. package/src/api/index.ts +5 -2
  36. package/src/config/index.ts +9 -1
  37. package/src/constants/addresses.ts +1 -1
  38. package/src/constants/itokens.ts +1 -1
  39. package/src/db/models/transaction.ts +10 -0
  40. package/src/gnosis/actions/deposit.ts +63 -0
  41. package/src/gnosis/actions/index.ts +7 -0
  42. package/src/gnosis/actions/withdraw.ts +67 -0
  43. package/src/gnosis/index.ts +19 -0
  44. package/src/index.ts +49 -8
  45. package/src/net/peer/index.ts +2 -1
  46. package/src/net/pool/index.ts +7 -3
  47. package/src/net/protocol/dial/SignatureDialProtocol.ts +5 -11
  48. package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
  49. package/src/net/protocol/index.ts +28 -6
  50. package/src/tasks/AutoUpdateTask.ts +48 -20
  51. package/src/tasks/BaseTask.ts +13 -3
  52. package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +24 -8
  53. package/src/tasks/InteropBridge/{SyncWithdrawEvents.ts → SyncBurnEvents.ts} +13 -15
  54. package/src/tasks/InteropBridge/SyncMintEvents.ts +99 -0
  55. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +22 -7
  56. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +2 -4
  57. package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +105 -0
  58. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
  59. package/src/tasks/index.ts +25 -4
  60. package/src/typechain/InteropBridgeToken.ts +23 -17
  61. package/src/typechain/InteropXGateway.ts +13 -13
  62. package/src/typechain/factories/InteropBridgeToken__factory.ts +23 -11
  63. package/src/typechain/factories/InteropXGateway__factory.ts +14 -14
  64. package/src/utils/index.ts +16 -125
@@ -8,7 +8,7 @@ import { ChainId } from "@/types";
8
8
  import config from "@/config";
9
9
  import { InteropBridgeToken } from "@/typechain";
10
10
 
11
- class SyncWithdrawEvents extends BaseTask {
11
+ class SyncBurnEvents extends BaseTask {
12
12
  contractAddress: string;
13
13
  provider: ethers.providers.JsonRpcProvider;
14
14
  contract: InteropBridgeToken;
@@ -17,7 +17,7 @@ class SyncWithdrawEvents extends BaseTask {
17
17
 
18
18
  constructor({ chainId, itokenAddress }: { chainId: ChainId, itokenAddress: string }) {
19
19
  super({
20
- logger: new Logger("InteropBridgeToken::SyncWithdrawEvents"),
20
+ logger: new Logger("InteropBridgeToken::SyncBurnEvents"),
21
21
  })
22
22
  this.chainId = chainId;
23
23
  this.itokenAddress = itokenAddress;
@@ -41,13 +41,13 @@ class SyncWithdrawEvents extends BaseTask {
41
41
  continue;
42
42
  }
43
43
 
44
- const { to, amount, chainId } = event.args;
44
+ const { to, amount, sourceChainId, targetChainId } = event.args;
45
45
 
46
46
  const uniqueIdentifier = {
47
47
  action: 'withdraw',
48
48
  submitTransactionHash: event.transactionHash,
49
- sourceChainId:this.chainId,
50
- targetChainId: chainId.toNumber(),
49
+ sourceChainId: sourceChainId,
50
+ targetChainId: targetChainId,
51
51
  }
52
52
 
53
53
  if (await Transaction.findOne({ where: uniqueIdentifier })) {
@@ -62,7 +62,6 @@ class SyncWithdrawEvents extends BaseTask {
62
62
  from: tx.from,
63
63
  to,
64
64
 
65
-
66
65
  submitTransactionHash: event.transactionHash,
67
66
  submitBlockNumber: event.blockNumber,
68
67
 
@@ -70,21 +69,22 @@ class SyncWithdrawEvents extends BaseTask {
70
69
  sourceTransactionHash: event.transactionHash,
71
70
  sourceBlockNumber: event.blockNumber,
72
71
  sourceStatus: "success",
73
-
74
72
  targetStatus: "uninitialised",
75
73
 
76
74
  submitEvent: {
77
- to,
75
+ to,
78
76
  amount: amount.toString(),
79
77
  itoken: this.itokenAddress,
80
- chainId: chainId.toString()
78
+ sourceChainId: sourceChainId,
79
+ targetChainId: targetChainId,
81
80
  },
82
81
 
83
82
  sourceEvent: {
84
- to,
85
- amount: amount.toString(),
83
+ to,
84
+ amount: amount.toString(),
86
85
  itoken: this.itokenAddress,
87
- chainId: chainId.toString(),
86
+ sourceChainId: sourceChainId,
87
+ targetChainId: targetChainId,
88
88
  },
89
89
  status: "pending",
90
90
  })
@@ -102,8 +102,6 @@ class SyncWithdrawEvents extends BaseTask {
102
102
  }
103
103
 
104
104
  async start(): Promise<void> {
105
- this.logger.info(`Starting execution watcher on interop chain`);
106
-
107
105
  this.provider = new ethers.providers.JsonRpcProvider(
108
106
  getRpcProviderUrl(this.chainId)
109
107
  );
@@ -118,4 +116,4 @@ class SyncWithdrawEvents extends BaseTask {
118
116
  }
119
117
  }
120
118
 
121
- export default SyncWithdrawEvents;
119
+ export default SyncBurnEvents;
@@ -0,0 +1,99 @@
1
+ import { BaseTask } from "../BaseTask";
2
+ import Logger from '@/logger';
3
+ import { ethers } from "ethers";
4
+ import abi from "@/abi";
5
+ import { Transaction } from "@/db";
6
+ import { getContract, getRpcProviderUrl } from "@/utils";
7
+ import { ChainId } from "@/types";
8
+ import config from "@/config";
9
+ import { InteropBridgeToken } from "@/typechain";
10
+
11
+ class SyncMintEvents extends BaseTask {
12
+ contractAddress: string;
13
+ provider: ethers.providers.JsonRpcProvider;
14
+ contract: InteropBridgeToken;
15
+ chainId: ChainId;
16
+ itokenAddress: string;
17
+
18
+ constructor({ chainId, itokenAddress }: { chainId: ChainId, itokenAddress: string }) {
19
+ super({
20
+ logger: new Logger("InteropBridgeToken::SyncMintEvents"),
21
+ })
22
+ this.chainId = chainId;
23
+ this.itokenAddress = itokenAddress;
24
+ }
25
+
26
+ async pollHandler() {
27
+ const currentBlock = await this.provider.getBlockNumber();
28
+
29
+ const events = await this.contract.queryFilter(
30
+ this.contract.filters.Mint(),
31
+ currentBlock - 500,
32
+ currentBlock,
33
+ );
34
+
35
+ for (const event of events) {
36
+
37
+ try {
38
+ if (!event.args) {
39
+ continue;
40
+ }
41
+
42
+ const { sourceChainId, targetChainId, amount, to, submitTransactionHash } = event.args;
43
+
44
+ const uniqueIdentifier = {
45
+ action: 'deposit',
46
+ submitTransactionHash: submitTransactionHash,
47
+ sourceChainId: sourceChainId,
48
+ targetChainId: targetChainId,
49
+
50
+ targetEvent: null
51
+ }
52
+
53
+ const transaction = await Transaction.findOne({ where: uniqueIdentifier });
54
+
55
+ if(! transaction){
56
+ return;
57
+ }
58
+
59
+ const tx = await event.getTransaction()
60
+
61
+ transaction.targetStatus = 'success'
62
+ transaction.targetErrors = []
63
+ transaction.targetTransactionHash = tx.hash
64
+ transaction.targetEvent = {
65
+ sourceChainId,
66
+ targetChainId,
67
+ amount: amount.toString(),
68
+ to,
69
+ submitTransactionHash
70
+ }
71
+ transaction.status = 'success'
72
+
73
+ await transaction.save()
74
+
75
+ this.logger.info(
76
+ `Mint confirmation received: ${transaction.transactionHash} `
77
+ );
78
+ } catch (error) {
79
+ this.logger.error(error);
80
+ }
81
+ }
82
+ }
83
+
84
+ async start(): Promise<void> {
85
+ this.provider = new ethers.providers.JsonRpcProvider(
86
+ getRpcProviderUrl(this.chainId)
87
+ );
88
+
89
+ this.contract = getContract<InteropBridgeToken>(
90
+ this.itokenAddress,
91
+ abi.interopBridgeToken,
92
+ new ethers.Wallet(config.privateKey!, this.provider)
93
+ );
94
+
95
+ await super.start()
96
+ }
97
+ }
98
+
99
+ export default SyncMintEvents;
@@ -3,7 +3,7 @@ import Logger from '@/logger';
3
3
  import { BigNumber, ethers } from "ethers";
4
4
  import abi from "@/abi";
5
5
  import { Transaction } from "@/db";
6
- import { buildDataForTransaction, buildSignatureBytes, getContract, getRpcProviderUrl, Signature } from "@/utils";
6
+ import { buildSignatureBytes, getContract, getRpcProviderUrl, Signature } from "@/utils";
7
7
  import { addresses } from "@/constants";
8
8
  import { ChainId } from "@/types";
9
9
  import config from "@/config";
@@ -12,10 +12,11 @@ import { Op } from "sequelize";
12
12
  import wait from "waait";
13
13
  import { peerPool, protocol } from "@/net";
14
14
  import { LogDescription } from "ethers/lib/utils";
15
+ import { buildGnosisAction } from "@/gnosis";
15
16
 
16
17
  const generateGnosisTransaction = async (transactionData: any, safeContract: GnosisSafe) => {
17
18
  console.log(transactionData);
18
-
19
+
19
20
  let isExecuted = await safeContract.dataHashes(
20
21
  await safeContract.getTransactionHash(
21
22
  transactionData.to,
@@ -97,7 +98,7 @@ class ProcessDepositEvents extends BaseTask {
97
98
  }
98
99
 
99
100
  console.log(`Processing transaction ${transaction.transactionHash}`);
100
-
101
+
101
102
  transaction.targetStatus = 'pending';
102
103
  await transaction.save();
103
104
 
@@ -121,9 +122,24 @@ class ProcessDepositEvents extends BaseTask {
121
122
  const ownersThreshold = await safeContract.getThreshold();
122
123
  await wait(10000);
123
124
 
125
+ let data, logs = [];
126
+
127
+ try {
128
+ ({ data, logs } = await buildGnosisAction(transaction));
129
+
130
+ } catch (error) {
131
+ console.log(error);
132
+ transaction.targetStatus = 'failed';
133
+ transaction.targetErrors = [error.message];
134
+ transaction.status = 'failed'
135
+ await transaction.save();
136
+ protocol.sendTransaction(transaction)
137
+ return;
138
+ }
139
+
124
140
  let gnosisTx = await generateGnosisTransaction({
125
141
  baseGas: "0",
126
- data: await buildDataForTransaction(transaction),
142
+ data,
127
143
  gasPrice: "0",
128
144
  gasToken: "0x0000000000000000000000000000000000000000",
129
145
  nonce: '0',
@@ -142,7 +158,7 @@ class ProcessDepositEvents extends BaseTask {
142
158
  console.log(`Collecting signatures for execution ${transaction.transactionHash}`)
143
159
 
144
160
  console.log(ownerPeerIds);
145
-
161
+
146
162
  const signatures = await protocol.requestSignatures({
147
163
  type: 'source',
148
164
  transactionHash: transaction.transactionHash,
@@ -210,6 +226,7 @@ class ProcessDepositEvents extends BaseTask {
210
226
  console.log('ExecutionSuccess')
211
227
  transaction.targetStatus = 'success'
212
228
  transaction.targetTransactionHash = txSent.hash
229
+ transaction.targetLogs = logs;
213
230
  transaction.status = 'success'
214
231
  await transaction.save();
215
232
  } else {
@@ -224,8 +241,6 @@ class ProcessDepositEvents extends BaseTask {
224
241
  }
225
242
 
226
243
  async start(): Promise<void> {
227
- this.logger.info(`Starting execution watcher on interop chain`);
228
-
229
244
  this.contractAddress = addresses[this.chainId].interopXGateway;
230
245
 
231
246
  this.provider = new ethers.providers.JsonRpcProvider(
@@ -45,8 +45,8 @@ class SyncDepositEvents extends BaseTask {
45
45
  const uniqueIdentifier = {
46
46
  action: 'deposit',
47
47
  submitTransactionHash: event.transactionHash,
48
- sourceChainId: sourceChainId.toNumber(),
49
- targetChainId: targetChainId.toNumber(),
48
+ sourceChainId: sourceChainId,
49
+ targetChainId: targetChainId,
50
50
  }
51
51
 
52
52
  if (await Transaction.findOne({ where: uniqueIdentifier })) {
@@ -105,8 +105,6 @@ class SyncDepositEvents extends BaseTask {
105
105
  }
106
106
 
107
107
  async start(): Promise<void> {
108
- this.logger.info(`Starting execution watcher on interop chain`);
109
-
110
108
  this.contractAddress = addresses[this.chainId].interopXGateway;
111
109
 
112
110
  this.provider = new ethers.providers.JsonRpcProvider(
@@ -0,0 +1,105 @@
1
+ import { BaseTask } from "../BaseTask";
2
+ import Logger from '@/logger';
3
+ import { ethers } from "ethers";
4
+ import abi from "@/abi";
5
+ import { Transaction } from "@/db";
6
+ import { getContract, getRpcProviderUrl } from "@/utils";
7
+ import { addresses } from "@/constants";
8
+ import { ChainId } from "@/types";
9
+ import config from "@/config";
10
+ import { InteropXGateway } from "@/typechain";
11
+
12
+ class SyncWithdrawEvents extends BaseTask {
13
+ contractAddress: string;
14
+ provider: ethers.providers.JsonRpcProvider;
15
+ contract: InteropXGateway;
16
+ chainId: ChainId;
17
+
18
+ constructor({ chainId }: { chainId: ChainId }) {
19
+ super({
20
+ logger: new Logger("InteropXGateway::SyncWithdrawEvents"),
21
+ })
22
+ this.chainId = chainId;
23
+ }
24
+
25
+ async pollHandler() {
26
+ const currentBlock = await this.provider.getBlockNumber();
27
+
28
+ const events = await this.contract.queryFilter(
29
+ this.contract.filters.LogGatewayWithdraw(),
30
+ currentBlock - 500,
31
+ currentBlock,
32
+ );
33
+
34
+ let processedEvents = 0;
35
+
36
+ for (const event of events) {
37
+
38
+ try {
39
+ if (!event.args) {
40
+ continue;
41
+ }
42
+
43
+ const { user, token, amount, sourceChainId, targetChainId, transactionHash } = event.args;
44
+
45
+ const uniqueIdentifier = {
46
+ action: 'withdraw',
47
+ submitTransactionHash: transactionHash,
48
+ sourceChainId: sourceChainId,
49
+ targetChainId: targetChainId,
50
+
51
+ targetEvent: null
52
+ }
53
+ const transaction = await Transaction.findOne({ where: uniqueIdentifier });
54
+
55
+ if (!transaction) {
56
+ return;
57
+ }
58
+
59
+ const tx = await event.getTransaction()
60
+
61
+ transaction.targetStatus = 'success'
62
+ transaction.targetErrors = []
63
+ transaction.targetTransactionHash = tx.hash
64
+ transaction.targetEvent = {
65
+ user,
66
+ token,
67
+ amount: amount.toString(),
68
+ sourceChainId,
69
+ targetChainId,
70
+ transactionHash,
71
+ }
72
+ transaction.status = 'success'
73
+
74
+ await transaction.save()
75
+
76
+ this.logger.info(
77
+ `Witdraw confirmation received: ${transaction.transactionHash} `
78
+ );
79
+ } catch (error) {
80
+ this.logger.error(error);
81
+ }
82
+ }
83
+
84
+ if (processedEvents > 0)
85
+ this.logger.info(`${processedEvents} events processed`);
86
+ }
87
+
88
+ async start(): Promise<void> {
89
+ this.contractAddress = addresses[this.chainId].interopXGateway;
90
+
91
+ this.provider = new ethers.providers.JsonRpcProvider(
92
+ getRpcProviderUrl(this.chainId)
93
+ );
94
+
95
+ this.contract = getContract<InteropXGateway>(
96
+ this.contractAddress,
97
+ abi.interopXGateway,
98
+ new ethers.Wallet(config.privateKey!, this.provider)
99
+ );
100
+
101
+ await super.start()
102
+ }
103
+ }
104
+
105
+ export default SyncWithdrawEvents;
@@ -0,0 +1,67 @@
1
+ import { BaseTask } from "../BaseTask";
2
+ import Logger from '@/logger';
3
+ import config from "@/config";
4
+ import { peerPool, protocol } from "@/net";
5
+ import { Transaction } from "@/db";
6
+ import { Op } from "sequelize";
7
+
8
+ class SyncTransactionStatusTask extends BaseTask {
9
+ pollIntervalMs: number = 60 * 1000
10
+ exceptLeadNode: boolean = true;
11
+
12
+ constructor() {
13
+ super({
14
+ logger: new Logger("SyncTransactionStatusTask"),
15
+ })
16
+ }
17
+
18
+ async pollHandler() {
19
+ // if transaction is pending for more than 1 hour, check lead node for status
20
+ const leadNode = peerPool.getLeadPeer();
21
+
22
+ if (!leadNode) {
23
+ return;
24
+ }
25
+
26
+ const transaction = await Transaction.findOne({
27
+ where: {
28
+ status: 'pending',
29
+ sourceCreatedAt: {
30
+ [Op.gte]: new Date(Date.now() - 60 * 60 * 1000),
31
+ },
32
+ }
33
+ })
34
+
35
+ if (!transaction) {
36
+ return;
37
+ }
38
+
39
+ this.logger.info(`Requesting transaction status for ${transaction.transactionHash}`)
40
+
41
+ const transactionStatus = await protocol.requestTransactionStatus(transaction.transactionHash, leadNode.id);
42
+
43
+ if (!transactionStatus) {
44
+ return;
45
+ }
46
+
47
+ this.logger.info(`Received transaction status for ${transaction.transactionHash}`)
48
+
49
+ transaction.sourceStatus = transactionStatus.sourceStatus
50
+ transaction.sourceTransactionHash = transactionStatus.sourceTransactionHash
51
+ transaction.sourceErrors = transactionStatus.sourceErrors
52
+ transaction.sourceLogs = transactionStatus.sourceLogs
53
+
54
+ transaction.targetStatus = transactionStatus.targetStatus
55
+ transaction.targetTransactionHash = transactionStatus.targetTransactionHash
56
+ transaction.targetErrors = transactionStatus.targetErrors
57
+ transaction.targetLogs = transactionStatus.targetLogs
58
+
59
+ transaction.status = transactionStatus.status
60
+
61
+ await transaction.save()
62
+
63
+ this.logger.info(`Updated transaction status for ${transaction.transactionHash}`)
64
+ }
65
+ }
66
+
67
+ export default SyncTransactionStatusTask;
@@ -1,16 +1,24 @@
1
1
  import { BaseTask } from "./BaseTask";
2
2
  import InteropXGatewayProcessDepositEvents from "./InteropXGateway/ProcessDepositEvents";
3
3
  import InteropXGatewaySyncDepositEvents from "./InteropXGateway/SyncDepositEvents";
4
+ import InteropXGatewaySyncWithdrawEvents from "./InteropXGateway/SyncWithdrawtEvents";
4
5
 
5
- import InteropBridgeSyncWithdrawEvents from "./InteropBridge/SyncWithdrawEvents";
6
6
  import InteropBridgeProcessWithdrawEvents from "./InteropBridge/ProcessWithdrawEvents";
7
+ import InteropBridgeSyncBurnEvents from "./InteropBridge/SyncBurnEvents";
8
+ import InteropBridgeSyncMintEvents from "./InteropBridge/SyncMintEvents";
9
+
10
+ import SyncTransactionStatusTask from "./Transactions/SyncTransactionStatusTask";
11
+
7
12
  import AutoUpdateTask from "./AutoUpdateTask";
8
13
 
9
14
  export class Tasks {
10
15
 
11
16
  tasks: BaseTask[] = [
17
+ new SyncTransactionStatusTask(),
12
18
  new AutoUpdateTask(),
13
19
 
20
+ // InteropXGateway
21
+
14
22
  new InteropXGatewaySyncDepositEvents({
15
23
  chainId: 43114
16
24
  }),
@@ -19,13 +27,26 @@ export class Tasks {
19
27
  chainId: 43114
20
28
  }),
21
29
 
22
- new InteropBridgeSyncWithdrawEvents({
23
- chainId: 137,
24
- itokenAddress: '0xEab02fe1F016eE3e4106c1C6aad35FeEe657268E',
30
+
31
+ new InteropXGatewaySyncWithdrawEvents({
32
+ chainId: 43114
25
33
  }),
26
34
 
35
+
36
+ // InteropBridge
37
+
27
38
  new InteropBridgeProcessWithdrawEvents({
28
39
  chainId: 137,
40
+ }),
41
+
42
+ new InteropBridgeSyncMintEvents({
43
+ chainId: 137,
44
+ itokenAddress: '0x62c0045f3277e7067cacad3c8038eeabb1bd92d1',
45
+ }),
46
+
47
+ new InteropBridgeSyncBurnEvents({
48
+ chainId: 137,
49
+ itokenAddress: '0x62c0045f3277e7067cacad3c8038eeabb1bd92d1',
29
50
  })
30
51
  ];
31
52
 
@@ -31,11 +31,11 @@ export interface InteropBridgeTokenInterface extends utils.Interface {
31
31
  "allowance(address,address)": FunctionFragment;
32
32
  "approve(address,uint256)": FunctionFragment;
33
33
  "balanceOf(address)": FunctionFragment;
34
- "burn(address,uint256,uint256)": FunctionFragment;
34
+ "burn(address,uint256,uint32)": FunctionFragment;
35
35
  "decimals()": FunctionFragment;
36
36
  "decreaseAllowance(address,uint256)": FunctionFragment;
37
37
  "increaseAllowance(address,uint256)": FunctionFragment;
38
- "mint(address,uint256,uint256,bytes32)": FunctionFragment;
38
+ "mint(address,uint256,uint32,bytes32)": FunctionFragment;
39
39
  "name()": FunctionFragment;
40
40
  "owner()": FunctionFragment;
41
41
  "renounceOwnership()": FunctionFragment;
@@ -153,8 +153,8 @@ export interface InteropBridgeTokenInterface extends utils.Interface {
153
153
 
154
154
  events: {
155
155
  "Approval(address,address,uint256)": EventFragment;
156
- "Burn(address,uint256,uint256)": EventFragment;
157
- "Mint(address,uint256,uint256,bytes32)": EventFragment;
156
+ "Burn(address,uint256,uint32,uint32)": EventFragment;
157
+ "Mint(address,uint256,uint32,uint32,bytes32)": EventFragment;
158
158
  "OwnershipTransferred(address,address)": EventFragment;
159
159
  "Transfer(address,address,uint256)": EventFragment;
160
160
  };
@@ -181,10 +181,11 @@ export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
181
181
  export interface BurnEventObject {
182
182
  to: string;
183
183
  amount: BigNumber;
184
- chainId: BigNumber;
184
+ sourceChainId: number;
185
+ targetChainId: number;
185
186
  }
186
187
  export type BurnEvent = TypedEvent<
187
- [string, BigNumber, BigNumber],
188
+ [string, BigNumber, number, number],
188
189
  BurnEventObject
189
190
  >;
190
191
 
@@ -193,11 +194,12 @@ export type BurnEventFilter = TypedEventFilter<BurnEvent>;
193
194
  export interface MintEventObject {
194
195
  to: string;
195
196
  amount: BigNumber;
196
- chainId: BigNumber;
197
- transactionHash: string;
197
+ sourceChainId: number;
198
+ targetChainId: number;
199
+ submitTransactionHash: string;
198
200
  }
199
201
  export type MintEvent = TypedEvent<
200
- [string, BigNumber, BigNumber, string],
202
+ [string, BigNumber, number, number, string],
201
203
  MintEventObject
202
204
  >;
203
205
 
@@ -486,28 +488,32 @@ export interface InteropBridgeToken extends BaseContract {
486
488
  value?: null
487
489
  ): ApprovalEventFilter;
488
490
 
489
- "Burn(address,uint256,uint256)"(
491
+ "Burn(address,uint256,uint32,uint32)"(
490
492
  to?: string | null,
491
493
  amount?: null,
492
- chainId?: BigNumberish | null
494
+ sourceChainId?: null,
495
+ targetChainId?: BigNumberish | null
493
496
  ): BurnEventFilter;
494
497
  Burn(
495
498
  to?: string | null,
496
499
  amount?: null,
497
- chainId?: BigNumberish | null
500
+ sourceChainId?: null,
501
+ targetChainId?: BigNumberish | null
498
502
  ): BurnEventFilter;
499
503
 
500
- "Mint(address,uint256,uint256,bytes32)"(
504
+ "Mint(address,uint256,uint32,uint32,bytes32)"(
501
505
  to?: string | null,
502
506
  amount?: null,
503
- chainId?: BigNumberish | null,
504
- transactionHash?: BytesLike | null
507
+ sourceChainId?: BigNumberish | null,
508
+ targetChainId?: null,
509
+ submitTransactionHash?: BytesLike | null
505
510
  ): MintEventFilter;
506
511
  Mint(
507
512
  to?: string | null,
508
513
  amount?: null,
509
- chainId?: BigNumberish | null,
510
- transactionHash?: BytesLike | null
514
+ sourceChainId?: BigNumberish | null,
515
+ targetChainId?: null,
516
+ submitTransactionHash?: BytesLike | null
511
517
  ): MintEventFilter;
512
518
 
513
519
  "OwnershipTransferred(address,address)"(
@@ -29,11 +29,11 @@ import type {
29
29
  export interface InteropXGatewayInterface extends utils.Interface {
30
30
  functions: {
31
31
  "_vnonce()": FunctionFragment;
32
- "deposit(address,uint256,uint256)": FunctionFragment;
33
- "depositFor(address,address,uint256,uint256)": FunctionFragment;
32
+ "deposit(address,uint256,uint32)": FunctionFragment;
33
+ "depositFor(address,address,uint256,uint32)": FunctionFragment;
34
34
  "owner()": FunctionFragment;
35
35
  "renounceOwnership()": FunctionFragment;
36
- "systemWithdraw(uint256,address,address,uint256,bytes32)": FunctionFragment;
36
+ "systemWithdraw(uint256,address,address,uint32,bytes32)": FunctionFragment;
37
37
  "transferOwnership(address)": FunctionFragment;
38
38
  };
39
39
 
@@ -89,8 +89,8 @@ export interface InteropXGatewayInterface extends utils.Interface {
89
89
  ): Result;
90
90
 
91
91
  events: {
92
- "LogGatewayDeposit(address,address,uint256,uint256,uint256,uint256)": EventFragment;
93
- "LogGatewayWithdraw(address,address,uint256,uint256,uint256,bytes32)": EventFragment;
92
+ "LogGatewayDeposit(address,address,uint256,uint256,uint32,uint32)": EventFragment;
93
+ "LogGatewayWithdraw(address,address,uint256,uint32,uint32,bytes32)": EventFragment;
94
94
  "OwnershipTransferred(address,address)": EventFragment;
95
95
  };
96
96
 
@@ -104,11 +104,11 @@ export interface LogGatewayDepositEventObject {
104
104
  token: string;
105
105
  amount: BigNumber;
106
106
  vnonce: BigNumber;
107
- sourceChainId: BigNumber;
108
- targetChainId: BigNumber;
107
+ sourceChainId: number;
108
+ targetChainId: number;
109
109
  }
110
110
  export type LogGatewayDepositEvent = TypedEvent<
111
- [string, string, BigNumber, BigNumber, BigNumber, BigNumber],
111
+ [string, string, BigNumber, BigNumber, number, number],
112
112
  LogGatewayDepositEventObject
113
113
  >;
114
114
 
@@ -119,12 +119,12 @@ export interface LogGatewayWithdrawEventObject {
119
119
  user: string;
120
120
  token: string;
121
121
  amount: BigNumber;
122
- sourceChainId: BigNumber;
123
- targetChainId: BigNumber;
122
+ sourceChainId: number;
123
+ targetChainId: number;
124
124
  transactionHash: string;
125
125
  }
126
126
  export type LogGatewayWithdrawEvent = TypedEvent<
127
- [string, string, BigNumber, BigNumber, BigNumber, string],
127
+ [string, string, BigNumber, number, number, string],
128
128
  LogGatewayWithdrawEventObject
129
129
  >;
130
130
 
@@ -283,7 +283,7 @@ export interface InteropXGateway extends BaseContract {
283
283
  };
284
284
 
285
285
  filters: {
286
- "LogGatewayDeposit(address,address,uint256,uint256,uint256,uint256)"(
286
+ "LogGatewayDeposit(address,address,uint256,uint256,uint32,uint32)"(
287
287
  user?: null,
288
288
  token?: string | null,
289
289
  amount?: null,
@@ -300,7 +300,7 @@ export interface InteropXGateway extends BaseContract {
300
300
  targetChainId?: BigNumberish | null
301
301
  ): LogGatewayDepositEventFilter;
302
302
 
303
- "LogGatewayWithdraw(address,address,uint256,uint256,uint256,bytes32)"(
303
+ "LogGatewayWithdraw(address,address,uint256,uint32,uint32,bytes32)"(
304
304
  user?: null,
305
305
  token?: string | null,
306
306
  amount?: null,