@instadapp/interop-x 0.0.0-dev.eb2b141 → 0.0.0-dev.f0a6281
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/package.json +4 -3
- package/dist/src/abi/interopBridgeToken.json +21 -9
- package/dist/src/abi/interopXGateway.json +11 -11
- package/dist/src/api/index.js +3 -3
- package/dist/src/config/index.js +11 -1
- package/dist/src/constants/addresses.js +1 -1
- package/dist/src/constants/itokens.js +1 -1
- package/dist/src/index.js +39 -6
- package/dist/src/net/peer/index.js +2 -1
- package/dist/src/net/pool/index.js +7 -2
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +28 -0
- package/dist/src/net/protocol/index.js +11 -0
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/src/tasks/BaseTask.js +11 -3
- package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +0 -1
- package/dist/src/tasks/InteropBridge/SyncWithdrawEvents.js +7 -6
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +13 -2
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +2 -3
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +53 -0
- package/dist/src/tasks/index.js +4 -0
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +23 -11
- package/dist/src/typechain/factories/InteropXGateway__factory.js +14 -14
- package/dist/src/utils/index.js +20 -10
- package/package.json +4 -3
- package/src/abi/interopBridgeToken.json +21 -9
- package/src/abi/interopXGateway.json +11 -11
- package/src/api/index.ts +2 -2
- package/src/config/index.ts +11 -1
- package/src/constants/addresses.ts +1 -1
- package/src/constants/itokens.ts +1 -1
- package/src/index.ts +53 -8
- package/src/net/peer/index.ts +2 -1
- package/src/net/pool/index.ts +7 -3
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +31 -0
- package/src/net/protocol/index.ts +12 -0
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +13 -3
- package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +0 -2
- package/src/tasks/InteropBridge/SyncWithdrawEvents.ts +7 -7
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +17 -6
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +2 -4
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +65 -0
- package/src/tasks/index.ts +5 -0
- package/src/typechain/InteropBridgeToken.ts +23 -17
- package/src/typechain/InteropXGateway.ts +13 -13
- package/src/typechain/factories/InteropBridgeToken__factory.ts +23 -11
- package/src/typechain/factories/InteropXGateway__factory.ts +14 -14
- package/src/utils/index.ts +21 -9
package/src/net/pool/index.ts
CHANGED
@@ -2,6 +2,8 @@ import { Event } from "@/types";
|
|
2
2
|
import config from "@/config";
|
3
3
|
import Logger from "@/logger";
|
4
4
|
import { getAddress } from "ethers/lib/utils";
|
5
|
+
import { shortenHash } from "@/utils";
|
6
|
+
import chalk from "chalk";
|
5
7
|
|
6
8
|
|
7
9
|
const logger = new Logger('PeerPool')
|
@@ -87,7 +89,7 @@ export class PeerPool {
|
|
87
89
|
|
88
90
|
if (newPeer) {
|
89
91
|
config.events.emit(Event.POOL_PEER_ADDED, peer)
|
90
|
-
logger.info(`Peer ${peer.id} with address ${peer.publicAddress} added to pool`)
|
92
|
+
logger.info(`Peer ${chalk.bold(shortenHash(peer.id, 16))} with address ${chalk.bold(shortenHash(peer.publicAddress))} added to pool`)
|
91
93
|
}
|
92
94
|
}
|
93
95
|
}
|
@@ -102,7 +104,7 @@ export class PeerPool {
|
|
102
104
|
if (this.pool.delete(peer.id)) {
|
103
105
|
peer.pooled = false
|
104
106
|
config.events.emit(Event.POOL_PEER_REMOVED, peer)
|
105
|
-
logger.info(`Peer ${peer.id} with address ${peer.publicAddress} removed from pool`)
|
107
|
+
logger.info(`Peer ${chalk.bold(shortenHash(peer.id, 16))} with address ${chalk.bold(shortenHash(peer.publicAddress))} removed from pool`)
|
106
108
|
}
|
107
109
|
}
|
108
110
|
}
|
@@ -123,7 +125,6 @@ export class PeerPool {
|
|
123
125
|
return this.activePeers.map((p) => p.id)
|
124
126
|
}
|
125
127
|
|
126
|
-
|
127
128
|
getPeer(id: string){
|
128
129
|
return this.pool.get(id);
|
129
130
|
}
|
@@ -138,6 +139,9 @@ export class PeerPool {
|
|
138
139
|
return getAddress(peer.publicAddress) === getAddress(config.leadNodeAddress)
|
139
140
|
}
|
140
141
|
|
142
|
+
getLeadPeer() {
|
143
|
+
return this.peers.find((p) => this.isLeadNode(p.id))
|
144
|
+
}
|
141
145
|
|
142
146
|
cleanup() {
|
143
147
|
// let compDate = Date.now() - this.PEERS_CLEANUP_TIME_LIMIT * 60
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { BaseDialProtocol } from "./BaseDialProtocol";
|
2
|
+
import { Transaction } from "@/db";
|
3
|
+
|
4
|
+
export class TransactionStatusDialProtocol extends BaseDialProtocol<string, Pick<Transaction, 'transactionHash' | 'sourceStatus' | 'sourceTransactionHash' | 'sourceErrors' | 'targetStatus' | 'targetTransactionHash' | 'targetErrors' | 'status'> | null> {
|
5
|
+
protected timeout = 30000;
|
6
|
+
|
7
|
+
constructor(libp2p) {
|
8
|
+
super(libp2p, '/interop-x/transaction-status')
|
9
|
+
}
|
10
|
+
|
11
|
+
async response(transactionHash: string){
|
12
|
+
const transaction = await Transaction.findOne({ where: { transactionHash } })
|
13
|
+
|
14
|
+
if(! transaction){
|
15
|
+
return null
|
16
|
+
}
|
17
|
+
return {
|
18
|
+
transactionHash: transaction.transactionHash,
|
19
|
+
|
20
|
+
sourceStatus: transaction.sourceStatus,
|
21
|
+
sourceTransactionHash: transaction.sourceTransactionHash,
|
22
|
+
sourceErrors: transaction.sourceErrors,
|
23
|
+
|
24
|
+
targetStatus: transaction.targetStatus,
|
25
|
+
targetTransactionHash: transaction.targetTransactionHash,
|
26
|
+
targetErrors: transaction.targetErrors,
|
27
|
+
|
28
|
+
status: transaction.status,
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -6,6 +6,7 @@ import { IPeerInfo, peerPool } from "..";
|
|
6
6
|
import config from "@/config";
|
7
7
|
import { Event } from "@/types";
|
8
8
|
import { Transaction } from "@/db";
|
9
|
+
import { TransactionStatusDialProtocol } from "./dial/TransactionStatusDialProtocol";
|
9
10
|
|
10
11
|
export interface ProtocolOptions {
|
11
12
|
/* Handshake timeout in ms (default: 8000) */
|
@@ -90,6 +91,7 @@ class Protocol extends EventEmitter {
|
|
90
91
|
},
|
91
92
|
];
|
92
93
|
private signature: SignatureDialProtocol;
|
94
|
+
private transactionStatus: TransactionStatusDialProtocol;
|
93
95
|
|
94
96
|
|
95
97
|
start({ libp2p, topic = null, }) {
|
@@ -109,6 +111,7 @@ class Protocol extends EventEmitter {
|
|
109
111
|
})
|
110
112
|
|
111
113
|
this.signature = new SignatureDialProtocol(this.libp2p);
|
114
|
+
this.transactionStatus = new TransactionStatusDialProtocol(this.libp2p);
|
112
115
|
}
|
113
116
|
|
114
117
|
|
@@ -177,6 +180,15 @@ class Protocol extends EventEmitter {
|
|
177
180
|
return []
|
178
181
|
}
|
179
182
|
}
|
183
|
+
|
184
|
+
async requestTransactionStatus(transactionHash: string, peerId: string) {
|
185
|
+
try {
|
186
|
+
return await this.transactionStatus.send(transactionHash, peerId);
|
187
|
+
} catch (error) {
|
188
|
+
console.log(error);
|
189
|
+
return null
|
190
|
+
}
|
191
|
+
}
|
180
192
|
}
|
181
193
|
|
182
194
|
export const protocol = new Protocol();
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import { BaseTask } from "./BaseTask";
|
2
|
+
import Logger from '@/logger';
|
3
|
+
import spawnAsync from 'await-spawn';
|
4
|
+
import { spawn } from 'child_process'
|
5
|
+
import config from "@/config";
|
6
|
+
import wait from "waait";
|
7
|
+
import packageJson from "../../package.json";
|
8
|
+
|
9
|
+
const currentVersion = packageJson.version;
|
10
|
+
const tag = config.staging ? 'dev' : 'latest';
|
11
|
+
|
12
|
+
class AutoUpdateTask extends BaseTask {
|
13
|
+
pollIntervalMs: number = 60 * 10 * 1000
|
14
|
+
|
15
|
+
constructor() {
|
16
|
+
super({
|
17
|
+
logger: new Logger("AutoUpdateTask"),
|
18
|
+
})
|
19
|
+
}
|
20
|
+
|
21
|
+
prePollHandler(): boolean {
|
22
|
+
return config.autoUpdate && !config.isLeadNode();
|
23
|
+
}
|
24
|
+
|
25
|
+
async getInstalledVersion() {
|
26
|
+
try {
|
27
|
+
const stdout = await spawnAsync('npm', ['-g', 'ls', '--depth=0', '--json'])
|
28
|
+
return JSON.parse(stdout.toString()).dependencies[packageJson.name].version
|
29
|
+
} catch (error) {
|
30
|
+
this.logger.error(error)
|
31
|
+
return currentVersion
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
async getLatestVersion() {
|
36
|
+
try {
|
37
|
+
const stdout = await spawnAsync('npm', ['view', `${packageJson.name}@${tag}`, 'version'])
|
38
|
+
return stdout.toString().trim()
|
39
|
+
} catch (error) {
|
40
|
+
this.logger.error(error)
|
41
|
+
return currentVersion
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
async pollHandler() {
|
46
|
+
const version = await this.getLatestVersion()
|
47
|
+
|
48
|
+
if (version === currentVersion) {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
this.logger.warn(`New version ${version} available.`)
|
53
|
+
|
54
|
+
this.logger.info('Updating...')
|
55
|
+
|
56
|
+
await spawnAsync('npm', ['-g', 'install', `@instadapp/interop-x@${tag}`, '-f']);
|
57
|
+
|
58
|
+
await wait(5000)
|
59
|
+
|
60
|
+
if (version !== await this.getInstalledVersion()) {
|
61
|
+
this.logger.warn(`failed to install ${version}, retrying in 5 minutes`)
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
this.logger.warn(`Installed version ${version}`)
|
66
|
+
this.logger.warn(`Restarting...`)
|
67
|
+
|
68
|
+
|
69
|
+
// TODO: its restarting in the bg, but it should be in the fg
|
70
|
+
const subprocess = spawn(process.argv[0], process.argv.slice(1), {
|
71
|
+
cwd: process.cwd(),
|
72
|
+
stdio: "inherit",
|
73
|
+
// shell: process.env.SHELL,
|
74
|
+
});
|
75
|
+
|
76
|
+
subprocess.unref();
|
77
|
+
|
78
|
+
process.exit()
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
export default AutoUpdateTask;
|
package/src/tasks/BaseTask.ts
CHANGED
@@ -19,6 +19,7 @@ export class BaseTask extends EventEmitter implements IBaseTask {
|
|
19
19
|
started: boolean = false
|
20
20
|
pollIntervalMs: number = 10 * 1000
|
21
21
|
leadNodeOnly: boolean = false
|
22
|
+
exceptLeadNode: boolean = false
|
22
23
|
|
23
24
|
public constructor({ logger }: { logger?: Logger }) {
|
24
25
|
super()
|
@@ -45,11 +46,20 @@ export class BaseTask extends EventEmitter implements IBaseTask {
|
|
45
46
|
}
|
46
47
|
|
47
48
|
prePollHandler(): boolean {
|
48
|
-
if
|
49
|
-
|
49
|
+
if(config.isMaintenanceMode()){
|
50
|
+
this.logger.warn('Maintenance mode is enabled. Skipping task.')
|
51
|
+
return false
|
50
52
|
}
|
51
53
|
|
52
|
-
|
54
|
+
if (this.exceptLeadNode) {
|
55
|
+
return !config.isLeadNode();
|
56
|
+
}
|
57
|
+
|
58
|
+
if (this.leadNodeOnly) {
|
59
|
+
return config.isLeadNode()
|
60
|
+
}
|
61
|
+
|
62
|
+
return true
|
53
63
|
}
|
54
64
|
|
55
65
|
async pollHandler() {
|
@@ -220,8 +220,6 @@ class ProcessWithdrawEvents extends BaseTask {
|
|
220
220
|
}
|
221
221
|
|
222
222
|
async start(): Promise<void> {
|
223
|
-
this.logger.info(`Starting execution watcher on interop chain`);
|
224
|
-
|
225
223
|
this.provider = new ethers.providers.JsonRpcProvider(
|
226
224
|
getRpcProviderUrl(this.chainId)
|
227
225
|
);
|
@@ -41,13 +41,13 @@ class SyncWithdrawEvents extends BaseTask {
|
|
41
41
|
continue;
|
42
42
|
}
|
43
43
|
|
44
|
-
const { to, amount,
|
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:
|
50
|
-
targetChainId:
|
49
|
+
sourceChainId: sourceChainId,
|
50
|
+
targetChainId: targetChainId,
|
51
51
|
}
|
52
52
|
|
53
53
|
if (await Transaction.findOne({ where: uniqueIdentifier })) {
|
@@ -77,14 +77,16 @@ class SyncWithdrawEvents extends BaseTask {
|
|
77
77
|
to,
|
78
78
|
amount: amount.toString(),
|
79
79
|
itoken: this.itokenAddress,
|
80
|
-
|
80
|
+
sourceChainId: sourceChainId,
|
81
|
+
targetChainId: targetChainId,
|
81
82
|
},
|
82
83
|
|
83
84
|
sourceEvent: {
|
84
85
|
to,
|
85
86
|
amount: amount.toString(),
|
86
87
|
itoken: this.itokenAddress,
|
87
|
-
|
88
|
+
sourceChainId: sourceChainId,
|
89
|
+
targetChainId: targetChainId,
|
88
90
|
},
|
89
91
|
status: "pending",
|
90
92
|
})
|
@@ -102,8 +104,6 @@ class SyncWithdrawEvents extends BaseTask {
|
|
102
104
|
}
|
103
105
|
|
104
106
|
async start(): Promise<void> {
|
105
|
-
this.logger.info(`Starting execution watcher on interop chain`);
|
106
|
-
|
107
107
|
this.provider = new ethers.providers.JsonRpcProvider(
|
108
108
|
getRpcProviderUrl(this.chainId)
|
109
109
|
);
|
@@ -15,7 +15,7 @@ import { LogDescription } from "ethers/lib/utils";
|
|
15
15
|
|
16
16
|
const generateGnosisTransaction = async (transactionData: any, safeContract: GnosisSafe) => {
|
17
17
|
console.log(transactionData);
|
18
|
-
|
18
|
+
|
19
19
|
let isExecuted = await safeContract.dataHashes(
|
20
20
|
await safeContract.getTransactionHash(
|
21
21
|
transactionData.to,
|
@@ -97,7 +97,7 @@ class ProcessDepositEvents extends BaseTask {
|
|
97
97
|
}
|
98
98
|
|
99
99
|
console.log(`Processing transaction ${transaction.transactionHash}`);
|
100
|
-
|
100
|
+
|
101
101
|
transaction.targetStatus = 'pending';
|
102
102
|
await transaction.save();
|
103
103
|
|
@@ -121,9 +121,22 @@ class ProcessDepositEvents extends BaseTask {
|
|
121
121
|
const ownersThreshold = await safeContract.getThreshold();
|
122
122
|
await wait(10000);
|
123
123
|
|
124
|
+
let data;
|
125
|
+
|
126
|
+
try {
|
127
|
+
data = await buildDataForTransaction(transaction);
|
128
|
+
} catch (error) {
|
129
|
+
console.log(error);
|
130
|
+
transaction.targetStatus = 'failed';
|
131
|
+
transaction.targetErrors = [error.message];
|
132
|
+
await transaction.save();
|
133
|
+
protocol.sendTransaction(transaction)
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
|
124
137
|
let gnosisTx = await generateGnosisTransaction({
|
125
138
|
baseGas: "0",
|
126
|
-
data
|
139
|
+
data,
|
127
140
|
gasPrice: "0",
|
128
141
|
gasToken: "0x0000000000000000000000000000000000000000",
|
129
142
|
nonce: '0',
|
@@ -142,7 +155,7 @@ class ProcessDepositEvents extends BaseTask {
|
|
142
155
|
console.log(`Collecting signatures for execution ${transaction.transactionHash}`)
|
143
156
|
|
144
157
|
console.log(ownerPeerIds);
|
145
|
-
|
158
|
+
|
146
159
|
const signatures = await protocol.requestSignatures({
|
147
160
|
type: 'source',
|
148
161
|
transactionHash: transaction.transactionHash,
|
@@ -224,8 +237,6 @@ class ProcessDepositEvents extends BaseTask {
|
|
224
237
|
}
|
225
238
|
|
226
239
|
async start(): Promise<void> {
|
227
|
-
this.logger.info(`Starting execution watcher on interop chain`);
|
228
|
-
|
229
240
|
this.contractAddress = addresses[this.chainId].interopXGateway;
|
230
241
|
|
231
242
|
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
|
49
|
-
targetChainId: targetChainId
|
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,65 @@
|
|
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
|
+
|
53
|
+
transaction.targetStatus = transactionStatus.targetStatus
|
54
|
+
transaction.targetTransactionHash = transactionStatus.targetTransactionHash
|
55
|
+
transaction.targetErrors = transactionStatus.targetErrors
|
56
|
+
|
57
|
+
transaction.status = transactionStatus.status
|
58
|
+
|
59
|
+
await transaction.save()
|
60
|
+
|
61
|
+
this.logger.info(`Updated transaction status for ${transaction.transactionHash}`)
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
export default SyncTransactionStatusTask;
|
package/src/tasks/index.ts
CHANGED
@@ -4,10 +4,15 @@ import InteropXGatewaySyncDepositEvents from "./InteropXGateway/SyncDepositEvent
|
|
4
4
|
|
5
5
|
import InteropBridgeSyncWithdrawEvents from "./InteropBridge/SyncWithdrawEvents";
|
6
6
|
import InteropBridgeProcessWithdrawEvents from "./InteropBridge/ProcessWithdrawEvents";
|
7
|
+
import AutoUpdateTask from "./AutoUpdateTask";
|
8
|
+
import SyncTransactionStatusTask from "./Transactions/SyncTransactionStatusTask";
|
7
9
|
|
8
10
|
export class Tasks {
|
9
11
|
|
10
12
|
tasks: BaseTask[] = [
|
13
|
+
new SyncTransactionStatusTask(),
|
14
|
+
new AutoUpdateTask(),
|
15
|
+
|
11
16
|
new InteropXGatewaySyncDepositEvents({
|
12
17
|
chainId: 43114
|
13
18
|
}),
|
@@ -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,
|
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,
|
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,
|
157
|
-
"Mint(address,uint256,
|
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
|
-
|
184
|
+
sourceChainId: number;
|
185
|
+
targetChainId: number;
|
185
186
|
}
|
186
187
|
export type BurnEvent = TypedEvent<
|
187
|
-
[string, 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
|
-
|
197
|
-
|
197
|
+
sourceChainId: number;
|
198
|
+
targetChainId: number;
|
199
|
+
submitTransactionHash: string;
|
198
200
|
}
|
199
201
|
export type MintEvent = TypedEvent<
|
200
|
-
[string, BigNumber,
|
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,
|
491
|
+
"Burn(address,uint256,uint32,uint32)"(
|
490
492
|
to?: string | null,
|
491
493
|
amount?: null,
|
492
|
-
|
494
|
+
sourceChainId?: null,
|
495
|
+
targetChainId?: BigNumberish | null
|
493
496
|
): BurnEventFilter;
|
494
497
|
Burn(
|
495
498
|
to?: string | null,
|
496
499
|
amount?: null,
|
497
|
-
|
500
|
+
sourceChainId?: null,
|
501
|
+
targetChainId?: BigNumberish | null
|
498
502
|
): BurnEventFilter;
|
499
503
|
|
500
|
-
"Mint(address,uint256,
|
504
|
+
"Mint(address,uint256,uint32,uint32,bytes32)"(
|
501
505
|
to?: string | null,
|
502
506
|
amount?: null,
|
503
|
-
|
504
|
-
|
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
|
-
|
510
|
-
|
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,
|
33
|
-
"depositFor(address,address,uint256,
|
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,
|
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,
|
93
|
-
"LogGatewayWithdraw(address,address,uint256,
|
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:
|
108
|
-
targetChainId:
|
107
|
+
sourceChainId: number;
|
108
|
+
targetChainId: number;
|
109
109
|
}
|
110
110
|
export type LogGatewayDepositEvent = TypedEvent<
|
111
|
-
[string, string, 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:
|
123
|
-
targetChainId:
|
122
|
+
sourceChainId: number;
|
123
|
+
targetChainId: number;
|
124
124
|
transactionHash: string;
|
125
125
|
}
|
126
126
|
export type LogGatewayWithdrawEvent = TypedEvent<
|
127
|
-
[string, string, BigNumber,
|
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,
|
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,
|
303
|
+
"LogGatewayWithdraw(address,address,uint256,uint32,uint32,bytes32)"(
|
304
304
|
user?: null,
|
305
305
|
token?: string | null,
|
306
306
|
amount?: null,
|