@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
918 lines (917 loc) • 912 kB
JSON
{
"contractName": "Require",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Stringifies parameters to pretty-print revert messages. Costs more gas than regular require()\",\"methods\":{},\"title\":\"Require\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":\"Require\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]}},\"version\":1}",
"bytecode": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158209c45f00215329450d5e4a17148a6041f98fa5eae360e6e553d32ba953905010b6c6578706572696d656e74616cf564736f6c63430005100040",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a723158209c45f00215329450d5e4a17148a6041f98fa5eae360e6e553d32ba953905010b6c6578706572696d656e74616cf564736f6c63430005100040",
"sourceMap": "805:9700:99:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
"deployedSourceMap": "805:9700:99:-;;;;;;;;",
"source": "/*\n\n Copyright 2019 dYdX Trading Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\npragma experimental ABIEncoderV2;\n\n\n/**\n * @title Require\n * @author dYdX\n *\n * Stringifies parameters to pretty-print revert messages. Costs more gas than regular require()\n */\nlibrary Require {\n\n // ============ Constants ============\n\n uint256 constant ASCII_ZERO = 48; // '0'\n uint256 constant ASCII_RELATIVE_ZERO = 87; // 'a' - 10\n uint256 constant ASCII_LOWER_EX = 120; // 'x'\n bytes2 constant COLON = 0x3a20; // ': '\n bytes2 constant COMMA = 0x2c20; // ', '\n bytes2 constant LPAREN = 0x203c; // ' <'\n byte constant RPAREN = 0x3e; // '>'\n uint256 constant FOUR_BIT_MASK = 0xf;\n\n // ============ Library Functions ============\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason)\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n uint256 payloadA\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n uint256 payloadA,\n uint256 payloadB\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n COMMA,\n stringify(payloadB),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n address payloadA\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n address payloadA,\n uint256 payloadB\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n COMMA,\n stringify(payloadB),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n address payloadA,\n uint256 payloadB,\n uint256 payloadC\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n COMMA,\n stringify(payloadB),\n COMMA,\n stringify(payloadC),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n bytes32 payloadA\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n RPAREN\n )\n )\n );\n }\n }\n\n function that(\n bool must,\n bytes32 file,\n bytes32 reason,\n bytes32 payloadA,\n uint256 payloadB,\n uint256 payloadC\n )\n internal\n pure\n {\n if (!must) {\n revert(\n string(\n abi.encodePacked(\n stringifyTruncated(file),\n COLON,\n stringifyTruncated(reason),\n LPAREN,\n stringify(payloadA),\n COMMA,\n stringify(payloadB),\n COMMA,\n stringify(payloadC),\n RPAREN\n )\n )\n );\n }\n }\n\n // ============ Private Functions ============\n\n function stringifyTruncated(\n bytes32 input\n )\n internal\n pure\n returns (bytes memory)\n {\n // put the input bytes into the result\n bytes memory result = abi.encodePacked(input);\n\n // determine the length of the input by finding the location of the last non-zero byte\n for (uint256 i = 32; i != 0; ) {\n // reverse-for-loops with unsigned integer\n /* solium-disable-next-line security/no-modify-for-iter-var */\n i--;\n\n // find the last non-zero byte in order to determine the length\n if (result[i] != 0) {\n uint256 length = i + 1;\n\n /* solium-disable-next-line security/no-inline-assembly */\n assembly {\n mstore(result, length) // r.length = length;\n }\n\n return result;\n }\n }\n\n // all bytes are zero\n return new bytes(0);\n }\n\n function stringify(\n uint256 input\n )\n private\n pure\n returns (bytes memory)\n {\n if (input == 0) {\n return \"0\";\n }\n\n // get the final string length\n uint256 j = input;\n uint256 length;\n while (j != 0) {\n ++length;\n j /= 10;\n }\n\n // allocate the string\n bytes memory bstr = new bytes(length);\n\n // populate the string starting with the least-significant character\n j = input;\n for (uint256 i = length; i != 0; ) {\n // reverse-for-loops with unsigned integer\n /* solium-disable-next-line security/no-modify-for-iter-var */\n i--;\n\n // take last decimal digit\n bstr[i] = byte(uint8(ASCII_ZERO + (j % 10)));\n\n // remove the last decimal digit\n j /= 10;\n }\n\n return bstr;\n }\n\n function stringify(\n address input\n )\n private\n pure\n returns (bytes memory)\n {\n uint256 z = uint256(input);\n\n // addresses are \"0x\" followed by 20 bytes of data which take up 2 characters each\n bytes memory result = new bytes(42);\n\n // populate the result with \"0x\"\n result[0] = byte(uint8(ASCII_ZERO));\n result[1] = byte(uint8(ASCII_LOWER_EX));\n\n // for each byte (starting from the lowest byte), populate the result with two characters\n for (uint256 i; i < 20; ++i) {\n // each byte takes two characters\n uint256 shift = i * 2;\n\n // populate the least-significant character\n result[41 - shift] = char(z & FOUR_BIT_MASK);\n z = z >> 4;\n\n // populate the most-significant character\n result[40 - shift] = char(z & FOUR_BIT_MASK);\n z = z >> 4;\n }\n\n return result;\n }\n\n function stringify(\n bytes32 input\n )\n private\n pure\n returns (bytes memory)\n {\n uint256 z = uint256(input);\n\n // bytes32 are \"0x\" followed by 32 bytes of data which take up 2 characters each\n bytes memory result = new bytes(66);\n\n // populate the result with \"0x\"\n result[0] = byte(uint8(ASCII_ZERO));\n result[1] = byte(uint8(ASCII_LOWER_EX));\n\n // for each byte (starting from the lowest byte), populate the result with two characters\n for (uint256 i; i < 32; ++i) {\n // each byte takes two characters\n uint256 shift = i * 2;\n\n // populate the least-significant character\n result[65 - shift] = char(z & FOUR_BIT_MASK);\n z = z >> 4;\n\n // populate the most-significant character\n result[64 - shift] = char(z & FOUR_BIT_MASK);\n z = z >> 4;\n }\n\n return result;\n }\n\n function char(\n uint256 input\n )\n private\n pure\n returns (byte)\n {\n // return ASCII digit (0-9)\n if (input < 10) {\n return byte(uint8(input + ASCII_ZERO));\n }\n\n // return ASCII letter (a-f)\n return byte(uint8(input + ASCII_RELATIVE_ZERO));\n }\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol",
"exportedSymbols": {
"Require": [
28452
]
},
"id": 28453,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 27762,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "603:23:99"
},
{
"id": 27763,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "627:33:99"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Require\n@author dYdX\n * Stringifies parameters to pretty-print revert messages. Costs more gas than regular require()",
"fullyImplemented": true,
"id": 28452,
"linearizedBaseContracts": [
28452
],
"name": "Require",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"id": 27766,
"name": "ASCII_ZERO",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "872:32:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27764,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "872:7:99",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3438",
"id": 27765,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "902:2:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_48_by_1",
"typeString": "int_const 48"
},
"value": "48"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27769,
"name": "ASCII_RELATIVE_ZERO",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "917:41:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27767,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "917:7:99",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3837",
"id": 27768,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "956:2:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_87_by_1",
"typeString": "int_const 87"
},
"value": "87"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27772,
"name": "ASCII_LOWER_EX",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "976:37:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27770,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "976:7:99",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "313230",
"id": 27771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1010:3:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_120_by_1",
"typeString": "int_const 120"
},
"value": "120"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27775,
"name": "COLON",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "1026:30:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
},
"typeName": {
"id": 27773,
"name": "bytes2",
"nodeType": "ElementaryTypeName",
"src": "1026:6:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307833613230",
"id": 27774,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1050:6:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_14880_by_1",
"typeString": "int_const 14880"
},
"value": "0x3a20"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27778,
"name": "COMMA",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "1070:30:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
},
"typeName": {
"id": 27776,
"name": "bytes2",
"nodeType": "ElementaryTypeName",
"src": "1070:6:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307832633230",
"id": 27777,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1094:6:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_11296_by_1",
"typeString": "int_const 11296"
},
"value": "0x2c20"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27781,
"name": "LPAREN",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "1114:31:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
},
"typeName": {
"id": 27779,
"name": "bytes2",
"nodeType": "ElementaryTypeName",
"src": "1114:6:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307832303363",
"id": 27780,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1139:6:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8252_by_1",
"typeString": "int_const 8252"
},
"value": "0x203c"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27784,
"name": "RPAREN",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "1159:27:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
},
"typeName": {
"id": 27782,
"name": "byte",
"nodeType": "ElementaryTypeName",
"src": "1159:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30783365",
"id": 27783,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1182:4:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_62_by_1",
"typeString": "int_const 62"
},
"value": "0x3e"
},
"visibility": "internal"
},
{
"constant": true,
"id": 27787,
"name": "FOUR_BIT_MASK",
"nodeType": "VariableDeclaration",
"scope": 28452,
"src": "1199:36:99",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27785,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1199:7:99",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307866",
"id": 27786,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1232:3:99",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_15_by_1",
"typeString": "int_const 15"
},
"value": "0xf"
},
"visibility": "internal"
},
{
"body": {
"id": 27815,
"nodeType": "Block",
"src": "1413:307:99",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 27797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1427:5:99",
"subExpression": {
"argumentTypes": null,
"id": 27796,
"name": "must",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27789,
"src": "1428:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 27814,
"nodeType": "IfStatement",
"src": "1423:291:99",
"trueBody": {
"id": 27813,
"nodeType": "Block",
"src": "1434:280:99",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 27803,
"name": "file",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27791,
"src": "1561:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 27802,
"name": "stringifyTruncated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28152,
"src": "1542:18:99",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes32) pure returns (bytes memory)"
}
},
"id": 27804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1542:24:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"id": 27805,
"name": "COLON",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27775,
"src": "1592:5:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 27807,
"name": "reason",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27793,
"src": "1642:6:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 27806,
"name": "stringifyTruncated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28152,
"src": "1623:18:99",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes32) pure returns (bytes memory)"
}
},
"id": 27808,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1623:26:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_bytes2",
"typeString": "bytes2"
},
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 27800,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38094,
"src": "1500:3:99",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 27801,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1500:16:99",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 27809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1500:171:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 27799,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1472:6:99",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_string_storage_ptr_$",
"typeString": "type(string storage pointer)"
},
"typeName": "string"
},
"id": 27810,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1472:217:99",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 27798,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
38112,
38113
],
"referencedDeclaration": 38113,
"src": "1448:6:99",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 27811,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1448:255:99",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 27812,
"nodeType": "ExpressionStatement",
"src": "1448:255:99"
}
]
}
}
]
},
"documentation": null,
"id": 27816,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "that",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 27794,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 27789,
"name": "must",
"nodeType": "VariableDeclaration",
"scope": 27816,
"src": "1317:9:99",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 27788,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1317:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 27791,
"name": "file",
"nodeType": "VariableDeclaration",
"scope": 27816,
"src": "1336:12:99",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 27790,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1336:7:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 27793,
"name": "reason",
"nodeType": "VariableDeclaration",
"scope": 27816,
"src": "1358:14:99",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 27792,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1358:7:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1307:71:99"
},
"returnParameters": {
"id": 27795,
"nodeType": "ParameterList",
"parameters": [],
"src": "1413:0:99"
},
"scope": 28452,
"src": "1294:426:99",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 27851,
"nodeType": "Block",
"src": "1871:416:99",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 27828,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1885:5:99",
"subExpression": {
"argumentTypes": null,
"id": 27827,
"name": "must",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27818,
"src": "1886:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 27850,
"nodeType": "IfStatement",
"src": "1881:400:99",
"trueBody": {
"id": 27849,
"nodeType": "Block",
"src": "1892:389:99",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 27834,
"name": "file",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27820,
"src": "2019:4:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 27833,
"name": "stringifyTruncated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28152,
"src": "2000:18:99",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_bytes_memory_ptr_$",
"typeString": "function (bytes32) pure returns (bytes memory)"
}
},
"id": 27835,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2000:24:99",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"id": 27836,
"name": "COLON",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27775,
"src": "2050:5:99",
"typeDescriptions": {