@ohos-ports/ethcall 0.0.0-stage → 6.0.6-beta.1
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.
- package/LICENSE +21 -0
- package/README.md +80 -2
- package/dist/abi/deploylessMulticall.json +25 -0
- package/dist/abi/deploylessMulticall2.json +30 -0
- package/dist/abi/deploylessMulticall3.json +30 -0
- package/dist/abi/multicall.json +157 -0
- package/dist/abi/multicall2.json +315 -0
- package/dist/abi/multicall3.json +440 -0
- package/dist/abi.d.ts +10 -0
- package/dist/abi.js +89 -0
- package/dist/abi.js.map +1 -0
- package/dist/call.d.ts +29 -0
- package/dist/call.js +183 -0
- package/dist/call.js.map +1 -0
- package/dist/calls.d.ts +3 -0
- package/dist/calls.js +8 -0
- package/dist/calls.js.map +1 -0
- package/dist/contract.d.ts +20 -0
- package/dist/contract.js +54 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/multicall.d.ts +12 -0
- package/dist/multicall.js +389 -0
- package/dist/multicall.js.map +1 -0
- package/dist/provider.d.ts +55 -0
- package/dist/provider.js +153 -0
- package/dist/provider.js.map +1 -0
- package/package.json +34 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Timur Badretdinov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ethcall
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> This package is not maintained and will be archived. Use viem's [`multicall`](https://viem.sh/docs/contract/multicall#multicall).
|
|
5
|
+
|
|
6
|
+
Utility library to make calls to Ethereum blockchain.
|
|
7
|
+
|
|
8
|
+
Uses MakerDAO's [Multicall contracts](https://github.com/makerdao/multicall) to make multiple requests in a single HTTP query. Encodes and decodes data automatically.
|
|
9
|
+
|
|
10
|
+
Powered by [abi-coder](https://github.com/Destiner/abi-coder) and [ethers.js](https://github.com/ethers-io/ethers.js/).
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
npm install ethcall
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> This package requires ethers V6. If you use ethers V5, you need to install ethcall V5.
|
|
17
|
+
|
|
18
|
+
> This package uses [Import Assertions](https://github.com/tc39/proposal-import-attributes#import-attributes), which is supported by Vite 4+, Rollup 3+, and Node 16+.
|
|
19
|
+
|
|
20
|
+
> This package is a pure ESM package. Follow [this guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) for more info.
|
|
21
|
+
|
|
22
|
+
## API
|
|
23
|
+
|
|
24
|
+
- `Contract`
|
|
25
|
+
- `constructor(address, abi)`: creates Contract instance
|
|
26
|
+
- `CALL_FUNC_NAME`: yields a `call` object; usage is similar to `ethers` Contract class
|
|
27
|
+
- `Provider`
|
|
28
|
+
- `constructor(chainId, provider, config)`: creates a Provider instance
|
|
29
|
+
- `all(calls)`: executes all calls in a single request
|
|
30
|
+
- `tryAll(calls)`: executes all calls in a single request. Ignores reverted calls and returns `null` value in place of return data (wrapper on top of `tryAggregate` method)
|
|
31
|
+
- `tryEach(calls, canFail)`: executes all calls in a single request. Ignores reverted calls and returns `null` value in place of return data for the calls that are allowed to fail (wrapper on top of `aggregate3` method)
|
|
32
|
+
- `getEthBalance(address)`: returns account ether balance
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
> Also see [examples](./examples) for reference.
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
import { Contract, Provider } from 'ethcall';
|
|
40
|
+
import { InfuraProvider } from 'ethers';
|
|
41
|
+
|
|
42
|
+
import erc20Abi from './abi/erc20.json' assert { type: 'json' };
|
|
43
|
+
|
|
44
|
+
const infuraKey = 'INSERT_YOUR_KEY_HERE';
|
|
45
|
+
const provider = new InfuraProvider('mainnet', infuraKey);
|
|
46
|
+
|
|
47
|
+
const daiAddress = '0x6b175474e89094c44da98b954eedeac495271d0f';
|
|
48
|
+
|
|
49
|
+
async function call() {
|
|
50
|
+
const ethcallProvider = new Provider(1, provider);
|
|
51
|
+
|
|
52
|
+
const daiContract = new Contract(daiAddress, erc20Abi);
|
|
53
|
+
|
|
54
|
+
const uniswapDaiPool = '0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667';
|
|
55
|
+
|
|
56
|
+
const ethBalanceCall = ethcallProvider.getEthBalance(uniswapDaiPool);
|
|
57
|
+
const daiBalanceCall = daiContract.balanceOf(uniswapDaiPool);
|
|
58
|
+
|
|
59
|
+
const data = await ethcallProvider.all([ethBalanceCall, daiBalanceCall], {
|
|
60
|
+
blockTag: 'latest',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const ethBalance = data[0];
|
|
64
|
+
const daiBalance = data[1];
|
|
65
|
+
|
|
66
|
+
console.log('eth balance', ethBalance.toString());
|
|
67
|
+
console.log('dai balance', daiBalance.toString());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
call();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
All Mulitcall contracts are stored in `src/multicall.ts` file. There are three `getMulticall` methods corresponding to three Multicall versions. To add a new contract, you need to know its version, address, chain id of the underlying chain, and (optionally) block at which the Multicall contract was deployed.
|
|
76
|
+
|
|
77
|
+
## Deployless Multicall
|
|
78
|
+
|
|
79
|
+
If you query a chain on which Multicall is not deployed, or if you query a historical block before the deployment of the contract, the deployless version will be used instead. In short, deployless Multicall "emulates" the deployed contract and returns the exact same data. Note that you can't query ETH balance using deployless version.
|
|
80
|
+
|
|
81
|
+
You can read more about deployless Multicall [here](https://destiner.io/blog/post/deployless-multicall/).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "target",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "bytes",
|
|
13
|
+
"name": "callData",
|
|
14
|
+
"type": "bytes"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"internalType": "struct DeploylessMulticall.Call[]",
|
|
18
|
+
"name": "calls",
|
|
19
|
+
"type": "tuple[]"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"stateMutability": "nonpayable",
|
|
23
|
+
"type": "constructor"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "bool",
|
|
6
|
+
"name": "requireSuccess",
|
|
7
|
+
"type": "bool"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"components": [
|
|
11
|
+
{
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "target",
|
|
14
|
+
"type": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "bytes",
|
|
18
|
+
"name": "callData",
|
|
19
|
+
"type": "bytes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"internalType": "struct DeploylessMulticall2.Call[]",
|
|
23
|
+
"name": "calls",
|
|
24
|
+
"type": "tuple[]"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"stateMutability": "nonpayable",
|
|
28
|
+
"type": "constructor"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "target",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "bool",
|
|
13
|
+
"name": "allowFailure",
|
|
14
|
+
"type": "bool"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "bytes",
|
|
18
|
+
"name": "callData",
|
|
19
|
+
"type": "bytes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"internalType": "struct DeploylessMulticall3.Call[]",
|
|
23
|
+
"name": "calls",
|
|
24
|
+
"type": "tuple[]"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"stateMutability": "nonpayable",
|
|
28
|
+
"type": "constructor"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"constant": true,
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"internalType": "address",
|
|
9
|
+
"name": "target",
|
|
10
|
+
"type": "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"internalType": "bytes",
|
|
14
|
+
"name": "callData",
|
|
15
|
+
"type": "bytes"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"internalType": "struct Multicall.Call[]",
|
|
19
|
+
"name": "calls",
|
|
20
|
+
"type": "tuple[]"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"name": "aggregate",
|
|
24
|
+
"outputs": [
|
|
25
|
+
{
|
|
26
|
+
"internalType": "uint256",
|
|
27
|
+
"name": "blockNumber",
|
|
28
|
+
"type": "uint256"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "bytes[]",
|
|
32
|
+
"name": "returnData",
|
|
33
|
+
"type": "bytes[]"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"payable": false,
|
|
37
|
+
"stateMutability": "view",
|
|
38
|
+
"type": "function"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"constant": true,
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "uint256",
|
|
45
|
+
"name": "blockNumber",
|
|
46
|
+
"type": "uint256"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"name": "getBlockHash",
|
|
50
|
+
"outputs": [
|
|
51
|
+
{
|
|
52
|
+
"internalType": "bytes32",
|
|
53
|
+
"name": "blockHash",
|
|
54
|
+
"type": "bytes32"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"payable": false,
|
|
58
|
+
"stateMutability": "view",
|
|
59
|
+
"type": "function"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"constant": true,
|
|
63
|
+
"inputs": [],
|
|
64
|
+
"name": "getCurrentBlockCoinbase",
|
|
65
|
+
"outputs": [
|
|
66
|
+
{
|
|
67
|
+
"internalType": "address",
|
|
68
|
+
"name": "coinbase",
|
|
69
|
+
"type": "address"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"payable": false,
|
|
73
|
+
"stateMutability": "view",
|
|
74
|
+
"type": "function"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"constant": true,
|
|
78
|
+
"inputs": [],
|
|
79
|
+
"name": "getCurrentBlockDifficulty",
|
|
80
|
+
"outputs": [
|
|
81
|
+
{
|
|
82
|
+
"internalType": "uint256",
|
|
83
|
+
"name": "difficulty",
|
|
84
|
+
"type": "uint256"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"payable": false,
|
|
88
|
+
"stateMutability": "view",
|
|
89
|
+
"type": "function"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"constant": true,
|
|
93
|
+
"inputs": [],
|
|
94
|
+
"name": "getCurrentBlockGasLimit",
|
|
95
|
+
"outputs": [
|
|
96
|
+
{
|
|
97
|
+
"internalType": "uint256",
|
|
98
|
+
"name": "gaslimit",
|
|
99
|
+
"type": "uint256"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"payable": false,
|
|
103
|
+
"stateMutability": "view",
|
|
104
|
+
"type": "function"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"constant": true,
|
|
108
|
+
"inputs": [],
|
|
109
|
+
"name": "getCurrentBlockTimestamp",
|
|
110
|
+
"outputs": [
|
|
111
|
+
{
|
|
112
|
+
"internalType": "uint256",
|
|
113
|
+
"name": "timestamp",
|
|
114
|
+
"type": "uint256"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"payable": false,
|
|
118
|
+
"stateMutability": "view",
|
|
119
|
+
"type": "function"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"constant": true,
|
|
123
|
+
"inputs": [
|
|
124
|
+
{
|
|
125
|
+
"internalType": "address",
|
|
126
|
+
"name": "addr",
|
|
127
|
+
"type": "address"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"name": "getEthBalance",
|
|
131
|
+
"outputs": [
|
|
132
|
+
{
|
|
133
|
+
"internalType": "uint256",
|
|
134
|
+
"name": "balance",
|
|
135
|
+
"type": "uint256"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"payable": false,
|
|
139
|
+
"stateMutability": "view",
|
|
140
|
+
"type": "function"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"constant": true,
|
|
144
|
+
"inputs": [],
|
|
145
|
+
"name": "getLastBlockHash",
|
|
146
|
+
"outputs": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "bytes32",
|
|
149
|
+
"name": "blockHash",
|
|
150
|
+
"type": "bytes32"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"payable": false,
|
|
154
|
+
"stateMutability": "view",
|
|
155
|
+
"type": "function"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "target",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "bytes",
|
|
13
|
+
"name": "callData",
|
|
14
|
+
"type": "bytes"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"internalType": "struct Multicall2.Call[]",
|
|
18
|
+
"name": "calls",
|
|
19
|
+
"type": "tuple[]"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"name": "aggregate",
|
|
23
|
+
"outputs": [
|
|
24
|
+
{
|
|
25
|
+
"internalType": "uint256",
|
|
26
|
+
"name": "blockNumber",
|
|
27
|
+
"type": "uint256"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"internalType": "bytes[]",
|
|
31
|
+
"name": "returnData",
|
|
32
|
+
"type": "bytes[]"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"payable": false,
|
|
36
|
+
"stateMutability": "view",
|
|
37
|
+
"type": "function"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"inputs": [
|
|
41
|
+
{
|
|
42
|
+
"components": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "address",
|
|
45
|
+
"name": "target",
|
|
46
|
+
"type": "address"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"internalType": "bytes",
|
|
50
|
+
"name": "callData",
|
|
51
|
+
"type": "bytes"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"internalType": "struct Multicall2.Call[]",
|
|
55
|
+
"name": "calls",
|
|
56
|
+
"type": "tuple[]"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"name": "blockAndAggregate",
|
|
60
|
+
"outputs": [
|
|
61
|
+
{
|
|
62
|
+
"internalType": "uint256",
|
|
63
|
+
"name": "blockNumber",
|
|
64
|
+
"type": "uint256"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"internalType": "bytes32",
|
|
68
|
+
"name": "blockHash",
|
|
69
|
+
"type": "bytes32"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"components": [
|
|
73
|
+
{
|
|
74
|
+
"internalType": "bool",
|
|
75
|
+
"name": "success",
|
|
76
|
+
"type": "bool"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"internalType": "bytes",
|
|
80
|
+
"name": "returnData",
|
|
81
|
+
"type": "bytes"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"internalType": "struct Multicall2.Result[]",
|
|
85
|
+
"name": "returnData",
|
|
86
|
+
"type": "tuple[]"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"stateMutability": "nonpayable",
|
|
90
|
+
"type": "function"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"inputs": [
|
|
94
|
+
{
|
|
95
|
+
"internalType": "uint256",
|
|
96
|
+
"name": "blockNumber",
|
|
97
|
+
"type": "uint256"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"name": "getBlockHash",
|
|
101
|
+
"outputs": [
|
|
102
|
+
{
|
|
103
|
+
"internalType": "bytes32",
|
|
104
|
+
"name": "blockHash",
|
|
105
|
+
"type": "bytes32"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"stateMutability": "view",
|
|
109
|
+
"type": "function"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"inputs": [],
|
|
113
|
+
"name": "getBlockNumber",
|
|
114
|
+
"outputs": [
|
|
115
|
+
{
|
|
116
|
+
"internalType": "uint256",
|
|
117
|
+
"name": "blockNumber",
|
|
118
|
+
"type": "uint256"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"stateMutability": "view",
|
|
122
|
+
"type": "function"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"inputs": [],
|
|
126
|
+
"name": "getCurrentBlockCoinbase",
|
|
127
|
+
"outputs": [
|
|
128
|
+
{
|
|
129
|
+
"internalType": "address",
|
|
130
|
+
"name": "coinbase",
|
|
131
|
+
"type": "address"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"stateMutability": "view",
|
|
135
|
+
"type": "function"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"inputs": [],
|
|
139
|
+
"name": "getCurrentBlockDifficulty",
|
|
140
|
+
"outputs": [
|
|
141
|
+
{
|
|
142
|
+
"internalType": "uint256",
|
|
143
|
+
"name": "difficulty",
|
|
144
|
+
"type": "uint256"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"stateMutability": "view",
|
|
148
|
+
"type": "function"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"inputs": [],
|
|
152
|
+
"name": "getCurrentBlockGasLimit",
|
|
153
|
+
"outputs": [
|
|
154
|
+
{
|
|
155
|
+
"internalType": "uint256",
|
|
156
|
+
"name": "gaslimit",
|
|
157
|
+
"type": "uint256"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"stateMutability": "view",
|
|
161
|
+
"type": "function"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"inputs": [],
|
|
165
|
+
"name": "getCurrentBlockTimestamp",
|
|
166
|
+
"outputs": [
|
|
167
|
+
{
|
|
168
|
+
"internalType": "uint256",
|
|
169
|
+
"name": "timestamp",
|
|
170
|
+
"type": "uint256"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"stateMutability": "view",
|
|
174
|
+
"type": "function"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"inputs": [
|
|
178
|
+
{
|
|
179
|
+
"internalType": "address",
|
|
180
|
+
"name": "addr",
|
|
181
|
+
"type": "address"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"name": "getEthBalance",
|
|
185
|
+
"outputs": [
|
|
186
|
+
{
|
|
187
|
+
"internalType": "uint256",
|
|
188
|
+
"name": "balance",
|
|
189
|
+
"type": "uint256"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"stateMutability": "view",
|
|
193
|
+
"type": "function"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"inputs": [],
|
|
197
|
+
"name": "getLastBlockHash",
|
|
198
|
+
"outputs": [
|
|
199
|
+
{
|
|
200
|
+
"internalType": "bytes32",
|
|
201
|
+
"name": "blockHash",
|
|
202
|
+
"type": "bytes32"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"stateMutability": "view",
|
|
206
|
+
"type": "function"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"inputs": [
|
|
210
|
+
{
|
|
211
|
+
"internalType": "bool",
|
|
212
|
+
"name": "requireSuccess",
|
|
213
|
+
"type": "bool"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"components": [
|
|
217
|
+
{
|
|
218
|
+
"internalType": "address",
|
|
219
|
+
"name": "target",
|
|
220
|
+
"type": "address"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"internalType": "bytes",
|
|
224
|
+
"name": "callData",
|
|
225
|
+
"type": "bytes"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"internalType": "struct Multicall2.Call[]",
|
|
229
|
+
"name": "calls",
|
|
230
|
+
"type": "tuple[]"
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"name": "tryAggregate",
|
|
234
|
+
"outputs": [
|
|
235
|
+
{
|
|
236
|
+
"components": [
|
|
237
|
+
{
|
|
238
|
+
"internalType": "bool",
|
|
239
|
+
"name": "success",
|
|
240
|
+
"type": "bool"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"internalType": "bytes",
|
|
244
|
+
"name": "returnData",
|
|
245
|
+
"type": "bytes"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"internalType": "struct Multicall2.Result[]",
|
|
249
|
+
"name": "returnData",
|
|
250
|
+
"type": "tuple[]"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"payable": false,
|
|
254
|
+
"stateMutability": "view",
|
|
255
|
+
"type": "function"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"inputs": [
|
|
259
|
+
{
|
|
260
|
+
"internalType": "bool",
|
|
261
|
+
"name": "requireSuccess",
|
|
262
|
+
"type": "bool"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"components": [
|
|
266
|
+
{
|
|
267
|
+
"internalType": "address",
|
|
268
|
+
"name": "target",
|
|
269
|
+
"type": "address"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"internalType": "bytes",
|
|
273
|
+
"name": "callData",
|
|
274
|
+
"type": "bytes"
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"internalType": "struct Multicall2.Call[]",
|
|
278
|
+
"name": "calls",
|
|
279
|
+
"type": "tuple[]"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"name": "tryBlockAndAggregate",
|
|
283
|
+
"outputs": [
|
|
284
|
+
{
|
|
285
|
+
"internalType": "uint256",
|
|
286
|
+
"name": "blockNumber",
|
|
287
|
+
"type": "uint256"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"internalType": "bytes32",
|
|
291
|
+
"name": "blockHash",
|
|
292
|
+
"type": "bytes32"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"components": [
|
|
296
|
+
{
|
|
297
|
+
"internalType": "bool",
|
|
298
|
+
"name": "success",
|
|
299
|
+
"type": "bool"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"internalType": "bytes",
|
|
303
|
+
"name": "returnData",
|
|
304
|
+
"type": "bytes"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"internalType": "struct Multicall2.Result[]",
|
|
308
|
+
"name": "returnData",
|
|
309
|
+
"type": "tuple[]"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"stateMutability": "nonpayable",
|
|
313
|
+
"type": "function"
|
|
314
|
+
}
|
|
315
|
+
]
|