UNPKG

jcc-solidity-utils

Version:
572 lines 23.6 kB
{ "contractName": "Payload", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.4.24+commit.e67f0147\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/Payload.sol\":\"Payload\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/Payload.sol\":{\"keccak256\":\"0xcff48caf52a1e4aa55e18c617391c052f9d9068705c3e2b62864d2c95672164d\",\"urls\":[\"bzzr://e46eebd7041f5157373aeb55ad2ad3e8c4d1a3af4004609a76ae79e74d834521\"]}},\"version\":1}", "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a723058202281f238702e518406f71f60aa77b62d3ad38bd22715ef07f4ddd12f8926df900029", "deployedBytecode": "0x6080604052600080fd00a165627a7a723058202281f238702e518406f71f60aa77b62d3ad38bd22715ef07f4ddd12f8926df900029", "sourceMap": "60:140:34:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60:140:34;;;;;;;", "deployedSourceMap": "60:140:34:-;;;;;", "source": "pragma solidity >=0.4.24;\n\n/**\n@dev 检测payload共通\n */\ncontract Payload {\n modifier onlyPayloadSize(uint256 size) {\n require(msg.data.length >= size + 4, \"payload size invaild\");\n _;\n }\n}\n", "sourcePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/Payload.sol", "ast": { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/Payload.sol", "exportedSymbols": { "Payload": [ 7331 ] }, "id": 7332, "nodeType": "SourceUnit", "nodes": [ { "id": 7313, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:34" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@dev 检测payload共通", "fullyImplemented": true, "id": 7331, "linearizedBaseContracts": [ 7331 ], "name": "Payload", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 7329, "nodeType": "Block", "src": "120:78:34", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7324, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 7318, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9041, "src": "134:3:34", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 7319, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "data", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "134:8:34", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, "id": 7320, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "134:15:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7323, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 7321, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7315, "src": "153:4:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "34", "id": 7322, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "160:1:34", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "153:8:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "134:27:34", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "7061796c6f61642073697a6520696e7661696c64", "id": 7325, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "163:22:34", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a9ddcd509000abd6e654f9ab850e95ed8dd377e8f7223f7bdfdefad7e376e06f", "typeString": "literal_string \"payload size invaild\"" }, "value": "payload size invaild" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_a9ddcd509000abd6e654f9ab850e95ed8dd377e8f7223f7bdfdefad7e376e06f", "typeString": "literal_string \"payload size invaild\"" } ], "id": 7317, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9044, 9045 ], "referencedDeclaration": 9045, "src": "126:7:34", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 7326, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "126:60:34", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 7327, "nodeType": "ExpressionStatement", "src": "126:60:34" }, { "id": 7328, "nodeType": "PlaceholderStatement", "src": "192:1:34" } ] }, "documentation": null, "id": 7330, "name": "onlyPayloadSize", "nodeType": "ModifierDefinition", "parameters": { "id": 7316, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7315, "name": "size", "nodeType": "VariableDeclaration", "scope": 7330, "src": "106:12:34", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7314, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "106:7:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "105:14:34" }, "src": "81:117:34", "visibility": "internal" } ], "scope": 7332, "src": "60:140:34" } ], "src": "0:201:34" }, "legacyAST": { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/Payload.sol", "exportedSymbols": { "Payload": [ 7331 ] }, "id": 7332, "nodeType": "SourceUnit", "nodes": [ { "id": 7313, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:34" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@dev 检测payload共通", "fullyImplemented": true, "id": 7331, "linearizedBaseContracts": [ 7331 ], "name": "Payload", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 7329, "nodeType": "Block", "src": "120:78:34", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7324, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 7318, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9041, "src": "134:3:34", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 7319, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "data", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "134:8:34", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, "id": 7320, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "134:15:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 7323, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 7321, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7315, "src": "153:4:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "34", "id": 7322, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "160:1:34", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, "src": "153:8:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "134:27:34", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "7061796c6f61642073697a6520696e7661696c64", "id": 7325, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "163:22:34", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a9ddcd509000abd6e654f9ab850e95ed8dd377e8f7223f7bdfdefad7e376e06f", "typeString": "literal_string \"payload size invaild\"" }, "value": "payload size invaild" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_a9ddcd509000abd6e654f9ab850e95ed8dd377e8f7223f7bdfdefad7e376e06f", "typeString": "literal_string \"payload size invaild\"" } ], "id": 7317, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9044, 9045 ], "referencedDeclaration": 9045, "src": "126:7:34", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 7326, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "126:60:34", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 7327, "nodeType": "ExpressionStatement", "src": "126:60:34" }, { "id": 7328, "nodeType": "PlaceholderStatement", "src": "192:1:34" } ] }, "documentation": null, "id": 7330, "name": "onlyPayloadSize", "nodeType": "ModifierDefinition", "parameters": { "id": 7316, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7315, "name": "size", "nodeType": "VariableDeclaration", "scope": 7330, "src": "106:12:34", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7314, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "106:7:34", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "105:14:34" }, "src": "81:117:34", "visibility": "internal" } ], "scope": 7332, "src": "60:140:34" } ], "src": "0:201:34" }, "compiler": { "name": "solc", "version": "0.4.24+commit.e67f0147.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.16", "updatedAt": "2021-03-06T09:30:01.065Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }