@instadapp/interop-x 0.0.0-dev.868731f → 0.0.0-dev.8965b57
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/package.json +8 -7
- package/dist/src/abi/index.js +2 -4
- package/dist/src/abi/interopXContract.json +391 -0
- package/dist/src/alias.js +10 -0
- package/dist/src/api/index.js +6 -3
- package/dist/src/config/index.js +11 -1
- package/dist/src/constants/addresses.js +3 -3
- package/dist/src/constants/index.js +0 -1
- package/dist/src/constants/tokens.js +31 -1
- package/dist/src/db/models/transaction.js +26 -10
- package/dist/src/gnosis/actions/index.js +9 -0
- package/dist/src/gnosis/actions/withdraw/index.js +55 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +75 -24
- package/dist/src/net/peer/index.js +2 -1
- package/dist/src/net/pool/index.js +25 -9
- package/dist/src/net/protocol/dial/SignatureDialProtocol.js +8 -2
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
- package/dist/src/net/protocol/index.js +51 -1
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/src/tasks/BaseTask.js +11 -3
- package/dist/src/tasks/InteropXContract/ProcessBridgeRequestEvents.js +152 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +77 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +89 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
- package/dist/src/tasks/index.js +15 -8
- package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
- package/dist/src/typechain/factories/InteropXContract__factory.js +526 -0
- package/dist/src/typechain/factories/index.js +3 -5
- package/dist/src/typechain/index.js +3 -5
- package/dist/src/utils/index.js +32 -42
- package/package.json +8 -7
- package/src/abi/index.ts +2 -4
- package/src/abi/interopXContract.json +391 -0
- package/src/alias.ts +6 -0
- package/src/api/index.ts +5 -2
- package/src/config/index.ts +11 -1
- package/src/constants/addresses.ts +3 -3
- package/src/constants/index.ts +0 -1
- package/src/constants/tokens.ts +32 -2
- package/src/db/models/transaction.ts +64 -25
- package/src/gnosis/actions/index.ts +5 -0
- package/src/gnosis/actions/withdraw/index.ts +76 -0
- package/src/gnosis/index.ts +19 -0
- package/src/index.ts +96 -26
- package/src/net/peer/index.ts +2 -1
- package/src/net/pool/index.ts +33 -13
- package/src/net/protocol/dial/SignatureDialProtocol.ts +10 -4
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
- package/src/net/protocol/index.ts +67 -1
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +13 -3
- package/src/tasks/InteropXContract/ProcessBridgeRequestEvents.ts +216 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +114 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +120 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
- package/src/tasks/index.ts +23 -9
- package/src/typechain/InteropXContract.ts +524 -0
- package/src/typechain/factories/InteropXContract__factory.ts +533 -0
- package/src/typechain/factories/index.ts +1 -2
- package/src/typechain/index.ts +2 -4
- package/src/utils/index.ts +67 -65
- package/tsconfig.json +7 -2
- package/dist/src/abi/interopBridgeToken.json +0 -286
- package/dist/src/abi/interopXGateway.json +0 -184
- package/dist/src/constants/itokens.js +0 -13
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -152
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -75
- package/dist/src/typechain/InteropXGateway.js +0 -2
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -459
- package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
- package/src/abi/interopBridgeToken.json +0 -286
- package/src/abi/interopXGateway.json +0 -184
- package/src/constants/itokens.ts +0 -10
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -247
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -126
- package/src/typechain/InteropBridgeToken.ts +0 -686
- package/src/typechain/InteropXGateway.ts +0 -407
- package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -466
- package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -1,152 +0,0 @@
|
|
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
|
-
const sequelize_1 = require("sequelize");
|
15
|
-
const waait_1 = __importDefault(require("waait"));
|
16
|
-
const net_1 = require("@/net");
|
17
|
-
const generateGnosisTransaction = async (transactionData, safeContract) => {
|
18
|
-
console.log(transactionData);
|
19
|
-
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));
|
20
|
-
while (isExecuted == 1) {
|
21
|
-
transactionData.safeTxGas = ethers_1.BigNumber.from(String(transactionData.safeTxGas)).add(1).toString();
|
22
|
-
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));
|
23
|
-
}
|
24
|
-
return transactionData;
|
25
|
-
};
|
26
|
-
class ProcessDepositEvents extends BaseTask_1.BaseTask {
|
27
|
-
constructor({ chainId }) {
|
28
|
-
super({
|
29
|
-
logger: new logger_1.default("InteropXGateway::ProcessDepositEvents"),
|
30
|
-
});
|
31
|
-
this.leadNodeOnly = true;
|
32
|
-
this.chainId = chainId;
|
33
|
-
}
|
34
|
-
async pollHandler() {
|
35
|
-
var _a;
|
36
|
-
const blockNumber = await this.provider.getBlockNumber();
|
37
|
-
const transaction = await db_1.Transaction.findOne({
|
38
|
-
where: {
|
39
|
-
status: 'pending',
|
40
|
-
sourceStatus: 'success',
|
41
|
-
targetStatus: 'uninitialised',
|
42
|
-
action: 'deposit',
|
43
|
-
sourceCreatedAt: {
|
44
|
-
[sequelize_1.Op.gte]: new Date(Date.now() - 12 * 60 * 60 * 1000),
|
45
|
-
},
|
46
|
-
sourceBlockNumber: {
|
47
|
-
[sequelize_1.Op.lt]: blockNumber - 12,
|
48
|
-
},
|
49
|
-
sourceChainId: this.chainId,
|
50
|
-
}
|
51
|
-
});
|
52
|
-
if (!transaction) {
|
53
|
-
return;
|
54
|
-
}
|
55
|
-
transaction.targetStatus = 'pending';
|
56
|
-
await transaction.save();
|
57
|
-
// refresh event data?
|
58
|
-
const targetChainProvider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(transaction.targetChainId));
|
59
|
-
const targetWallet = new ethers_1.ethers.Wallet(config_1.default.privateKey, targetChainProvider);
|
60
|
-
const safeAddress = constants_1.addresses[transaction.targetChainId].gnosisSafe;
|
61
|
-
const safeContract = (0, utils_1.getContract)(safeAddress, abi_1.default.gnosisSafe, targetWallet);
|
62
|
-
const ownersThreshold = await safeContract.getThreshold();
|
63
|
-
await (0, waait_1.default)(10000);
|
64
|
-
let gnosisTx = await generateGnosisTransaction({
|
65
|
-
baseGas: "0",
|
66
|
-
data: await (0, utils_1.buildDataForTransaction)(transaction),
|
67
|
-
gasPrice: "0",
|
68
|
-
gasToken: "0x0000000000000000000000000000000000000000",
|
69
|
-
nonce: '0',
|
70
|
-
operation: "1",
|
71
|
-
refundReceiver: "0x0000000000000000000000000000000000000000",
|
72
|
-
safeAddress: safeAddress,
|
73
|
-
safeTxGas: "79668",
|
74
|
-
to: constants_1.addresses[transaction.targetChainId].multisend,
|
75
|
-
value: "0",
|
76
|
-
}, safeContract);
|
77
|
-
const owners = await safeContract.getOwners().then(owners => owners.map(owner => owner.toLowerCase()));
|
78
|
-
const ownerPeerIds = net_1.peerPool.activePeers.filter(peer => owners.includes(peer.publicAddress.toLowerCase())).map(peer => peer.id);
|
79
|
-
console.log(`Collecting signatures for execution ${transaction.transactionHash}`);
|
80
|
-
console.log(ownerPeerIds);
|
81
|
-
const signatures = await net_1.protocol.requestSignatures({
|
82
|
-
type: 'source',
|
83
|
-
transactionHash: transaction.transactionHash,
|
84
|
-
safeTxGas: gnosisTx.safeTxGas,
|
85
|
-
safeNonce: gnosisTx.nonce
|
86
|
-
}, ownerPeerIds);
|
87
|
-
const validSignatures = signatures.filter(s => !!s.data && s.data !== '0x');
|
88
|
-
console.log({ signatures, validSignatures, ownersThreshold: ownersThreshold.toString() });
|
89
|
-
if (validSignatures.length === 0 || ownersThreshold.gt(validSignatures.length)) {
|
90
|
-
await transaction.save();
|
91
|
-
transaction.targetDelayUntil = new Date(Date.now() + 30 * 1000);
|
92
|
-
transaction.targetStatus = 'pending';
|
93
|
-
await transaction.save();
|
94
|
-
const errorMessage = (_a = signatures.find(s => !!s.error)) === null || _a === void 0 ? void 0 : _a.error;
|
95
|
-
throw new Error(`Not enough signatures` + (errorMessage ? `: ${errorMessage}` : ''));
|
96
|
-
}
|
97
|
-
const execTransactionParams = [
|
98
|
-
gnosisTx.to,
|
99
|
-
gnosisTx.value,
|
100
|
-
gnosisTx.data,
|
101
|
-
gnosisTx.operation,
|
102
|
-
gnosisTx.safeTxGas,
|
103
|
-
gnosisTx.baseGas,
|
104
|
-
gnosisTx.gasPrice,
|
105
|
-
gnosisTx.gasToken,
|
106
|
-
gnosisTx.refundReceiver,
|
107
|
-
(0, utils_1.buildSignatureBytes)(validSignatures),
|
108
|
-
];
|
109
|
-
console.log(`Executing transaction for execution ${transaction.transactionHash}`);
|
110
|
-
console.log({
|
111
|
-
execTransactionParams
|
112
|
-
});
|
113
|
-
const { data: txData } = await safeContract.populateTransaction.execTransaction(gnosisTx.to, gnosisTx.value, gnosisTx.data, gnosisTx.operation, gnosisTx.safeTxGas, gnosisTx.baseGas, gnosisTx.gasPrice, gnosisTx.gasToken, gnosisTx.refundReceiver, (0, utils_1.buildSignatureBytes)(validSignatures));
|
114
|
-
console.log({
|
115
|
-
from: targetWallet.address,
|
116
|
-
gasPrice: ethers_1.BigNumber.from(120 * 10 ** 9).toString(),
|
117
|
-
gasLimit: ethers_1.BigNumber.from(6000000).toString(),
|
118
|
-
to: safeAddress,
|
119
|
-
data: txData,
|
120
|
-
});
|
121
|
-
return;
|
122
|
-
const txSent = await targetWallet.sendTransaction({
|
123
|
-
from: targetWallet.address,
|
124
|
-
gasPrice: ethers_1.BigNumber.from(120 * 10 ** 9),
|
125
|
-
gasLimit: ethers_1.BigNumber.from(6000000),
|
126
|
-
to: safeAddress,
|
127
|
-
data: txData,
|
128
|
-
});
|
129
|
-
const receipt = await txSent.wait();
|
130
|
-
const parsedLogs = [];
|
131
|
-
receipt.logs.forEach((log) => {
|
132
|
-
try {
|
133
|
-
parsedLogs.push(safeContract.interface.parseLog(log));
|
134
|
-
}
|
135
|
-
catch (e) { }
|
136
|
-
});
|
137
|
-
if (parsedLogs.find(e => e.name === 'ExecutionSuccess')) {
|
138
|
-
console.log('ExecutionSuccess');
|
139
|
-
}
|
140
|
-
else {
|
141
|
-
console.log('ExecutionFailure');
|
142
|
-
}
|
143
|
-
}
|
144
|
-
async start() {
|
145
|
-
this.logger.info(`Starting execution watcher on interop chain`);
|
146
|
-
this.contractAddress = constants_1.addresses[this.chainId].interopXGateway;
|
147
|
-
this.provider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(this.chainId));
|
148
|
-
this.contract = (0, utils_1.getContract)(this.contractAddress, abi_1.default.interopXGateway, new ethers_1.ethers.Wallet(config_1.default.privateKey, this.provider));
|
149
|
-
await super.start();
|
150
|
-
}
|
151
|
-
}
|
152
|
-
exports.default = ProcessDepositEvents;
|
@@ -1,75 +0,0 @@
|
|
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.toNumber(),
|
35
|
-
targetChainId: targetChainId.toNumber(),
|
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(`Execution 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.logger.info(`Starting execution watcher on interop chain`);
|
69
|
-
this.contractAddress = constants_1.addresses[this.chainId].interopXGateway;
|
70
|
-
this.provider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(this.chainId));
|
71
|
-
this.contract = (0, utils_1.getContract)(this.contractAddress, abi_1.default.interopXGateway, new ethers_1.ethers.Wallet(config_1.default.privateKey, this.provider));
|
72
|
-
await super.start();
|
73
|
-
}
|
74
|
-
}
|
75
|
-
exports.default = SyncDepositEvents;
|
@@ -1,459 +0,0 @@
|
|
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.InteropBridgeToken__factory = void 0;
|
7
|
-
const ethers_1 = require("ethers");
|
8
|
-
const _abi = [
|
9
|
-
{
|
10
|
-
inputs: [
|
11
|
-
{
|
12
|
-
internalType: "address",
|
13
|
-
name: "__owner",
|
14
|
-
type: "address",
|
15
|
-
},
|
16
|
-
],
|
17
|
-
stateMutability: "nonpayable",
|
18
|
-
type: "constructor",
|
19
|
-
},
|
20
|
-
{
|
21
|
-
anonymous: false,
|
22
|
-
inputs: [
|
23
|
-
{
|
24
|
-
indexed: true,
|
25
|
-
internalType: "address",
|
26
|
-
name: "owner",
|
27
|
-
type: "address",
|
28
|
-
},
|
29
|
-
{
|
30
|
-
indexed: true,
|
31
|
-
internalType: "address",
|
32
|
-
name: "spender",
|
33
|
-
type: "address",
|
34
|
-
},
|
35
|
-
{
|
36
|
-
indexed: false,
|
37
|
-
internalType: "uint256",
|
38
|
-
name: "value",
|
39
|
-
type: "uint256",
|
40
|
-
},
|
41
|
-
],
|
42
|
-
name: "Approval",
|
43
|
-
type: "event",
|
44
|
-
},
|
45
|
-
{
|
46
|
-
anonymous: false,
|
47
|
-
inputs: [
|
48
|
-
{
|
49
|
-
indexed: true,
|
50
|
-
internalType: "address",
|
51
|
-
name: "to",
|
52
|
-
type: "address",
|
53
|
-
},
|
54
|
-
{
|
55
|
-
indexed: false,
|
56
|
-
internalType: "uint256",
|
57
|
-
name: "amount",
|
58
|
-
type: "uint256",
|
59
|
-
},
|
60
|
-
{
|
61
|
-
indexed: true,
|
62
|
-
internalType: "uint256",
|
63
|
-
name: "chainId",
|
64
|
-
type: "uint256",
|
65
|
-
},
|
66
|
-
],
|
67
|
-
name: "Burn",
|
68
|
-
type: "event",
|
69
|
-
},
|
70
|
-
{
|
71
|
-
anonymous: false,
|
72
|
-
inputs: [
|
73
|
-
{
|
74
|
-
indexed: true,
|
75
|
-
internalType: "address",
|
76
|
-
name: "to",
|
77
|
-
type: "address",
|
78
|
-
},
|
79
|
-
{
|
80
|
-
indexed: false,
|
81
|
-
internalType: "uint256",
|
82
|
-
name: "amount",
|
83
|
-
type: "uint256",
|
84
|
-
},
|
85
|
-
{
|
86
|
-
indexed: true,
|
87
|
-
internalType: "uint256",
|
88
|
-
name: "chainId",
|
89
|
-
type: "uint256",
|
90
|
-
},
|
91
|
-
{
|
92
|
-
indexed: true,
|
93
|
-
internalType: "bytes32",
|
94
|
-
name: "transactionHash",
|
95
|
-
type: "bytes32",
|
96
|
-
},
|
97
|
-
],
|
98
|
-
name: "Mint",
|
99
|
-
type: "event",
|
100
|
-
},
|
101
|
-
{
|
102
|
-
anonymous: false,
|
103
|
-
inputs: [
|
104
|
-
{
|
105
|
-
indexed: true,
|
106
|
-
internalType: "address",
|
107
|
-
name: "previousOwner",
|
108
|
-
type: "address",
|
109
|
-
},
|
110
|
-
{
|
111
|
-
indexed: true,
|
112
|
-
internalType: "address",
|
113
|
-
name: "newOwner",
|
114
|
-
type: "address",
|
115
|
-
},
|
116
|
-
],
|
117
|
-
name: "OwnershipTransferred",
|
118
|
-
type: "event",
|
119
|
-
},
|
120
|
-
{
|
121
|
-
anonymous: false,
|
122
|
-
inputs: [
|
123
|
-
{
|
124
|
-
indexed: true,
|
125
|
-
internalType: "address",
|
126
|
-
name: "from",
|
127
|
-
type: "address",
|
128
|
-
},
|
129
|
-
{
|
130
|
-
indexed: true,
|
131
|
-
internalType: "address",
|
132
|
-
name: "to",
|
133
|
-
type: "address",
|
134
|
-
},
|
135
|
-
{
|
136
|
-
indexed: false,
|
137
|
-
internalType: "uint256",
|
138
|
-
name: "value",
|
139
|
-
type: "uint256",
|
140
|
-
},
|
141
|
-
],
|
142
|
-
name: "Transfer",
|
143
|
-
type: "event",
|
144
|
-
},
|
145
|
-
{
|
146
|
-
inputs: [
|
147
|
-
{
|
148
|
-
internalType: "address",
|
149
|
-
name: "owner",
|
150
|
-
type: "address",
|
151
|
-
},
|
152
|
-
{
|
153
|
-
internalType: "address",
|
154
|
-
name: "spender",
|
155
|
-
type: "address",
|
156
|
-
},
|
157
|
-
],
|
158
|
-
name: "allowance",
|
159
|
-
outputs: [
|
160
|
-
{
|
161
|
-
internalType: "uint256",
|
162
|
-
name: "",
|
163
|
-
type: "uint256",
|
164
|
-
},
|
165
|
-
],
|
166
|
-
stateMutability: "view",
|
167
|
-
type: "function",
|
168
|
-
},
|
169
|
-
{
|
170
|
-
inputs: [
|
171
|
-
{
|
172
|
-
internalType: "address",
|
173
|
-
name: "spender",
|
174
|
-
type: "address",
|
175
|
-
},
|
176
|
-
{
|
177
|
-
internalType: "uint256",
|
178
|
-
name: "amount",
|
179
|
-
type: "uint256",
|
180
|
-
},
|
181
|
-
],
|
182
|
-
name: "approve",
|
183
|
-
outputs: [
|
184
|
-
{
|
185
|
-
internalType: "bool",
|
186
|
-
name: "",
|
187
|
-
type: "bool",
|
188
|
-
},
|
189
|
-
],
|
190
|
-
stateMutability: "nonpayable",
|
191
|
-
type: "function",
|
192
|
-
},
|
193
|
-
{
|
194
|
-
inputs: [
|
195
|
-
{
|
196
|
-
internalType: "address",
|
197
|
-
name: "account",
|
198
|
-
type: "address",
|
199
|
-
},
|
200
|
-
],
|
201
|
-
name: "balanceOf",
|
202
|
-
outputs: [
|
203
|
-
{
|
204
|
-
internalType: "uint256",
|
205
|
-
name: "",
|
206
|
-
type: "uint256",
|
207
|
-
},
|
208
|
-
],
|
209
|
-
stateMutability: "view",
|
210
|
-
type: "function",
|
211
|
-
},
|
212
|
-
{
|
213
|
-
inputs: [
|
214
|
-
{
|
215
|
-
internalType: "address",
|
216
|
-
name: "to",
|
217
|
-
type: "address",
|
218
|
-
},
|
219
|
-
{
|
220
|
-
internalType: "uint256",
|
221
|
-
name: "amount",
|
222
|
-
type: "uint256",
|
223
|
-
},
|
224
|
-
{
|
225
|
-
internalType: "uint256",
|
226
|
-
name: "chainId",
|
227
|
-
type: "uint256",
|
228
|
-
},
|
229
|
-
],
|
230
|
-
name: "burn",
|
231
|
-
outputs: [],
|
232
|
-
stateMutability: "nonpayable",
|
233
|
-
type: "function",
|
234
|
-
},
|
235
|
-
{
|
236
|
-
inputs: [],
|
237
|
-
name: "decimals",
|
238
|
-
outputs: [
|
239
|
-
{
|
240
|
-
internalType: "uint8",
|
241
|
-
name: "",
|
242
|
-
type: "uint8",
|
243
|
-
},
|
244
|
-
],
|
245
|
-
stateMutability: "view",
|
246
|
-
type: "function",
|
247
|
-
},
|
248
|
-
{
|
249
|
-
inputs: [
|
250
|
-
{
|
251
|
-
internalType: "address",
|
252
|
-
name: "spender",
|
253
|
-
type: "address",
|
254
|
-
},
|
255
|
-
{
|
256
|
-
internalType: "uint256",
|
257
|
-
name: "subtractedValue",
|
258
|
-
type: "uint256",
|
259
|
-
},
|
260
|
-
],
|
261
|
-
name: "decreaseAllowance",
|
262
|
-
outputs: [
|
263
|
-
{
|
264
|
-
internalType: "bool",
|
265
|
-
name: "",
|
266
|
-
type: "bool",
|
267
|
-
},
|
268
|
-
],
|
269
|
-
stateMutability: "nonpayable",
|
270
|
-
type: "function",
|
271
|
-
},
|
272
|
-
{
|
273
|
-
inputs: [
|
274
|
-
{
|
275
|
-
internalType: "address",
|
276
|
-
name: "spender",
|
277
|
-
type: "address",
|
278
|
-
},
|
279
|
-
{
|
280
|
-
internalType: "uint256",
|
281
|
-
name: "addedValue",
|
282
|
-
type: "uint256",
|
283
|
-
},
|
284
|
-
],
|
285
|
-
name: "increaseAllowance",
|
286
|
-
outputs: [
|
287
|
-
{
|
288
|
-
internalType: "bool",
|
289
|
-
name: "",
|
290
|
-
type: "bool",
|
291
|
-
},
|
292
|
-
],
|
293
|
-
stateMutability: "nonpayable",
|
294
|
-
type: "function",
|
295
|
-
},
|
296
|
-
{
|
297
|
-
inputs: [
|
298
|
-
{
|
299
|
-
internalType: "address",
|
300
|
-
name: "to",
|
301
|
-
type: "address",
|
302
|
-
},
|
303
|
-
{
|
304
|
-
internalType: "uint256",
|
305
|
-
name: "amount",
|
306
|
-
type: "uint256",
|
307
|
-
},
|
308
|
-
{
|
309
|
-
internalType: "uint256",
|
310
|
-
name: "chainId",
|
311
|
-
type: "uint256",
|
312
|
-
},
|
313
|
-
{
|
314
|
-
internalType: "bytes32",
|
315
|
-
name: "transactionHash",
|
316
|
-
type: "bytes32",
|
317
|
-
},
|
318
|
-
],
|
319
|
-
name: "mint",
|
320
|
-
outputs: [],
|
321
|
-
stateMutability: "nonpayable",
|
322
|
-
type: "function",
|
323
|
-
},
|
324
|
-
{
|
325
|
-
inputs: [],
|
326
|
-
name: "name",
|
327
|
-
outputs: [
|
328
|
-
{
|
329
|
-
internalType: "string",
|
330
|
-
name: "",
|
331
|
-
type: "string",
|
332
|
-
},
|
333
|
-
],
|
334
|
-
stateMutability: "view",
|
335
|
-
type: "function",
|
336
|
-
},
|
337
|
-
{
|
338
|
-
inputs: [],
|
339
|
-
name: "owner",
|
340
|
-
outputs: [
|
341
|
-
{
|
342
|
-
internalType: "address",
|
343
|
-
name: "",
|
344
|
-
type: "address",
|
345
|
-
},
|
346
|
-
],
|
347
|
-
stateMutability: "view",
|
348
|
-
type: "function",
|
349
|
-
},
|
350
|
-
{
|
351
|
-
inputs: [],
|
352
|
-
name: "renounceOwnership",
|
353
|
-
outputs: [],
|
354
|
-
stateMutability: "nonpayable",
|
355
|
-
type: "function",
|
356
|
-
},
|
357
|
-
{
|
358
|
-
inputs: [],
|
359
|
-
name: "symbol",
|
360
|
-
outputs: [
|
361
|
-
{
|
362
|
-
internalType: "string",
|
363
|
-
name: "",
|
364
|
-
type: "string",
|
365
|
-
},
|
366
|
-
],
|
367
|
-
stateMutability: "view",
|
368
|
-
type: "function",
|
369
|
-
},
|
370
|
-
{
|
371
|
-
inputs: [],
|
372
|
-
name: "totalSupply",
|
373
|
-
outputs: [
|
374
|
-
{
|
375
|
-
internalType: "uint256",
|
376
|
-
name: "",
|
377
|
-
type: "uint256",
|
378
|
-
},
|
379
|
-
],
|
380
|
-
stateMutability: "view",
|
381
|
-
type: "function",
|
382
|
-
},
|
383
|
-
{
|
384
|
-
inputs: [
|
385
|
-
{
|
386
|
-
internalType: "address",
|
387
|
-
name: "to",
|
388
|
-
type: "address",
|
389
|
-
},
|
390
|
-
{
|
391
|
-
internalType: "uint256",
|
392
|
-
name: "amount",
|
393
|
-
type: "uint256",
|
394
|
-
},
|
395
|
-
],
|
396
|
-
name: "transfer",
|
397
|
-
outputs: [
|
398
|
-
{
|
399
|
-
internalType: "bool",
|
400
|
-
name: "",
|
401
|
-
type: "bool",
|
402
|
-
},
|
403
|
-
],
|
404
|
-
stateMutability: "nonpayable",
|
405
|
-
type: "function",
|
406
|
-
},
|
407
|
-
{
|
408
|
-
inputs: [
|
409
|
-
{
|
410
|
-
internalType: "address",
|
411
|
-
name: "from",
|
412
|
-
type: "address",
|
413
|
-
},
|
414
|
-
{
|
415
|
-
internalType: "address",
|
416
|
-
name: "to",
|
417
|
-
type: "address",
|
418
|
-
},
|
419
|
-
{
|
420
|
-
internalType: "uint256",
|
421
|
-
name: "amount",
|
422
|
-
type: "uint256",
|
423
|
-
},
|
424
|
-
],
|
425
|
-
name: "transferFrom",
|
426
|
-
outputs: [
|
427
|
-
{
|
428
|
-
internalType: "bool",
|
429
|
-
name: "",
|
430
|
-
type: "bool",
|
431
|
-
},
|
432
|
-
],
|
433
|
-
stateMutability: "nonpayable",
|
434
|
-
type: "function",
|
435
|
-
},
|
436
|
-
{
|
437
|
-
inputs: [
|
438
|
-
{
|
439
|
-
internalType: "address",
|
440
|
-
name: "newOwner",
|
441
|
-
type: "address",
|
442
|
-
},
|
443
|
-
],
|
444
|
-
name: "transferOwnership",
|
445
|
-
outputs: [],
|
446
|
-
stateMutability: "nonpayable",
|
447
|
-
type: "function",
|
448
|
-
},
|
449
|
-
];
|
450
|
-
class InteropBridgeToken__factory {
|
451
|
-
static createInterface() {
|
452
|
-
return new ethers_1.utils.Interface(_abi);
|
453
|
-
}
|
454
|
-
static connect(address, signerOrProvider) {
|
455
|
-
return new ethers_1.Contract(address, _abi, signerOrProvider);
|
456
|
-
}
|
457
|
-
}
|
458
|
-
exports.InteropBridgeToken__factory = InteropBridgeToken__factory;
|
459
|
-
InteropBridgeToken__factory.abi = _abi;
|