UNPKG

@daostack/upgrades

Version:
531 lines (530 loc) 19.1 kB
{ "fileName": "WithInitialValues.sol", "contractName": "WithoutInitialValuesInFieldsDeclarations", "source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\ncontract WithoutInitialValuesInFieldsDeclarations {\n uint constant myConst = 115994;\n\n function doSomething() public pure returns (string memory) {\n return 'do';\n }\n}\n\ncontract WithInitialValuesInFieldsDeclarations {\n string public allaps = 'allaps';\n\n function doSomething() public pure virtual returns (string memory) {\n return 'do';\n }\n}\n\ncontract WithParentWithInitialValuesInFieldsDeclarations is WithInitialValuesInFieldsDeclarations {\n string public myVar;\n\n function doSomething() public pure override returns (string memory) {\n return 'do';\n }\n}\n", "sourcePath": "contracts/mocks/WithInitialValues.sol", "sourceMap": "57:172:23:-:0;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "57:172:23:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;146:81;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;190:13;211:11;;;;;;;;;;;;;;;;;;;;;;;146:81;;:::o", "abi": [ { "inputs": [], "name": "doSomething", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" } ], "ast": { "absolutePath": "contracts/mocks/WithInitialValues.sol", "exportedSymbols": { "WithInitialValuesInFieldsDeclarations": [ 4999 ], "WithParentWithInitialValuesInFieldsDeclarations": [ 5013 ], "WithoutInitialValuesInFieldsDeclarations": [ 4987 ] }, "id": 5014, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 4975, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:23" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 4987, "linearizedBaseContracts": [ 4987 ], "name": "WithoutInitialValuesInFieldsDeclarations", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 4978, "mutability": "constant", "name": "myConst", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4987, "src": "111:30:23", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4976, "name": "uint", "nodeType": "ElementaryTypeName", "src": "111:4:23", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": { "argumentTypes": null, "hexValue": "313135393934", "id": 4977, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "135:6:23", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_115994_by_1", "typeString": "int_const 115994" }, "value": "115994" }, "visibility": "internal" }, { "body": { "id": 4985, "nodeType": "Block", "src": "205:22:23", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "646f", "id": 4983, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "218:4:23", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a25dd137276eccd5048f808ec1a55102f9cde0dc9f47be33bc0c29fa331a789d", "typeString": "literal_string \"do\"" }, "value": "do" }, "functionReturnParameters": 4982, "id": 4984, "nodeType": "Return", "src": "211:11:23" } ] }, "documentation": null, "functionSelector": "82692679", "id": 4986, "implemented": true, "kind": "function", "modifiers": [], "name": "doSomething", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4979, "nodeType": "ParameterList", "parameters": [], "src": "166:2:23" }, "returnParameters": { "id": 4982, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4981, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4986, "src": "190:13:23", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 4980, "name": "string", "nodeType": "ElementaryTypeName", "src": "190:6:23", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "189:15:23" }, "scope": 4987, "src": "146:81:23", "stateMutability": "pure", "virtual": false, "visibility": "public" } ], "scope": 5014, "src": "57:172:23" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 4999, "linearizedBaseContracts": [ 4999 ], "name": "WithInitialValuesInFieldsDeclarations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "bc4b0e64", "id": 4990, "mutability": "mutable", "name": "allaps", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4999, "src": "282:31:23", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 4988, "name": "string", "nodeType": "ElementaryTypeName", "src": "282:6:23", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "616c6c617073", "id": 4989, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "305:8:23", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_e919cf55dac0a9e9746a92ec54b98336dc9d8e3bcca6fbbc6ecdc60172503ead", "typeString": "literal_string \"allaps\"" }, "value": "allaps" }, "visibility": "public" }, { "body": { "id": 4997, "nodeType": "Block", "src": "385:22:23", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "646f", "id": 4995, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "398:4:23", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a25dd137276eccd5048f808ec1a55102f9cde0dc9f47be33bc0c29fa331a789d", "typeString": "literal_string \"do\"" }, "value": "do" }, "functionReturnParameters": 4994, "id": 4996, "nodeType": "Return", "src": "391:11:23" } ] }, "documentation": null, "functionSelector": "82692679", "id": 4998, "implemented": true, "kind": "function", "modifiers": [], "name": "doSomething", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4991, "nodeType": "ParameterList", "parameters": [], "src": "338:2:23" }, "returnParameters": { "id": 4994, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4993, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4998, "src": "370:13:23", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 4992, "name": "string", "nodeType": "ElementaryTypeName", "src": "370:6:23", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "369:15:23" }, "scope": 4999, "src": "318:89:23", "stateMutability": "pure", "virtual": true, "visibility": "public" } ], "scope": 5014, "src": "231:178:23" }, { "abstract": false, "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 5000, "name": "WithInitialValuesInFieldsDeclarations", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4999, "src": "471:37:23", "typeDescriptions": { "typeIdentifier": "t_contract$_WithInitialValuesInFieldsDeclarations_$4999", "typeString": "contract WithInitialValuesInFieldsDeclarations" } }, "id": 5001, "nodeType": "InheritanceSpecifier", "src": "471:37:23" } ], "contractDependencies": [ 4999 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 5013, "linearizedBaseContracts": [ 5013, 4999 ], "name": "WithParentWithInitialValuesInFieldsDeclarations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "c6b91540", "id": 5003, "mutability": "mutable", "name": "myVar", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5013, "src": "513:19:23", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 5002, "name": "string", "nodeType": "ElementaryTypeName", "src": "513:6:23", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "baseFunctions": [ 4998 ], "body": { "id": 5011, "nodeType": "Block", "src": "605:22:23", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "646f", "id": 5009, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "618:4:23", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a25dd137276eccd5048f808ec1a55102f9cde0dc9f47be33bc0c29fa331a789d", "typeString": "literal_string \"do\"" }, "value": "do" }, "functionReturnParameters": 5008, "id": 5010, "nodeType": "Return", "src": "611:11:23" } ] }, "documentation": null, "functionSelector": "82692679", "id": 5012, "implemented": true, "kind": "function", "modifiers": [], "name": "doSomething", "nodeType": "FunctionDefinition", "overrides": { "id": 5005, "nodeType": "OverrideSpecifier", "overrides": [], "src": "572:8:23" }, "parameters": { "id": 5004, "nodeType": "ParameterList", "parameters": [], "src": "557:2:23" }, "returnParameters": { "id": 5008, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5007, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 5012, "src": "590:13:23", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 5006, "name": "string", "nodeType": "ElementaryTypeName", "src": "590:6:23", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "589:15:23" }, "scope": 5013, "src": "537:90:23", "stateMutability": "pure", "virtual": false, "visibility": "public" } ], "scope": 5014, "src": "411:218:23" } ], "src": "0:630:23" }, "bytecode": "0x60806040523480156100115760006000fd5b50610017565b61012b806100266000396000f3fe608060405234801560105760006000fd5b5060043610602c5760003560e01c80638269267914603257602c565b60006000fd5b603860b1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101560775780820151818401525b602081019050605d565b50505050905090810190601f16801560a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606040518060400160405280600281526020017f646f000000000000000000000000000000000000000000000000000000000000815260200150905060f2565b9056fea26469706673582212204add88b126d805270d44590993f8dd515e05247196d0f928d2edfdc39f90a44f64736f6c634300060a0033", "deployedBytecode": "0x608060405234801560105760006000fd5b5060043610602c5760003560e01c80638269267914603257602c565b60006000fd5b603860b1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101560775780820151818401525b602081019050605d565b50505050905090810190601f16801560a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606040518060400160405280600281526020017f646f000000000000000000000000000000000000000000000000000000000000815260200150905060f2565b9056fea26469706673582212204add88b126d805270d44590993f8dd515e05247196d0f928d2edfdc39f90a44f64736f6c634300060a0033", "compiler": { "name": "solc", "version": "0.6.10+commit.00c0fcaf.Emscripten.clang", "optimizer": {}, "evmVersion": "constantinople" } }