@instadapp/interop-x 0.0.0-dev.75809ae → 0.0.0-dev.76d0265
Sign up to get free protection for your applications and to get access to all the features.
- package/.env.example +2 -1
- package/dist/package.json +74 -0
- package/dist/src/abi/erc20.json +350 -0
- package/dist/src/abi/gnosisSafe.json +747 -0
- package/dist/src/abi/index.js +13 -0
- package/dist/src/abi/interopXContract.json +454 -0
- package/dist/src/alias.js +10 -0
- package/dist/src/api/index.js +36 -0
- package/dist/src/config/index.js +31 -0
- package/dist/src/constants/addresses.js +20 -0
- package/dist/{constants → src/constants}/index.js +1 -0
- package/dist/src/constants/tokens.js +130 -0
- package/dist/{db → src/db}/index.js +0 -0
- package/dist/{db → src/db}/models/index.js +1 -1
- package/dist/src/db/models/transaction.js +70 -0
- package/dist/{db → src/db}/sequelize.js +2 -1
- package/dist/src/gnosis/actions/index.js +9 -0
- package/dist/src/gnosis/actions/withdraw/index.js +115 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +119 -0
- package/dist/{logger → src/logger}/index.js +0 -0
- package/dist/{net → src/net}/index.js +0 -0
- package/dist/{net → src/net}/peer/index.js +13 -8
- package/dist/{net → src/net}/pool/index.js +34 -11
- package/dist/{net → src/net}/protocol/dial/BaseDialProtocol.js +1 -1
- package/dist/{net → src/net}/protocol/dial/SignatureDialProtocol.js +21 -14
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
- package/dist/{net → src/net}/protocol/index.js +54 -4
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/{tasks → src/tasks}/BaseTask.js +14 -6
- package/dist/src/tasks/InteropXContract/ProcessBridgeRequestEvents.js +159 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeCommittedEvents.js +93 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +90 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
- package/dist/src/tasks/index.js +41 -0
- package/dist/src/typechain/Erc20.js +2 -0
- package/dist/src/typechain/GnosisSafe.js +2 -0
- package/dist/src/typechain/InteropXContract.js +2 -0
- package/dist/src/typechain/common.js +2 -0
- package/dist/src/typechain/factories/Erc20__factory.js +367 -0
- package/dist/src/typechain/factories/GnosisSafe__factory.js +1174 -0
- package/dist/src/typechain/factories/InteropXContract__factory.js +635 -0
- package/dist/src/typechain/factories/index.js +12 -0
- package/dist/src/typechain/index.js +33 -0
- package/dist/{types.js → src/types.js} +0 -0
- package/dist/src/utils/index.js +193 -0
- package/package.json +30 -15
- package/patches/@ethersproject+properties+5.6.0.patch +13 -0
- package/src/abi/erc20.json +350 -0
- package/src/abi/gnosisSafe.json +747 -0
- package/src/abi/index.ts +9 -0
- package/src/abi/interopXContract.json +454 -0
- package/src/alias.ts +6 -0
- package/src/api/index.ts +36 -0
- package/src/config/index.ts +18 -2
- package/src/constants/addresses.ts +13 -6
- package/src/constants/index.ts +1 -0
- package/src/constants/tokens.ts +127 -0
- package/src/db/index.ts +1 -1
- package/src/db/models/index.ts +1 -1
- package/src/db/models/transaction.ts +145 -0
- package/src/db/sequelize.ts +2 -1
- package/src/gnosis/actions/index.ts +5 -0
- package/src/gnosis/actions/withdraw/index.ts +155 -0
- package/src/gnosis/index.ts +19 -0
- package/src/index.ts +118 -7
- package/src/net/peer/index.ts +12 -10
- package/src/net/pool/index.ts +43 -13
- package/src/net/protocol/dial/BaseDialProtocol.ts +1 -1
- package/src/net/protocol/dial/SignatureDialProtocol.ts +24 -17
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
- package/src/net/protocol/index.ts +70 -4
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +16 -7
- package/src/tasks/InteropXContract/ProcessBridgeRequestEvents.ts +227 -0
- package/src/tasks/InteropXContract/SyncBridgeCommittedEvents.ts +125 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +115 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +121 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
- package/src/tasks/index.ts +28 -2
- package/src/typechain/Erc20.ts +491 -0
- package/src/typechain/GnosisSafe.ts +1728 -0
- package/src/typechain/InteropXContract.ts +680 -0
- package/src/typechain/common.ts +44 -0
- package/src/typechain/factories/Erc20__factory.ts +368 -0
- package/src/typechain/factories/GnosisSafe__factory.ts +1178 -0
- package/src/typechain/factories/InteropXContract__factory.ts +642 -0
- package/src/typechain/factories/index.ts +6 -0
- package/src/typechain/index.ts +10 -0
- package/src/types.ts +2 -2
- package/src/utils/index.ts +163 -4
- package/tsconfig.json +8 -0
- package/dist/config/index.js +0 -17
- package/dist/constants/addresses.js +0 -13
- package/dist/db/models/execution.js +0 -38
- package/dist/index.js +0 -34
- package/dist/tasks/index.js +0 -19
- package/dist/utils/index.js +0 -89
- package/src/db/models/execution.ts +0 -57
@@ -0,0 +1,193 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.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
|
+
/**
|
8
|
+
* @module util
|
9
|
+
*/
|
10
|
+
const axios_1 = __importDefault(require("axios"));
|
11
|
+
const axios_retry_1 = __importDefault(require("axios-retry"));
|
12
|
+
const constants_1 = require("@/constants");
|
13
|
+
const ethers_1 = require("ethers");
|
14
|
+
const async_retry_1 = __importDefault(require("async-retry"));
|
15
|
+
exports.http = axios_1.default.create();
|
16
|
+
(0, axios_retry_1.default)(exports.http, { retries: 3, retryDelay: axios_retry_1.default.exponentialDelay });
|
17
|
+
function shortenHash(hash, length = 4) {
|
18
|
+
if (!hash)
|
19
|
+
return;
|
20
|
+
if (hash.length < 12)
|
21
|
+
return hash;
|
22
|
+
const beginningChars = hash.startsWith("0x") ? length + 2 : length;
|
23
|
+
const shortened = hash.substr(0, beginningChars) + "…" + hash.substr(-length);
|
24
|
+
return shortened;
|
25
|
+
}
|
26
|
+
exports.shortenHash = shortenHash;
|
27
|
+
function short(buffer) {
|
28
|
+
return buffer.toString('hex').slice(0, 8) + '...';
|
29
|
+
}
|
30
|
+
exports.short = short;
|
31
|
+
const signGnosisSafeTx = async ({ to, data = null, value = '0', operation = '1', baseGas = '0', gasPrice = "0", gasToken = "0x0000000000000000000000000000000000000000", refundReceiver = "0x0000000000000000000000000000000000000000", safeTxGas = "79668", nonce = "0", chainId = 137, }, { signer }) => {
|
32
|
+
const gnosisSafe = constants_1.addresses[chainId].gnosisSafe;
|
33
|
+
const domain = {
|
34
|
+
verifyingContract: gnosisSafe,
|
35
|
+
chainId,
|
36
|
+
};
|
37
|
+
const types = {
|
38
|
+
SafeTx: [
|
39
|
+
{ type: 'address', name: 'to' },
|
40
|
+
{ type: 'uint256', name: 'value' },
|
41
|
+
{ type: 'bytes', name: 'data' },
|
42
|
+
{ type: 'uint8', name: 'operation' },
|
43
|
+
{ type: 'uint256', name: 'safeTxGas' },
|
44
|
+
{ type: 'uint256', name: 'baseGas' },
|
45
|
+
{ type: 'uint256', name: 'gasPrice' },
|
46
|
+
{ type: 'address', name: 'gasToken' },
|
47
|
+
{ type: 'address', name: 'refundReceiver' },
|
48
|
+
{ type: 'uint256', name: 'nonce' },
|
49
|
+
],
|
50
|
+
};
|
51
|
+
const message = {
|
52
|
+
baseGas,
|
53
|
+
data,
|
54
|
+
gasPrice,
|
55
|
+
gasToken,
|
56
|
+
nonce: Number(nonce),
|
57
|
+
operation,
|
58
|
+
refundReceiver,
|
59
|
+
safeAddress: gnosisSafe,
|
60
|
+
safeTxGas: String(safeTxGas),
|
61
|
+
to,
|
62
|
+
value,
|
63
|
+
};
|
64
|
+
return await signer._signTypedData(domain, types, message);
|
65
|
+
};
|
66
|
+
exports.signGnosisSafeTx = signGnosisSafeTx;
|
67
|
+
const getRpcProviderUrl = (chainId) => {
|
68
|
+
switch (chainId) {
|
69
|
+
case 1:
|
70
|
+
return 'https://rpc.ankr.com/eth';
|
71
|
+
case 137:
|
72
|
+
return 'https://rpc.ankr.com/polygon';
|
73
|
+
case 43114:
|
74
|
+
return 'https://rpc.ankr.com/avalanche';
|
75
|
+
default:
|
76
|
+
throw new Error(`Unknown chainId: ${chainId}`);
|
77
|
+
}
|
78
|
+
};
|
79
|
+
exports.getRpcProviderUrl = getRpcProviderUrl;
|
80
|
+
const buildSignatureBytes = (signatures) => {
|
81
|
+
signatures.sort((left, right) => left.signer.toLowerCase().localeCompare(right.signer.toLowerCase()));
|
82
|
+
let signatureBytes = "0x";
|
83
|
+
for (const sig of signatures) {
|
84
|
+
signatureBytes += sig.data.slice(2);
|
85
|
+
}
|
86
|
+
return signatureBytes;
|
87
|
+
};
|
88
|
+
exports.buildSignatureBytes = buildSignatureBytes;
|
89
|
+
/**
|
90
|
+
* Call an async function with a maximum time limit (in milliseconds) for the timeout
|
91
|
+
* Resolved promise for async function call, or an error if time limit reached
|
92
|
+
*/
|
93
|
+
const asyncCallWithTimeout = async (asyncPromise, timeout) => {
|
94
|
+
let timeoutHandle;
|
95
|
+
const timeoutPromise = new Promise((_resolve, reject) => {
|
96
|
+
timeoutHandle = setTimeout(() => reject(new Error('Async call timeout limit reached')), timeout);
|
97
|
+
});
|
98
|
+
return Promise.race([asyncPromise, timeoutPromise]).then(result => {
|
99
|
+
clearTimeout(timeoutHandle);
|
100
|
+
return result;
|
101
|
+
});
|
102
|
+
};
|
103
|
+
exports.asyncCallWithTimeout = asyncCallWithTimeout;
|
104
|
+
const generateInteropTransactionHash = (data) => {
|
105
|
+
return ethers_1.ethers.utils.solidityKeccak256(['string', 'string', 'string', 'string', 'string'], [
|
106
|
+
String(data.actionId),
|
107
|
+
String(data.bridger),
|
108
|
+
String(data.requestTransactionHash),
|
109
|
+
String(data.sourceChainId),
|
110
|
+
String(data.targetChainId),
|
111
|
+
]);
|
112
|
+
};
|
113
|
+
exports.generateInteropTransactionHash = generateInteropTransactionHash;
|
114
|
+
class ContractError extends Error {
|
115
|
+
}
|
116
|
+
exports.ContractError = ContractError;
|
117
|
+
function getContract(address, contractInterface, signerOrProvider) {
|
118
|
+
if (!ethers_1.ethers.utils.getAddress(address) || address === ethers_1.ethers.constants.AddressZero) {
|
119
|
+
throw Error(`Invalid 'address' parameter '${address}'.`);
|
120
|
+
}
|
121
|
+
const contract = new ethers_1.ethers.Contract(address, contractInterface, signerOrProvider);
|
122
|
+
// Make sure the contract properties is writable
|
123
|
+
const desc = Object.getOwnPropertyDescriptor(contract, 'functions');
|
124
|
+
if (!desc || desc.writable !== true) {
|
125
|
+
return contract;
|
126
|
+
}
|
127
|
+
return new Proxy(contract, {
|
128
|
+
get(target, prop, receiver) {
|
129
|
+
const value = Reflect.get(target, prop, receiver);
|
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
|
+
}
|
137
|
+
return async (...args) => {
|
138
|
+
try {
|
139
|
+
return await (0, async_retry_1.default)(async () => await value.bind(contract)(...args), { retries: isConstant ? 1 : 3 });
|
140
|
+
}
|
141
|
+
catch (error) {
|
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;
|
147
|
+
}
|
148
|
+
};
|
149
|
+
}
|
150
|
+
if (typeof value === 'object' && ['populateTransaction', 'estimateGas', 'functions', 'callStatic'].includes(String(prop))) {
|
151
|
+
const parentProp = String(prop);
|
152
|
+
return new Proxy(value, {
|
153
|
+
get(target, prop, receiver) {
|
154
|
+
const value = Reflect.get(target, prop, receiver);
|
155
|
+
if (typeof value === 'function') {
|
156
|
+
return async (...args) => {
|
157
|
+
try {
|
158
|
+
return await (0, async_retry_1.default)(async () => await value.bind(contract)(...args), { retries: parentProp === 'callStatic' ? 3 : 1 });
|
159
|
+
}
|
160
|
+
catch (error) {
|
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;
|
166
|
+
}
|
167
|
+
};
|
168
|
+
}
|
169
|
+
}
|
170
|
+
});
|
171
|
+
}
|
172
|
+
return value;
|
173
|
+
},
|
174
|
+
});
|
175
|
+
}
|
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.
|
3
|
+
"version": "0.0.0-dev.76d0265",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"engines": {
|
@@ -9,9 +9,11 @@
|
|
9
9
|
},
|
10
10
|
"scripts": {
|
11
11
|
"start": "yarn build && node bin/interop-x",
|
12
|
-
"build": "export GIT_REF=$(git rev-parse --short HEAD) && rimraf ./dist && tsc -p tsconfig.json && replace-in-file '@GIT_SHORT_HASH@' $GIT_REF ./dist
|
13
|
-
"dev": "NODE_ENV=development nodemon",
|
14
|
-
"
|
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
|
+
"dev": "yarn generate-abi-types && NODE_ENV=development nodemon",
|
14
|
+
"generate-abi-types": "rimraf src/typechain && typechain --target=ethers-v5 'src/abi/*.json' --out-dir 'src/typechain'",
|
15
|
+
"prepublishOnly": "yarn build",
|
16
|
+
"postinstall": "patch-package"
|
15
17
|
},
|
16
18
|
"nodemonConfig": {
|
17
19
|
"watch": [
|
@@ -22,14 +24,19 @@
|
|
22
24
|
},
|
23
25
|
"dependencies": {
|
24
26
|
"@achingbrain/libp2p-gossipsub": "^0.12.2",
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
27
|
+
"@fastify/cors": "^7.0.0",
|
28
|
+
"async-retry": "^1.3.3",
|
29
|
+
"await-spawn": "^4.0.2",
|
30
|
+
"axios": "^0.27.2",
|
31
|
+
"axios-retry": "^3.2.5",
|
28
32
|
"chalk": "4.1.2",
|
29
|
-
"dotenv": "^16.0.
|
33
|
+
"dotenv": "^16.0.1",
|
30
34
|
"ethereumjs-util": "^7.1.4",
|
31
|
-
"ethers": "^5.6.
|
35
|
+
"ethers": "^5.6.5",
|
32
36
|
"ethers-multisend": "^2.1.1",
|
37
|
+
"expand-home-dir": "^0.0.3",
|
38
|
+
"fastify": "^3.29.0",
|
39
|
+
"fs-extra": "^10.1.0",
|
33
40
|
"libp2p": "^0.36.2",
|
34
41
|
"libp2p-bootstrap": "^0.14.0",
|
35
42
|
"libp2p-kad-dht": "^0.28.6",
|
@@ -39,21 +46,29 @@
|
|
39
46
|
"libp2p-pubsub-peer-discovery": "^4.0.0",
|
40
47
|
"libp2p-tcp": "^0.17.2",
|
41
48
|
"libp2p-websockets": "^0.16.2",
|
42
|
-
"luxon": "^2.
|
43
|
-
"
|
49
|
+
"luxon": "^2.4.0",
|
50
|
+
"module-alias": "^2.2.2",
|
51
|
+
"patch-package": "^6.4.7",
|
52
|
+
"postinstall-postinstall": "^2.1.0",
|
53
|
+
"sequelize": "6.18.0",
|
54
|
+
"sqlite3": "^5.0.8",
|
44
55
|
"waait": "^1.0.5"
|
45
56
|
},
|
46
57
|
"bin": {
|
47
|
-
"interop-
|
58
|
+
"interop-x": "bin/interop-x",
|
59
|
+
"interopx": "bin/interop-x"
|
48
60
|
},
|
49
61
|
"devDependencies": {
|
62
|
+
"@typechain/ethers-v5": "^10.0.0",
|
63
|
+
"@types/bn.js": "^5.1.0",
|
50
64
|
"@types/fs-extra": "^9.0.13",
|
51
|
-
"@types/node": "^17.0.
|
52
|
-
"nodemon": "^2.0.
|
65
|
+
"@types/node": "^17.0.33",
|
66
|
+
"nodemon": "^2.0.16",
|
53
67
|
"replace-in-file": "^6.3.2",
|
54
68
|
"rimraf": "^3.0.2",
|
55
69
|
"ts-node": "^10.5.0",
|
56
70
|
"tsconfig-paths": "^3.12.0",
|
57
|
-
"
|
71
|
+
"typechain": "^8.0.0",
|
72
|
+
"typescript": "^4.6.4"
|
58
73
|
}
|
59
74
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
diff --git a/node_modules/@ethersproject/properties/lib/index.js b/node_modules/@ethersproject/properties/lib/index.js
|
2
|
+
index 41e0b52..4c7a9e3 100644
|
3
|
+
--- a/node_modules/@ethersproject/properties/lib/index.js
|
4
|
+
+++ b/node_modules/@ethersproject/properties/lib/index.js
|
5
|
+
@@ -44,7 +44,7 @@ function defineReadOnly(object, name, value) {
|
6
|
+
Object.defineProperty(object, name, {
|
7
|
+
enumerable: true,
|
8
|
+
value: value,
|
9
|
+
- writable: false,
|
10
|
+
+ writable: true,
|
11
|
+
});
|
12
|
+
}
|
13
|
+
exports.defineReadOnly = defineReadOnly;
|
@@ -0,0 +1,350 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"inputs": [
|
4
|
+
{
|
5
|
+
"internalType": "uint256",
|
6
|
+
"name": "_totalSupply",
|
7
|
+
"type": "uint256"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"payable": false,
|
11
|
+
"stateMutability": "nonpayable",
|
12
|
+
"type": "constructor"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"anonymous": false,
|
16
|
+
"inputs": [
|
17
|
+
{
|
18
|
+
"indexed": true,
|
19
|
+
"internalType": "address",
|
20
|
+
"name": "owner",
|
21
|
+
"type": "address"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"indexed": true,
|
25
|
+
"internalType": "address",
|
26
|
+
"name": "spender",
|
27
|
+
"type": "address"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"indexed": false,
|
31
|
+
"internalType": "uint256",
|
32
|
+
"name": "value",
|
33
|
+
"type": "uint256"
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"name": "Approval",
|
37
|
+
"type": "event"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"anonymous": false,
|
41
|
+
"inputs": [
|
42
|
+
{
|
43
|
+
"indexed": true,
|
44
|
+
"internalType": "address",
|
45
|
+
"name": "from",
|
46
|
+
"type": "address"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"indexed": true,
|
50
|
+
"internalType": "address",
|
51
|
+
"name": "to",
|
52
|
+
"type": "address"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"indexed": false,
|
56
|
+
"internalType": "uint256",
|
57
|
+
"name": "value",
|
58
|
+
"type": "uint256"
|
59
|
+
}
|
60
|
+
],
|
61
|
+
"name": "Transfer",
|
62
|
+
"type": "event"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"constant": true,
|
66
|
+
"inputs": [],
|
67
|
+
"name": "DOMAIN_SEPARATOR",
|
68
|
+
"outputs": [
|
69
|
+
{
|
70
|
+
"internalType": "bytes32",
|
71
|
+
"name": "",
|
72
|
+
"type": "bytes32"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
"payable": false,
|
76
|
+
"stateMutability": "view",
|
77
|
+
"type": "function"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"constant": true,
|
81
|
+
"inputs": [],
|
82
|
+
"name": "PERMIT_TYPEHASH",
|
83
|
+
"outputs": [
|
84
|
+
{
|
85
|
+
"internalType": "bytes32",
|
86
|
+
"name": "",
|
87
|
+
"type": "bytes32"
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"payable": false,
|
91
|
+
"stateMutability": "view",
|
92
|
+
"type": "function"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"constant": true,
|
96
|
+
"inputs": [
|
97
|
+
{
|
98
|
+
"internalType": "address",
|
99
|
+
"name": "",
|
100
|
+
"type": "address"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"internalType": "address",
|
104
|
+
"name": "",
|
105
|
+
"type": "address"
|
106
|
+
}
|
107
|
+
],
|
108
|
+
"name": "allowance",
|
109
|
+
"outputs": [
|
110
|
+
{
|
111
|
+
"internalType": "uint256",
|
112
|
+
"name": "",
|
113
|
+
"type": "uint256"
|
114
|
+
}
|
115
|
+
],
|
116
|
+
"payable": false,
|
117
|
+
"stateMutability": "view",
|
118
|
+
"type": "function"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"constant": false,
|
122
|
+
"inputs": [
|
123
|
+
{
|
124
|
+
"internalType": "address",
|
125
|
+
"name": "spender",
|
126
|
+
"type": "address"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"internalType": "uint256",
|
130
|
+
"name": "value",
|
131
|
+
"type": "uint256"
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"name": "approve",
|
135
|
+
"outputs": [
|
136
|
+
{
|
137
|
+
"internalType": "bool",
|
138
|
+
"name": "",
|
139
|
+
"type": "bool"
|
140
|
+
}
|
141
|
+
],
|
142
|
+
"payable": false,
|
143
|
+
"stateMutability": "nonpayable",
|
144
|
+
"type": "function"
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"constant": true,
|
148
|
+
"inputs": [
|
149
|
+
{
|
150
|
+
"internalType": "address",
|
151
|
+
"name": "",
|
152
|
+
"type": "address"
|
153
|
+
}
|
154
|
+
],
|
155
|
+
"name": "balanceOf",
|
156
|
+
"outputs": [
|
157
|
+
{
|
158
|
+
"internalType": "uint256",
|
159
|
+
"name": "",
|
160
|
+
"type": "uint256"
|
161
|
+
}
|
162
|
+
],
|
163
|
+
"payable": false,
|
164
|
+
"stateMutability": "view",
|
165
|
+
"type": "function"
|
166
|
+
},
|
167
|
+
{
|
168
|
+
"constant": true,
|
169
|
+
"inputs": [],
|
170
|
+
"name": "decimals",
|
171
|
+
"outputs": [
|
172
|
+
{
|
173
|
+
"internalType": "uint8",
|
174
|
+
"name": "",
|
175
|
+
"type": "uint8"
|
176
|
+
}
|
177
|
+
],
|
178
|
+
"payable": false,
|
179
|
+
"stateMutability": "view",
|
180
|
+
"type": "function"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"constant": true,
|
184
|
+
"inputs": [],
|
185
|
+
"name": "name",
|
186
|
+
"outputs": [
|
187
|
+
{
|
188
|
+
"internalType": "string",
|
189
|
+
"name": "",
|
190
|
+
"type": "string"
|
191
|
+
}
|
192
|
+
],
|
193
|
+
"payable": false,
|
194
|
+
"stateMutability": "view",
|
195
|
+
"type": "function"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"constant": true,
|
199
|
+
"inputs": [
|
200
|
+
{
|
201
|
+
"internalType": "address",
|
202
|
+
"name": "",
|
203
|
+
"type": "address"
|
204
|
+
}
|
205
|
+
],
|
206
|
+
"name": "nonces",
|
207
|
+
"outputs": [
|
208
|
+
{
|
209
|
+
"internalType": "uint256",
|
210
|
+
"name": "",
|
211
|
+
"type": "uint256"
|
212
|
+
}
|
213
|
+
],
|
214
|
+
"payable": false,
|
215
|
+
"stateMutability": "view",
|
216
|
+
"type": "function"
|
217
|
+
},
|
218
|
+
{
|
219
|
+
"constant": false,
|
220
|
+
"inputs": [
|
221
|
+
{
|
222
|
+
"internalType": "address",
|
223
|
+
"name": "owner",
|
224
|
+
"type": "address"
|
225
|
+
},
|
226
|
+
{
|
227
|
+
"internalType": "address",
|
228
|
+
"name": "spender",
|
229
|
+
"type": "address"
|
230
|
+
},
|
231
|
+
{
|
232
|
+
"internalType": "uint256",
|
233
|
+
"name": "value",
|
234
|
+
"type": "uint256"
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"internalType": "uint256",
|
238
|
+
"name": "deadline",
|
239
|
+
"type": "uint256"
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"internalType": "uint8",
|
243
|
+
"name": "v",
|
244
|
+
"type": "uint8"
|
245
|
+
},
|
246
|
+
{
|
247
|
+
"internalType": "bytes32",
|
248
|
+
"name": "r",
|
249
|
+
"type": "bytes32"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
"internalType": "bytes32",
|
253
|
+
"name": "s",
|
254
|
+
"type": "bytes32"
|
255
|
+
}
|
256
|
+
],
|
257
|
+
"name": "permit",
|
258
|
+
"outputs": [],
|
259
|
+
"payable": false,
|
260
|
+
"stateMutability": "nonpayable",
|
261
|
+
"type": "function"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"constant": true,
|
265
|
+
"inputs": [],
|
266
|
+
"name": "symbol",
|
267
|
+
"outputs": [
|
268
|
+
{
|
269
|
+
"internalType": "string",
|
270
|
+
"name": "",
|
271
|
+
"type": "string"
|
272
|
+
}
|
273
|
+
],
|
274
|
+
"payable": false,
|
275
|
+
"stateMutability": "view",
|
276
|
+
"type": "function"
|
277
|
+
},
|
278
|
+
{
|
279
|
+
"constant": true,
|
280
|
+
"inputs": [],
|
281
|
+
"name": "totalSupply",
|
282
|
+
"outputs": [
|
283
|
+
{
|
284
|
+
"internalType": "uint256",
|
285
|
+
"name": "",
|
286
|
+
"type": "uint256"
|
287
|
+
}
|
288
|
+
],
|
289
|
+
"payable": false,
|
290
|
+
"stateMutability": "view",
|
291
|
+
"type": "function"
|
292
|
+
},
|
293
|
+
{
|
294
|
+
"constant": false,
|
295
|
+
"inputs": [
|
296
|
+
{
|
297
|
+
"internalType": "address",
|
298
|
+
"name": "to",
|
299
|
+
"type": "address"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"internalType": "uint256",
|
303
|
+
"name": "value",
|
304
|
+
"type": "uint256"
|
305
|
+
}
|
306
|
+
],
|
307
|
+
"name": "transfer",
|
308
|
+
"outputs": [
|
309
|
+
{
|
310
|
+
"internalType": "bool",
|
311
|
+
"name": "",
|
312
|
+
"type": "bool"
|
313
|
+
}
|
314
|
+
],
|
315
|
+
"payable": false,
|
316
|
+
"stateMutability": "nonpayable",
|
317
|
+
"type": "function"
|
318
|
+
},
|
319
|
+
{
|
320
|
+
"constant": false,
|
321
|
+
"inputs": [
|
322
|
+
{
|
323
|
+
"internalType": "address",
|
324
|
+
"name": "from",
|
325
|
+
"type": "address"
|
326
|
+
},
|
327
|
+
{
|
328
|
+
"internalType": "address",
|
329
|
+
"name": "to",
|
330
|
+
"type": "address"
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"internalType": "uint256",
|
334
|
+
"name": "value",
|
335
|
+
"type": "uint256"
|
336
|
+
}
|
337
|
+
],
|
338
|
+
"name": "transferFrom",
|
339
|
+
"outputs": [
|
340
|
+
{
|
341
|
+
"internalType": "bool",
|
342
|
+
"name": "",
|
343
|
+
"type": "bool"
|
344
|
+
}
|
345
|
+
],
|
346
|
+
"payable": false,
|
347
|
+
"stateMutability": "nonpayable",
|
348
|
+
"type": "function"
|
349
|
+
}
|
350
|
+
]
|