UNPKG

truffle-analyze

Version:

Add vulnerability and weakness analysis via the MythX

335 lines 12.1 kB
{ "contractName": "PublicStorageArray", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "states", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x6080604052602060405190810160405280600060010260001916600019168152506000906001610030929190610043565b5034801561003d57600080fd5b506100bb565b828054828255906000526020600020908101928215610085579160200282015b82811115610084578251829060001916905591602001919060010190610063565b5b5090506100929190610096565b5090565b6100b891905b808211156100b457600081600090555060010161009c565b5090565b90565b60d8806100c96000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063017a9105146044575b600080fd5b348015604f57600080fd5b50606c60048036038101908080359060200190929190505050608a565b60405180826000191660001916815260200191505060405180910390f35b600081815481101515609857fe5b9060005260206000200160009150905054815600a165627a7a72305820d1c4ab8874b5f3cc139613c225a5908ed916e813f5ccdf9a9de97ce28420ca090029", "deployedBytecode": "0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063017a9105146044575b600080fd5b348015604f57600080fd5b50606c60048036038101908080359060200190929190505050608a565b60405180826000191660001916815260200191505060405180910390f35b600081815481101515609857fe5b9060005260206000200160009150905054815600a165627a7a72305820d1c4ab8874b5f3cc139613c225a5908ed916e813f5ccdf9a9de97ce28420ca090029", "sourceMap": "26:75:1:-;;;60:38;;;;;;;;;95:1;87:10;;60:38;;;;;;;;;;;;;;;;;:::i;:::-;;26:75;8:9:-1;5:2;;;30:1;27;20:12;5:2;26:75:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", "deployedSourceMap": "26:75:1:-;;;;;;;;;;;;;;;;;;;;;;;;60:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;60:38:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.4.22;\n\ncontract PublicStorageArray {\n bytes32[] public states = [bytes32(0)];\n}\n", "sourcePath": "/home/rocky/truffle/mythjs-should-detect/storage_arrays/contracts/PublicStorageArray.sol", "ast": { "absolutePath": "/home/rocky/truffle/mythjs-should-detect/storage_arrays/contracts/PublicStorageArray.sol", "exportedSymbols": { "PublicStorageArray": [ 66 ] }, "id": 67, "nodeType": "SourceUnit", "nodes": [ { "id": 58, "literals": [ "solidity", "^", "0.4", ".22" ], "nodeType": "PragmaDirective", "src": "0:24:1" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 66, "linearizedBaseContracts": [ 66 ], "name": "PublicStorageArray", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 65, "name": "states", "nodeType": "VariableDeclaration", "scope": 66, "src": "60:38:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 59, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "60:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 60, "length": null, "nodeType": "ArrayTypeName", "src": "60:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "value": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 62, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "95:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 61, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "87:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes32_$", "typeString": "type(bytes32)" }, "typeName": "bytes32" }, "id": 63, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "87:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 64, "isConstant": false, "isInlineArray": true, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "86:12:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$1_memory_ptr", "typeString": "bytes32[1] memory" } }, "visibility": "public" } ], "scope": 67, "src": "26:75:1" } ], "src": "0:102:1" }, "legacyAST": { "absolutePath": "/home/rocky/truffle/mythjs-should-detect/storage_arrays/contracts/PublicStorageArray.sol", "exportedSymbols": { "PublicStorageArray": [ 66 ] }, "id": 67, "nodeType": "SourceUnit", "nodes": [ { "id": 58, "literals": [ "solidity", "^", "0.4", ".22" ], "nodeType": "PragmaDirective", "src": "0:24:1" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 66, "linearizedBaseContracts": [ 66 ], "name": "PublicStorageArray", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 65, "name": "states", "nodeType": "VariableDeclaration", "scope": 66, "src": "60:38:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[]" }, "typeName": { "baseType": { "id": 59, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "60:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 60, "length": null, "nodeType": "ArrayTypeName", "src": "60:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } }, "value": { "argumentTypes": null, "components": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 62, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "95:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 61, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "87:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes32_$", "typeString": "type(bytes32)" }, "typeName": "bytes32" }, "id": 63, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "87:10:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "id": 64, "isConstant": false, "isInlineArray": true, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", "src": "86:12:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$1_memory_ptr", "typeString": "bytes32[1] memory" } }, "visibility": "public" } ], "scope": 67, "src": "26:75:1" } ], "src": "0:102:1" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.0-beta.1", "updatedAt": "2018-10-18T20:36:32.541Z" }