@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
626 lines • 418 kB
JSON
{
"contractName": "MultiCall",
"abi": [
{
"constant": false,
"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[]"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"name": "getEthBalance",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getLastBlockHash",
"outputs": [
{
"internalType": "bytes32",
"name": "blockHash",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentBlockTimestamp",
"outputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentBlockDifficulty",
"outputs": [
{
"internalType": "uint256",
"name": "difficulty",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentBlockGasLimit",
"outputs": [
{
"internalType": "uint256",
"name": "gaslimit",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentBlockCoinbase",
"outputs": [
{
"internalType": "address",
"name": "coinbase",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"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[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentBlockCoinbase\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentBlockDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"difficulty\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentBlockGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"gaslimit\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getEthBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getLastBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Michael Elliot <mike@makerdao.com>Joshua Levine <joshua@makerdao.com>Nick Johnson <arachnid@notdot.net>Corey Caplan <corey@dolomite.io>\",\"methods\":{},\"title\":\"MultiCall - Aggregate results from multiple read-only function calls\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/utils/MultiCall.sol\":\"MultiCall\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/utils/MultiCall.sol\":{\"keccak256\":\"0xd952cd7f94600c493753663d213da3b9af033c2f64c675f0c5cdc7a6cab37ed0\",\"urls\":[\"bzz-raw://68048fc4ec3fd6343f89d5e60ffa771f0fc5ffc86dd24c7b462b887e3cf11ce5\",\"dweb:/ipfs/QmakL2JEVqzFLGnqYATNy6yigem7FcPPKj4orEx4847wM3\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610bed806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d146100e757806386d516e8146100ef578063a8b0574e146100f7578063ee82ac5e1461010c57610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100cc5780634d2301cc146100d4575b600080fd5b61009561011f565b6040516100a29190610a1a565b60405180910390f35b6100be6100b9366004610757565b610123565b6040516100a2929190610a39565b61009561031e565b6100956100e2366004610731565b610345565b61009561035f565b610095610363565b6100ff610367565b6040516100a29190610a0c565b61009561011a3660046107c1565b61036b565b4290565b60006060439150825160405190808252806020026020018201604052801561015f57816020015b606081526020019060019003908161014a5790505b50905060005b8351811015610318576000606085838151811061017e57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106101ac57fe5b6020026020010151602001516040516101c591906109b0565b6000604051808303816000865af19150503d8060008114610202576040519150601f19603f3d011682016040523d82523d6000602084013e610207565b606091505b5091509150816102f6576044815110156102b757606061023d87858151811061022c57fe5b60200260200101516000015161036f565b90508060405160200161025091906109ea565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526102ae91600401610a28565b60405180910390fd5b60048101905060606102ce87858151811061022c57fe5b905080828060200190516102e5919081019061078c565b6040516020016102509291906109bc565b8084848151811061030357fe5b60209081029190910101525050600101610165565b50915091565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43014090565b73ffffffffffffffffffffffffffffffffffffffff163190565b4490565b4590565b4190565b4090565b604080518082018252601081527f303132333435363738396162636465660000000000000000000000000000000060208201528151602a808252606082810190945273ffffffffffffffffffffffffffffffffffffffff8516929184916020820181803883390190505090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061040957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061046657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156105ac578260048583600c01602081106104b357fe5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff16815181106104eb57fe5b602001015160f81c60f81b82826002026002018151811061050857fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350828482600c016020811061054757fe5b825191901a600f1690811061055857fe5b602001015160f81c60f81b82826002026003018151811061057557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101610498565b50949350505050565b80356105c081610b8a565b92915050565b600082601f8301126105d757600080fd5b81356105ea6105e582610a80565b610a59565b81815260209384019390925082018360005b83811015610628578135860161061288826106c7565b84525060209283019291909101906001016105fc565b5050505092915050565b600082601f83011261064357600080fd5b81356106516105e582610aa1565b9150808252602083016020830185838301111561066d57600080fd5b610678838284610b26565b50505092915050565b600082601f83011261069257600080fd5b81516106a06105e582610aa1565b915080825260208301602083018583830111156106bc57600080fd5b610678838284610b32565b6000604082840312156106d957600080fd5b6106e36040610a59565b905060006106f184846105b5565b825250602082013567ffffffffffffffff81111561070e57600080fd5b61071a84828501610632565b60208301525092915050565b80356105c081610ba1565b60006020828403121561074357600080fd5b600061074f84846105b5565b949350505050565b60006020828403121561076957600080fd5b813567ffffffffffffffff81111561078057600080fd5b61074f848285016105c6565b60006020828403121561079e57600080fd5b815167ffffffffffffffff8111156107b557600080fd5b61074f84828501610681565b6000602082840312156107d357600080fd5b600061074f8484610726565b60006107eb8383610878565b9392505050565b6107fb81610aff565b82525050565b600061080c82610aed565b6108168185610af1565b93508360208202850161082885610ae7565b8060005b85811015610862578484038952815161084585826107df565b945061085083610ae7565b60209a909a019992505060010161082c565b5091979650505050505050565b6107fb81610b0a565b600061088382610aed565b61088d8185610af1565b935061089d818560208601610b32565b6108a681610b62565b9093019392505050565b60006108bb82610aed565b6108c58185610afa565b93506108d5818560208601610b32565b9290920192915050565b60006108ec602183610afa565b7f4d756c746963616c6c3a3a6167677265676174653a207265766572742061742081527f3c00000000000000000000000000000000000000000000000000000000000000602082015260210192915050565b600061094b600f83610afa565b7f3e207769746820726561736f6e3a2000000000000000000000000000000000008152600f0192915050565b6000610984600183610afa565b7f3e00000000000000000000000000000000000000000000000000000000000000815260010192915050565b60006107eb82846108b0565b60006109c7826108df565b91506109d382856108b0565b91506109de8261093e565b915061074f82846108b0565b60006109f5826108df565b9150610a0182846108b0565b91506107eb82610977565b602081016105c082846107f2565b602081016105c0828461086f565b602080825281016107eb8184610878565b60408101610a47828561086f565b818103602083015261074f8184610801565b60405181810167ffffffffffffffff81118282101715610a7857600080fd5b604052919050565b600067ffffffffffffffff821115610a9757600080fd5b5060209081020190565b600067ffffffffffffffff821115610ab857600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b90815260200190565b919050565b60006105c082610b0d565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b82818337506000910152565b60005b83811015610b4d578181015183820152602001610b35565b83811115610b5c576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610b9381610aff565b8114610b9e57600080fd5b50565b610b9381610b0a56fea365627a7a7231582044166a188ae1f74ea63b326a104e838a77bf6002b99957865444e3340bce799d6c6578706572696d656e74616cf564736f6c63430005100040",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c806372425d9d1161005b57806372425d9d146100e757806386d516e8146100ef578063a8b0574e146100f7578063ee82ac5e1461010c57610088565b80630f28c97d1461008d578063252dba42146100ab57806327e86d6e146100cc5780634d2301cc146100d4575b600080fd5b61009561011f565b6040516100a29190610a1a565b60405180910390f35b6100be6100b9366004610757565b610123565b6040516100a2929190610a39565b61009561031e565b6100956100e2366004610731565b610345565b61009561035f565b610095610363565b6100ff610367565b6040516100a29190610a0c565b61009561011a3660046107c1565b61036b565b4290565b60006060439150825160405190808252806020026020018201604052801561015f57816020015b606081526020019060019003908161014a5790505b50905060005b8351811015610318576000606085838151811061017e57fe5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff168684815181106101ac57fe5b6020026020010151602001516040516101c591906109b0565b6000604051808303816000865af19150503d8060008114610202576040519150601f19603f3d011682016040523d82523d6000602084013e610207565b606091505b5091509150816102f6576044815110156102b757606061023d87858151811061022c57fe5b60200260200101516000015161036f565b90508060405160200161025091906109ea565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526102ae91600401610a28565b60405180910390fd5b60048101905060606102ce87858151811061022c57fe5b905080828060200190516102e5919081019061078c565b6040516020016102509291906109bc565b8084848151811061030357fe5b60209081029190910101525050600101610165565b50915091565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43014090565b73ffffffffffffffffffffffffffffffffffffffff163190565b4490565b4590565b4190565b4090565b604080518082018252601081527f303132333435363738396162636465660000000000000000000000000000000060208201528151602a808252606082810190945273ffffffffffffffffffffffffffffffffffffffff8516929184916020820181803883390190505090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061040957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061046657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156105ac578260048583600c01602081106104b357fe5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff16815181106104eb57fe5b602001015160f81c60f81b82826002026002018151811061050857fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350828482600c016020811061054757fe5b825191901a600f1690811061055857fe5b602001015160f81c60f81b82826002026003018151811061057557fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101610498565b50949350505050565b80356105c081610b8a565b92915050565b600082601f8301126105d757600080fd5b81356105ea6105e582610a80565b610a59565b81815260209384019390925082018360005b83811015610628578135860161061288826106c7565b84525060209283019291909101906001016105fc565b5050505092915050565b600082601f83011261064357600080fd5b81356106516105e582610aa1565b9150808252602083016020830185838301111561066d57600080fd5b610678838284610b26565b50505092915050565b600082601f83011261069257600080fd5b81516106a06105e582610aa1565b915080825260208301602083018583830111156106bc57600080fd5b610678838284610b32565b6000604082840312156106d957600080fd5b6106e36040610a59565b905060006106f184846105b5565b825250602082013567ffffffffffffffff81111561070e57600080fd5b61071a84828501610632565b60208301525092915050565b80356105c081610ba1565b60006020828403121561074357600080fd5b600061074f84846105b5565b949350505050565b60006020828403121561076957600080fd5b813567ffffffffffffffff81111561078057600080fd5b61074f848285016105c6565b60006020828403121561079e57600080fd5b815167ffffffffffffffff8111156107b557600080fd5b61074f84828501610681565b6000602082840312156107d357600080fd5b600061074f8484610726565b60006107eb8383610878565b9392505050565b6107fb81610aff565b82525050565b600061080c82610aed565b6108168185610af1565b93508360208202850161082885610ae7565b8060005b85811015610862578484038952815161084585826107df565b945061085083610ae7565b60209a909a019992505060010161082c565b5091979650505050505050565b6107fb81610b0a565b600061088382610aed565b61088d8185610af1565b935061089d818560208601610b32565b6108a681610b62565b9093019392505050565b60006108bb82610aed565b6108c58185610afa565b93506108d5818560208601610b32565b9290920192915050565b60006108ec602183610afa565b7f4d756c746963616c6c3a3a6167677265676174653a207265766572742061742081527f3c00000000000000000000000000000000000000000000000000000000000000602082015260210192915050565b600061094b600f83610afa565b7f3e207769746820726561736f6e3a2000000000000000000000000000000000008152600f0192915050565b6000610984600183610afa565b7f3e00000000000000000000000000000000000000000000000000000000000000815260010192915050565b60006107eb82846108b0565b60006109c7826108df565b91506109d382856108b0565b91506109de8261093e565b915061074f82846108b0565b60006109f5826108df565b9150610a0182846108b0565b91506107eb82610977565b602081016105c082846107f2565b602081016105c0828461086f565b602080825281016107eb8184610878565b60408101610a47828561086f565b818103602083015261074f8184610801565b60405181810167ffffffffffffffff81118282101715610a7857600080fd5b604052919050565b600067ffffffffffffffff821115610a9757600080fd5b5060209081020190565b600067ffffffffffffffff821115610ab857600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60200190565b5190565b90815260200190565b919050565b60006105c082610b0d565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b82818337506000910152565b60005b83811015610b4d578181015183820152602001610b35565b83811115610b5c576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610b9381610aff565b8114610b9e57600080fd5b50565b610b9381610b0a56fea365627a7a7231582044166a188ae1f74ea63b326a104e838a77bf6002b99957865444e3340bce799d6c6578706572696d656e74616cf564736f6c63430005100040",
"sourceMap": "365:2969:61:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;365:2969:61;;;;;;;",
"deployedSourceMap": "365:2969:61:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;365:2969:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2331:120;;;:::i;:::-;;;;;;;;;;;;;;;;464:1447;;;;;;;;;:::i;:::-;;;;;;;;;2201:124;;;:::i;1941:114::-;;;;;;;;;:::i;2457:124::-;;;:::i;2587:116::-;;;:::i;2709:::-;;;:::i;:::-;;;;;;;;2061:134;;;;;;;;;:::i;2331:120::-;2429:15;;2331:120::o;464:1447::-;520:19;541:25;592:12;578:26;;639:5;:12;627:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;614:38;;667:9;662:1243;682:5;:12;678:1;:16;662:1243;;;784:12;798:19;821:5;827:1;821:8;;;;;;;;;;;;;;:15;;;:20;;842:5;848:1;842:8;;;;;;;;;;;;;;:17;;;821:39;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;783:77:61;;;;879:7;874:985;;926:2;910:6;:13;:18;906:939;;;952:26;981:33;998:5;1004:1;998:8;;;;;;;;;;;;;;:15;;;981:16;:33::i;:::-;952:62;;1104:12;1050:72;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;1050:72:61;;;;1036:88;;;;;;;;;;;;;;;;;906:939;1304:4;1296:6;1292:17;1282:27;;1352:26;1381:33;1398:5;1404:1;1398:8;;;;;;;1381:33;1352:62;;1623:12;1731:6;1720:28;;;;;;;;;;;;;;1504:274;;;;;;;;;;906:939;1888:6;1872:10;1883:1;1872:13;;;;;;;;;;;;;;;;;:22;-1:-1:-1;;696:3:61;;662:1243;;;;464:1447;;;:::o;2201:124::-;2301:16;:12;:16;2291:27;;2201:124::o;1941:114::-;2036:12;;;;1941:114::o;2457:124::-;2558:16;;2457:124::o;2587:116::-;2682:14;;2587:116::o;2709:::-;2804:14;;2709:116::o;2061:134::-;2166:22;;2061:134::o;2831:501::-;2975:37;;;;;;;;;;;;;;;;3045:13;;3055:2;3045:13;;;2897;3045;;;;;;2947:17;;;;2975:37;2897:13;;3045;;;21:6:-1;;104:10;3045:13:61;87:34:-1;135:17;;-1:-1;3045:13:61;3022:36;;3068:16;:7;3076:1;3068:10;;;;;;;;;;;:16;;;;;;;;;;;3094;:7;3102:1;3094:10;;;;;;;;;;;:16;;;;;;;;;;;3125:9;3120:174;3140:2;3136:1;:6;3120:174;;;3184:3;3212:1;3194:6;3201:1;3205:2;3201:6;3194:14;;;;;;;;;;:19;;;;;3188:26;;3184:31;;;;;;;;;;;;;;;;;;3163:7;3175:1;3179;3175:5;3171:1;:9;3163:18;;;;;;;;;;;:52;;;;;;;;;;;3250:3;3260:6;3267:1;3271:2;3267:6;3260:14;;;;;;;3250:33;;3260:14;;;3277:4;3254:28;;3250:33;;;;;;;;;;;;;;3229:7;3241:1;3245;3241:5;3237:1;:9;3229:18;;;;;;;;;;;:54;;;;;;;;;;-1:-1:-1;3144:3:61;;3120:174;;;-1:-1:-1;3317:7:61;2831:501;-1:-1:-1;;;;2831:501:61:o;5:130:-1:-;72:20;;97:33;72:20;97:33;;;57:78;;;;;174:735;;310:3;303:4;295:6;291:17;287:27;277:2;;328:1;325;318:12;277:2;365:6;352:20;387:99;402:83;478:6;402:83;;;387:99;;;514:21;;;558:4;546:17;;;;378:108;;-1:-1;571:14;;546:17;666:1;651:252;676:6;673:1;670:13;651:252;;;759:3;746:17;738:6;734:30;783:56;835:3;823:10;783:56;;;771:69;;-1:-1;863:4;854:14;;;;882;;;;;698:1;691:9;651:252;;;655:14;270:639;;;;;;;;918:432;;1015:3;1008:4;1000:6;996:17;992:27;982:2;;1033:1;1030;1023:12;982:2;1070:6;1057:20;1092:60;1107:44;1144:6;1107:44;;1092:60;1083:69;;1172:6;1165:5;1158:21;1208:4;1200:6;1196:17;1241:4;1234:5;1230:16;1276:3;1267:6;1262:3;1258:16;1255:25;1252:2;;;1293:1;1290;1283:12;1252:2;1303:41;1337:6;1332:3;1327;1303:41;;;975:375;;;;;;;;1359:436;;1468:3;1461:4;1453:6;1449:17;1445:27;1435:2;;1486:1;1483;1476:12;1435:2;1516:6;1510:13;1538:61;1553:45;1591:6;1553:45;;1538:61;1529:70;;1619:6;1612:5;1605:21;1655:4;1647:6;1643:17;1688:4;1681:5;1677:16;1723:3;1714:6;1709:3;1705:16;1702:25;1699:2;;;1740:1;1737;1730:12;1699:2;1750:39;1782:6;1777:3;1772;1750:39;;1831:558;;1939:4;1927:9;1922:3;1918:19;1914:30;1911:2;;;1957:1;1954;1947:12;1911:2;1975:20;1990:4;1975:20;;;1966:29;-1:-1;2047:1;2079:49;2124:3;2104:9;2079:49;;;2054:75;;-1:-1;2222:2;2207:18;;2194:32;2246:18;2235:30;;2232:2;;;2278:1;2275;2268:12;2232:2;2313:54;2363:3;2354:6;2343:9;2339:22;2313:54;;;2306:4;2299:5;2295:16;2288:80;2150:229;1905:484;;;;;2396:130;2463:20;;2488:33;2463:20;2488:33;;2533:241;;2637:2;2625:9;2616:7;2612:23;2608:32;2605:2;;;2653:1;2650;2643:12;2605:2;2688:1;2705:53;2750:7;2730:9;2705:53;;;2695:63;2599:175;-1:-1;;;;2599:175;2781:415;;2929:2;2917:9;2908:7;2904:23;2900:32;2897:2;;;2945:1;2942;2935:12;2897:2;2980:31;;3031:18;3020:30;;3017:2;;;3063:1;3060;3053:12;3017:2;3083:97;3172:7;3163:6;3152:9;3148:22;3083:97;;3203:354;;3324:2;3312:9;3303:7;3299:23;3295:32;3292:2;;;3340:1;3337;3330:12;3292:2;3375:24;;3419:18;3408:30;;3405:2;;;3451:1;3448;3441:12;3405:2;3471:70;3533:7;3524:6;3513:9;3509:22;3471:70;;3564:241;;3668:2;3656:9;3647:7;3643:23;3639:32;3636:2;;;3684:1;3681;3674:12;3636:2;3719:1;3736:53;3781:7;3761:9;3736:53;;3813:177;;3924:60;3980:3;3972:6;3924:60;;;3910:74;3903:87;-1:-1;;;3903:87;3998:113;4081:24;4099:5;4081:24;;;4076:3;4069:37;4063:48;;;4145:888;;4300:59;4353:5;4300:59;;;4372:91;4456:6;4451:3;4372:91;;;4365:98;;4486:3;4528:4;4520:6;4516:17;4511:3;4507:27;4555:61;4610:5;4555:61;;;4636:7;4664:1;4649:345;4674:6;4671:1;4668:13;4649:345;;;4736:9;4730:4;4726:20;4721:3;4714:33;4781:6;4775:13;4803:74;4872:4;4857:13;4803:74;;;4795:82;;4894:65;4952:6;4894:65;;;4982:4;4973:14;;;;;4884:75;-1:-1;;4696:1;4689:9;4649:345;;;-1:-1;5007:4;;4279:754;-1:-1;;;;;;;4279:754;5041:113;5124:24;5142:5;5124:24;;5161:315;;5257:34;5285:5;5257:34;;;5303:60;5356:6;5351:3;5303:60;;;5296:67;;5368:52;5413:6;5408:3;5401:4;5394:5;5390:16;5368:52;;;5441:29;5463:6;5441:29;;;5432:39;;;;5237:239;-1:-1;;;5237:239;5483:348;;5607:34;5635:5;5607:34;;;5653:88;5734:6;5729:3;5653:88;;;5646:95;;5746:52;5791:6;5786:3;5779:4;5772:5;5768:16;5746:52;;;5810:16;;;;;5587:244;-1:-1;;5587:244;6919:406;;7097:85;7179:2;7174:3;7097:85;;;7215:34;7195:55;;7284:3;7279:2;7270:12;;7263:25;7316:2;7307:12;;7083:242;-1:-1;;7083:242;7334:351;;7512:85;7594:2;7589:3;7512:85;;;7630:17;7610:38;;7676:2;7667:12;;7498:187;-1:-1;;7498:187;7694:335;;7872:84;7954:1;7949:3;7872:84;;;7989:3;7969:24;;8021:1;8012:11;;7858:171;-1:-1;;7858:171;8157:254;;8297:89;8382:3;8373:6;8297:89;;8418:953;;8810:148;8954:3;8810:148;;;8803:155;;8976:95;9067:3;9058:6;8976:95;;;8969:102;;9089:148;9233:3;9089:148;;;9082:155;;9255:91;9342:3;9333:6;9255:91;;9378:800;;9726:148;9870:3;9726:148;;;9719:155;;9892:95;9983:3;9974:6;9892:95;;;9885:102;;10005:148;10149:3;10005:148;;10185:213;10303:2;10288:18;;10317:71;10292:9;10361:6;10317:71;;10405:213;10523:2;10508:18;;10537:71;10512:9;10581:6;10537:71;;10625:301;10763:2;10777:47;;;10748:18;;10838:78;10748:18;10902:6;10838:78;;11153:492;11359:2;11344:18;;11373:71;11348:9;11417:6;11373:71;;;11492:9;11486:4;11482:20;11477:2;11466:9;11462:18;11455:48;11517:118;11630:4;11621:6;11517:118;;11652:256;11714:2;11708:9;11740:17;;;11815:18;11800:34;;11836:22;;;11797:62;11794:2;;;11872:1;11869;11862:12;11794:2;11888;11881:22;11692:216;;-1:-1;11692:216;11915:323;;12093:18;12085:6;12082:30;12079:2;;;12125:1;12122;12115:12;12079:2;-1:-1;12160:4;12148:17;;;12213:15;;12016:222;12245:317;;12384:18;12376:6;12373:30;12370:2;;;12416:1;12413;12406:12;12370:2;-1:-1;12547:4;12483;12460:17;;;;12479:9;12456:33;12537:15;;12307:255;12894:156;13023:4;13014:14;;12971:79;13057:142;13165:12;;13136:63;13705:183;13828:19;;;13877:4;13868:14;;13821:67;14058:144;14193:3;14171:31;-1:-1;14171:31;14536:91;;14598:24;14616:5;14598:24;;14634:72;14696:5;14679:27;14713:121;14786:42;14775:54;;14758:76;14921:145;15002:6;14997:3;14992;14979:30;-1:-1;15058:1;15040:16;;15033:27;14972:94;15075:268;15140:1;15147:101;15161:6;15158:1;15155:13;15147:101;;;15228:11;;;15222:18;15209:11;;;15202:39;15183:2;15176:10;15147:101;;;15263:6;15260:1;15257:13;15254:2;;;15328:1;15319:6;15314:3;15310:16;15303:27;15254:2;15124:219;;;;;15351:97;15439:2;15419:14;15435:7;15415:28;;15399:49;15456:117;15525:24;15543:5;15525:24;;;15518:5;15515:35;15505:2;;15564:1;15561;15554:12;15505:2;15499:74;;15580:117;15649:24;15667:5;15649:24;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\npragma experimental ABIEncoderV2;\n\n\n\n/**\n * @title MultiCall - Aggregate results from multiple read-only function calls\n * @author Michael Elliot <mike@makerdao.com>\n * @author Joshua Levine <joshua@makerdao.com>\n * @author Nick Johnson <arachnid@notdot.net>\n * @author Corey Caplan <corey@dolomite.io>\n */\ncontract MultiCall {\n\n struct Call {\n address target;\n bytes callData;\n }\n\n function aggregate(Call[] memory calls) public returns (uint256 blockNumber, bytes[] memory returnData) {\n blockNumber = block.number;\n returnData = new bytes[](calls.length);\n for (uint256 i; i < calls.length; ++i) {\n // solium-disable-next-line security/no-low-level-calls\n (bool success, bytes memory result) = calls[i].target.call(calls[i].callData);\n if (!success) {\n if (result.length < 68) {\n string memory targetString = _addressToString(calls[i].target);\n revert(string(abi.encodePacked(\"Multicall::aggregate: revert at <\", targetString, \">\")));\n } else {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n result := add(result, 0x04)\n }\n string memory targetString = _addressToString(calls[i].target);\n revert(\n string(\n abi.encodePacked(\n \"Multicall::aggregate: revert at <\",\n targetString,\n \"> with reason: \",\n abi.decode(result, (string))\n )\n )\n );\n }\n }\n returnData[i] = result;\n }\n }\n\n // Helper functions\n function getEthBalance(address addr) public view returns (uint256 balance) {\n balance = addr.balance;\n }\n\n function getBlockHash(uint256 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 (uint256 timestamp) {\n timestamp = block.timestamp;\n }\n\n function getCurrentBlockDifficulty() public view returns (uint256 difficulty) {\n difficulty = block.difficulty;\n }\n\n function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) {\n gaslimit = block.gaslimit;\n }\n\n function getCurrentBlockCoinbase() public view returns (address coinbase) {\n coinbase = block.coinbase;\n }\n\n function _addressToString(address _address) internal pure returns(string memory) {\n bytes32 _bytes = bytes32(uint256(_address));\n bytes memory HEX = \"0123456789abcdef\";\n bytes memory _string = new bytes(42);\n _string[0] = \"0\";\n _string[1] = \"x\";\n for (uint256 i; i < 20; ++i) {\n _string[2 + i * 2] = HEX[uint8(_bytes[i + 12] >> 4)];\n _string[3 + i * 2] = HEX[uint8(_bytes[i + 12] & 0x0f)];\n }\n return string(_string);\n }\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/utils/MultiCall.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/utils/MultiCall.sol",
"exportedSymbols": {
"MultiCall": [
16628
]
},
"id": 16629,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 16324,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:24:61"
},
{
"id": 16325,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "58:33:61"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title MultiCall - Aggregate results from multiple read-only function calls\n@author Michael Elliot <mike@makerdao.com>\n@author Joshua Levine <joshua@makerdao.com>\n@author Nick Johnson <arachnid@notdot.net>\n@author Corey Caplan <corey@dolomite.io>",
"fullyImplemented": true,
"id": 16628,
"linearizedBaseContracts": [
16628
],
"name": "MultiCall",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "MultiCall.Call",
"id": 16330,
"members": [
{
"constant": false,
"id": 16327,
"name": "target",
"nodeType": "VariableDeclaration",
"scope": 16330,
"src": "413:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 16326,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "413:7:61",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16329,
"name": "callData",
"nodeType": "VariableDeclaration",
"scope": 16330,
"src": "437:14:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 16328,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "437:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Call",
"nodeType": "StructDefinition",
"scope": 16628,
"src": "391:67:61",
"visibility": "public"
},
{
"body": {
"id": 16446,
"nodeType": "Block",
"src": "568:1343:61",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 16344,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16341,
"name": "blockNumber",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16336,
"src": "578:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16342,
"name": "block",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38097,
"src": "592:5:61",
"typeDescriptions": {
"typeIdentifier": "t_magic_block",
"typeString": "block"
}
},
"id": 16343,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "number",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "592:12:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "578:26:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 16345,
"nodeType": "ExpressionStatement",
"src": "578:26:61"
},
{
"expression": {
"argumentTypes": null,
"id": 16353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 16346,
"name": "returnData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16339,
"src": "614:10:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_memory_$dyn_memory_ptr",
"typeString": "bytes memory[] memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16350,
"name": "calls",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16333,
"src": "639:5:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Call_$16330_memory_$dyn_memory_ptr",
"typeString": "struct MultiCall.Call memory[] memory"
}
},
"id": 16351,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "639:12:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 16349,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "627:11:61",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_bytes_memory_$dyn_memory_$",
"typeString": "function (uint256) pure returns (bytes memory[] memory)"
},
"typeName": {
"baseType": {
"id": 16347,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "631:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"id": 16348,
"length": null,
"nodeType": "ArrayTypeName",
"src": "631:7:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_storage_$dyn_storage_ptr",
"typeString": "bytes[]"
}
}
},
"id": 16352,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "627:25:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_memory_$dyn_memory",
"typeString": "bytes memory[] memory"
}
},
"src": "614:38:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes_memory_$dyn_memory_ptr",
"typeString": "bytes memory[] memory"
}
},
"id": 16354,
"nodeType": "ExpressionStatement",
"src": "614:38:61"
},
{
"body": {
"id": 16444,
"nodeType": "Block",
"src": "701:1204:61",
"statements": [
{
"assignments": [
16366,
16368
],
"declarations": [
{
"constant": false,
"id": 16366,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 16444,
"src": "784:12:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 16365,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "784:4:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16368,
"name": "result",
"nodeType": "VariableDeclaration",
"scope": 16444,
"src": "798:19:61",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 16367,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "798:5:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 16379,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16374,
"name": "calls",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16333,
"src": "842:5:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Call_$16330_memory_$dyn_memory_ptr",
"typeString": "struct MultiCall.Call memory[] memory"
}
},
"id": 16376,
"indexExpression": {
"argumentTypes": null,
"id": 16375,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16356,
"src": "848:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "842:8:61",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Call_$16330_memory",
"typeString": "struct MultiCall.Call memory"
}
},
"id": 16377,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "callData",
"nodeType": "MemberAccess",
"referencedDeclaration": 16329,
"src": "842:17:61",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 16369,
"name": "calls",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16333,
"src": "821:5:61",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Call_$16330_memory_$dyn_memory_ptr",
"typeString": "struct MultiCall.Call memory[] memory"
}
},
"id": 16371,
"indexExpression": {
"argumentTypes": null,
"id": 16370,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 16356,
"src": "827:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLVa