-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMulticall.json
181 lines (181 loc) · 13.9 KB
/
Multicall.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
"address": "0xcb0Cb9DBe285e8234BAaFeE24CD27A9E4be42D91",
"abi": [
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
}
],
"internalType": "struct Multicall.Call[]",
"name": "calls",
"type": "tuple[]"
}
],
"name": "aggregate",
"outputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "bytes[]",
"name": "returnData",
"type": "bytes[]"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockCoinbase",
"outputs": [
{
"internalType": "address",
"name": "coinbase",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockDifficulty",
"outputs": [
{
"internalType": "uint256",
"name": "difficulty",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockGasLimit",
"outputs": [
{
"internalType": "uint256",
"name": "gaslimit",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCurrentBlockTimestamp",
"outputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"name": "getEthBalance",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLastBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xe2e4050c9d2779550d2658db569db57cecc1405f6bce8d4b29d8e5910dbcc381",
"receipt": {
"to": null,
"from": "0x595b85b4A418e3B8df897D02F5BD49167D00862F",
"contractAddress": "0xcb0Cb9DBe285e8234BAaFeE24CD27A9E4be42D91",
"transactionIndex": 0,
"gasUsed": "342994",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x7b9a5ba8959f306a6850b3e4d8f66924f3371fa35b77ccf6fa6b0501bdf51115",
"transactionHash": "0xe2e4050c9d2779550d2658db569db57cecc1405f6bce8d4b29d8e5910dbcc381",
"logs": [],
"blockNumber": 8091139,
"cumulativeGasUsed": "342994",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "1d9629ab24906d36ae52db8a3432376a",
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct Multicall.Call[]\",\"name\":\"calls\",\"type\":\"tuple[]\"}],\"name\":\"aggregate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"returnData\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockCoinbase\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gaslimit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getEthBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/base/Multicall.sol\":\"Multicall\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":20},\"remappings\":[]},\"sources\":{\"contracts/base/Multicall.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity >=0.5.0;\\npragma experimental ABIEncoderV2;\\n\\ncontract Multicall {\\n struct Call {\\n address target;\\n bytes callData;\\n }\\n\\n function aggregate(Call[] memory calls) public returns (uint blockNumber, bytes[] memory returnData) {\\n blockNumber = block.number;\\n returnData = new bytes[](calls.length);\\n for (uint i = 0; i < calls.length; i++) {\\n (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData);\\n require(success);\\n returnData[i] = ret;\\n }\\n }\\n\\n // Helper functions\\n function getEthBalance(address addr) public view returns (uint balance) {\\n balance = addr.balance;\\n }\\n\\n function getBlockHash(uint blockNumber) public view returns (bytes32 blockHash) {\\n blockHash = blockhash(blockNumber);\\n }\\n\\n function getLastBlockHash() public view returns (bytes32 blockHash) {\\n blockHash = blockhash(block.number - 1);\\n }\\n\\n function getCurrentBlockTimestamp() public view returns (uint timestamp) {\\n timestamp = block.timestamp;\\n }\\n\\n function getCurrentBlockDifficulty() public view returns (uint difficulty) {\\n difficulty = block.difficulty;\\n }\\n\\n function getCurrentBlockGasLimit() public view returns (uint gaslimit) {\\n gaslimit = block.gaslimit;\\n }\\n\\n function getCurrentBlockCoinbase() public view returns (address coinbase) {\\n coinbase = block.coinbase;\\n }\\n}\\n\",\"keccak256\":\"0x896f77061830cfb146bc1cf8864fd5a5fa4ff31b23059ed12d0c87594ed130e1\",\"license\":\"GPL-3.0-or-later\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061053e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100785760003560e01c80630f28c97d1461007d578063252dba421461009b57806327e86d6e146100bc5780634d2301cc146100c457806372425d9d146100d757806386d516e8146100df578063a8b0574e146100e7578063ee82ac5e146100fc575b600080fd5b61008561010f565b6040516100929190610429565b60405180910390f35b6100ae6100a9366004610347565b610113565b604051610092929190610432565b610085610235565b6100856100d2366004610325565b61023e565b61008561024b565b61008561024f565b6100ef610253565b6040516100929190610415565b61008561010a3660046103e1565b610257565b4290565b805143906060906001600160401b038111801561012f57600080fd5b5060405190808252806020026020018201604052801561016357816020015b606081526020019060019003908161014e5790505b50905060005b835181101561022f576000606085838151811061018257fe5b6020026020010151600001516001600160a01b03168684815181106101a357fe5b6020026020010151602001516040516101bc91906103f9565b6000604051808303816000865af19150503d80600081146101f9576040519150601f19603f3d011682016040523d82523d6000602084013e6101fe565b606091505b50915091508161020d57600080fd5b8084848151811061021a57fe5b60209081029190910101525050600101610169565b50915091565b60001943014090565b6001600160a01b03163190565b4490565b4590565b4190565b4090565b80356001600160a01b038116811461027257600080fd5b92915050565b600060408284031215610289578081fd5b61029360406104b2565b905061029f838361025b565b81526020808301356001600160401b03808211156102bc57600080fd5b818501915085601f8301126102d057600080fd5b8135818111156102df57600080fd5b6102f1601f8201601f191685016104b2565b9150808252868482850101111561030757600080fd5b80848401858401376000908201840152918301919091525092915050565b600060208284031215610336578081fd5b610340838361025b565b9392505050565b60006020808385031215610359578182fd5b82356001600160401b038082111561036f578384fd5b818501915085601f830112610382578384fd5b813581811115610390578485fd5b61039d84858302016104b2565b8181528481019250838501865b838110156103d3576103c18a888435890101610278565b855293860193908601906001016103aa565b509098975050505050505050565b6000602082840312156103f2578081fd5b5035919050565b6000825161040b8184602087016104d8565b9190910192915050565b6001600160a01b0391909116815260200190565b90815260200190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b828110156104a457878603605f190184528151805180885261048581888a018985016104d8565b601f01601f19169690960185019550928401929084019060010161045e565b509398975050505050505050565b6040518181016001600160401b03811182821017156104d057600080fd5b604052919050565b60005b838110156104f35781810151838201526020016104db565b83811115610502576000848401525b5050505056fea264697066735822122049f9e542511bec666a0b7a29bc48f859a50de38576575520bac77729946f783364736f6c634300060c0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100785760003560e01c80630f28c97d1461007d578063252dba421461009b57806327e86d6e146100bc5780634d2301cc146100c457806372425d9d146100d757806386d516e8146100df578063a8b0574e146100e7578063ee82ac5e146100fc575b600080fd5b61008561010f565b6040516100929190610429565b60405180910390f35b6100ae6100a9366004610347565b610113565b604051610092929190610432565b610085610235565b6100856100d2366004610325565b61023e565b61008561024b565b61008561024f565b6100ef610253565b6040516100929190610415565b61008561010a3660046103e1565b610257565b4290565b805143906060906001600160401b038111801561012f57600080fd5b5060405190808252806020026020018201604052801561016357816020015b606081526020019060019003908161014e5790505b50905060005b835181101561022f576000606085838151811061018257fe5b6020026020010151600001516001600160a01b03168684815181106101a357fe5b6020026020010151602001516040516101bc91906103f9565b6000604051808303816000865af19150503d80600081146101f9576040519150601f19603f3d011682016040523d82523d6000602084013e6101fe565b606091505b50915091508161020d57600080fd5b8084848151811061021a57fe5b60209081029190910101525050600101610169565b50915091565b60001943014090565b6001600160a01b03163190565b4490565b4590565b4190565b4090565b80356001600160a01b038116811461027257600080fd5b92915050565b600060408284031215610289578081fd5b61029360406104b2565b905061029f838361025b565b81526020808301356001600160401b03808211156102bc57600080fd5b818501915085601f8301126102d057600080fd5b8135818111156102df57600080fd5b6102f1601f8201601f191685016104b2565b9150808252868482850101111561030757600080fd5b80848401858401376000908201840152918301919091525092915050565b600060208284031215610336578081fd5b610340838361025b565b9392505050565b60006020808385031215610359578182fd5b82356001600160401b038082111561036f578384fd5b818501915085601f830112610382578384fd5b813581811115610390578485fd5b61039d84858302016104b2565b8181528481019250838501865b838110156103d3576103c18a888435890101610278565b855293860193908601906001016103aa565b509098975050505050505050565b6000602082840312156103f2578081fd5b5035919050565b6000825161040b8184602087016104d8565b9190910192915050565b6001600160a01b0391909116815260200190565b90815260200190565b600060408201848352602060408185015281855180845260608601915060608382028701019350828701855b828110156104a457878603605f190184528151805180885261048581888a018985016104d8565b601f01601f19169690960185019550928401929084019060010161045e565b509398975050505050505050565b6040518181016001600160401b03811182821017156104d057600080fd5b604052919050565b60005b838110156104f35781810151838201526020016104db565b83811115610502576000848401525b5050505056fea264697066735822122049f9e542511bec666a0b7a29bc48f859a50de38576575520bac77729946f783364736f6c634300060c0033",
"libraries": {},
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}